From aec0e712e101ca9badaec0805f53992629cfff96 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 21 Apr 2026 00:20:48 +0000 Subject: [PATCH 1/4] Configurations: 'specification/compute/resource-manager/Microsoft.Compute/Compute/tspconfig.yaml', API Version: 2025-11-01, SDK Release Type: stable, and CommitSHA: '1e6111d12c709c3395fb8546e311b6c67fd87efc' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6183422 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .github/CODEOWNERS | 2 +- pnpm-lock.yaml | 431 +- sdk/compute/arm-compute/CHANGELOG.md | 366 + sdk/compute/arm-compute/README.md | 20 +- sdk/compute/arm-compute/_meta.json | 8 - sdk/compute/arm-compute/api-extractor.json | 4 +- sdk/compute/arm-compute/eslint.config.mjs | 14 + sdk/compute/arm-compute/metadata.json | 998 + sdk/compute/arm-compute/package.json | 286 +- .../review/arm-compute-api-node.api.md | 26 + .../arm-compute-models-common-node.api.md | 105 + .../arm-compute-models-compute-node.api.md | 3737 +++ ...arm-compute-models-computeDisk-node.api.md | 736 + ...-compute-models-computeGallery-node.api.md | 1212 + .../arm-compute-models-computeSku-node.api.md | 93 + .../review/arm-compute-models-node.api.md | 103 + .../review/arm-compute-node.api.md | 6207 ++--- ...MigrationToVirtualMachineScaleSetSample.ts | 23 +- ...tsConvertToVirtualMachineScaleSetSample.ts | 35 +- .../availabilitySetsCreateOrUpdateSample.ts | 54 +- .../availabilitySetsDeleteSample.ts | 37 +- .../samples-dev/availabilitySetsGetSample.ts | 35 +- ...vailabilitySetsListAvailableSizesSample.ts | 36 +- ...vailabilitySetsListBySubscriptionSample.ts | 25 +- .../samples-dev/availabilitySetsListSample.ts | 29 +- ...MigrationToVirtualMachineScaleSetSample.ts | 40 +- .../availabilitySetsUpdateSample.ts | 61 +- ...MigrationToVirtualMachineScaleSetSample.ts | 40 +- ...tyReservationGroupsCreateOrUpdateSample.ts | 116 +- .../capacityReservationGroupsDeleteSample.ts | 37 +- .../capacityReservationGroupsGetSample.ts | 67 +- ...ervationGroupsListByResourceGroupSample.ts | 30 +- ...servationGroupsListBySubscriptionSample.ts | 47 +- .../capacityReservationGroupsUpdateSample.ts | 48 +- ...apacityReservationsCreateOrUpdateSample.ts | 111 +- .../capacityReservationsDeleteSample.ts | 43 +- .../capacityReservationsGetSample.ts | 76 +- ...onsListByCapacityReservationGroupSample.ts | 55 +- .../capacityReservationsUpdateSample.ts | 73 +- ...erviceOperatingSystemsGetOSFamilySample.ts | 32 - ...rviceOperatingSystemsGetOSVersionSample.ts | 32 - ...iceOperatingSystemsListOSFamiliesSample.ts | 33 - ...iceOperatingSystemsListOSVersionsSample.ts | 33 - .../cloudServiceRoleInstancesDeleteSample.ts | 35 - ...rviceRoleInstancesGetInstanceViewSample.ts | 35 - ...RoleInstancesGetRemoteDesktopFileSample.ts | 35 - .../cloudServiceRoleInstancesGetSample.ts | 35 - .../cloudServiceRoleInstancesListSample.ts | 36 - .../cloudServiceRoleInstancesRebuildSample.ts | 35 - .../cloudServiceRoleInstancesReimageSample.ts | 35 - .../cloudServiceRoleInstancesRestartSample.ts | 35 - .../samples-dev/cloudServiceRolesGetSample.ts | 35 - .../cloudServiceRolesListSample.ts | 36 - .../cloudServicesCreateOrUpdateSample.ts | 353 - .../cloudServicesDeleteInstancesSample.ts | 43 - .../samples-dev/cloudServicesDeleteSample.ts | 33 - .../cloudServicesGetInstanceViewSample.ts | 33 - .../samples-dev/cloudServicesGetSample.ts | 33 - .../samples-dev/cloudServicesListAllSample.ts | 30 - .../samples-dev/cloudServicesListSample.ts | 32 - .../cloudServicesPowerOffSample.ts | 33 - .../samples-dev/cloudServicesRebuildSample.ts | 43 - .../samples-dev/cloudServicesReimageSample.ts | 43 - .../samples-dev/cloudServicesRestartSample.ts | 43 - .../samples-dev/cloudServicesStartSample.ts | 33 - ...rvicesUpdateDomainGetUpdateDomainSample.ts | 35 - ...icesUpdateDomainListUpdateDomainsSample.ts | 36 - ...vicesUpdateDomainWalkUpdateDomainSample.ts | 36 - .../samples-dev/cloudServicesUpdateSample.ts | 41 - .../communityGalleriesGetSample.ts | 17 +- .../communityGalleryImageVersionsGetSample.ts | 22 +- ...communityGalleryImageVersionsListSample.ts | 20 +- .../communityGalleryImagesGetSample.ts | 19 +- .../communityGalleryImagesListSample.ts | 18 +- ...dedicatedHostGroupsCreateOrUpdateSample.ts | 77 +- .../dedicatedHostGroupsDeleteSample.ts | 37 +- .../dedicatedHostGroupsGetSample.ts | 39 +- ...atedHostGroupsListByResourceGroupSample.ts | 33 +- ...catedHostGroupsListBySubscriptionSample.ts | 21 +- .../dedicatedHostGroupsUpdateSample.ts | 71 +- .../dedicatedHostsCreateOrUpdateSample.ts | 36 +- .../samples-dev/dedicatedHostsDeleteSample.ts | 41 +- .../samples-dev/dedicatedHostsGetSample.ts | 30 +- .../dedicatedHostsListAvailableSizesSample.ts | 21 +- .../dedicatedHostsListByHostGroupSample.ts | 36 +- .../dedicatedHostsRedeploySample.ts | 21 +- .../dedicatedHostsRestartSample.ts | 21 +- .../samples-dev/dedicatedHostsUpdateSample.ts | 103 +- .../diskAccessesCreateOrUpdateSample.ts | 23 +- ...sDeleteAPrivateEndpointConnectionSample.ts | 26 +- .../samples-dev/diskAccessesDeleteSample.ts | 19 +- ...ssesGetAPrivateEndpointConnectionSample.ts | 20 +- ...skAccessesGetPrivateLinkResourcesSample.ts | 17 +- .../samples-dev/diskAccessesGetSample.ts | 41 +- .../diskAccessesListByResourceGroupSample.ts | 17 +- ...sesListPrivateEndpointConnectionsSample.ts | 18 +- .../samples-dev/diskAccessesListSample.ts | 11 +- ...sUpdateAPrivateEndpointConnectionSample.ts | 44 +- .../samples-dev/diskAccessesUpdateSample.ts | 25 +- .../diskEncryptionSetsCreateOrUpdateSample.ts | 132 +- .../diskEncryptionSetsDeleteSample.ts | 19 +- .../diskEncryptionSetsGetSample.ts | 41 +- ...yptionSetsListAssociatedResourcesSample.ts | 18 +- ...EncryptionSetsListByResourceGroupSample.ts | 17 +- .../diskEncryptionSetsListSample.ts | 11 +- .../diskEncryptionSetsUpdateSample.ts | 113 +- .../samples-dev/diskRestorePointGetSample.ts | 51 +- .../diskRestorePointGrantAccessSample.ts | 37 +- ...iskRestorePointListByRestorePointSample.ts | 23 +- .../diskRestorePointRevokeAccessSample.ts | 30 +- .../samples-dev/disksCreateOrUpdateSample.ts | 951 +- .../samples-dev/disksDeleteSample.ts | 19 +- .../arm-compute/samples-dev/disksGetSample.ts | 15 +- .../samples-dev/disksGrantAccessSample.ts | 77 +- .../disksListByResourceGroupSample.ts | 17 +- .../samples-dev/disksListSample.ts | 11 +- .../samples-dev/disksRevokeAccessSample.ts | 19 +- .../samples-dev/disksUpdateSample.ts | 229 +- .../galleriesCreateOrUpdateSample.ts | 153 +- .../samples-dev/galleriesDeleteSample.ts | 19 +- .../samples-dev/galleriesGetSample.ts | 103 +- .../galleriesListByResourceGroupSample.ts | 17 +- .../samples-dev/galleriesListSample.ts | 11 +- .../samples-dev/galleriesUpdateSample.ts | 25 +- ...ApplicationVersionsCreateOrUpdateSample.ts | 117 +- .../galleryApplicationVersionsDeleteSample.ts | 26 +- .../galleryApplicationVersionsGetSample.ts | 61 +- ...nVersionsListByGalleryApplicationSample.ts | 21 +- .../galleryApplicationVersionsUpdateSample.ts | 82 +- ...galleryApplicationsCreateOrUpdateSample.ts | 77 +- .../galleryApplicationsDeleteSample.ts | 23 +- .../galleryApplicationsGetSample.ts | 20 +- .../galleryApplicationsListByGallerySample.ts | 18 +- .../galleryApplicationsUpdateSample.ts | 75 +- ...alleryImageVersionsCreateOrUpdateSample.ts | 1348 +- .../galleryImageVersionsDeleteSample.ts | 26 +- .../galleryImageVersionsGetSample.ts | 165 +- ...ryImageVersionsListByGalleryImageSample.ts | 21 +- .../galleryImageVersionsUpdateSample.ts | 145 +- .../galleryImagesCreateOrUpdateSample.ts | 42 +- .../samples-dev/galleryImagesDeleteSample.ts | 21 +- .../samples-dev/galleryImagesGetSample.ts | 20 +- .../galleryImagesListByGallerySample.ts | 19 +- .../samples-dev/galleryImagesUpdateSample.ts | 99 +- ...trolProfileVersionsCreateOrUpdateSample.ts | 64 +- ...ccessControlProfileVersionsDeleteSample.ts | 29 +- ...VMAccessControlProfileVersionsGetSample.ts | 23 +- ...yGalleryInVMAccessControlProfileSample.ts} | 25 +- ...ccessControlProfileVersionsUpdateSample.ts | 50 +- ...cessControlProfilesCreateOrUpdateSample.ts | 37 +- ...ryInVMAccessControlProfilesDeleteSample.ts | 26 +- ...lleryInVMAccessControlProfilesGetSample.ts | 20 +- ...ccessControlProfilesListByGallerySample.ts | 18 +- ...ryInVMAccessControlProfilesUpdateSample.ts | 35 +- ...lleryScriptVersionsCreateOrUpdateSample.ts | 161 +- .../galleryScriptVersionsDeleteSample.ts | 26 +- .../galleryScriptVersionsGetSample.ts | 51 +- ...ScriptVersionsListByGalleryScriptSample.ts | 21 +- .../galleryScriptVersionsUpdateSample.ts | 157 +- .../galleryScriptsCreateOrUpdateSample.ts | 44 +- .../samples-dev/galleryScriptsDeleteSample.ts | 21 +- .../samples-dev/galleryScriptsGetSample.ts | 20 +- .../galleryScriptsListByGallerySample.ts | 18 +- .../samples-dev/galleryScriptsUpdateSample.ts | 43 +- .../gallerySharingProfileUpdateSample.ts | 82 +- .../samples-dev/imagesCreateOrUpdateSample.ts | 360 +- .../samples-dev/imagesDeleteSample.ts | 37 +- .../samples-dev/imagesGetSample.ts | 15 +- .../imagesListByResourceGroupSample.ts | 17 +- .../samples-dev/imagesListSample.ts | 11 +- .../samples-dev/imagesUpdateSample.ts | 29 +- ...lyticsExportRequestRateByIntervalSample.ts | 34 +- ...gAnalyticsExportThrottledRequestsSample.ts | 33 +- .../samples-dev/operationsListSample.ts | 25 +- ...mityPlacementGroupsCreateOrUpdateSample.ts | 36 +- .../proximityPlacementGroupsDeleteSample.ts | 19 +- .../proximityPlacementGroupsGetSample.ts | 17 +- ...lacementGroupsListByResourceGroupSample.ts | 17 +- ...PlacementGroupsListBySubscriptionSample.ts | 11 +- .../proximityPlacementGroupsUpdateSample.ts | 28 +- .../samples-dev/resourceSkusListSample.ts | 57 +- ...orePointCollectionsCreateOrUpdateSample.ts | 69 +- .../restorePointCollectionsDeleteSample.ts | 37 +- .../restorePointCollectionsGetSample.ts | 35 +- .../restorePointCollectionsListAllSample.ts | 11 +- .../restorePointCollectionsListSample.ts | 17 +- .../restorePointCollectionsUpdateSample.ts | 53 +- .../samples-dev/restorePointsCreateSample.ts | 56 +- .../samples-dev/restorePointsDeleteSample.ts | 41 +- .../samples-dev/restorePointsGetSample.ts | 39 +- .../samples-dev/sharedGalleriesGetSample.ts | 14 +- .../samples-dev/sharedGalleriesListSample.ts | 14 +- .../sharedGalleryImageVersionsGetSample.ts | 22 +- .../sharedGalleryImageVersionsListSample.ts | 20 +- .../sharedGalleryImagesGetSample.ts | 19 +- .../sharedGalleryImagesListSample.ts | 18 +- .../snapshotsCreateOrUpdateSample.ts | 227 +- .../samples-dev/snapshotsDeleteSample.ts | 19 +- .../samples-dev/snapshotsGetSample.ts | 29 +- .../samples-dev/snapshotsGrantAccessSample.ts | 27 +- .../snapshotsListByResourceGroupSample.ts | 17 +- .../samples-dev/snapshotsListSample.ts | 11 +- .../snapshotsRevokeAccessSample.ts | 19 +- .../samples-dev/snapshotsUpdateSample.ts | 60 +- ...DeletedResourceListByArtifactNameSample.ts | 24 +- .../samples-dev/sshPublicKeysCreateSample.ts | 36 +- .../samples-dev/sshPublicKeysDeleteSample.ts | 37 +- .../sshPublicKeysGenerateKeyPairSample.ts | 80 +- .../samples-dev/sshPublicKeysGetSample.ts | 18 +- .../sshPublicKeysListByResourceGroupSample.ts | 33 +- .../sshPublicKeysListBySubscriptionSample.ts | 21 +- .../samples-dev/sshPublicKeysUpdateSample.ts | 51 +- .../samples-dev/usageListSample.ts | 27 +- .../virtualMachineExtensionImagesGetSample.ts | 43 +- ...alMachineExtensionImagesListTypesSample.ts | 32 +- ...achineExtensionImagesListVersionsSample.ts | 53 +- ...alMachineExtensionsCreateOrUpdateSample.ts | 131 +- .../virtualMachineExtensionsDeleteSample.ts | 43 +- .../virtualMachineExtensionsGetSample.ts | 49 +- .../virtualMachineExtensionsListSample.ts | 45 +- .../virtualMachineExtensionsUpdateSample.ts | 59 +- .../virtualMachineImagesEdgeZoneGetSample.ts | 55 +- ...alMachineImagesEdgeZoneListOffersSample.ts | 37 +- ...chineImagesEdgeZoneListPublishersSample.ts | 31 +- .../virtualMachineImagesEdgeZoneListSample.ts | 65 +- ...tualMachineImagesEdgeZoneListSkusSample.ts | 43 +- .../virtualMachineImagesGetSample.ts | 49 +- ...irtualMachineImagesListByEdgeZoneSample.ts | 35 +- .../virtualMachineImagesListOffersSample.ts | 32 +- ...irtualMachineImagesListPublishersSample.ts | 25 +- .../virtualMachineImagesListSample.ts | 59 +- .../virtualMachineImagesListSkusSample.ts | 37 +- ...alMachineImagesListWithPropertiesSample.ts | 63 +- ...lMachineRunCommandsCreateOrUpdateSample.ts | 74 +- .../virtualMachineRunCommandsDeleteSample.ts | 21 +- ...ineRunCommandsGetByVirtualMachineSample.ts | 20 +- .../virtualMachineRunCommandsGetSample.ts | 18 +- ...neRunCommandsListByVirtualMachineSample.ts | 18 +- .../virtualMachineRunCommandsListSample.ts | 13 +- .../virtualMachineRunCommandsUpdateSample.ts | 64 +- ...eScaleSetExtensionsCreateOrUpdateSample.ts | 85 +- ...alMachineScaleSetExtensionsDeleteSample.ts | 51 +- ...rtualMachineScaleSetExtensionsGetSample.ts | 49 +- ...tualMachineScaleSetExtensionsListSample.ts | 35 +- ...alMachineScaleSetExtensionsUpdateSample.ts | 83 +- ...ineScaleSetLifeCycleHookEventsGetSample.ts | 29 + ...neScaleSetLifeCycleHookEventsListSample.ts | 32 + ...ScaleSetLifeCycleHookEventsUpdateSample.ts | 40 + ...hineScaleSetRollingUpgradesCancelSample.ts | 39 +- ...eScaleSetRollingUpgradesGetLatestSample.ts | 33 +- ...lingUpgradesStartExtensionUpgradeSample.ts | 23 +- ...eSetRollingUpgradesStartOSUpgradeSample.ts | 42 +- ...caleSetVMExtensionsCreateOrUpdateSample.ts | 49 +- ...MachineScaleSetVMExtensionsDeleteSample.ts | 29 +- ...ualMachineScaleSetVMExtensionsGetSample.ts | 23 +- ...alMachineScaleSetVMExtensionsListSample.ts | 20 +- ...MachineScaleSetVMExtensionsUpdateSample.ts | 49 +- ...aleSetVMRunCommandsCreateOrUpdateSample.ts | 83 +- ...achineScaleSetVMRunCommandsDeleteSample.ts | 29 +- ...alMachineScaleSetVMRunCommandsGetSample.ts | 23 +- ...lMachineScaleSetVMRunCommandsListSample.ts | 21 +- ...achineScaleSetVMRunCommandsUpdateSample.ts | 50 +- ...eScaleSetVMSApproveRollingUpgradeSample.ts | 36 - ...eScaleSetVMSAttachDetachDataDisksSample.ts | 117 - .../virtualMachineScaleSetVMSDeleteSample.ts | 44 - .../virtualMachineScaleSetVMSGetSample.ts | 83 - .../virtualMachineScaleSetVMSListSample.ts | 99 - ...hineScaleSetVMSPerformMaintenanceSample.ts | 61 - ...virtualMachineScaleSetVMSPowerOffSample.ts | 68 - ...virtualMachineScaleSetVMSRedeploySample.ts | 59 - ...rtualMachineScaleSetVMSReimageAllSample.ts | 59 - .../virtualMachineScaleSetVMSReimageSample.ts | 72 - .../virtualMachineScaleSetVMSRestartSample.ts | 59 - ...SetVMSRetrieveBootDiagnosticsDataSample.ts | 44 - ...rtualMachineScaleSetVMSRunCommandSample.ts | 41 - ...achineScaleSetVMSSimulateEvictionSample.ts | 35 - .../virtualMachineScaleSetVMSStartSample.ts | 59 - .../virtualMachineScaleSetVMSUpdateSample.ts | 463 - ...eScaleSetVMsApproveRollingUpgradeSample.ts | 28 + ...eScaleSetVMsAttachDetachDataDisksSample.ts | 98 + ...tualMachineScaleSetVMsDeallocateSample.ts} | 45 +- .../virtualMachineScaleSetVMsDeleteSample.ts | 26 + ...achineScaleSetVMsGetInstanceViewSample.ts} | 20 +- .../virtualMachineScaleSetVMsGetSample.ts | 74 + .../virtualMachineScaleSetVMsListSample.ts | 90 + ...hineScaleSetVMsPerformMaintenanceSample.ts | 42 + ...virtualMachineScaleSetVMsPowerOffSample.ts | 44 + ...virtualMachineScaleSetVMsRedeploySample.ts | 46 + ...rtualMachineScaleSetVMsReimageAllSample.ts | 46 + .../virtualMachineScaleSetVMsReimageSample.ts | 43 + .../virtualMachineScaleSetVMsRestartSample.ts | 38 + ...SetVMsRetrieveBootDiagnosticsDataSample.ts | 30 + ...rtualMachineScaleSetVMsRunCommandSample.ts | 30 + ...achineScaleSetVMsSimulateEvictionSample.ts | 28 + .../virtualMachineScaleSetVMsStartSample.ts | 42 + .../virtualMachineScaleSetVMsUpdateSample.ts | 303 + ...ineScaleSetsApproveRollingUpgradeSample.ts | 38 +- ...SetsConvertToSinglePlacementGroupSample.ts | 59 +- ...ualMachineScaleSetsCreateOrUpdateSample.ts | 6662 +++-- ...virtualMachineScaleSetsDeallocateSample.ts | 56 +- ...alMachineScaleSetsDeleteInstancesSample.ts | 66 +- .../virtualMachineScaleSetsDeleteSample.ts | 32 +- ...iceFabricPlatformUpdateDomainWalkSample.ts | 39 +- ...alMachineScaleSetsGetInstanceViewSample.ts | 33 +- ...chineScaleSetsGetOSUpgradeHistorySample.ts | 39 +- .../virtualMachineScaleSetsGetSample.ts | 87 +- .../virtualMachineScaleSetsListAllSample.ts | 21 +- ...ualMachineScaleSetsListByLocationSample.ts | 16 +- .../virtualMachineScaleSetsListSample.ts | 33 +- .../virtualMachineScaleSetsListSkusSample.ts | 36 +- ...achineScaleSetsPerformMaintenanceSample.ts | 55 +- .../virtualMachineScaleSetsPowerOffSample.ts | 56 +- .../virtualMachineScaleSetsReapplySample.ts | 43 +- .../virtualMachineScaleSetsRedeploySample.ts | 53 +- ...virtualMachineScaleSetsReimageAllSample.ts | 53 +- .../virtualMachineScaleSetsReimageSample.ts | 59 +- .../virtualMachineScaleSetsRestartSample.ts | 53 +- .../virtualMachineScaleSetsScaleOutSample.ts | 33 +- ...eSetsSetOrchestrationServiceStateSample.ts | 71 +- .../virtualMachineScaleSetsStartSample.ts | 51 +- ...alMachineScaleSetsUpdateInstancesSample.ts | 59 +- .../virtualMachineScaleSetsUpdateSample.ts | 362 +- .../virtualMachineSizesListSample.ts | 27 +- .../virtualMachinesAssessPatchesSample.ts | 18 +- ...tualMachinesAttachDetachDataDisksSample.ts | 127 +- .../virtualMachinesCaptureSample.ts | 61 +- ...tualMachinesConvertToManagedDisksSample.ts | 37 +- .../virtualMachinesCreateOrUpdateSample.ts | 4013 ++- .../virtualMachinesDeallocateSample.ts | 68 +- .../virtualMachinesDeleteSample.ts | 28 +- .../virtualMachinesGeneralizeSample.ts | 19 +- .../samples-dev/virtualMachinesGetSample.ts | 79 +- .../virtualMachinesInstallPatchesSample.ts | 34 +- .../virtualMachinesInstanceViewSample.ts | 35 +- .../virtualMachinesListAllSample.ts | 35 +- ...virtualMachinesListAvailableSizesSample.ts | 18 +- .../virtualMachinesListByLocationSample.ts | 14 +- .../samples-dev/virtualMachinesListSample.ts | 42 +- ...irtualMachinesMigrateToVMScaleSetSample.ts | 36 +- ...virtualMachinesPerformMaintenanceSample.ts | 37 +- .../virtualMachinesPowerOffSample.ts | 48 +- .../virtualMachinesReapplySample.ts | 19 +- .../virtualMachinesRedeploySample.ts | 37 +- .../virtualMachinesReimageSample.ts | 71 +- .../virtualMachinesRestartSample.ts | 37 +- ...chinesRetrieveBootDiagnosticsDataSample.ts | 29 +- .../virtualMachinesRunCommandSample.ts | 24 +- .../virtualMachinesSimulateEvictionSample.ts | 19 +- .../samples-dev/virtualMachinesStartSample.ts | 37 +- .../virtualMachinesUpdateSample.ts | 159 +- ...MigrationToVirtualMachineScaleSetSample.js | 31 - ...tsConvertToVirtualMachineScaleSetSample.js | 36 - .../availabilitySetsCreateOrUpdateSample.js | 63 - .../availabilitySetsDeleteSample.js | 45 - .../javascript/availabilitySetsGetSample.js | 45 - .../javascript/availabilitySetsListSample.js | 49 - ...MigrationToVirtualMachineScaleSetSample.js | 37 - .../availabilitySetsUpdateSample.js | 68 - ...MigrationToVirtualMachineScaleSetSample.js | 37 - ...tyReservationGroupsCreateOrUpdateSample.js | 103 - .../capacityReservationGroupsGetSample.js | 80 - .../capacityReservationGroupsUpdateSample.js | 58 - ...apacityReservationsCreateOrUpdateSample.js | 99 - .../capacityReservationsGetSample.js | 86 - .../capacityReservationsUpdateSample.js | 74 - ...erviceOperatingSystemsGetOSFamilySample.js | 28 - ...rviceOperatingSystemsGetOSVersionSample.js | 28 - ...iceOperatingSystemsListOSFamiliesSample.js | 30 - ...iceOperatingSystemsListOSVersionsSample.js | 30 - .../cloudServiceRoleInstancesDeleteSample.js | 33 - ...rviceRoleInstancesGetInstanceViewSample.js | 33 - ...RoleInstancesGetRemoteDesktopFileSample.js | 33 - .../cloudServiceRoleInstancesGetSample.js | 33 - .../cloudServiceRoleInstancesListSample.js | 34 - .../cloudServiceRoleInstancesRebuildSample.js | 33 - .../cloudServiceRoleInstancesReimageSample.js | 33 - .../cloudServiceRoleInstancesRestartSample.js | 33 - .../javascript/cloudServiceRolesGetSample.js | 29 - .../javascript/cloudServiceRolesListSample.js | 31 - .../cloudServicesCreateOrUpdateSample.js | 337 - .../cloudServicesDeleteInstancesSample.js | 36 - .../javascript/cloudServicesDeleteSample.js | 28 - .../cloudServicesGetInstanceViewSample.js | 28 - .../v23/javascript/cloudServicesGetSample.js | 28 - .../javascript/cloudServicesListAllSample.js | 29 - .../v23/javascript/cloudServicesListSample.js | 30 - .../javascript/cloudServicesPowerOffSample.js | 31 - .../javascript/cloudServicesRebuildSample.js | 36 - .../javascript/cloudServicesReimageSample.js | 36 - .../javascript/cloudServicesRestartSample.js | 36 - .../javascript/cloudServicesStartSample.js | 28 - ...rvicesUpdateDomainGetUpdateDomainSample.js | 33 - ...icesUpdateDomainListUpdateDomainsSample.js | 34 - ...vicesUpdateDomainWalkUpdateDomainSample.js | 33 - .../javascript/cloudServicesUpdateSample.js | 34 - .../javascript/communityGalleriesGetSample.js | 28 - .../communityGalleryImageVersionsGetSample.js | 35 - .../communityGalleryImagesGetSample.js | 33 - ...dedicatedHostGroupsCreateOrUpdateSample.js | 68 - .../dedicatedHostGroupsDeleteSample.js | 45 - .../dedicatedHostGroupsGetSample.js | 45 - .../dedicatedHostGroupsUpdateSample.js | 78 - .../dedicatedHostsCreateOrUpdateSample.js | 40 - .../javascript/dedicatedHostsDeleteSample.js | 55 - .../v23/javascript/dedicatedHostsGetSample.js | 36 - .../javascript/dedicatedHostsUpdateSample.js | 102 - .../diskAccessesCreateOrUpdateSample.js | 33 - ...sDeleteAPrivateEndpointConnectionSample.js | 33 - .../javascript/diskAccessesDeleteSample.js | 28 - .../v23/javascript/diskAccessesGetSample.js | 45 - ...sUpdateAPrivateEndpointConnectionSample.js | 40 - .../javascript/diskAccessesUpdateSample.js | 35 - .../diskEncryptionSetsCreateOrUpdateSample.js | 108 - .../diskEncryptionSetsDeleteSample.js | 31 - .../javascript/diskEncryptionSetsGetSample.js | 45 - .../diskEncryptionSetsUpdateSample.js | 100 - .../javascript/diskRestorePointGetSample.js | 59 - .../diskRestorePointGrantAccessSample.js | 41 - ...iskRestorePointListByRestorePointSample.js | 36 - .../diskRestorePointRevokeAccessSample.js | 35 - .../javascript/disksCreateOrUpdateSample.js | 699 - .../v23/javascript/disksDeleteSample.js | 28 - .../samples/v23/javascript/disksGetSample.js | 28 - .../v23/javascript/disksGrantAccessSample.js | 89 - .../v23/javascript/disksRevokeAccessSample.js | 28 - .../v23/javascript/disksUpdateSample.js | 202 - .../galleriesCreateOrUpdateSample.js | 154 - .../v23/javascript/galleriesDeleteSample.js | 28 - .../v23/javascript/galleriesGetSample.js | 100 - .../v23/javascript/galleriesUpdateSample.js | 31 - ...ApplicationVersionsCreateOrUpdateSample.js | 78 - .../galleryApplicationVersionsDeleteSample.js | 35 - .../galleryApplicationVersionsGetSample.js | 62 - .../galleryApplicationVersionsUpdateSample.js | 61 - ...galleryApplicationsCreateOrUpdateSample.js | 58 - .../galleryApplicationsDeleteSample.js | 33 - .../galleryApplicationsGetSample.js | 33 - .../galleryApplicationsUpdateSample.js | 57 - ...alleryImageVersionsCreateOrUpdateSample.js | 884 - .../galleryImageVersionsDeleteSample.js | 35 - .../galleryImageVersionsGetSample.js | 164 - .../galleryImageVersionsUpdateSample.js | 120 - .../galleryImagesCreateOrUpdateSample.js | 45 - .../javascript/galleryImagesDeleteSample.js | 33 - .../v23/javascript/galleryImagesGetSample.js | 29 - .../galleryImagesListByGallerySample.js | 31 - .../javascript/galleryImagesUpdateSample.js | 85 - ...trolProfileVersionsCreateOrUpdateSample.js | 63 - ...ccessControlProfileVersionsDeleteSample.js | 35 - ...VMAccessControlProfileVersionsGetSample.js | 35 - ...ccessControlProfileVersionsUpdateSample.js | 42 - ...cessControlProfilesCreateOrUpdateSample.js | 38 - ...ryInVMAccessControlProfilesDeleteSample.js | 33 - ...lleryInVMAccessControlProfilesGetSample.js | 33 - ...ryInVMAccessControlProfilesUpdateSample.js | 37 - .../galleryScriptVersionsDeleteSample.js | 35 - .../galleryScriptVersionsGetSample.js | 59 - .../galleryScriptVersionsUpdateSample.js | 104 - .../galleryScriptsCreateOrUpdateSample.js | 44 - .../javascript/galleryScriptsDeleteSample.js | 33 - .../v23/javascript/galleryScriptsGetSample.js | 29 - .../galleryScriptsListByGallerySample.js | 31 - .../javascript/galleryScriptsUpdateSample.js | 41 - .../gallerySharingProfileUpdateSample.js | 86 - .../v23/javascript/imagesDeleteSample.js | 45 - .../v23/javascript/operationsListSample.js | 49 - ...mityPlacementGroupsCreateOrUpdateSample.js | 38 - .../proximityPlacementGroupsDeleteSample.js | 31 - .../proximityPlacementGroupsGetSample.js | 31 - .../proximityPlacementGroupsUpdateSample.js | 35 - .../v23/javascript/resourceSkusListSample.js | 69 - .../restorePointCollectionsDeleteSample.js | 51 - .../restorePointCollectionsGetSample.js | 51 - .../restorePointCollectionsUpdateSample.js | 61 - .../javascript/restorePointsCreateSample.js | 70 - .../javascript/restorePointsDeleteSample.js | 55 - .../v23/javascript/restorePointsGetSample.js | 55 - .../javascript/sharedGalleriesGetSample.js | 28 - .../sharedGalleryImageVersionsGetSample.js | 35 - .../snapshotsCreateOrUpdateSample.js | 216 - .../v23/javascript/snapshotsDeleteSample.js | 28 - .../v23/javascript/snapshotsGetSample.js | 45 - .../javascript/snapshotsGrantAccessSample.js | 37 - .../javascript/snapshotsRevokeAccessSample.js | 28 - .../v23/javascript/snapshotsUpdateSample.js | 62 - .../javascript/sshPublicKeysCreateSample.js | 32 - .../javascript/sshPublicKeysDeleteSample.js | 45 - .../sshPublicKeysGenerateKeyPairSample.js | 78 - .../v23/javascript/sshPublicKeysGetSample.js | 28 - .../javascript/sshPublicKeysUpdateSample.js | 50 - .../virtualMachineExtensionImagesGetSample.js | 59 - ...alMachineExtensionImagesListTypesSample.js | 45 - ...achineExtensionImagesListVersionsSample.js | 64 - ...alMachineExtensionsCreateOrUpdateSample.js | 94 - .../virtualMachineExtensionsDeleteSample.js | 55 - .../virtualMachineExtensionsGetSample.js | 58 - .../virtualMachineExtensionsListSample.js | 47 - .../virtualMachineExtensionsUpdateSample.js | 49 - .../virtualMachineImagesEdgeZoneGetSample.js | 67 - .../virtualMachineImagesEdgeZoneListSample.js | 72 - ...tualMachineImagesEdgeZoneListSkusSample.js | 59 - .../virtualMachineImagesGetSample.js | 63 - .../virtualMachineImagesListOffersSample.js | 45 - .../virtualMachineImagesListSample.js | 63 - .../virtualMachineImagesListSkusSample.js | 47 - ...alMachineImagesListWithPropertiesSample.js | 70 - ...lMachineRunCommandsCreateOrUpdateSample.js | 55 - .../virtualMachineRunCommandsDeleteSample.js | 33 - ...ineRunCommandsGetByVirtualMachineSample.js | 33 - .../virtualMachineRunCommandsGetSample.js | 29 - .../virtualMachineRunCommandsUpdateSample.js | 53 - ...eScaleSetExtensionsCreateOrUpdateSample.js | 71 - ...alMachineScaleSetExtensionsDeleteSample.js | 55 - ...rtualMachineScaleSetExtensionsGetSample.js | 58 - ...tualMachineScaleSetExtensionsListSample.js | 57 - ...alMachineScaleSetExtensionsUpdateSample.js | 70 - ...hineScaleSetRollingUpgradesCancelSample.js | 51 - ...eScaleSetRollingUpgradesGetLatestSample.js | 51 - ...caleSetVMExtensionsCreateOrUpdateSample.js | 43 - ...MachineScaleSetVMExtensionsDeleteSample.js | 35 - ...ualMachineScaleSetVMExtensionsGetSample.js | 35 - ...MachineScaleSetVMExtensionsUpdateSample.js | 43 - ...aleSetVMRunCommandsCreateOrUpdateSample.js | 61 - ...achineScaleSetVMRunCommandsDeleteSample.js | 35 - ...alMachineScaleSetVMRunCommandsGetSample.js | 35 - ...achineScaleSetVMRunCommandsUpdateSample.js | 44 - ...eScaleSetVMSApproveRollingUpgradeSample.js | 33 - ...eScaleSetVMSAttachDetachDataDisksSample.js | 107 - .../virtualMachineScaleSetVMSDeleteSample.js | 38 - .../virtualMachineScaleSetVMSGetSample.js | 77 - .../virtualMachineScaleSetVMSListSample.js | 89 - ...hineScaleSetVMSPerformMaintenanceSample.js | 55 - ...virtualMachineScaleSetVMSPowerOffSample.js | 60 - ...virtualMachineScaleSetVMSRedeploySample.js | 55 - ...rtualMachineScaleSetVMSReimageAllSample.js | 55 - .../virtualMachineScaleSetVMSReimageSample.js | 63 - .../virtualMachineScaleSetVMSRestartSample.js | 55 - ...SetVMSRetrieveBootDiagnosticsDataSample.js | 36 - ...rtualMachineScaleSetVMSRunCommandSample.js | 38 - ...achineScaleSetVMSSimulateEvictionSample.js | 33 - .../virtualMachineScaleSetVMSStartSample.js | 55 - .../virtualMachineScaleSetVMSUpdateSample.js | 451 - ...ineScaleSetsApproveRollingUpgradeSample.js | 38 - ...SetsConvertToSinglePlacementGroupSample.js | 57 - ...ualMachineScaleSetsCreateOrUpdateSample.js | 3802 --- ...virtualMachineScaleSetsDeallocateSample.js | 60 - ...alMachineScaleSetsDeleteInstancesSample.js | 64 - .../virtualMachineScaleSetsDeleteSample.js | 36 - ...alMachineScaleSetsGetInstanceViewSample.js | 51 - ...chineScaleSetsGetOSUpgradeHistorySample.js | 57 - .../virtualMachineScaleSetsGetSample.js | 91 - .../virtualMachineScaleSetsListSample.js | 49 - .../virtualMachineScaleSetsPowerOffSample.js | 60 - .../virtualMachineScaleSetsReapplySample.js | 55 - .../virtualMachineScaleSetsRedeploySample.js | 58 - ...virtualMachineScaleSetsReimageAllSample.js | 58 - .../virtualMachineScaleSetsReimageSample.js | 60 - .../virtualMachineScaleSetsRestartSample.js | 58 - .../virtualMachineScaleSetsScaleOutSample.js | 36 - ...eSetsSetOrchestrationServiceStateSample.js | 61 - .../virtualMachineScaleSetsStartSample.js | 56 - ...alMachineScaleSetsUpdateInstancesSample.js | 59 - .../virtualMachinesAssessPatchesSample.js | 28 - ...tualMachinesAttachDetachDataDisksSample.js | 105 - .../virtualMachinesCaptureSample.js | 63 - ...tualMachinesConvertToManagedDisksSample.js | 51 - .../virtualMachinesDeallocateSample.js | 51 - .../javascript/virtualMachinesDeleteSample.js | 34 - .../javascript/virtualMachinesGetSample.js | 83 - .../virtualMachinesInstanceViewSample.js | 45 - ...irtualMachinesMigrateToVMScaleSetSample.js | 39 - ...virtualMachinesPerformMaintenanceSample.js | 51 - .../virtualMachinesPowerOffSample.js | 51 - .../virtualMachinesReapplySample.js | 28 - .../virtualMachinesRedeploySample.js | 45 - .../virtualMachinesRestartSample.js | 45 - .../virtualMachinesRunCommandSample.js | 34 - .../virtualMachinesSimulateEvictionSample.js | 28 - .../javascript/virtualMachinesStartSample.js | 45 - ...MigrationToVirtualMachineScaleSetSample.ts | 34 - ...tsConvertToVirtualMachineScaleSetSample.ts | 45 - .../availabilitySetsCreateOrUpdateSample.ts | 68 - .../src/availabilitySetsDeleteSample.ts | 55 - .../src/availabilitySetsGetSample.ts | 55 - ...vailabilitySetsListBySubscriptionSample.ts | 38 - .../src/availabilitySetsListSample.ts | 53 - ...MigrationToVirtualMachineScaleSetSample.ts | 44 - .../src/availabilitySetsUpdateSample.ts | 76 - ...MigrationToVirtualMachineScaleSetSample.ts | 44 - ...tyReservationGroupsCreateOrUpdateSample.ts | 113 - .../src/capacityReservationGroupsGetSample.ts | 90 - ...ervationGroupsListByResourceGroupSample.ts | 43 - .../capacityReservationGroupsUpdateSample.ts | 66 - ...apacityReservationsCreateOrUpdateSample.ts | 109 - .../src/capacityReservationsGetSample.ts | 96 - .../src/capacityReservationsUpdateSample.ts | 82 - ...erviceOperatingSystemsGetOSFamilySample.ts | 32 - ...rviceOperatingSystemsGetOSVersionSample.ts | 32 - ...iceOperatingSystemsListOSFamiliesSample.ts | 33 - ...iceOperatingSystemsListOSVersionsSample.ts | 33 - .../cloudServiceRoleInstancesDeleteSample.ts | 35 - ...rviceRoleInstancesGetInstanceViewSample.ts | 35 - ...RoleInstancesGetRemoteDesktopFileSample.ts | 35 - .../src/cloudServiceRoleInstancesGetSample.ts | 35 - .../cloudServiceRoleInstancesListSample.ts | 36 - .../cloudServiceRoleInstancesRebuildSample.ts | 35 - .../cloudServiceRoleInstancesReimageSample.ts | 35 - .../cloudServiceRoleInstancesRestartSample.ts | 35 - .../src/cloudServiceRolesGetSample.ts | 35 - .../src/cloudServiceRolesListSample.ts | 36 - .../src/cloudServicesCreateOrUpdateSample.ts | 353 - .../src/cloudServicesDeleteInstancesSample.ts | 43 - .../src/cloudServicesDeleteSample.ts | 33 - .../src/cloudServicesGetInstanceViewSample.ts | 33 - .../typescript/src/cloudServicesGetSample.ts | 33 - .../src/cloudServicesListAllSample.ts | 30 - .../typescript/src/cloudServicesListSample.ts | 32 - .../src/cloudServicesPowerOffSample.ts | 33 - .../src/cloudServicesRebuildSample.ts | 43 - .../src/cloudServicesReimageSample.ts | 43 - .../src/cloudServicesRestartSample.ts | 43 - .../src/cloudServicesStartSample.ts | 33 - ...rvicesUpdateDomainGetUpdateDomainSample.ts | 35 - ...icesUpdateDomainListUpdateDomainsSample.ts | 36 - ...vicesUpdateDomainWalkUpdateDomainSample.ts | 36 - .../src/cloudServicesUpdateSample.ts | 41 - .../src/communityGalleriesGetSample.ts | 32 - .../communityGalleryImageVersionsGetSample.ts | 36 - ...dedicatedHostGroupsCreateOrUpdateSample.ts | 76 - .../src/dedicatedHostGroupsDeleteSample.ts | 55 - .../src/dedicatedHostGroupsGetSample.ts | 55 - .../src/dedicatedHostGroupsUpdateSample.ts | 86 - .../src/dedicatedHostsCreateOrUpdateSample.ts | 43 - .../src/dedicatedHostsDeleteSample.ts | 59 - .../typescript/src/dedicatedHostsGetSample.ts | 42 - .../src/dedicatedHostsUpdateSample.ts | 112 - .../src/diskAccessesCreateOrUpdateSample.ts | 36 - ...sDeleteAPrivateEndpointConnectionSample.ts | 36 - .../src/diskAccessesDeleteSample.ts | 33 - .../typescript/src/diskAccessesGetSample.ts | 55 - ...sUpdateAPrivateEndpointConnectionSample.ts | 47 - .../src/diskAccessesUpdateSample.ts | 38 - .../diskEncryptionSetsCreateOrUpdateSample.ts | 116 - .../src/diskEncryptionSetsDeleteSample.ts | 33 - .../src/diskEncryptionSetsGetSample.ts | 55 - .../src/diskEncryptionSetsUpdateSample.ts | 113 - .../src/diskRestorePointGetSample.ts | 65 - .../src/diskRestorePointGrantAccessSample.ts | 46 - ...iskRestorePointListByRestorePointSample.ts | 38 - .../src/diskRestorePointRevokeAccessSample.ts | 39 - .../src/disksCreateOrUpdateSample.ts | 869 - .../v23/typescript/src/disksDeleteSample.ts | 33 - .../v23/typescript/src/disksGetSample.ts | 30 - .../typescript/src/disksGrantAccessSample.ts | 96 - .../typescript/src/disksRevokeAccessSample.ts | 33 - .../v23/typescript/src/disksUpdateSample.ts | 263 - .../src/galleriesCreateOrUpdateSample.ts | 165 - .../typescript/src/galleriesDeleteSample.ts | 33 - .../v23/typescript/src/galleriesGetSample.ts | 122 - .../typescript/src/galleriesUpdateSample.ts | 38 - ...ApplicationVersionsCreateOrUpdateSample.ts | 85 - .../galleryApplicationVersionsDeleteSample.ts | 37 - .../galleryApplicationVersionsGetSample.ts | 70 - .../galleryApplicationVersionsUpdateSample.ts | 67 - ...galleryApplicationsCreateOrUpdateSample.ts | 64 - .../src/galleryApplicationsDeleteSample.ts | 35 - .../src/galleryApplicationsGetSample.ts | 35 - .../src/galleryApplicationsUpdateSample.ts | 63 - ...alleryImageVersionsCreateOrUpdateSample.ts | 914 - .../src/galleryImageVersionsDeleteSample.ts | 37 - .../src/galleryImageVersionsGetSample.ts | 180 - .../src/galleryImageVersionsUpdateSample.ts | 130 - .../src/galleryImagesCreateOrUpdateSample.ts | 48 - .../src/galleryImagesDeleteSample.ts | 35 - .../typescript/src/galleryImagesGetSample.ts | 35 - .../src/galleryImagesListByGallerySample.ts | 36 - .../src/galleryImagesUpdateSample.ts | 93 - ...trolProfileVersionsCreateOrUpdateSample.ts | 71 - ...ccessControlProfileVersionsDeleteSample.ts | 38 - ...VMAccessControlProfileVersionsGetSample.ts | 37 - ...ccessControlProfileVersionsUpdateSample.ts | 54 - ...cessControlProfilesCreateOrUpdateSample.ts | 45 - ...ryInVMAccessControlProfilesDeleteSample.ts | 36 - ...lleryInVMAccessControlProfilesGetSample.ts | 35 - ...ryInVMAccessControlProfilesUpdateSample.ts | 43 - .../src/galleryScriptVersionsDeleteSample.ts | 37 - .../src/galleryScriptVersionsGetSample.ts | 63 - .../src/galleryScriptVersionsUpdateSample.ts | 110 - .../src/galleryScriptsCreateOrUpdateSample.ts | 47 - .../src/galleryScriptsDeleteSample.ts | 35 - .../typescript/src/galleryScriptsGetSample.ts | 35 - .../src/galleryScriptsUpdateSample.ts | 47 - .../src/gallerySharingProfileUpdateSample.ts | 96 - .../v23/typescript/src/imagesDeleteSample.ts | 55 - .../typescript/src/operationsListSample.ts | 51 - ...mityPlacementGroupsCreateOrUpdateSample.ts | 44 - .../proximityPlacementGroupsDeleteSample.ts | 33 - .../src/proximityPlacementGroupsGetSample.ts | 33 - .../proximityPlacementGroupsUpdateSample.ts | 41 - .../typescript/src/resourceSkusListSample.ts | 76 - .../restorePointCollectionsDeleteSample.ts | 55 - .../src/restorePointCollectionsGetSample.ts | 55 - .../restorePointCollectionsUpdateSample.ts | 69 - .../src/restorePointsCreateSample.ts | 75 - .../src/restorePointsDeleteSample.ts | 59 - .../typescript/src/restorePointsGetSample.ts | 59 - .../src/sharedGalleriesGetSample.ts | 29 - .../sharedGalleryImageVersionsGetSample.ts | 36 - .../src/snapshotsCreateOrUpdateSample.ts | 233 - .../typescript/src/snapshotsDeleteSample.ts | 33 - .../v23/typescript/src/snapshotsGetSample.ts | 49 - .../src/snapshotsGrantAccessSample.ts | 40 - .../src/snapshotsRevokeAccessSample.ts | 33 - .../typescript/src/snapshotsUpdateSample.ts | 67 - .../src/sshPublicKeysCreateSample.ts | 42 - .../src/sshPublicKeysDeleteSample.ts | 55 - .../src/sshPublicKeysGenerateKeyPairSample.ts | 92 - .../typescript/src/sshPublicKeysGetSample.ts | 33 - .../src/sshPublicKeysUpdateSample.ts | 66 - .../virtualMachineExtensionImagesGetSample.ts | 61 - ...alMachineExtensionImagesListTypesSample.ts | 53 - ...achineExtensionImagesListVersionsSample.ts | 70 - ...alMachineExtensionsCreateOrUpdateSample.ts | 104 - .../virtualMachineExtensionsDeleteSample.ts | 59 - .../src/virtualMachineExtensionsGetSample.ts | 66 - .../src/virtualMachineExtensionsListSample.ts | 62 - .../virtualMachineExtensionsUpdateSample.ts | 55 - .../virtualMachineImagesEdgeZoneGetSample.ts | 69 - .../virtualMachineImagesEdgeZoneListSample.ts | 78 - ...tualMachineImagesEdgeZoneListSkusSample.ts | 61 - .../src/virtualMachineImagesGetSample.ts | 65 - .../virtualMachineImagesListOffersSample.ts | 53 - .../src/virtualMachineImagesListSample.ts | 74 - .../src/virtualMachineImagesListSkusSample.ts | 57 - ...alMachineImagesListWithPropertiesSample.ts | 76 - ...lMachineRunCommandsCreateOrUpdateSample.ts | 64 - .../virtualMachineRunCommandsDeleteSample.ts | 35 - ...ineRunCommandsGetByVirtualMachineSample.ts | 35 - .../src/virtualMachineRunCommandsGetSample.ts | 33 - .../virtualMachineRunCommandsUpdateSample.ts | 60 - ...eScaleSetExtensionsCreateOrUpdateSample.ts | 81 - ...alMachineScaleSetExtensionsDeleteSample.ts | 61 - ...rtualMachineScaleSetExtensionsGetSample.ts | 66 - ...tualMachineScaleSetExtensionsListSample.ts | 61 - ...alMachineScaleSetExtensionsUpdateSample.ts | 80 - ...hineScaleSetRollingUpgradesCancelSample.ts | 57 - ...eScaleSetRollingUpgradesGetLatestSample.ts | 55 - ...caleSetVMExtensionsCreateOrUpdateSample.ts | 50 - ...MachineScaleSetVMExtensionsDeleteSample.ts | 38 - ...ualMachineScaleSetVMExtensionsGetSample.ts | 37 - ...MachineScaleSetVMExtensionsUpdateSample.ts | 50 - ...aleSetVMRunCommandsCreateOrUpdateSample.ts | 70 - ...achineScaleSetVMRunCommandsDeleteSample.ts | 38 - ...alMachineScaleSetVMRunCommandsGetSample.ts | 37 - ...achineScaleSetVMRunCommandsUpdateSample.ts | 52 - ...eScaleSetVMSApproveRollingUpgradeSample.ts | 36 - ...eScaleSetVMSAttachDetachDataDisksSample.ts | 117 - .../virtualMachineScaleSetVMSDeleteSample.ts | 44 - .../src/virtualMachineScaleSetVMSGetSample.ts | 83 - .../virtualMachineScaleSetVMSListSample.ts | 99 - ...hineScaleSetVMSPerformMaintenanceSample.ts | 61 - ...virtualMachineScaleSetVMSPowerOffSample.ts | 68 - ...virtualMachineScaleSetVMSRedeploySample.ts | 59 - ...rtualMachineScaleSetVMSReimageAllSample.ts | 59 - .../virtualMachineScaleSetVMSReimageSample.ts | 72 - .../virtualMachineScaleSetVMSRestartSample.ts | 59 - ...SetVMSRetrieveBootDiagnosticsDataSample.ts | 44 - ...rtualMachineScaleSetVMSRunCommandSample.ts | 41 - ...achineScaleSetVMSSimulateEvictionSample.ts | 35 - .../virtualMachineScaleSetVMSStartSample.ts | 59 - .../virtualMachineScaleSetVMSUpdateSample.ts | 463 - ...ineScaleSetsApproveRollingUpgradeSample.ts | 46 - ...SetsConvertToSinglePlacementGroupSample.ts | 67 - ...ualMachineScaleSetsCreateOrUpdateSample.ts | 3969 --- ...virtualMachineScaleSetsDeallocateSample.ts | 69 - ...alMachineScaleSetsDeleteInstancesSample.ts | 75 - .../virtualMachineScaleSetsDeleteSample.ts | 42 - ...alMachineScaleSetsGetInstanceViewSample.ts | 55 - ...chineScaleSetsGetOSUpgradeHistorySample.ts | 61 - .../src/virtualMachineScaleSetsGetSample.ts | 109 - .../src/virtualMachineScaleSetsListSample.ts | 57 - .../virtualMachineScaleSetsPowerOffSample.ts | 69 - .../virtualMachineScaleSetsReapplySample.ts | 59 - .../virtualMachineScaleSetsRedeploySample.ts | 67 - ...virtualMachineScaleSetsReimageAllSample.ts | 67 - .../virtualMachineScaleSetsReimageSample.ts | 69 - .../virtualMachineScaleSetsRestartSample.ts | 67 - .../virtualMachineScaleSetsScaleOutSample.ts | 42 - ...eSetsSetOrchestrationServiceStateSample.ts | 71 - .../src/virtualMachineScaleSetsStartSample.ts | 65 - ...alMachineScaleSetsUpdateInstancesSample.ts | 69 - .../src/virtualMachinesAssessPatchesSample.ts | 33 - ...tualMachinesAttachDetachDataDisksSample.ts | 113 - .../src/virtualMachinesCaptureSample.ts | 71 - ...tualMachinesConvertToManagedDisksSample.ts | 55 - .../src/virtualMachinesDeallocateSample.ts | 62 - .../src/virtualMachinesDeleteSample.ts | 40 - .../src/virtualMachinesGetSample.ts | 103 - .../virtualMachinesInstallPatchesSample.ts | 48 - .../src/virtualMachinesInstanceViewSample.ts | 55 - .../src/virtualMachinesListSample.ts | 62 - ...irtualMachinesMigrateToVMScaleSetSample.ts | 46 - ...virtualMachinesPerformMaintenanceSample.ts | 55 - .../src/virtualMachinesPowerOffSample.ts | 62 - .../src/virtualMachinesReapplySample.ts | 33 - .../src/virtualMachinesRedeploySample.ts | 55 - .../src/virtualMachinesRestartSample.ts | 55 - ...chinesRetrieveBootDiagnosticsDataSample.ts | 42 - .../src/virtualMachinesRunCommandSample.ts | 37 - .../virtualMachinesSimulateEvictionSample.ts | 33 - .../src/virtualMachinesStartSample.ts | 55 - .../samples/{v23 => v24}/javascript/README.md | 1214 +- ...MigrationToVirtualMachineScaleSetSample.js | 27 + ...tsConvertToVirtualMachineScaleSetSample.js | 26 + .../availabilitySetsCreateOrUpdateSample.js | 48 + .../availabilitySetsDeleteSample.js | 38 + .../javascript/availabilitySetsGetSample.js | 40 + ...vailabilitySetsListAvailableSizesSample.js | 32 +- ...vailabilitySetsListBySubscriptionSample.js | 16 +- .../javascript/availabilitySetsListSample.js | 48 + ...MigrationToVirtualMachineScaleSetSample.js | 32 + .../availabilitySetsUpdateSample.js | 53 + ...MigrationToVirtualMachineScaleSetSample.js | 32 + ...tyReservationGroupsCreateOrUpdateSample.js | 93 + .../capacityReservationGroupsDeleteSample.js | 33 +- .../capacityReservationGroupsGetSample.js | 67 + ...ervationGroupsListByResourceGroupSample.js | 22 +- ...servationGroupsListBySubscriptionSample.js | 35 +- .../capacityReservationGroupsUpdateSample.js | 48 + ...apacityReservationsCreateOrUpdateSample.js | 86 + .../capacityReservationsDeleteSample.js | 39 +- .../capacityReservationsGetSample.js | 70 + ...onsListByCapacityReservationGroupSample.js | 49 +- .../capacityReservationsUpdateSample.js | 53 + .../javascript/communityGalleriesGetSample.js | 25 + .../communityGalleryImageVersionsGetSample.js | 30 + ...communityGalleryImageVersionsListSample.js | 19 +- .../communityGalleryImagesGetSample.js | 29 + .../communityGalleryImagesListSample.js | 14 +- ...dedicatedHostGroupsCreateOrUpdateSample.js | 61 + .../dedicatedHostGroupsDeleteSample.js | 38 + .../dedicatedHostGroupsGetSample.js | 40 + ...atedHostGroupsListByResourceGroupSample.js | 25 +- ...catedHostGroupsListBySubscriptionSample.js | 19 +- .../dedicatedHostGroupsUpdateSample.js | 45 + .../dedicatedHostsCreateOrUpdateSample.js | 35 + .../javascript/dedicatedHostsDeleteSample.js | 38 + .../v24/javascript/dedicatedHostsGetSample.js | 30 + .../dedicatedHostsListAvailableSizesSample.js | 19 +- .../dedicatedHostsListByHostGroupSample.js | 32 +- .../dedicatedHostsRedeploySample.js | 19 +- .../javascript/dedicatedHostsRestartSample.js | 19 +- .../javascript/dedicatedHostsUpdateSample.js | 75 + .../diskAccessesCreateOrUpdateSample.js | 27 + ...sDeleteAPrivateEndpointConnectionSample.js | 28 + .../javascript/diskAccessesDeleteSample.js | 24 + ...ssesGetAPrivateEndpointConnectionSample.js | 18 +- ...skAccessesGetPrivateLinkResourcesSample.js | 15 +- .../v24/javascript/diskAccessesGetSample.js | 40 + .../diskAccessesListByResourceGroupSample.js | 13 +- ...sesListPrivateEndpointConnectionsSample.js | 16 +- .../javascript/diskAccessesListSample.js | 10 +- ...sUpdateAPrivateEndpointConnectionSample.js | 35 + .../javascript/diskAccessesUpdateSample.js | 27 + .../diskEncryptionSetsCreateOrUpdateSample.js | 94 + .../diskEncryptionSetsDeleteSample.js | 24 + .../javascript/diskEncryptionSetsGetSample.js | 40 + ...yptionSetsListAssociatedResourcesSample.js | 16 +- ...EncryptionSetsListByResourceGroupSample.js | 13 +- .../diskEncryptionSetsListSample.js | 10 +- .../diskEncryptionSetsUpdateSample.js | 78 + .../javascript/diskRestorePointGetSample.js | 50 + .../diskRestorePointGrantAccessSample.js | 31 + ...iskRestorePointListByRestorePointSample.js | 33 + .../diskRestorePointRevokeAccessSample.js | 29 + .../javascript/disksCreateOrUpdateSample.js | 610 + .../v24/javascript/disksDeleteSample.js | 24 + .../samples/v24/javascript/disksGetSample.js | 25 + .../v24/javascript/disksGrantAccessSample.js | 67 + .../disksListByResourceGroupSample.js | 13 +- .../javascript/disksListSample.js | 10 +- .../v24/javascript/disksRevokeAccessSample.js | 24 + .../v24/javascript/disksUpdateSample.js | 182 + .../galleriesCreateOrUpdateSample.js | 118 + .../v24/javascript/galleriesDeleteSample.js | 24 + .../v24/javascript/galleriesGetSample.js | 89 + .../galleriesListByResourceGroupSample.js | 13 +- .../javascript/galleriesListSample.js | 10 +- .../v24/javascript/galleriesUpdateSample.js | 27 + ...ApplicationVersionsCreateOrUpdateSample.js | 72 + .../galleryApplicationVersionsDeleteSample.js | 29 + .../galleryApplicationVersionsGetSample.js | 51 + ...nVersionsListByGalleryApplicationSample.js | 19 +- .../galleryApplicationVersionsUpdateSample.js | 55 + ...galleryApplicationsCreateOrUpdateSample.js | 53 + .../galleryApplicationsDeleteSample.js | 28 + .../galleryApplicationsGetSample.js | 29 + .../galleryApplicationsListByGallerySample.js | 16 +- .../galleryApplicationsUpdateSample.js | 52 + ...alleryImageVersionsCreateOrUpdateSample.js | 830 + .../galleryImageVersionsDeleteSample.js | 29 + .../galleryImageVersionsGetSample.js | 133 + ...ryImageVersionsListByGalleryImageSample.js | 19 +- .../galleryImageVersionsUpdateSample.js | 93 + .../galleryImagesCreateOrUpdateSample.js | 36 + .../javascript/galleryImagesDeleteSample.js | 24 + .../v24/javascript/galleryImagesGetSample.js | 29 + .../galleryImagesListByGallerySample.js | 29 + .../javascript/galleryImagesUpdateSample.js | 62 + ...trolProfileVersionsCreateOrUpdateSample.js | 53 + ...ccessControlProfileVersionsDeleteSample.js | 29 + ...VMAccessControlProfileVersionsGetSample.js | 30 + ...yGalleryInVMAccessControlProfileSample.js} | 23 +- ...ccessControlProfileVersionsUpdateSample.js | 36 + ...cessControlProfilesCreateOrUpdateSample.js | 30 + ...ryInVMAccessControlProfilesDeleteSample.js | 28 + ...lleryInVMAccessControlProfilesGetSample.js | 29 + ...ccessControlProfilesListByGallerySample.js | 16 +- ...ryInVMAccessControlProfilesUpdateSample.js | 30 + ...lleryScriptVersionsCreateOrUpdateSample.js | 96 + .../galleryScriptVersionsDeleteSample.js | 29 + .../galleryScriptVersionsGetSample.js | 50 + ...ScriptVersionsListByGalleryScriptSample.js | 19 +- .../galleryScriptVersionsUpdateSample.js} | 80 +- .../galleryScriptsCreateOrUpdateSample.js | 39 + .../javascript/galleryScriptsDeleteSample.js | 24 + .../v24/javascript/galleryScriptsGetSample.js | 29 + .../galleryScriptsListByGallerySample.js | 32 + .../javascript/galleryScriptsUpdateSample.js | 36 + .../gallerySharingProfileUpdateSample.js | 68 + .../javascript/imagesCreateOrUpdateSample.js | 333 +- .../v24/javascript/imagesDeleteSample.js | 38 + .../javascript/imagesGetSample.js | 13 +- .../imagesListByResourceGroupSample.js | 13 +- .../javascript/imagesListSample.js | 10 +- .../javascript/imagesUpdateSample.js | 22 +- ...lyticsExportRequestRateByIntervalSample.js | 26 +- ...gAnalyticsExportThrottledRequestsSample.js | 26 +- .../v24/javascript/operationsListSample.js | 46 + .../{v23 => v24}/javascript/package.json | 6 +- ...mityPlacementGroupsCreateOrUpdateSample.js | 34 + .../proximityPlacementGroupsDeleteSample.js | 24 + .../proximityPlacementGroupsGetSample.js | 28 + ...lacementGroupsListByResourceGroupSample.js | 13 +- ...PlacementGroupsListBySubscriptionSample.js | 10 +- .../proximityPlacementGroupsUpdateSample.js | 29 + .../v24/javascript/resourceSkusListSample.js | 67 + ...orePointCollectionsCreateOrUpdateSample.js | 59 +- .../restorePointCollectionsDeleteSample.js | 38 + .../restorePointCollectionsGetSample.js | 40 + .../restorePointCollectionsListAllSample.js | 10 +- .../restorePointCollectionsListSample.js | 13 +- .../restorePointCollectionsUpdateSample.js | 46 + .../javascript/restorePointsCreateSample.js | 51 + .../javascript/restorePointsDeleteSample.js | 38 + .../v24/javascript/restorePointsGetSample.js | 40 + .../{v23 => v24}/javascript/sample.env | 0 .../javascript/sharedGalleriesGetSample.js | 25 + .../javascript/sharedGalleriesListSample.js | 13 +- .../sharedGalleryImageVersionsGetSample.js | 30 + .../sharedGalleryImageVersionsListSample.js | 19 +- .../sharedGalleryImagesGetSample.js | 18 +- .../sharedGalleryImagesListSample.js | 14 +- .../snapshotsCreateOrUpdateSample.js | 166 + .../v24/javascript/snapshotsDeleteSample.js | 24 + .../v24/javascript/snapshotsGetSample.js | 40 + .../javascript/snapshotsGrantAccessSample.js | 29 + .../snapshotsListByResourceGroupSample.js | 13 +- .../javascript/snapshotsListSample.js | 10 +- .../javascript/snapshotsRevokeAccessSample.js | 24 + .../v24/javascript/snapshotsUpdateSample.js | 47 + ...DeletedResourceListByArtifactNameSample.js | 22 +- .../javascript/sshPublicKeysCreateSample.js | 28 + .../javascript/sshPublicKeysDeleteSample.js | 38 + .../sshPublicKeysGenerateKeyPairSample.js | 66 + .../v24/javascript/sshPublicKeysGetSample.js | 25 + .../sshPublicKeysListByResourceGroupSample.js | 25 +- .../sshPublicKeysListBySubscriptionSample.js | 19 +- .../javascript/sshPublicKeysUpdateSample.js | 43 + .../javascript/usageListSample.js | 25 +- .../virtualMachineExtensionImagesGetSample.js | 50 + ...alMachineExtensionImagesListTypesSample.js | 43 + ...achineExtensionImagesListVersionsSample.js | 49 + ...alMachineExtensionsCreateOrUpdateSample.js | 85 + .../virtualMachineExtensionsDeleteSample.js | 42 + .../virtualMachineExtensionsGetSample.js | 45 + .../virtualMachineExtensionsListSample.js | 45 + .../virtualMachineExtensionsUpdateSample.js | 44 + .../virtualMachineImagesEdgeZoneGetSample.js | 54 + ...alMachineImagesEdgeZoneListOffersSample.js | 35 +- ...chineImagesEdgeZoneListPublishersSample.js | 31 +- .../virtualMachineImagesEdgeZoneListSample.js | 53 + ...tualMachineImagesEdgeZoneListSkusSample.js | 50 + .../virtualMachineImagesGetSample.js | 52 + ...irtualMachineImagesListByEdgeZoneSample.js | 27 +- .../virtualMachineImagesListOffersSample.js | 43 + ...irtualMachineImagesListPublishersSample.js | 23 +- .../virtualMachineImagesListSample.js | 51 + .../virtualMachineImagesListSkusSample.js | 44 + ...alMachineImagesListWithPropertiesSample.js | 53 + ...lMachineRunCommandsCreateOrUpdateSample.js | 48 + .../virtualMachineRunCommandsDeleteSample.js | 24 + ...ineRunCommandsGetByVirtualMachineSample.js | 29 + .../virtualMachineRunCommandsGetSample.js | 25 + ...neRunCommandsListByVirtualMachineSample.js | 16 +- .../virtualMachineRunCommandsListSample.js | 13 +- .../virtualMachineRunCommandsUpdateSample.js | 44 + ...eScaleSetExtensionsCreateOrUpdateSample.js | 62 + ...alMachineScaleSetExtensionsDeleteSample.js | 46 + ...rtualMachineScaleSetExtensionsGetSample.js | 49 + ...tualMachineScaleSetExtensionsListSample.js | 54 + ...alMachineScaleSetExtensionsUpdateSample.js | 61 + ...ineScaleSetLifeCycleHookEventsGetSample.js | 29 + ...neScaleSetLifeCycleHookEventsListSample.js | 32 + ...ScaleSetLifeCycleHookEventsUpdateSample.js | 40 + ...hineScaleSetRollingUpgradesCancelSample.js | 38 + ...eScaleSetRollingUpgradesGetLatestSample.js | 46 + ...lingUpgradesStartExtensionUpgradeSample.js | 21 +- ...eSetRollingUpgradesStartOSUpgradeSample.js | 34 +- ...caleSetVMExtensionsCreateOrUpdateSample.js | 37 + ...MachineScaleSetVMExtensionsDeleteSample.js | 29 + ...ualMachineScaleSetVMExtensionsGetSample.js | 30 + ...alMachineScaleSetVMExtensionsListSample.js | 18 +- ...MachineScaleSetVMExtensionsUpdateSample.js | 37 + ...aleSetVMRunCommandsCreateOrUpdateSample.js | 51 + ...achineScaleSetVMRunCommandsDeleteSample.js | 29 + ...alMachineScaleSetVMRunCommandsGetSample.js | 30 + ...lMachineScaleSetVMRunCommandsListSample.js | 19 +- ...achineScaleSetVMRunCommandsUpdateSample.js | 36 + ...eScaleSetVMsApproveRollingUpgradeSample.js | 28 + ...eScaleSetVMsAttachDetachDataDisksSample.js | 98 + ...tualMachineScaleSetVMsDeallocateSample.js} | 41 +- .../virtualMachineScaleSetVMsDeleteSample.js | 26 + ...achineScaleSetVMsGetInstanceViewSample.js} | 18 +- .../virtualMachineScaleSetVMsGetSample.js | 74 + .../virtualMachineScaleSetVMsListSample.js | 90 + ...hineScaleSetVMsPerformMaintenanceSample.js | 42 + ...virtualMachineScaleSetVMsPowerOffSample.js | 44 + ...virtualMachineScaleSetVMsRedeploySample.js | 46 + ...rtualMachineScaleSetVMsReimageAllSample.js | 46 + .../virtualMachineScaleSetVMsReimageSample.js | 43 + .../virtualMachineScaleSetVMsRestartSample.js | 38 + ...SetVMsRetrieveBootDiagnosticsDataSample.js | 30 + ...rtualMachineScaleSetVMsRunCommandSample.js | 30 + ...achineScaleSetVMsSimulateEvictionSample.js | 28 + .../virtualMachineScaleSetVMsStartSample.js | 42 + .../virtualMachineScaleSetVMsUpdateSample.js | 303 + ...ineScaleSetsApproveRollingUpgradeSample.js | 28 + ...SetsConvertToSinglePlacementGroupSample.js | 46 + ...ualMachineScaleSetsCreateOrUpdateSample.js | 3913 +++ ...virtualMachineScaleSetsDeallocateSample.js | 41 + ...alMachineScaleSetsDeleteInstancesSample.js | 45 + .../virtualMachineScaleSetsDeleteSample.js | 26 + ...iceFabricPlatformUpdateDomainWalkSample.js | 35 +- ...alMachineScaleSetsGetInstanceViewSample.js | 46 + ...chineScaleSetsGetOSUpgradeHistorySample.js | 54 + .../virtualMachineScaleSetsGetSample.js | 84 + .../virtualMachineScaleSetsListAllSample.js | 19 +- ...ualMachineScaleSetsListByLocationSample.js | 13 +- .../virtualMachineScaleSetsListSample.js | 48 + .../virtualMachineScaleSetsListSkusSample.js | 32 +- ...achineScaleSetsPerformMaintenanceSample.js | 42 +- .../virtualMachineScaleSetsPowerOffSample.js | 41 + .../virtualMachineScaleSetsReapplySample.js | 44 + .../virtualMachineScaleSetsRedeploySample.js | 40 + ...virtualMachineScaleSetsReimageAllSample.js | 40 + .../virtualMachineScaleSetsReimageSample.js | 44 + .../virtualMachineScaleSetsRestartSample.js | 40 + .../virtualMachineScaleSetsScaleOutSample.js | 27 + ...eSetsSetOrchestrationServiceStateSample.js | 46 + .../virtualMachineScaleSetsStartSample.js | 40 + ...alMachineScaleSetsUpdateInstancesSample.js | 44 + .../virtualMachineScaleSetsUpdateSample.js | 349 +- .../virtualMachineSizesListSample.js | 25 +- .../virtualMachinesAssessPatchesSample.js | 25 + ...tualMachinesAttachDetachDataDisksSample.js | 94 + .../virtualMachinesCaptureSample.js | 48 + ...tualMachinesConvertToManagedDisksSample.js | 38 + .../virtualMachinesCreateOrUpdateSample.js | 3892 ++- .../virtualMachinesDeallocateSample.js | 54 + .../javascript/virtualMachinesDeleteSample.js | 24 + .../virtualMachinesGeneralizeSample.js | 14 +- .../javascript/virtualMachinesGetSample.js | 74 + .../virtualMachinesInstallPatchesSample.js | 26 +- .../virtualMachinesInstanceViewSample.js | 40 + .../virtualMachinesListAllSample.js | 27 +- ...virtualMachinesListAvailableSizesSample.js | 17 +- .../virtualMachinesListByLocationSample.js | 13 +- .../javascript/virtualMachinesListSample.js | 29 +- ...irtualMachinesMigrateToVMScaleSetSample.js | 26 + ...virtualMachinesPerformMaintenanceSample.js | 38 + .../virtualMachinesPowerOffSample.js | 40 + .../virtualMachinesReapplySample.js | 24 + .../virtualMachinesRedeploySample.js | 38 + .../virtualMachinesReimageSample.js | 60 +- .../virtualMachinesRestartSample.js | 38 + ...chinesRetrieveBootDiagnosticsDataSample.js | 21 +- .../virtualMachinesRunCommandSample.js | 27 + .../virtualMachinesSimulateEvictionSample.js | 24 + .../javascript/virtualMachinesStartSample.js | 38 + .../javascript/virtualMachinesUpdateSample.js | 149 +- .../samples/{v23 => v24}/typescript/README.md | 1214 +- .../{v23 => v24}/typescript/package.json | 8 +- .../{v23 => v24}/typescript/sample.env | 0 ...MigrationToVirtualMachineScaleSetSample.ts | 27 + ...tsConvertToVirtualMachineScaleSetSample.ts | 26 + .../availabilitySetsCreateOrUpdateSample.ts | 48 + .../src/availabilitySetsDeleteSample.ts | 38 + .../src/availabilitySetsGetSample.ts | 40 + ...vailabilitySetsListAvailableSizesSample.ts | 36 +- ...vailabilitySetsListBySubscriptionSample.ts | 31 + .../src/availabilitySetsListSample.ts | 48 + ...MigrationToVirtualMachineScaleSetSample.ts | 32 + .../src/availabilitySetsUpdateSample.ts | 53 + ...MigrationToVirtualMachineScaleSetSample.ts | 32 + ...tyReservationGroupsCreateOrUpdateSample.ts | 93 + .../capacityReservationGroupsDeleteSample.ts | 37 +- .../src/capacityReservationGroupsGetSample.ts | 67 + ...ervationGroupsListByResourceGroupSample.ts | 31 + ...servationGroupsListBySubscriptionSample.ts | 47 +- .../capacityReservationGroupsUpdateSample.ts | 48 + ...apacityReservationsCreateOrUpdateSample.ts | 86 + .../src/capacityReservationsDeleteSample.ts | 43 +- .../src/capacityReservationsGetSample.ts | 70 + ...onsListByCapacityReservationGroupSample.ts | 55 +- .../src/capacityReservationsUpdateSample.ts | 53 + .../src/communityGalleriesGetSample.ts | 25 + .../communityGalleryImageVersionsGetSample.ts | 30 + ...communityGalleryImageVersionsListSample.ts | 20 +- .../src/communityGalleryImagesGetSample.ts | 19 +- .../src/communityGalleryImagesListSample.ts | 18 +- ...dedicatedHostGroupsCreateOrUpdateSample.ts | 61 + .../src/dedicatedHostGroupsDeleteSample.ts | 38 + .../src/dedicatedHostGroupsGetSample.ts | 40 + ...atedHostGroupsListByResourceGroupSample.ts | 33 +- ...catedHostGroupsListBySubscriptionSample.ts | 21 +- .../src/dedicatedHostGroupsUpdateSample.ts | 45 + .../src/dedicatedHostsCreateOrUpdateSample.ts | 35 + .../src/dedicatedHostsDeleteSample.ts | 38 + .../typescript/src/dedicatedHostsGetSample.ts | 30 + .../dedicatedHostsListAvailableSizesSample.ts | 21 +- .../dedicatedHostsListByHostGroupSample.ts | 36 +- .../src/dedicatedHostsRedeploySample.ts | 21 +- .../src/dedicatedHostsRestartSample.ts | 21 +- .../src/dedicatedHostsUpdateSample.ts | 75 + .../src/diskAccessesCreateOrUpdateSample.ts | 27 + ...sDeleteAPrivateEndpointConnectionSample.ts | 28 + .../src/diskAccessesDeleteSample.ts | 24 + ...ssesGetAPrivateEndpointConnectionSample.ts | 20 +- ...skAccessesGetPrivateLinkResourcesSample.ts | 17 +- .../typescript/src/diskAccessesGetSample.ts | 40 + .../diskAccessesListByResourceGroupSample.ts | 17 +- ...sesListPrivateEndpointConnectionsSample.ts | 18 +- .../typescript/src/diskAccessesListSample.ts | 11 +- ...sUpdateAPrivateEndpointConnectionSample.ts | 35 + .../src/diskAccessesUpdateSample.ts | 27 + .../diskEncryptionSetsCreateOrUpdateSample.ts | 94 + .../src/diskEncryptionSetsDeleteSample.ts | 24 + .../src/diskEncryptionSetsGetSample.ts | 40 + ...yptionSetsListAssociatedResourcesSample.ts | 18 +- ...EncryptionSetsListByResourceGroupSample.ts | 17 +- .../src/diskEncryptionSetsListSample.ts | 11 +- .../src/diskEncryptionSetsUpdateSample.ts | 78 + .../src/diskRestorePointGetSample.ts | 50 + .../src/diskRestorePointGrantAccessSample.ts | 31 + ...iskRestorePointListByRestorePointSample.ts | 33 + .../src/diskRestorePointRevokeAccessSample.ts | 29 + .../src/disksCreateOrUpdateSample.ts | 610 + .../v24/typescript/src/disksDeleteSample.ts | 24 + .../v24/typescript/src/disksGetSample.ts | 25 + .../typescript/src/disksGrantAccessSample.ts | 67 + .../src/disksListByResourceGroupSample.ts | 17 +- .../typescript/src/disksListSample.ts | 11 +- .../typescript/src/disksRevokeAccessSample.ts | 24 + .../v24/typescript/src/disksUpdateSample.ts | 182 + .../src/galleriesCreateOrUpdateSample.ts | 118 + .../typescript/src/galleriesDeleteSample.ts | 24 + .../v24/typescript/src/galleriesGetSample.ts | 89 + .../src/galleriesListByResourceGroupSample.ts | 17 +- .../typescript/src/galleriesListSample.ts | 11 +- .../typescript/src/galleriesUpdateSample.ts | 27 + ...ApplicationVersionsCreateOrUpdateSample.ts | 72 + .../galleryApplicationVersionsDeleteSample.ts | 29 + .../galleryApplicationVersionsGetSample.ts | 51 + ...nVersionsListByGalleryApplicationSample.ts | 21 +- .../galleryApplicationVersionsUpdateSample.ts | 55 + ...galleryApplicationsCreateOrUpdateSample.ts | 53 + .../src/galleryApplicationsDeleteSample.ts | 28 + .../src/galleryApplicationsGetSample.ts | 29 + .../galleryApplicationsListByGallerySample.ts | 18 +- .../src/galleryApplicationsUpdateSample.ts | 52 + ...alleryImageVersionsCreateOrUpdateSample.ts | 830 + .../src/galleryImageVersionsDeleteSample.ts | 29 + .../src/galleryImageVersionsGetSample.ts | 133 + ...ryImageVersionsListByGalleryImageSample.ts | 21 +- .../src/galleryImageVersionsUpdateSample.ts | 93 + .../src/galleryImagesCreateOrUpdateSample.ts | 36 + .../src/galleryImagesDeleteSample.ts | 24 + .../typescript/src/galleryImagesGetSample.ts | 29 + .../src/galleryImagesListByGallerySample.ts | 29 + .../src/galleryImagesUpdateSample.ts | 62 + ...trolProfileVersionsCreateOrUpdateSample.ts | 53 + ...ccessControlProfileVersionsDeleteSample.ts | 29 + ...VMAccessControlProfileVersionsGetSample.ts | 30 + ...yGalleryInVMAccessControlProfileSample.ts} | 25 +- ...ccessControlProfileVersionsUpdateSample.ts | 36 + ...cessControlProfilesCreateOrUpdateSample.ts | 30 + ...ryInVMAccessControlProfilesDeleteSample.ts | 28 + ...lleryInVMAccessControlProfilesGetSample.ts | 29 + ...ccessControlProfilesListByGallerySample.ts | 18 +- ...ryInVMAccessControlProfilesUpdateSample.ts | 30 + ...lleryScriptVersionsCreateOrUpdateSample.ts | 96 + .../src/galleryScriptVersionsDeleteSample.ts | 29 + .../src/galleryScriptVersionsGetSample.ts | 50 + ...ScriptVersionsListByGalleryScriptSample.ts | 21 +- .../src/galleryScriptVersionsUpdateSample.ts} | 88 +- .../src/galleryScriptsCreateOrUpdateSample.ts | 39 + .../src/galleryScriptsDeleteSample.ts | 24 + .../typescript/src/galleryScriptsGetSample.ts | 29 + .../src/galleryScriptsListByGallerySample.ts | 18 +- .../src/galleryScriptsUpdateSample.ts | 36 + .../src/gallerySharingProfileUpdateSample.ts | 68 + .../src/imagesCreateOrUpdateSample.ts | 360 +- .../v24/typescript/src/imagesDeleteSample.ts | 38 + .../typescript/src/imagesGetSample.ts | 15 +- .../src/imagesListByResourceGroupSample.ts | 17 +- .../typescript/src/imagesListSample.ts | 11 +- .../typescript/src/imagesUpdateSample.ts | 29 +- ...lyticsExportRequestRateByIntervalSample.ts | 34 +- ...gAnalyticsExportThrottledRequestsSample.ts | 33 +- .../typescript/src/operationsListSample.ts | 46 + ...mityPlacementGroupsCreateOrUpdateSample.ts | 34 + .../proximityPlacementGroupsDeleteSample.ts | 24 + .../src/proximityPlacementGroupsGetSample.ts | 28 + ...lacementGroupsListByResourceGroupSample.ts | 17 +- ...PlacementGroupsListBySubscriptionSample.ts | 11 +- .../proximityPlacementGroupsUpdateSample.ts | 29 + .../typescript/src/resourceSkusListSample.ts | 67 + ...orePointCollectionsCreateOrUpdateSample.ts | 69 +- .../restorePointCollectionsDeleteSample.ts | 38 + .../src/restorePointCollectionsGetSample.ts | 40 + .../restorePointCollectionsListAllSample.ts | 11 +- .../src/restorePointCollectionsListSample.ts | 17 +- .../restorePointCollectionsUpdateSample.ts | 46 + .../src/restorePointsCreateSample.ts | 51 + .../src/restorePointsDeleteSample.ts | 38 + .../typescript/src/restorePointsGetSample.ts | 40 + .../src/sharedGalleriesGetSample.ts | 25 + .../src/sharedGalleriesListSample.ts | 14 +- .../sharedGalleryImageVersionsGetSample.ts | 30 + .../sharedGalleryImageVersionsListSample.ts | 20 +- .../src/sharedGalleryImagesGetSample.ts | 19 +- .../src/sharedGalleryImagesListSample.ts | 18 +- .../src/snapshotsCreateOrUpdateSample.ts | 166 + .../typescript/src/snapshotsDeleteSample.ts | 24 + .../v24/typescript/src/snapshotsGetSample.ts | 40 + .../src/snapshotsGrantAccessSample.ts | 29 + .../src/snapshotsListByResourceGroupSample.ts | 17 +- .../typescript/src/snapshotsListSample.ts | 11 +- .../src/snapshotsRevokeAccessSample.ts | 24 + .../typescript/src/snapshotsUpdateSample.ts | 47 + ...DeletedResourceListByArtifactNameSample.ts | 24 +- .../src/sshPublicKeysCreateSample.ts | 28 + .../src/sshPublicKeysDeleteSample.ts | 38 + .../src/sshPublicKeysGenerateKeyPairSample.ts | 66 + .../typescript/src/sshPublicKeysGetSample.ts | 25 + .../sshPublicKeysListByResourceGroupSample.ts | 33 +- .../sshPublicKeysListBySubscriptionSample.ts | 21 +- .../src/sshPublicKeysUpdateSample.ts | 43 + .../typescript/src/usageListSample.ts | 27 +- .../virtualMachineExtensionImagesGetSample.ts | 50 + ...alMachineExtensionImagesListTypesSample.ts | 43 + ...achineExtensionImagesListVersionsSample.ts | 49 + ...alMachineExtensionsCreateOrUpdateSample.ts | 85 + .../virtualMachineExtensionsDeleteSample.ts | 42 + .../src/virtualMachineExtensionsGetSample.ts | 45 + .../src/virtualMachineExtensionsListSample.ts | 45 + .../virtualMachineExtensionsUpdateSample.ts | 44 + .../virtualMachineImagesEdgeZoneGetSample.ts | 54 + ...alMachineImagesEdgeZoneListOffersSample.ts | 37 +- ...chineImagesEdgeZoneListPublishersSample.ts | 31 +- .../virtualMachineImagesEdgeZoneListSample.ts | 53 + ...tualMachineImagesEdgeZoneListSkusSample.ts | 50 + .../src/virtualMachineImagesGetSample.ts | 52 + ...irtualMachineImagesListByEdgeZoneSample.ts | 35 +- .../virtualMachineImagesListOffersSample.ts | 43 + ...irtualMachineImagesListPublishersSample.ts | 25 +- .../src/virtualMachineImagesListSample.ts | 51 + .../src/virtualMachineImagesListSkusSample.ts | 44 + ...alMachineImagesListWithPropertiesSample.ts | 53 + ...lMachineRunCommandsCreateOrUpdateSample.ts | 48 + .../virtualMachineRunCommandsDeleteSample.ts | 24 + ...ineRunCommandsGetByVirtualMachineSample.ts | 29 + .../src/virtualMachineRunCommandsGetSample.ts | 25 + ...neRunCommandsListByVirtualMachineSample.ts | 18 +- .../virtualMachineRunCommandsListSample.ts | 13 +- .../virtualMachineRunCommandsUpdateSample.ts | 44 + ...eScaleSetExtensionsCreateOrUpdateSample.ts | 62 + ...alMachineScaleSetExtensionsDeleteSample.ts | 46 + ...rtualMachineScaleSetExtensionsGetSample.ts | 49 + ...tualMachineScaleSetExtensionsListSample.ts | 54 + ...alMachineScaleSetExtensionsUpdateSample.ts | 61 + ...ineScaleSetLifeCycleHookEventsGetSample.ts | 29 + ...neScaleSetLifeCycleHookEventsListSample.ts | 32 + ...ScaleSetLifeCycleHookEventsUpdateSample.ts | 40 + ...hineScaleSetRollingUpgradesCancelSample.ts | 38 + ...eScaleSetRollingUpgradesGetLatestSample.ts | 46 + ...lingUpgradesStartExtensionUpgradeSample.ts | 23 +- ...eSetRollingUpgradesStartOSUpgradeSample.ts | 42 +- ...caleSetVMExtensionsCreateOrUpdateSample.ts | 37 + ...MachineScaleSetVMExtensionsDeleteSample.ts | 29 + ...ualMachineScaleSetVMExtensionsGetSample.ts | 30 + ...alMachineScaleSetVMExtensionsListSample.ts | 20 +- ...MachineScaleSetVMExtensionsUpdateSample.ts | 37 + ...aleSetVMRunCommandsCreateOrUpdateSample.ts | 51 + ...achineScaleSetVMRunCommandsDeleteSample.ts | 29 + ...alMachineScaleSetVMRunCommandsGetSample.ts | 30 + ...lMachineScaleSetVMRunCommandsListSample.ts | 21 +- ...achineScaleSetVMRunCommandsUpdateSample.ts | 36 + ...eScaleSetVMsApproveRollingUpgradeSample.ts | 28 + ...eScaleSetVMsAttachDetachDataDisksSample.ts | 98 + ...tualMachineScaleSetVMsDeallocateSample.ts} | 45 +- .../virtualMachineScaleSetVMsDeleteSample.ts | 26 + ...achineScaleSetVMsGetInstanceViewSample.ts} | 20 +- .../src/virtualMachineScaleSetVMsGetSample.ts | 74 + .../virtualMachineScaleSetVMsListSample.ts | 90 + ...hineScaleSetVMsPerformMaintenanceSample.ts | 42 + ...virtualMachineScaleSetVMsPowerOffSample.ts | 44 + ...virtualMachineScaleSetVMsRedeploySample.ts | 46 + ...rtualMachineScaleSetVMsReimageAllSample.ts | 46 + .../virtualMachineScaleSetVMsReimageSample.ts | 43 + .../virtualMachineScaleSetVMsRestartSample.ts | 38 + ...SetVMsRetrieveBootDiagnosticsDataSample.ts | 30 + ...rtualMachineScaleSetVMsRunCommandSample.ts | 30 + ...achineScaleSetVMsSimulateEvictionSample.ts | 28 + .../virtualMachineScaleSetVMsStartSample.ts | 42 + .../virtualMachineScaleSetVMsUpdateSample.ts | 303 + ...ineScaleSetsApproveRollingUpgradeSample.ts | 28 + ...SetsConvertToSinglePlacementGroupSample.ts | 46 + ...ualMachineScaleSetsCreateOrUpdateSample.ts | 3913 +++ ...virtualMachineScaleSetsDeallocateSample.ts | 41 + ...alMachineScaleSetsDeleteInstancesSample.ts | 45 + .../virtualMachineScaleSetsDeleteSample.ts | 26 + ...iceFabricPlatformUpdateDomainWalkSample.ts | 39 +- ...alMachineScaleSetsGetInstanceViewSample.ts | 46 + ...chineScaleSetsGetOSUpgradeHistorySample.ts | 54 + .../src/virtualMachineScaleSetsGetSample.ts | 84 + .../virtualMachineScaleSetsListAllSample.ts | 21 +- ...ualMachineScaleSetsListByLocationSample.ts | 16 +- .../src/virtualMachineScaleSetsListSample.ts | 48 + .../virtualMachineScaleSetsListSkusSample.ts | 36 +- ...achineScaleSetsPerformMaintenanceSample.ts | 55 +- .../virtualMachineScaleSetsPowerOffSample.ts | 41 + .../virtualMachineScaleSetsReapplySample.ts | 44 + .../virtualMachineScaleSetsRedeploySample.ts | 40 + ...virtualMachineScaleSetsReimageAllSample.ts | 40 + .../virtualMachineScaleSetsReimageSample.ts | 44 + .../virtualMachineScaleSetsRestartSample.ts | 40 + .../virtualMachineScaleSetsScaleOutSample.ts | 27 + ...eSetsSetOrchestrationServiceStateSample.ts | 46 + .../src/virtualMachineScaleSetsStartSample.ts | 40 + ...alMachineScaleSetsUpdateInstancesSample.ts | 44 + .../virtualMachineScaleSetsUpdateSample.ts | 362 +- .../src/virtualMachineSizesListSample.ts | 27 +- .../src/virtualMachinesAssessPatchesSample.ts | 25 + ...tualMachinesAttachDetachDataDisksSample.ts | 94 + .../src/virtualMachinesCaptureSample.ts | 48 + ...tualMachinesConvertToManagedDisksSample.ts | 38 + .../virtualMachinesCreateOrUpdateSample.ts | 4013 ++- .../src/virtualMachinesDeallocateSample.ts | 54 + .../src/virtualMachinesDeleteSample.ts | 24 + .../src/virtualMachinesGeneralizeSample.ts | 19 +- .../src/virtualMachinesGetSample.ts | 74 + .../virtualMachinesInstallPatchesSample.ts | 34 + .../src/virtualMachinesInstanceViewSample.ts | 40 + .../src/virtualMachinesListAllSample.ts | 35 +- ...virtualMachinesListAvailableSizesSample.ts | 18 +- .../virtualMachinesListByLocationSample.ts | 14 +- .../src/virtualMachinesListSample.ts | 50 + ...irtualMachinesMigrateToVMScaleSetSample.ts | 26 + ...virtualMachinesPerformMaintenanceSample.ts | 38 + .../src/virtualMachinesPowerOffSample.ts | 40 + .../src/virtualMachinesReapplySample.ts | 24 + .../src/virtualMachinesRedeploySample.ts | 38 + .../src/virtualMachinesReimageSample.ts | 71 +- .../src/virtualMachinesRestartSample.ts | 38 + ...chinesRetrieveBootDiagnosticsDataSample.ts | 29 + .../src/virtualMachinesRunCommandSample.ts | 27 + .../virtualMachinesSimulateEvictionSample.ts | 24 + .../src/virtualMachinesStartSample.ts | 38 + .../src/virtualMachinesUpdateSample.ts | 159 +- .../{v23 => v24}/typescript/tsconfig.json | 13 +- .../src/api/availabilitySets/index.ts | 29 + .../src/api/availabilitySets/operations.ts | 655 + .../src/api/availabilitySets/options.ts | 46 + .../api/capacityReservationGroups/index.ts | 19 + .../capacityReservationGroups/operations.ts | 353 + .../api/capacityReservationGroups/options.ts | 38 + .../src/api/capacityReservations/index.ts | 17 + .../api/capacityReservations/operations.ts | 354 + .../src/api/capacityReservations/options.ts | 38 + .../src/api/communityGalleries/index.ts | 5 + .../src/api/communityGalleries/operations.ts | 58 + .../src/api/communityGalleries/options.ts | 7 + .../communityGalleryImageVersions/index.ts | 8 + .../operations.ts | 141 + .../communityGalleryImageVersions/options.ts | 10 + .../src/api/communityGalleryImages/index.ts | 8 + .../api/communityGalleryImages/operations.ts | 128 + .../src/api/communityGalleryImages/options.ts | 10 + .../src/api/computeManagementContext.ts | 50 + .../src/api/dedicatedHostGroups/index.ts | 19 + .../src/api/dedicatedHostGroups/operations.ts | 337 + .../src/api/dedicatedHostGroups/options.ts | 26 + .../src/api/dedicatedHosts/index.ts | 23 + .../src/api/dedicatedHosts/operations.ts | 483 + .../src/api/dedicatedHosts/options.ts | 47 + .../arm-compute/src/api/diskAccesses/index.ts | 29 + .../src/api/diskAccesses/operations.ts | 663 + .../src/api/diskAccesses/options.ts | 52 + .../src/api/diskEncryptionSets/index.ts | 21 + .../src/api/diskEncryptionSets/operations.ts | 413 + .../src/api/diskEncryptionSets/options.ts | 34 + .../src/api/diskRestorePoint/index.ts | 10 + .../src/api/diskRestorePoint/operations.ts | 288 + .../src/api/diskRestorePoint/options.ts | 22 + .../arm-compute/src/api/disks/index.ts | 23 + .../arm-compute/src/api/disks/operations.ts | 454 + .../arm-compute/src/api/disks/options.ts | 43 + .../arm-compute/src/api/galleries/index.ts | 12 + .../src/api/galleries/operations.ts | 341 + .../arm-compute/src/api/galleries/options.ts | 37 + .../api/galleryApplicationVersions/index.ts | 11 + .../galleryApplicationVersions/operations.ts | 375 + .../api/galleryApplicationVersions/options.ts | 32 + .../src/api/galleryApplications/index.ts | 11 + .../src/api/galleryApplications/operations.ts | 336 + .../src/api/galleryApplications/options.ts | 28 + .../src/api/galleryImageVersions/index.ts | 11 + .../api/galleryImageVersions/operations.ts | 363 + .../src/api/galleryImageVersions/options.ts | 32 + .../src/api/galleryImages/index.ts | 11 + .../src/api/galleryImages/operations.ts | 321 + .../src/api/galleryImages/options.ts | 28 + .../index.ts | 17 + .../operations.ts | 392 + .../options.ts | 28 + .../galleryInVMAccessControlProfiles/index.ts | 11 + .../operations.ts | 344 + .../options.ts | 28 + .../src/api/galleryScriptVersions/index.ts | 11 + .../api/galleryScriptVersions/operations.ts | 364 + .../src/api/galleryScriptVersions/options.ts | 28 + .../src/api/galleryScripts/index.ts | 11 + .../src/api/galleryScripts/operations.ts | 334 + .../src/api/galleryScripts/options.ts | 28 + .../src/api/gallerySharingProfile/index.ts | 5 + .../api/gallerySharingProfile/operations.ts | 73 + .../src/api/gallerySharingProfile/options.ts | 10 + .../arm-compute/src/api/images/index.ts | 12 + .../arm-compute/src/api/images/operations.ts | 340 + .../arm-compute/src/api/images/options.ts | 34 + sdk/compute/arm-compute/src/api/index.ts | 8 + .../arm-compute/src/api/logAnalytics/index.ts | 8 + .../src/api/logAnalytics/operations.ts | 140 + .../src/api/logAnalytics/options.ts | 16 + .../arm-compute/src/api/operations/index.ts | 5 + .../src/api/operations/operations.ts | 60 + .../arm-compute/src/api/operations/options.ts | 7 + .../src/api/proximityPlacementGroups/index.ts | 19 + .../proximityPlacementGroups/operations.ts | 350 + .../api/proximityPlacementGroups/options.ts | 25 + .../arm-compute/src/api/resourceSkus/index.ts | 5 + .../src/api/resourceSkus/operations.ts | 63 + .../src/api/resourceSkus/options.ts | 12 + .../src/api/restorePointCollections/index.ts | 12 + .../api/restorePointCollections/operations.ts | 353 + .../api/restorePointCollections/options.ts | 29 + .../src/api/restorePoints/index.ts | 9 + .../src/api/restorePoints/operations.ts | 205 + .../src/api/restorePoints/options.ts | 23 + .../src/api/sharedGalleries/index.ts | 8 + .../src/api/sharedGalleries/operations.ts | 116 + .../src/api/sharedGalleries/options.ts | 14 + .../api/sharedGalleryImageVersions/index.ts | 8 + .../sharedGalleryImageVersions/operations.ts | 142 + .../api/sharedGalleryImageVersions/options.ts | 14 + .../src/api/sharedGalleryImages/index.ts | 8 + .../src/api/sharedGalleryImages/operations.ts | 127 + .../src/api/sharedGalleryImages/options.ts | 14 + .../arm-compute/src/api/snapshots/index.ts | 23 + .../src/api/snapshots/operations.ts | 455 + .../arm-compute/src/api/snapshots/options.ts | 43 + .../src/api/softDeletedResource/index.ts | 5 + .../src/api/softDeletedResource/operations.ts | 84 + .../src/api/softDeletedResource/options.ts | 7 + .../src/api/sshPublicKeys/index.ts | 21 + .../src/api/sshPublicKeys/operations.ts | 401 + .../src/api/sshPublicKeys/options.ts | 29 + .../arm-compute/src/api/usage/index.ts | 5 + .../arm-compute/src/api/usage/operations.ts | 62 + .../arm-compute/src/api/usage/options.ts | 7 + .../virtualMachineExtensionImages/index.ts | 9 + .../operations.ts | 177 + .../virtualMachineExtensionImages/options.ts | 18 + .../src/api/virtualMachineExtensions/index.ts | 11 + .../virtualMachineExtensions/operations.ts | 327 + .../api/virtualMachineExtensions/options.ts | 34 + .../src/api/virtualMachineImages/index.ts | 21 + .../api/virtualMachineImages/operations.ts | 405 + .../src/api/virtualMachineImages/options.ts | 33 + .../api/virtualMachineImagesEdgeZone/index.ts | 11 + .../operations.ts | 308 + .../virtualMachineImagesEdgeZone/options.ts | 26 + .../api/virtualMachineRunCommands/index.ts | 21 + .../virtualMachineRunCommands/operations.ts | 431 + .../api/virtualMachineRunCommands/options.ts | 40 + .../virtualMachineScaleSetExtensions/index.ts | 11 + .../operations.ts | 345 + .../options.ts | 31 + .../index.ts | 9 + .../operations.ts | 200 + .../options.ts | 13 + .../index.ts | 10 + .../operations.ts | 226 + .../options.ts | 25 + .../index.ts | 11 + .../operations.ts | 370 + .../options.ts | 34 + .../index.ts | 11 + .../operations.ts | 358 + .../options.ts | 34 + .../api/virtualMachineScaleSetVMs/index.ts | 43 + .../virtualMachineScaleSetVMs/operations.ts | 1081 + .../api/virtualMachineScaleSetVMs/options.ts | 124 + .../src/api/virtualMachineScaleSets/index.ts | 59 + .../api/virtualMachineScaleSets/operations.ts | 1531 ++ .../api/virtualMachineScaleSets/options.ts | 180 + .../src/api/virtualMachineSizes/index.ts | 5 + .../src/api/virtualMachineSizes/operations.ts | 67 + .../src/api/virtualMachineSizes/options.ts | 7 + .../src/api/virtualMachines/index.ts | 61 + .../src/api/virtualMachines/operations.ts | 1519 ++ .../src/api/virtualMachines/options.ts | 184 + .../src/classic/availabilitySets/index.ts | 240 + .../capacityReservationGroups/index.ts | 111 + .../src/classic/capacityReservations/index.ts | 295 + .../src/classic/communityGalleries/index.ts | 35 + .../communityGalleryImageVersions/index.ts | 57 + .../classic/communityGalleryImages/index.ts | 52 + .../src/classic/dedicatedHostGroups/index.ts | 107 + .../src/classic/dedicatedHosts/index.ts | 346 + .../src/classic/diskAccesses/index.ts | 401 + .../src/classic/diskEncryptionSets/index.ts | 242 + .../src/classic/diskRestorePoint/index.ts | 240 + .../arm-compute/src/classic/disks/index.ts | 284 + .../src/classic/galleries/index.ts | 194 + .../galleryApplicationVersions/index.ts | 332 + .../src/classic/galleryApplications/index.ts | 275 + .../src/classic/galleryImageVersions/index.ts | 321 + .../src/classic/galleryImages/index.ts | 252 + .../index.ts | 344 + .../galleryInVMAccessControlProfiles/index.ts | 285 + .../classic/galleryScriptVersions/index.ts | 321 + .../src/classic/galleryScripts/index.ts | 252 + .../classic/gallerySharingProfile/index.ts | 72 + .../arm-compute/src/classic/images/index.ts | 191 + sdk/compute/arm-compute/src/classic/index.ts | 53 + .../src/classic/logAnalytics/index.ts | 119 + .../src/classic/operations/index.ts | 26 + .../classic/proximityPlacementGroups/index.ts | 111 + .../src/classic/resourceSkus/index.ts | 28 + .../classic/restorePointCollections/index.ts | 139 + .../src/classic/restorePoints/index.ts | 179 + .../src/classic/sharedGalleries/index.ts | 46 + .../sharedGalleryImageVersions/index.ts | 57 + .../src/classic/sharedGalleryImages/index.ts | 52 + .../src/classic/snapshots/index.ts | 293 + .../src/classic/softDeletedResource/index.ts | 48 + .../src/classic/sshPublicKeys/index.ts | 124 + .../arm-compute/src/classic/usage/index.ts | 26 + .../virtualMachineExtensionImages/index.ts | 71 + .../classic/virtualMachineExtensions/index.ts | 255 + .../src/classic/virtualMachineImages/index.ts | 136 + .../virtualMachineImagesEdgeZone/index.ts | 114 + .../virtualMachineRunCommands/index.ts | 268 + .../virtualMachineScaleSetExtensions/index.ts | 279 + .../index.ts | 83 + .../index.ts | 165 + .../index.ts | 321 + .../index.ts | 309 + .../virtualMachineScaleSetVMs/index.ts | 822 + .../classic/virtualMachineScaleSets/index.ts | 945 + .../src/classic/virtualMachineSizes/index.ts | 32 + .../src/classic/virtualMachines/index.ts | 948 + .../src/computeManagementClient.ts | 593 +- sdk/compute/arm-compute/src/index.ts | 1247 +- sdk/compute/arm-compute/src/logger.ts | 5 + sdk/compute/arm-compute/src/lroImpl.ts | 34 - .../arm-compute/src/models/common/index.ts | 26 + .../arm-compute/src/models/common/models.ts | 290 + .../arm-compute/src/models/compute/index.ts | 487 + .../arm-compute/src/models/compute/models.ts | 15773 +++++++++++ .../src/models/computeDisk/index.ts | 90 + .../src/models/computeDisk/models.ts | 2932 ++ .../src/models/computeGallery/index.ts | 181 + .../src/models/computeGallery/models.ts | 5534 ++++ .../src/models/computeSku/index.ts | 18 + .../src/models/computeSku/models.ts | 314 + sdk/compute/arm-compute/src/models/index.ts | 15271 +---------- sdk/compute/arm-compute/src/models/mappers.ts | 22714 ---------------- sdk/compute/arm-compute/src/models/models.ts | 300 + .../arm-compute/src/models/parameters.ts | 1584 -- .../src/operations/availabilitySets.ts | 853 - .../operations/capacityReservationGroups.ts | 457 - .../src/operations/capacityReservations.ts | 659 - .../cloudServiceOperatingSystems.ts | 378 - .../operations/cloudServiceRoleInstances.ts | 761 - .../src/operations/cloudServiceRoles.ts | 227 - .../src/operations/cloudServices.ts | 1304 - .../operations/cloudServicesUpdateDomain.ts | 355 - .../src/operations/communityGalleries.ts | 69 - .../communityGalleryImageVersions.ts | 258 - .../src/operations/communityGalleryImages.ts | 220 - .../src/operations/dedicatedHostGroups.ts | 452 - .../src/operations/dedicatedHosts.ts | 1037 - .../src/operations/diskAccesses.ts | 1209 - .../src/operations/diskEncryptionSets.ts | 875 - .../operations/diskRestorePointOperations.ts | 558 - .../arm-compute/src/operations/disks.ts | 896 - .../arm-compute/src/operations/galleries.ts | 659 - .../operations/galleryApplicationVersions.ts | 701 - .../src/operations/galleryApplications.ts | 627 - .../src/operations/galleryImageVersions.ts | 692 - .../src/operations/galleryImages.ts | 624 - ...galleryInVMAccessControlProfileVersions.ts | 735 - .../galleryInVMAccessControlProfiles.ts | 660 - .../src/operations/galleryScriptVersions.ts | 705 - .../src/operations/galleryScripts.ts | 636 - .../src/operations/gallerySharingProfile.ts | 156 - .../arm-compute/src/operations/images.ts | 659 - .../arm-compute/src/operations/index.ts | 60 - .../src/operations/logAnalytics.ts | 264 - .../arm-compute/src/operations/operations.ts | 140 - .../operations/proximityPlacementGroups.ts | 446 - .../src/operations/resourceSkus.ts | 140 - .../src/operations/restorePointCollections.ts | 514 - .../src/operations/restorePoints.ts | 339 - .../src/operations/sharedGalleries.ts | 197 - .../operations/sharedGalleryImageVersions.ts | 262 - .../src/operations/sharedGalleryImages.ts | 221 - .../arm-compute/src/operations/snapshots.ts | 908 - .../src/operations/softDeletedResource.ts | 241 - .../src/operations/sshPublicKeys.ts | 495 - .../src/operations/usageOperations.ts | 156 - .../virtualMachineExtensionImages.ts | 178 - .../operations/virtualMachineExtensions.ts | 506 - .../src/operations/virtualMachineImages.ts | 372 - .../virtualMachineImagesEdgeZone.ts | 301 - .../operations/virtualMachineRunCommands.ts | 774 - .../virtualMachineScaleSetExtensions.ts | 614 - .../virtualMachineScaleSetRollingUpgrades.ts | 384 - .../virtualMachineScaleSetVMExtensions.ts | 549 - .../virtualMachineScaleSetVMRunCommands.ts | 680 - .../operations/virtualMachineScaleSetVMs.ts | 1893 -- .../src/operations/virtualMachineScaleSets.ts | 2755 -- .../src/operations/virtualMachineSizes.ts | 159 - .../src/operations/virtualMachines.ts | 2784 -- .../operationsInterfaces/availabilitySets.ts | 179 - .../capacityReservationGroups.ts | 97 - .../capacityReservations.ts | 156 - .../cloudServiceOperatingSystems.ts | 68 - .../cloudServiceRoleInstances.ts | 190 - .../operationsInterfaces/cloudServiceRoles.ts | 43 - .../src/operationsInterfaces/cloudServices.ts | 287 - .../cloudServicesUpdateDomain.ts | 77 - .../communityGalleries.ts | 25 - .../communityGalleryImageVersions.ts | 48 - .../communityGalleryImages.ts | 42 - .../dedicatedHostGroups.ts | 92 - .../operationsInterfaces/dedicatedHosts.ts | 230 - .../src/operationsInterfaces/diskAccesses.ts | 269 - .../diskEncryptionSets.ts | 169 - .../diskRestorePointOperations.ts | 126 - .../src/operationsInterfaces/disks.ts | 201 - .../src/operationsInterfaces/galleries.ts | 130 - .../galleryApplicationVersions.ts | 165 - .../galleryApplications.ts | 145 - .../galleryImageVersions.ts | 163 - .../src/operationsInterfaces/galleryImages.ts | 142 - ...galleryInVMAccessControlProfileVersions.ts | 186 - .../galleryInVMAccessControlProfiles.ts | 162 - .../galleryScriptVersions.ts | 169 - .../operationsInterfaces/galleryScripts.ts | 147 - .../gallerySharingProfile.ts | 47 - .../src/operationsInterfaces/images.ts | 129 - .../src/operationsInterfaces/index.ts | 60 - .../src/operationsInterfaces/logAnalytics.ts | 75 - .../src/operationsInterfaces/operations.ts | 18 - .../proximityPlacementGroups.ts | 89 - .../src/operationsInterfaces/resourceSkus.ts | 18 - .../restorePointCollections.ts | 107 - .../src/operationsInterfaces/restorePoints.ts | 92 - .../operationsInterfaces/sharedGalleries.ts | 38 - .../sharedGalleryImageVersions.ts | 50 - .../sharedGalleryImages.ts | 43 - .../src/operationsInterfaces/snapshots.ts | 206 - .../softDeletedResource.ts | 33 - .../src/operationsInterfaces/sshPublicKeys.ts | 106 - .../operationsInterfaces/usageOperations.ts | 20 - .../virtualMachineExtensionImages.ts | 57 - .../virtualMachineExtensions.ts | 144 - .../virtualMachineImages.ts | 119 - .../virtualMachineImagesEdgeZone.ts | 99 - .../virtualMachineRunCommands.ts | 171 - .../virtualMachineScaleSetExtensions.ts | 145 - .../virtualMachineScaleSetRollingUpgrades.ts | 103 - .../virtualMachineScaleSetVMExtensions.ts | 160 - .../virtualMachineScaleSetVMRunCommands.ts | 161 - .../virtualMachineScaleSetVMs.ts | 490 - .../virtualMachineScaleSets.ts | 589 - .../virtualMachineSizes.ts | 23 - .../operationsInterfaces/virtualMachines.ts | 634 - sdk/compute/arm-compute/src/pagingHelper.ts | 34 - .../arm-compute/src/restorePollerHelpers.ts | 798 + .../src/static-helpers/cloudSettingHelpers.ts | 42 + .../src/static-helpers/pagingHelpers.ts | 270 + .../src/static-helpers/pollingHelpers.ts | 150 + .../serialization/check-prop-undefined.ts | 17 + .../src/static-helpers/simplePollerHelpers.ts | 119 + .../src/static-helpers/urlTemplate.ts | 227 + sdk/compute/arm-compute/test/snippets.spec.ts | 2 +- sdk/compute/arm-compute/tsp-location.yaml | 4 + sdk/compute/arm-compute/warp.config.yml | 30 +- 1734 files changed, 118137 insertions(+), 149662 deletions(-) delete mode 100644 sdk/compute/arm-compute/_meta.json create mode 100644 sdk/compute/arm-compute/eslint.config.mjs create mode 100644 sdk/compute/arm-compute/metadata.json create mode 100644 sdk/compute/arm-compute/review/arm-compute-api-node.api.md create mode 100644 sdk/compute/arm-compute/review/arm-compute-models-common-node.api.md create mode 100644 sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md create mode 100644 sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md create mode 100644 sdk/compute/arm-compute/review/arm-compute-models-computeGallery-node.api.md create mode 100644 sdk/compute/arm-compute/review/arm-compute-models-computeSku-node.api.md create mode 100644 sdk/compute/arm-compute/review/arm-compute-models-node.api.md delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSFamilySample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSVersionSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSFamiliesSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSVersionsSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetInstanceViewSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRebuildSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesReimageSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRolesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServiceRolesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesDeleteInstancesSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesGetInstanceViewSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesListAllSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesPowerOffSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesRebuildSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesReimageSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesStartSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainGetUpdateDomainSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainListUpdateDomainsSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainWalkUpdateDomainSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/cloudServicesUpdateSample.ts rename sdk/compute/arm-compute/{samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts => samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts} (50%) create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsListSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSListSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPerformMaintenanceSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPowerOffSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRedeploySample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageAllSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRunCommandSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSSimulateEvictionSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSStartSample.ts delete mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts rename sdk/compute/arm-compute/{samples/v23/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts => samples-dev/virtualMachineScaleSetVMsDeallocateSample.ts} (50%) create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsDeleteSample.ts rename sdk/compute/arm-compute/{samples/v23/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts => samples-dev/virtualMachineScaleSetVMsGetInstanceViewSample.ts} (52%) create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsListSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPerformMaintenanceSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPowerOffSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRedeploySample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageAllSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRestartSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRunCommandSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsSimulateEvictionSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsStartSample.ts create mode 100644 sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetRemoteDesktopFileSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRebuildSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesReimageSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRestartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteInstancesSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetInstanceViewSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListAllSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesPowerOffSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRebuildSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesReimageSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRestartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesStartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/communityGalleriesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskAccessesCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGrantAccessSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointListByRestorePointSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointRevokeAccessSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/disksCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/disksDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/disksGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/disksGrantAccessSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/disksRevokeAccessSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/disksUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleriesCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleriesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleriesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleriesUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImagesCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImagesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImagesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImagesListByGallerySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryImagesUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsListByGallerySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/gallerySharingProfileUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/imagesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/operationsListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/resourceSkusListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/restorePointsCreateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/restorePointsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/restorePointsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/snapshotsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/snapshotsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/snapshotsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/snapshotsGrantAccessSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/snapshotsRevokeAccessSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/snapshotsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysCreateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGenerateKeyPairSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListTypesSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListVersionsSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSkusSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListOffersSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSkusSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListWithPropertiesSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSApproveRollingUpgradeSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSAttachDetachDataDisksSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPowerOffSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRedeploySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageAllSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRestartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRunCommandSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSStartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeallocateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteInstancesSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetInstanceViewSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPowerOffSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReapplySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRedeploySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageAllSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRestartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsScaleOutSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsStartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateInstancesSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAssessPatchesSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAttachDetachDataDisksSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCaptureSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesConvertToManagedDisksSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeallocateSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeleteSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstanceViewSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesMigrateToVMScaleSetSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPerformMaintenanceSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPowerOffSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReapplySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRedeploySample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRestartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRunCommandSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesSimulateEvictionSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesStartSample.js delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListBySubscriptionSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRebuildSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesReimageSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteInstancesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetInstanceViewSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListAllSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesPowerOffSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRebuildSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesReimageSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesStartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleriesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGrantAccessSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointListByRestorePointSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointRevokeAccessSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/disksCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/disksDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/disksGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/disksGrantAccessSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/disksRevokeAccessSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/disksUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleriesCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleriesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleriesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleriesUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesListByGallerySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/gallerySharingProfileUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/imagesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/operationsListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/resourceSkusListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsCreateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGrantAccessSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsRevokeAccessSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysCreateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGenerateKeyPairSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListTypesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListOffersSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSkusSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListWithPropertiesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSStartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeallocateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPowerOffSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReapplySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRedeploySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageAllSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsScaleOutSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsStartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAssessPatchesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCaptureSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesConvertToManagedDisksSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeallocateSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeleteSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstallPatchesSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstanceViewSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPerformMaintenanceSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPowerOffSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReapplySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRedeploySample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRestartSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRunCommandSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesSimulateEvictionSample.ts delete mode 100644 sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesStartSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/README.md (58%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/availabilitySetsListAvailableSizesSample.js (54%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/availabilitySetsListBySubscriptionSample.js (56%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsCreateOrUpdateSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/capacityReservationGroupsDeleteSample.js (56%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/capacityReservationGroupsListByResourceGroupSample.js (58%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/capacityReservationGroupsListBySubscriptionSample.js (59%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsCreateOrUpdateSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/capacityReservationsDeleteSample.js (56%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/capacityReservationsListByCapacityReservationGroupSample.js (55%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/communityGalleriesGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/communityGalleryImageVersionsListSample.js (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/communityGalleryImagesListSample.js (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/dedicatedHostGroupsListByResourceGroupSample.js (59%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/dedicatedHostGroupsListBySubscriptionSample.js (64%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/dedicatedHostsListAvailableSizesSample.js (60%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/dedicatedHostsListByHostGroupSample.js (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/dedicatedHostsRedeploySample.js (61%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/dedicatedHostsRestartSample.js (60%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskAccessesCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js (52%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskAccessesGetPrivateLinkResourcesSample.js (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskAccessesListByResourceGroupSample.js (57%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskAccessesListPrivateEndpointConnectionsSample.js (57%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskAccessesListSample.js (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskEncryptionSetsListAssociatedResourcesSample.js (55%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskEncryptionSetsListByResourceGroupSample.js (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/diskEncryptionSetsListSample.js (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGrantAccessSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointListByRestorePointSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointRevokeAccessSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/disksCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/disksDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/disksGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/disksGrantAccessSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/disksListByResourceGroupSample.js (51%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/disksListSample.js (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/disksRevokeAccessSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/disksUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleriesCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleriesDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleriesGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/galleriesListByResourceGroupSample.js (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/galleriesListSample.js (61%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleriesUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/galleryApplicationsListByGallerySample.js (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/galleryImageVersionsListByGalleryImageSample.js (52%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImagesCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImagesDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImagesGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImagesListByGallerySample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryImagesUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsGetSample.js rename sdk/compute/arm-compute/samples/{v23/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.js => v24/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.js} (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/galleryInVMAccessControlProfilesListByGallerySample.js (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/galleryScriptVersionsListByGalleryScriptSample.js (52%) rename sdk/compute/arm-compute/samples/{v23/javascript/galleryScriptVersionsCreateOrUpdateSample.js => v24/javascript/galleryScriptVersionsUpdateSample.js} (66%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsListByGallerySample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/gallerySharingProfileUpdateSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/imagesCreateOrUpdateSample.js (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/imagesDeleteSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/imagesGetSample.js (50%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/imagesListByResourceGroupSample.js (60%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/imagesListSample.js (69%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/imagesUpdateSample.js (54%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/logAnalyticsExportRequestRateByIntervalSample.js (63%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/logAnalyticsExportThrottledRequestsSample.js (64%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/operationsListSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/package.json (87%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/proximityPlacementGroupsListByResourceGroupSample.js (54%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/proximityPlacementGroupsListBySubscriptionSample.js (61%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/resourceSkusListSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/restorePointCollectionsCreateOrUpdateSample.js (60%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/restorePointCollectionsListAllSample.js (71%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/restorePointCollectionsListSample.js (52%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/restorePointsCreateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/restorePointsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/restorePointsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/sample.env (100%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/sharedGalleriesListSample.js (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/sharedGalleryImageVersionsListSample.js (53%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/sharedGalleryImagesGetSample.js (50%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/sharedGalleryImagesListSample.js (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/snapshotsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/snapshotsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/snapshotsGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/snapshotsGrantAccessSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/snapshotsListByResourceGroupSample.js (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/snapshotsListSample.js (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/snapshotsRevokeAccessSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/snapshotsUpdateSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/softDeletedResourceListByArtifactNameSample.js (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysCreateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGenerateKeyPairSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/sshPublicKeysListByResourceGroupSample.js (58%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/sshPublicKeysListBySubscriptionSample.js (63%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysUpdateSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/usageListSample.js (56%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListTypesSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListVersionsSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsListSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineImagesEdgeZoneListOffersSample.js (50%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js (52%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSkusSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineImagesListByEdgeZoneSample.js (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListOffersSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineImagesListPublishersSample.js (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSkusSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListWithPropertiesSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js (55%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineRunCommandsListSample.js (61%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsListSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsListSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js (53%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js (51%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetVMExtensionsListSample.js (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetVMRunCommandsListSample.js (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsApproveRollingUpgradeSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsAttachDetachDataDisksSample.js rename sdk/compute/arm-compute/samples/{v23/javascript/virtualMachineScaleSetVMSDeallocateSample.js => v24/javascript/virtualMachineScaleSetVMsDeallocateSample.js} (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeleteSample.js rename sdk/compute/arm-compute/samples/{v23/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js => v24/javascript/virtualMachineScaleSetVMsGetInstanceViewSample.js} (52%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsListSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPerformMaintenanceSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPowerOffSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRedeploySample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageAllSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRestartSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRunCommandSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsSimulateEvictionSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsStartSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeallocateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteInstancesSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js (51%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetInstanceViewSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetsListAllSample.js (68%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetsListByLocationSample.js (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetsListSkusSample.js (54%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js (55%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPowerOffSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReapplySample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRedeploySample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageAllSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRestartSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsScaleOutSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsStartSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateInstancesSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineScaleSetsUpdateSample.js (80%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachineSizesListSample.js (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAssessPatchesSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAttachDetachDataDisksSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCaptureSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesConvertToManagedDisksSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesCreateOrUpdateSample.js (64%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeallocateSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeleteSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesGeneralizeSample.js (67%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGetSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesInstallPatchesSample.js (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstanceViewSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesListAllSample.js (58%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesListAvailableSizesSample.js (59%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesListByLocationSample.js (63%) rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesListSample.js (52%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesMigrateToVMScaleSetSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPerformMaintenanceSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPowerOffSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReapplySample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRedeploySample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesReimageSample.js (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRestartSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRunCommandSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesSimulateEvictionSample.js create mode 100644 sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesStartSample.js rename sdk/compute/arm-compute/samples/{v23 => v24}/javascript/virtualMachinesUpdateSample.js (61%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/README.md (58%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/package.json (86%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/sample.env (100%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/availabilitySetsListAvailableSizesSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListBySubscriptionSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/capacityReservationGroupsDeleteSample.ts (56%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsCreateOrUpdateSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/capacityReservationsDeleteSample.ts (56%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts (55%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleriesGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/communityGalleryImageVersionsListSample.ts (53%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/communityGalleryImagesGetSample.ts (50%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/communityGalleryImagesListSample.ts (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts (59%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts (65%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/dedicatedHostsListAvailableSizesSample.ts (60%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/dedicatedHostsListByHostGroupSample.ts (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/dedicatedHostsRedeploySample.ts (61%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/dedicatedHostsRestartSample.ts (61%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts (52%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskAccessesListByResourceGroupSample.ts (57%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts (58%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskAccessesListSample.ts (63%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts (55%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/diskEncryptionSetsListSample.ts (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGrantAccessSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointListByRestorePointSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointRevokeAccessSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/disksCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/disksDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/disksGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/disksGrantAccessSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/disksListByResourceGroupSample.ts (52%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/disksListSample.ts (63%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/disksRevokeAccessSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/disksUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleriesCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleriesDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleriesGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleriesListByResourceGroupSample.ts (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleriesListSample.ts (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleriesUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleryApplicationsListByGallerySample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleryImageVersionsListByGalleryImageSample.ts (53%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesListByGallerySample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts rename sdk/compute/arm-compute/{samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts => samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts} (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts (53%) rename sdk/compute/arm-compute/samples/{v23/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts => v24/typescript/src/galleryScriptVersionsUpdateSample.ts} (63%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/galleryScriptsListByGallerySample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/gallerySharingProfileUpdateSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/imagesCreateOrUpdateSample.ts (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/imagesDeleteSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/imagesGetSample.ts (50%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/imagesListByResourceGroupSample.ts (60%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/imagesListSample.ts (69%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/imagesUpdateSample.ts (52%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/logAnalyticsExportThrottledRequestsSample.ts (57%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/operationsListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts (54%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts (61%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/resourceSkusListSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts (57%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/restorePointCollectionsListAllSample.ts (71%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/restorePointCollectionsListSample.ts (52%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsCreateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/sharedGalleriesListSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/sharedGalleryImageVersionsListSample.ts (54%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/sharedGalleryImagesGetSample.ts (50%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/sharedGalleryImagesListSample.ts (51%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGrantAccessSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/snapshotsListByResourceGroupSample.ts (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/snapshotsListSample.ts (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsRevokeAccessSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsUpdateSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/softDeletedResourceListByArtifactNameSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysCreateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGenerateKeyPairSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/sshPublicKeysListByResourceGroupSample.ts (58%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/sshPublicKeysListBySubscriptionSample.ts (64%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysUpdateSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/usageListSample.ts (57%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListTypesSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts (50%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListOffersSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineImagesListPublishersSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSkusSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListWithPropertiesSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts (56%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineRunCommandsListSample.ts (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts (53%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts (51%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts rename sdk/compute/arm-compute/{samples-dev/virtualMachineScaleSetVMSDeallocateSample.ts => samples/v24/typescript/src/virtualMachineScaleSetVMsDeallocateSample.ts} (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeleteSample.ts rename sdk/compute/arm-compute/{samples-dev/virtualMachineScaleSetVMSGetInstanceViewSample.ts => samples/v24/typescript/src/virtualMachineScaleSetVMsGetInstanceViewSample.ts} (52%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPerformMaintenanceSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPowerOffSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRedeploySample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageAllSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRestartSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRunCommandSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsSimulateEvictionSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsStartSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeallocateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts (51%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetsListAllSample.ts (68%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetsListByLocationSample.ts (62%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetsListSkusSample.ts (54%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts (50%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPowerOffSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReapplySample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRedeploySample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageAllSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRestartSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsScaleOutSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsStartSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineScaleSetsUpdateSample.ts (77%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachineSizesListSample.ts (54%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAssessPatchesSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCaptureSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesConvertToManagedDisksSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachinesCreateOrUpdateSample.ts (63%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeallocateSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeleteSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachinesGeneralizeSample.ts (67%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstallPatchesSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstanceViewSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachinesListAllSample.ts (53%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachinesListAvailableSizesSample.ts (60%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachinesListByLocationSample.ts (64%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPerformMaintenanceSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPowerOffSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReapplySample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRedeploySample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachinesReimageSample.ts (57%) create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRestartSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRunCommandSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesSimulateEvictionSample.ts create mode 100644 sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesStartSample.ts rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/src/virtualMachinesUpdateSample.ts (58%) rename sdk/compute/arm-compute/samples/{v23 => v24}/typescript/tsconfig.json (68%) create mode 100644 sdk/compute/arm-compute/src/api/availabilitySets/index.ts create mode 100644 sdk/compute/arm-compute/src/api/availabilitySets/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/availabilitySets/options.ts create mode 100644 sdk/compute/arm-compute/src/api/capacityReservationGroups/index.ts create mode 100644 sdk/compute/arm-compute/src/api/capacityReservationGroups/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/capacityReservationGroups/options.ts create mode 100644 sdk/compute/arm-compute/src/api/capacityReservations/index.ts create mode 100644 sdk/compute/arm-compute/src/api/capacityReservations/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/capacityReservations/options.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleries/index.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleries/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleries/options.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleryImageVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleryImageVersions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleryImageVersions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleryImages/index.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleryImages/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/communityGalleryImages/options.ts create mode 100644 sdk/compute/arm-compute/src/api/computeManagementContext.ts create mode 100644 sdk/compute/arm-compute/src/api/dedicatedHostGroups/index.ts create mode 100644 sdk/compute/arm-compute/src/api/dedicatedHostGroups/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/dedicatedHostGroups/options.ts create mode 100644 sdk/compute/arm-compute/src/api/dedicatedHosts/index.ts create mode 100644 sdk/compute/arm-compute/src/api/dedicatedHosts/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/dedicatedHosts/options.ts create mode 100644 sdk/compute/arm-compute/src/api/diskAccesses/index.ts create mode 100644 sdk/compute/arm-compute/src/api/diskAccesses/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/diskAccesses/options.ts create mode 100644 sdk/compute/arm-compute/src/api/diskEncryptionSets/index.ts create mode 100644 sdk/compute/arm-compute/src/api/diskEncryptionSets/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/diskEncryptionSets/options.ts create mode 100644 sdk/compute/arm-compute/src/api/diskRestorePoint/index.ts create mode 100644 sdk/compute/arm-compute/src/api/diskRestorePoint/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/diskRestorePoint/options.ts create mode 100644 sdk/compute/arm-compute/src/api/disks/index.ts create mode 100644 sdk/compute/arm-compute/src/api/disks/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/disks/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleries/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleries/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleries/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryApplicationVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryApplicationVersions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryApplicationVersions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryApplications/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryApplications/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryApplications/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryImageVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryImageVersions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryImageVersions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryImages/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryImages/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryImages/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryScriptVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryScriptVersions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryScriptVersions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryScripts/index.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryScripts/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/galleryScripts/options.ts create mode 100644 sdk/compute/arm-compute/src/api/gallerySharingProfile/index.ts create mode 100644 sdk/compute/arm-compute/src/api/gallerySharingProfile/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/gallerySharingProfile/options.ts create mode 100644 sdk/compute/arm-compute/src/api/images/index.ts create mode 100644 sdk/compute/arm-compute/src/api/images/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/images/options.ts create mode 100644 sdk/compute/arm-compute/src/api/index.ts create mode 100644 sdk/compute/arm-compute/src/api/logAnalytics/index.ts create mode 100644 sdk/compute/arm-compute/src/api/logAnalytics/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/logAnalytics/options.ts create mode 100644 sdk/compute/arm-compute/src/api/operations/index.ts create mode 100644 sdk/compute/arm-compute/src/api/operations/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/operations/options.ts create mode 100644 sdk/compute/arm-compute/src/api/proximityPlacementGroups/index.ts create mode 100644 sdk/compute/arm-compute/src/api/proximityPlacementGroups/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/proximityPlacementGroups/options.ts create mode 100644 sdk/compute/arm-compute/src/api/resourceSkus/index.ts create mode 100644 sdk/compute/arm-compute/src/api/resourceSkus/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/resourceSkus/options.ts create mode 100644 sdk/compute/arm-compute/src/api/restorePointCollections/index.ts create mode 100644 sdk/compute/arm-compute/src/api/restorePointCollections/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/restorePointCollections/options.ts create mode 100644 sdk/compute/arm-compute/src/api/restorePoints/index.ts create mode 100644 sdk/compute/arm-compute/src/api/restorePoints/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/restorePoints/options.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleries/index.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleries/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleries/options.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleryImages/index.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleryImages/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/sharedGalleryImages/options.ts create mode 100644 sdk/compute/arm-compute/src/api/snapshots/index.ts create mode 100644 sdk/compute/arm-compute/src/api/snapshots/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/snapshots/options.ts create mode 100644 sdk/compute/arm-compute/src/api/softDeletedResource/index.ts create mode 100644 sdk/compute/arm-compute/src/api/softDeletedResource/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/softDeletedResource/options.ts create mode 100644 sdk/compute/arm-compute/src/api/sshPublicKeys/index.ts create mode 100644 sdk/compute/arm-compute/src/api/sshPublicKeys/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/sshPublicKeys/options.ts create mode 100644 sdk/compute/arm-compute/src/api/usage/index.ts create mode 100644 sdk/compute/arm-compute/src/api/usage/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/usage/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineExtensions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineExtensions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineExtensions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineImages/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineImages/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineImages/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineRunCommands/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineRunCommands/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineRunCommands/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSets/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSets/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineScaleSets/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineSizes/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineSizes/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachineSizes/options.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachines/index.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachines/operations.ts create mode 100644 sdk/compute/arm-compute/src/api/virtualMachines/options.ts create mode 100644 sdk/compute/arm-compute/src/classic/availabilitySets/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/capacityReservationGroups/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/capacityReservations/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/communityGalleries/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/communityGalleryImageVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/communityGalleryImages/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/dedicatedHostGroups/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/dedicatedHosts/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/diskAccesses/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/diskEncryptionSets/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/diskRestorePoint/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/disks/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleries/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryApplicationVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryApplications/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryImageVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryImages/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfileVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfiles/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryScriptVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/galleryScripts/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/gallerySharingProfile/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/images/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/logAnalytics/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/operations/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/proximityPlacementGroups/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/resourceSkus/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/restorePointCollections/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/restorePoints/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/sharedGalleries/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/sharedGalleryImageVersions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/sharedGalleryImages/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/snapshots/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/softDeletedResource/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/sshPublicKeys/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/usage/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineExtensionImages/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineExtensions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineImages/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineImagesEdgeZone/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineRunCommands/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineScaleSetExtensions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineScaleSetLifeCycleHookEvents/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineScaleSetRollingUpgrades/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMExtensions/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMRunCommands/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMs/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineScaleSets/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachineSizes/index.ts create mode 100644 sdk/compute/arm-compute/src/classic/virtualMachines/index.ts create mode 100644 sdk/compute/arm-compute/src/logger.ts delete mode 100644 sdk/compute/arm-compute/src/lroImpl.ts create mode 100644 sdk/compute/arm-compute/src/models/common/index.ts create mode 100644 sdk/compute/arm-compute/src/models/common/models.ts create mode 100644 sdk/compute/arm-compute/src/models/compute/index.ts create mode 100644 sdk/compute/arm-compute/src/models/compute/models.ts create mode 100644 sdk/compute/arm-compute/src/models/computeDisk/index.ts create mode 100644 sdk/compute/arm-compute/src/models/computeDisk/models.ts create mode 100644 sdk/compute/arm-compute/src/models/computeGallery/index.ts create mode 100644 sdk/compute/arm-compute/src/models/computeGallery/models.ts create mode 100644 sdk/compute/arm-compute/src/models/computeSku/index.ts create mode 100644 sdk/compute/arm-compute/src/models/computeSku/models.ts delete mode 100644 sdk/compute/arm-compute/src/models/mappers.ts create mode 100644 sdk/compute/arm-compute/src/models/models.ts delete mode 100644 sdk/compute/arm-compute/src/models/parameters.ts delete mode 100644 sdk/compute/arm-compute/src/operations/availabilitySets.ts delete mode 100644 sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts delete mode 100644 sdk/compute/arm-compute/src/operations/capacityReservations.ts delete mode 100644 sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts delete mode 100644 sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts delete mode 100644 sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts delete mode 100644 sdk/compute/arm-compute/src/operations/cloudServices.ts delete mode 100644 sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts delete mode 100644 sdk/compute/arm-compute/src/operations/communityGalleries.ts delete mode 100644 sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/communityGalleryImages.ts delete mode 100644 sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts delete mode 100644 sdk/compute/arm-compute/src/operations/dedicatedHosts.ts delete mode 100644 sdk/compute/arm-compute/src/operations/diskAccesses.ts delete mode 100644 sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts delete mode 100644 sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts delete mode 100644 sdk/compute/arm-compute/src/operations/disks.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleries.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryApplications.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryImageVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryImages.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryScriptVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/galleryScripts.ts delete mode 100644 sdk/compute/arm-compute/src/operations/gallerySharingProfile.ts delete mode 100644 sdk/compute/arm-compute/src/operations/images.ts delete mode 100644 sdk/compute/arm-compute/src/operations/index.ts delete mode 100644 sdk/compute/arm-compute/src/operations/logAnalytics.ts delete mode 100644 sdk/compute/arm-compute/src/operations/operations.ts delete mode 100644 sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts delete mode 100644 sdk/compute/arm-compute/src/operations/resourceSkus.ts delete mode 100644 sdk/compute/arm-compute/src/operations/restorePointCollections.ts delete mode 100644 sdk/compute/arm-compute/src/operations/restorePoints.ts delete mode 100644 sdk/compute/arm-compute/src/operations/sharedGalleries.ts delete mode 100644 sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts delete mode 100644 sdk/compute/arm-compute/src/operations/snapshots.ts delete mode 100644 sdk/compute/arm-compute/src/operations/softDeletedResource.ts delete mode 100644 sdk/compute/arm-compute/src/operations/sshPublicKeys.ts delete mode 100644 sdk/compute/arm-compute/src/operations/usageOperations.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineExtensions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineImages.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineImagesEdgeZone.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineScaleSetRollingUpgrades.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMExtensions.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts delete mode 100644 sdk/compute/arm-compute/src/operations/virtualMachines.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/availabilitySets.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/capacityReservationGroups.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/capacityReservations.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceOperatingSystems.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoleInstances.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoles.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/cloudServices.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/cloudServicesUpdateDomain.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/communityGalleries.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHostGroups.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHosts.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/diskAccesses.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/diskEncryptionSets.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/diskRestorePointOperations.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/disks.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleries.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryApplicationVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryApplications.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryImages.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryScriptVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryScripts.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/gallerySharingProfile.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/images.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/index.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/logAnalytics.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/operations.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/proximityPlacementGroups.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/resourceSkus.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/restorePointCollections.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/restorePoints.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleries.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImageVersions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImages.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/snapshots.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/softDeletedResource.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/sshPublicKeys.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/usageOperations.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImages.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImagesEdgeZone.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineRunCommands.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetExtensions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetRollingUpgrades.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMExtensions.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMRunCommands.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMs.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSets.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineSizes.ts delete mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/virtualMachines.ts delete mode 100644 sdk/compute/arm-compute/src/pagingHelper.ts create mode 100644 sdk/compute/arm-compute/src/restorePollerHelpers.ts create mode 100644 sdk/compute/arm-compute/src/static-helpers/cloudSettingHelpers.ts create mode 100644 sdk/compute/arm-compute/src/static-helpers/pagingHelpers.ts create mode 100644 sdk/compute/arm-compute/src/static-helpers/pollingHelpers.ts create mode 100644 sdk/compute/arm-compute/src/static-helpers/serialization/check-prop-undefined.ts create mode 100644 sdk/compute/arm-compute/src/static-helpers/simplePollerHelpers.ts create mode 100644 sdk/compute/arm-compute/src/static-helpers/urlTemplate.ts create mode 100644 sdk/compute/arm-compute/tsp-location.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0e5b85551324..0238bef8e93a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -439,7 +439,7 @@ # PRLabel: %Mgmt /sdk/connectedcache/arm-connectedcache/ @qiaozha @MaryGao @JialinHuang803 -# PRLabel: %Mgmt +# PRLabel: %Mgmt %mgmt-review-needed /sdk/compute/arm-compute/ @qiaozha @MaryGao @JialinHuang803 # PRLabel: %Mgmt diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 532b60de115e..b875b732e00c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5928,24 +5928,27 @@ importers: sdk/compute/arm-compute: 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-client': - specifier: ^1.9.3 - version: link:../../core/core-client '@azure/core-lro': - specifier: ^2.5.4 - version: 2.7.2 - '@azure/core-paging': - specifier: ^1.6.2 - version: link:../../core/core-paging + specifier: ^3.1.0 + version: link:../../core/core-lro '@azure/core-rest-pipeline': - specifier: ^1.19.1 + 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 @@ -5959,18 +5962,15 @@ importers: '@azure-tools/test-utils-vitest': specifier: workspace:^ version: link:../../test-utils/test-utils-vitest - '@azure/arm-network': - specifier: ^32.2.0 - version: 32.2.0 '@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 - '@azure/logger': - specifier: workspace:^ - version: link:../../core/logger '@types/node': specifier: 'catalog:' version: 20.19.39 @@ -33580,30 +33580,6 @@ packages: '@epic-web/invariant@1.0.0': resolution: {integrity: sha1-EHPl3ubdVAQQeEmQ63PkrNJcmBM=} - '@esbuild/aix-ppc64@0.27.7': - resolution: {integrity: sha1-grdPkqp41yC3FBYpOfskjJCt31M=} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - - '@esbuild/android-arm64@0.27.7': - resolution: {integrity: sha1-94y4oxIfwgWlMoWtskly2zhdGF0=} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm@0.27.7': - resolution: {integrity: sha1-WT4QoUULv8rGyzIfYfRoRTusIJ0=} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - - '@esbuild/android-x64@0.27.7': - resolution: {integrity: sha1-RTFD0HMyYDPS0iyvnkjeS64nSwc=} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - '@esbuild/darwin-arm64@0.27.7': resolution: {integrity: sha1-byMAD7m0C34Et9BgbAaTvQYy8yI=} engines: {node: '>=18'} @@ -33616,120 +33592,18 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.27.7': - resolution: {integrity: sha1-IuRjj6UC0cACcHcyTJdkDjrfOmI=} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.27.7': - resolution: {integrity: sha1-kiS45P6pJM4hlOPvw+muv4IhktY=} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - - '@esbuild/linux-arm64@0.27.7': - resolution: {integrity: sha1-T10cJ1J9gXs1aEriFBnlfCvaCWY=} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm@0.27.7': - resolution: {integrity: sha1-uenQcMjBwESc8Ssg6sN9cKRZWSE=} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.27.7': - resolution: {integrity: sha1-P4D7aWqpYFGpQEfzXIWwiyHDb54=} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-loong64@0.27.7': - resolution: {integrity: sha1-m+HywoIQsT67QVYiG7o1b+FnUgU=} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-mips64el@0.27.7': - resolution: {integrity: sha1-SrXuZ6Pfy8tej9eIPa5uc1sRY7g=} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-ppc64@0.27.7': - resolution: {integrity: sha1-2seMaJ9kmUWcQyHlwVAywSMH5+o=} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-riscv64@0.27.7': - resolution: {integrity: sha1-BQ99OzVcOpgwjpNbxNYyXakbACc=} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-s390x@0.27.7': - resolution: {integrity: sha1-1h9xXOYdQ/5YRK0Nj0Y/iMvk/vY=} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - '@esbuild/linux-x64@0.27.7': resolution: {integrity: sha1-yo4apHj8ggkle/Osj3nE3CmC8yo=} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.27.7': - resolution: {integrity: sha1-FlDywblI3us++Ujy/DBhRyPAlpA=} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.27.7': - resolution: {integrity: sha1-ZXcqs0LEszGb8HBaIRBQqsG24yA=} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - - '@esbuild/openbsd-arm64@0.27.7': - resolution: {integrity: sha1-N+18+mZUnXlVhS/ON9DD3k5xXqE=} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.27.7': - resolution: {integrity: sha1-Ab89OFhV71DLM9t8S1L5V8NM0Xk=} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - - '@esbuild/openharmony-arm64@0.27.7': - resolution: {integrity: sha1-bB+Us0CGWZqr2k6sj2OClLmHdBA=} - engines: {node: '>=18'} - cpu: [arm64] - os: [openharmony] - - '@esbuild/sunos-x64@0.27.7': - resolution: {integrity: sha1-Sw3ReuCmlB0tD9NakGOSUXBxqQ0=} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - '@esbuild/win32-arm64@0.27.7': resolution: {integrity: sha1-NBk6tVZdb/aMqSisBL51ECzLLnc=} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.27.7': - resolution: {integrity: sha1-62fw5EglFdjBiU7eYxwyek2p/E0=} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - '@esbuild/win32-x64@0.27.7': resolution: {integrity: sha1-j+MLMIi4m0hzw6bMh1l645IMCos=} engines: {node: '>=18'} @@ -34852,16 +34726,6 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.60.2': - resolution: {integrity: sha1-oZxkXDdRWM1cUKNEEG8PoY64IcQ=} - cpu: [arm] - os: [android] - - '@rollup/rollup-android-arm64@4.60.2': - resolution: {integrity: sha1-GvGaqdOtbQDfJoH1nPy4v3SZV2s=} - cpu: [arm64] - os: [android] - '@rollup/rollup-darwin-arm64@4.60.2': resolution: {integrity: sha1-O4Rj4Duio5NFP+pw59kHN5wntkk=} cpu: [arm64] @@ -34872,82 +34736,6 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.60.2': - resolution: {integrity: sha1-lLrKwxkPYh3hNVkitZnzgXeGBEw=} - cpu: [arm64] - os: [freebsd] - - '@rollup/rollup-freebsd-x64@4.60.2': - resolution: {integrity: sha1-igCU9TO5/aFgtckK2eDHj8o0F4g=} - cpu: [x64] - os: [freebsd] - - '@rollup/rollup-linux-arm-gnueabihf@4.60.2': - resolution: {integrity: sha1-O36QGlVcckXIf3RAl5vuCh7Igrs=} - cpu: [arm] - os: [linux] - libc: [glibc] - - '@rollup/rollup-linux-arm-musleabihf@4.60.2': - resolution: {integrity: sha1-7poJty6K12TP1hiLMv8d5Sj/fr4=} - cpu: [arm] - os: [linux] - libc: [musl] - - '@rollup/rollup-linux-arm64-gnu@4.60.2': - resolution: {integrity: sha1-ukg/Ssqb4UEXHQhtvQGtpqsDtY0=} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rollup/rollup-linux-arm64-musl@4.60.2': - resolution: {integrity: sha1-F7WVt5Dm32jpHF0CUm/IMqmFzk8=} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@rollup/rollup-linux-loong64-gnu@4.60.2': - resolution: {integrity: sha1-VRcYcUB1or+zaigTxGbjoOnVar8=} - cpu: [loong64] - os: [linux] - libc: [glibc] - - '@rollup/rollup-linux-loong64-musl@4.60.2': - resolution: {integrity: sha1-uhVu0SQ0R6PXEJcgAdXc/jgn/z0=} - cpu: [loong64] - os: [linux] - libc: [musl] - - '@rollup/rollup-linux-ppc64-gnu@4.60.2': - resolution: {integrity: sha1-apV6cJuGrGLvaOWXrAPb1DNngrE=} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@rollup/rollup-linux-ppc64-musl@4.60.2': - resolution: {integrity: sha1-ykF2tK1T8+3uO0v6b570j/OPFns=} - cpu: [ppc64] - os: [linux] - libc: [musl] - - '@rollup/rollup-linux-riscv64-gnu@4.60.2': - resolution: {integrity: sha1-TmsI9y6+r9tB8+xDO9IouoVzRzs=} - cpu: [riscv64] - os: [linux] - libc: [glibc] - - '@rollup/rollup-linux-riscv64-musl@4.60.2': - resolution: {integrity: sha1-oLi4WAx2gMgIbLMiZSflRyJTuJU=} - cpu: [riscv64] - os: [linux] - libc: [musl] - - '@rollup/rollup-linux-s390x-gnu@4.60.2': - resolution: {integrity: sha1-ef4VuSzguuK2Cc8m3RWM0+K3NjQ=} - cpu: [s390x] - os: [linux] - libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.60.2': resolution: {integrity: sha1-aqgwL6Rf08u8UQzNIjycN79n5T8=} cpu: [x64] @@ -34960,26 +34748,11 @@ packages: os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.60.2': - resolution: {integrity: sha1-XwfIY+dP1Ch5Tx3FdJ8yG2YdHxc=} - cpu: [x64] - os: [openbsd] - - '@rollup/rollup-openharmony-arm64@4.60.2': - resolution: {integrity: sha1-jg1xMkvg9CNCixKyWi646o4KeDM=} - cpu: [arm64] - os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.60.2': resolution: {integrity: sha1-pVP9+Qp4Ws5tdQHu1iQcRosIiZk=} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.60.2': - resolution: {integrity: sha1-D7BPCogCf7/TI+JaRG3rzkdzhow=} - cpu: [ia32] - os: [win32] - '@rollup/rollup-win32-x64-gnu@4.60.2': resolution: {integrity: sha1-qqnjbb3A8OOX5ZZtzOG0KFNU7eI=} cpu: [x64] @@ -35058,21 +34831,11 @@ packages: cpu: [x64] os: [linux] - '@turbo/linux-arm64@2.9.6': - resolution: {integrity: sha1-Fb4KCiN1Ph5P65VT39A06WI/iCQ=} - cpu: [arm64] - os: [linux] - '@turbo/windows-64@2.9.6': resolution: {integrity: sha1-WlUjg6nhgPFfH6eY6hg6wmoEhlY=} cpu: [x64] os: [win32] - '@turbo/windows-arm64@2.9.6': - resolution: {integrity: sha1-VdO0+1VhR3Ba1aUG80odZT9WE/U=} - cpu: [arm64] - os: [win32] - '@types/argparse@1.0.38': resolution: {integrity: sha1-qB/YYG1IH4c6OADG665PHXaKVqk=} @@ -39851,81 +39614,18 @@ snapshots: '@epic-web/invariant@1.0.0': {} - '@esbuild/aix-ppc64@0.27.7': - optional: true - - '@esbuild/android-arm64@0.27.7': - optional: true - - '@esbuild/android-arm@0.27.7': - optional: true - - '@esbuild/android-x64@0.27.7': - optional: true - '@esbuild/darwin-arm64@0.27.7': optional: true '@esbuild/darwin-x64@0.27.7': optional: true - '@esbuild/freebsd-arm64@0.27.7': - optional: true - - '@esbuild/freebsd-x64@0.27.7': - optional: true - - '@esbuild/linux-arm64@0.27.7': - optional: true - - '@esbuild/linux-arm@0.27.7': - optional: true - - '@esbuild/linux-ia32@0.27.7': - optional: true - - '@esbuild/linux-loong64@0.27.7': - optional: true - - '@esbuild/linux-mips64el@0.27.7': - optional: true - - '@esbuild/linux-ppc64@0.27.7': - optional: true - - '@esbuild/linux-riscv64@0.27.7': - optional: true - - '@esbuild/linux-s390x@0.27.7': - optional: true - '@esbuild/linux-x64@0.27.7': optional: true - '@esbuild/netbsd-arm64@0.27.7': - optional: true - - '@esbuild/netbsd-x64@0.27.7': - optional: true - - '@esbuild/openbsd-arm64@0.27.7': - optional: true - - '@esbuild/openbsd-x64@0.27.7': - optional: true - - '@esbuild/openharmony-arm64@0.27.7': - optional: true - - '@esbuild/sunos-x64@0.27.7': - optional: true - '@esbuild/win32-arm64@0.27.7': optional: true - '@esbuild/win32-ia32@0.27.7': - optional: true - '@esbuild/win32-x64@0.27.7': optional: true @@ -41245,75 +40945,21 @@ snapshots: optionalDependencies: rollup: 4.60.2 - '@rollup/rollup-android-arm-eabi@4.60.2': - optional: true - - '@rollup/rollup-android-arm64@4.60.2': - optional: true - '@rollup/rollup-darwin-arm64@4.60.2': optional: true '@rollup/rollup-darwin-x64@4.60.2': optional: true - '@rollup/rollup-freebsd-arm64@4.60.2': - optional: true - - '@rollup/rollup-freebsd-x64@4.60.2': - optional: true - - '@rollup/rollup-linux-arm-gnueabihf@4.60.2': - optional: true - - '@rollup/rollup-linux-arm-musleabihf@4.60.2': - optional: true - - '@rollup/rollup-linux-arm64-gnu@4.60.2': - optional: true - - '@rollup/rollup-linux-arm64-musl@4.60.2': - optional: true - - '@rollup/rollup-linux-loong64-gnu@4.60.2': - optional: true - - '@rollup/rollup-linux-loong64-musl@4.60.2': - optional: true - - '@rollup/rollup-linux-ppc64-gnu@4.60.2': - optional: true - - '@rollup/rollup-linux-ppc64-musl@4.60.2': - optional: true - - '@rollup/rollup-linux-riscv64-gnu@4.60.2': - optional: true - - '@rollup/rollup-linux-riscv64-musl@4.60.2': - optional: true - - '@rollup/rollup-linux-s390x-gnu@4.60.2': - optional: true - '@rollup/rollup-linux-x64-gnu@4.60.2': optional: true '@rollup/rollup-linux-x64-musl@4.60.2': optional: true - '@rollup/rollup-openbsd-x64@4.60.2': - optional: true - - '@rollup/rollup-openharmony-arm64@4.60.2': - optional: true - '@rollup/rollup-win32-arm64-msvc@4.60.2': optional: true - '@rollup/rollup-win32-ia32-msvc@4.60.2': - optional: true - '@rollup/rollup-win32-x64-gnu@4.60.2': optional: true @@ -41390,15 +41036,9 @@ snapshots: '@turbo/linux-64@2.9.6': optional: true - '@turbo/linux-arm64@2.9.6': - optional: true - '@turbo/windows-64@2.9.6': optional: true - '@turbo/windows-arm64@2.9.6': - optional: true - '@types/argparse@1.0.38': {} '@types/babel__core@7.20.5': @@ -42576,31 +42216,10 @@ snapshots: esbuild@0.27.7: optionalDependencies: - '@esbuild/aix-ppc64': 0.27.7 - '@esbuild/android-arm': 0.27.7 - '@esbuild/android-arm64': 0.27.7 - '@esbuild/android-x64': 0.27.7 '@esbuild/darwin-arm64': 0.27.7 '@esbuild/darwin-x64': 0.27.7 - '@esbuild/freebsd-arm64': 0.27.7 - '@esbuild/freebsd-x64': 0.27.7 - '@esbuild/linux-arm': 0.27.7 - '@esbuild/linux-arm64': 0.27.7 - '@esbuild/linux-ia32': 0.27.7 - '@esbuild/linux-loong64': 0.27.7 - '@esbuild/linux-mips64el': 0.27.7 - '@esbuild/linux-ppc64': 0.27.7 - '@esbuild/linux-riscv64': 0.27.7 - '@esbuild/linux-s390x': 0.27.7 '@esbuild/linux-x64': 0.27.7 - '@esbuild/netbsd-arm64': 0.27.7 - '@esbuild/netbsd-x64': 0.27.7 - '@esbuild/openbsd-arm64': 0.27.7 - '@esbuild/openbsd-x64': 0.27.7 - '@esbuild/openharmony-arm64': 0.27.7 - '@esbuild/sunos-x64': 0.27.7 '@esbuild/win32-arm64': 0.27.7 - '@esbuild/win32-ia32': 0.27.7 '@esbuild/win32-x64': 0.27.7 escalade@3.2.0: {} @@ -44666,29 +44285,11 @@ snapshots: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.60.2 - '@rollup/rollup-android-arm64': 4.60.2 '@rollup/rollup-darwin-arm64': 4.60.2 '@rollup/rollup-darwin-x64': 4.60.2 - '@rollup/rollup-freebsd-arm64': 4.60.2 - '@rollup/rollup-freebsd-x64': 4.60.2 - '@rollup/rollup-linux-arm-gnueabihf': 4.60.2 - '@rollup/rollup-linux-arm-musleabihf': 4.60.2 - '@rollup/rollup-linux-arm64-gnu': 4.60.2 - '@rollup/rollup-linux-arm64-musl': 4.60.2 - '@rollup/rollup-linux-loong64-gnu': 4.60.2 - '@rollup/rollup-linux-loong64-musl': 4.60.2 - '@rollup/rollup-linux-ppc64-gnu': 4.60.2 - '@rollup/rollup-linux-ppc64-musl': 4.60.2 - '@rollup/rollup-linux-riscv64-gnu': 4.60.2 - '@rollup/rollup-linux-riscv64-musl': 4.60.2 - '@rollup/rollup-linux-s390x-gnu': 4.60.2 '@rollup/rollup-linux-x64-gnu': 4.60.2 '@rollup/rollup-linux-x64-musl': 4.60.2 - '@rollup/rollup-openbsd-x64': 4.60.2 - '@rollup/rollup-openharmony-arm64': 4.60.2 '@rollup/rollup-win32-arm64-msvc': 4.60.2 - '@rollup/rollup-win32-ia32-msvc': 4.60.2 '@rollup/rollup-win32-x64-gnu': 4.60.2 '@rollup/rollup-win32-x64-msvc': 4.60.2 fsevents: 2.3.3 @@ -45157,9 +44758,7 @@ snapshots: '@turbo/darwin-64': 2.9.6 '@turbo/darwin-arm64': 2.9.6 '@turbo/linux-64': 2.9.6 - '@turbo/linux-arm64': 2.9.6 '@turbo/windows-64': 2.9.6 - '@turbo/windows-arm64': 2.9.6 type-check@0.3.2: dependencies: diff --git a/sdk/compute/arm-compute/CHANGELOG.md b/sdk/compute/arm-compute/CHANGELOG.md index c769e586107c..4d3301b941eb 100644 --- a/sdk/compute/arm-compute/CHANGELOG.md +++ b/sdk/compute/arm-compute/CHANGELOG.md @@ -1,5 +1,371 @@ # Release History +## 24.0.0 (2026-04-21) + +### Features Added + - Added operation group VirtualMachineScaleSetLifeCycleHookEventsOperations + - Added operation AvailabilitySetsOperations.convertToVirtualMachineScaleSet + - Added operation CapacityReservationsOperations.createOrUpdate + - Added operation CapacityReservationsOperations.delete + - Added operation CapacityReservationsOperations.update + - Added operation DedicatedHostsOperations.createOrUpdate + - Added operation DedicatedHostsOperations.delete + - Added operation DedicatedHostsOperations.redeploy + - Added operation DedicatedHostsOperations.restart + - Added operation DedicatedHostsOperations.update + - Added operation DiskAccessesOperations.createOrUpdate + - Added operation DiskAccessesOperations.delete + - Added operation DiskAccessesOperations.deleteAPrivateEndpointConnection + - Added operation DiskAccessesOperations.update + - Added operation DiskAccessesOperations.updateAPrivateEndpointConnection + - Added operation DiskEncryptionSetsOperations.createOrUpdate + - Added operation DiskEncryptionSetsOperations.delete + - Added operation DiskEncryptionSetsOperations.update + - Added operation DiskRestorePointOperations.grantAccess + - Added operation DiskRestorePointOperations.revokeAccess + - Added operation DisksOperations.createOrUpdate + - Added operation DisksOperations.delete + - Added operation DisksOperations.grantAccess + - Added operation DisksOperations.revokeAccess + - Added operation DisksOperations.update + - Added operation GalleriesOperations.createOrUpdate + - Added operation GalleriesOperations.delete + - Added operation GalleriesOperations.update + - Added operation GalleryApplicationsOperations.createOrUpdate + - Added operation GalleryApplicationsOperations.delete + - Added operation GalleryApplicationsOperations.update + - Added operation GalleryApplicationVersionsOperations.createOrUpdate + - Added operation GalleryApplicationVersionsOperations.delete + - Added operation GalleryApplicationVersionsOperations.update + - Added operation GalleryImagesOperations.createOrUpdate + - Added operation GalleryImagesOperations.delete + - Added operation GalleryImagesOperations.update + - Added operation GalleryImageVersionsOperations.createOrUpdate + - Added operation GalleryImageVersionsOperations.delete + - Added operation GalleryImageVersionsOperations.update + - Added operation GalleryInVMAccessControlProfilesOperations.createOrUpdate + - Added operation GalleryInVMAccessControlProfilesOperations.delete + - Added operation GalleryInVMAccessControlProfilesOperations.update + - Added operation GalleryInVMAccessControlProfileVersionsOperations.createOrUpdate + - Added operation GalleryInVMAccessControlProfileVersionsOperations.delete + - Added operation GalleryInVMAccessControlProfileVersionsOperations.update + - Added operation GalleryScriptsOperations.createOrUpdate + - Added operation GalleryScriptsOperations.delete + - Added operation GalleryScriptsOperations.update + - Added operation GalleryScriptVersionsOperations.createOrUpdate + - Added operation GalleryScriptVersionsOperations.delete + - Added operation GalleryScriptVersionsOperations.update + - Added operation GallerySharingProfileOperations.update + - Added operation ImagesOperations.createOrUpdate + - Added operation ImagesOperations.delete + - Added operation ImagesOperations.update + - Added operation LogAnalyticsOperations.exportRequestRateByInterval + - Added operation LogAnalyticsOperations.exportThrottledRequests + - Added operation RestorePointCollectionsOperations.delete + - Added operation RestorePointsOperations.create + - Added operation RestorePointsOperations.delete + - Added operation SnapshotsOperations.createOrUpdate + - Added operation SnapshotsOperations.delete + - Added operation SnapshotsOperations.grantAccess + - Added operation SnapshotsOperations.revokeAccess + - Added operation SnapshotsOperations.update + - Added operation VirtualMachineExtensionsOperations.createOrUpdate + - Added operation VirtualMachineExtensionsOperations.delete + - Added operation VirtualMachineExtensionsOperations.update + - Added operation VirtualMachineRunCommandsOperations.createOrUpdate + - Added operation VirtualMachineRunCommandsOperations.delete + - Added operation VirtualMachineRunCommandsOperations.update + - Added operation VirtualMachinesOperations.assessPatches + - Added operation VirtualMachinesOperations.attachDetachDataDisks + - Added operation VirtualMachinesOperations.capture + - Added operation VirtualMachinesOperations.convertToManagedDisks + - Added operation VirtualMachinesOperations.createOrUpdate + - Added operation VirtualMachinesOperations.deallocate + - Added operation VirtualMachinesOperations.delete + - Added operation VirtualMachinesOperations.installPatches + - Added operation VirtualMachinesOperations.migrateToVMScaleSet + - Added operation VirtualMachinesOperations.performMaintenance + - Added operation VirtualMachinesOperations.powerOff + - Added operation VirtualMachinesOperations.reapply + - Added operation VirtualMachinesOperations.redeploy + - Added operation VirtualMachinesOperations.reimage + - Added operation VirtualMachinesOperations.restart + - Added operation VirtualMachinesOperations.runCommand + - Added operation VirtualMachinesOperations.start + - Added operation VirtualMachinesOperations.update + - Added operation VirtualMachineScaleSetExtensionsOperations.createOrUpdate + - Added operation VirtualMachineScaleSetExtensionsOperations.delete + - Added operation VirtualMachineScaleSetExtensionsOperations.update + - Added operation VirtualMachineScaleSetRollingUpgradesOperations.cancel + - Added operation VirtualMachineScaleSetRollingUpgradesOperations.startExtensionUpgrade + - Added operation VirtualMachineScaleSetRollingUpgradesOperations.startOSUpgrade + - Added operation VirtualMachineScaleSetsOperations.approveRollingUpgrade + - Added operation VirtualMachineScaleSetsOperations.createOrUpdate + - Added operation VirtualMachineScaleSetsOperations.deallocate + - Added operation VirtualMachineScaleSetsOperations.delete + - Added operation VirtualMachineScaleSetsOperations.deleteInstances + - Added operation VirtualMachineScaleSetsOperations.getOSUpgradeHistory + - Added operation VirtualMachineScaleSetsOperations.performMaintenance + - Added operation VirtualMachineScaleSetsOperations.powerOff + - Added operation VirtualMachineScaleSetsOperations.reapply + - Added operation VirtualMachineScaleSetsOperations.redeploy + - Added operation VirtualMachineScaleSetsOperations.reimage + - Added operation VirtualMachineScaleSetsOperations.reimageAll + - Added operation VirtualMachineScaleSetsOperations.restart + - Added operation VirtualMachineScaleSetsOperations.scaleOut + - Added operation VirtualMachineScaleSetsOperations.setOrchestrationServiceState + - Added operation VirtualMachineScaleSetsOperations.start + - Added operation VirtualMachineScaleSetsOperations.update + - Added operation VirtualMachineScaleSetsOperations.updateInstances + - Added operation VirtualMachineScaleSetVMExtensionsOperations.createOrUpdate + - Added operation VirtualMachineScaleSetVMExtensionsOperations.delete + - Added operation VirtualMachineScaleSetVMExtensionsOperations.update + - Added operation VirtualMachineScaleSetVMRunCommandsOperations.createOrUpdate + - Added operation VirtualMachineScaleSetVMRunCommandsOperations.delete + - Added operation VirtualMachineScaleSetVMRunCommandsOperations.update + - Added operation VirtualMachineScaleSetVMsOperations.approveRollingUpgrade + - Added operation VirtualMachineScaleSetVMsOperations.attachDetachDataDisks + - Added operation VirtualMachineScaleSetVMsOperations.deallocate + - Added operation VirtualMachineScaleSetVMsOperations.delete + - Added operation VirtualMachineScaleSetVMsOperations.performMaintenance + - Added operation VirtualMachineScaleSetVMsOperations.powerOff + - Added operation VirtualMachineScaleSetVMsOperations.redeploy + - Added operation VirtualMachineScaleSetVMsOperations.reimage + - Added operation VirtualMachineScaleSetVMsOperations.reimageAll + - Added operation VirtualMachineScaleSetVMsOperations.restart + - Added operation VirtualMachineScaleSetVMsOperations.runCommand + - Added operation VirtualMachineScaleSetVMsOperations.start + - Added operation VirtualMachineScaleSetVMsOperations.update + - Added Interface AvailabilitySetProperties + - Added Interface CapacityReservationGroupProperties + - Added Interface CapacityReservationProperties + - Added Interface CommunityGalleryIdentifier + - Added Interface CommunityGalleryImageProperties + - Added Interface CommunityGalleryImageVersionProperties + - Added Interface CommunityGalleryProperties + - Added Interface DedicatedHostGroupProperties + - Added Interface DedicatedHostProperties + - Added Interface DiskAccessProperties + - Added Interface DiskEncryptionSetUpdateProperties + - Added Interface DiskProperties + - Added Interface DiskRestorePointProperties + - Added Interface DiskUpdateProperties + - Added Interface EncryptionSetProperties + - Added Interface ExternalHealthPolicy + - Added Interface GalleryApplicationProperties + - Added Interface GalleryApplicationVersionProperties + - Added Interface GalleryImageProperties + - Added Interface GalleryImageVersionProperties + - Added Interface GalleryProperties + - Added Interface GallerySoftDeletedResourceProperties + - Added Interface ImageProperties + - Added Interface LifecycleHook + - Added Interface LifecycleHooksProfile + - Added Interface NetworkInterfaceReferenceProperties + - Added Interface OperationRecoverySettings + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings + - Added Interface PrivateEndpointConnectionProperties + - Added Interface PrivateLinkResourceProperties + - Added Interface ProximityPlacementGroupProperties + - Added Interface ReimageRecoveryPolicy + - Added Interface ResiliencyProfile + - Added Interface RestartRecoveryPolicy + - Added Interface RestorePointCollectionProperties + - Added Interface RestorePointProperties + - Added Interface RestorePollerOptions + - Added Interface RollingUpgradeStatusInfoProperties + - Added Interface SharedGalleryIdentifier + - Added Interface SharedGalleryImageProperties + - Added Interface SharedGalleryImageVersionProperties + - Added Interface SharedGalleryProperties + - Added Interface SimplePollerLike + - Added Interface SnapshotProperties + - Added Interface SnapshotUpdateProperties + - Added Interface SshPublicKeyResourceProperties + - Added Interface StartRecoveryPolicy + - Added Interface VirtualMachineExtensionImageProperties + - Added Interface VirtualMachineExtensionProperties + - Added Interface VirtualMachineExtensionUpdateProperties + - Added Interface VirtualMachineImageProperties + - Added Interface VirtualMachineNetworkInterfaceConfigurationProperties + - Added Interface VirtualMachineNetworkInterfaceIPConfigurationProperties + - Added Interface VirtualMachineProperties + - Added Interface VirtualMachinePublicIPAddressConfigurationProperties + - Added Interface VirtualMachineRunCommandProperties + - Added Interface VirtualMachineScaleSetExtensionProperties + - Added Interface VirtualMachineScaleSetIPConfigurationProperties + - Added Interface VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams + - Added Interface VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams + - Added Interface VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams + - Added Interface VirtualMachineScaleSetNetworkConfigurationProperties + - Added Interface VirtualMachineScaleSetProperties + - Added Interface VirtualMachineScaleSetPublicIPAddressConfigurationProperties + - Added Interface VirtualMachineScaleSetUpdateIPConfigurationProperties + - Added Interface VirtualMachineScaleSetUpdateNetworkConfigurationProperties + - Added Interface VirtualMachineScaleSetUpdateProperties + - Added Interface VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + - Added Interface VirtualMachineScaleSetVMProperties + - Added Interface VMScaleSetLifecycleHookEvent + - Added Interface VMScaleSetLifecycleHookEventAdditionalContext + - Added Interface VMScaleSetLifecycleHookEventProperties + - Added Interface VMScaleSetLifecycleHookEventTargetResource + - Added Interface VMScaleSetLifecycleHookEventUpdate + - Added Interface ZoneMovement + - Interface CapacityReservationsListByCapacityReservationGroupOptionalParams has a new optional parameter expand + - Interface DataDisk has a new optional parameter storageFaultDomainAlignment + - Interface DiffDiskSettings has a new optional parameter enableFullCaching + - Interface DiskInstanceView has a new optional parameter storageAlignmentStatus + - Interface OSDisk has a new optional parameter storageFaultDomainAlignment + - Interface ResiliencyPolicy has a new optional parameter operationRecoverySettings + - Interface VirtualMachine has a new optional parameter resiliencyProfile + - Interface VirtualMachineScaleSet has a new optional parameter externalHealthPolicy + - Interface VirtualMachineScaleSet has a new optional parameter lifecycleHooksProfile + - Interface VirtualMachineScaleSetDataDisk has a new optional parameter storageFaultDomainAlignment + - Interface VirtualMachineScaleSetOSDisk has a new optional parameter storageFaultDomainAlignment + - Interface VirtualMachineScaleSetUpdate has a new optional parameter lifecycleHooksProfile + - Interface VirtualMachineScaleSetUpdate has a new optional parameter placement + - Interface VirtualMachineScaleSetUpdateOSDisk has a new optional parameter storageFaultDomainAlignment + - Interface VirtualMachineScaleSetVM has a new optional parameter virtualMachineResourceId + - Interface VirtualMachineUpdate has a new optional parameter resiliencyProfile + - Added Type Alias AzureSupportedClouds + - Added Type Alias ComponentNames + - Added Type Alias LifecycleHookAction + - Added Type Alias LifecycleHookActionState + - Added Type Alias PassNames + - Added Type Alias StorageAlignmentStatus + - Added Type Alias StorageFaultDomainAlignmentType + - Added Type Alias VMScaleSetLifecycleHookEventState + - Added Type Alias VMScaleSetLifecycleHookEventType + - Added Enum AzureClouds + - Added Enum KnownLifecycleHookAction + - Added Enum KnownLifecycleHookActionState + - Added Enum KnownStorageAlignmentStatus + - Added Enum KnownStorageFaultDomainAlignmentType + - Added Enum KnownVMScaleSetLifecycleHookEventState + - Added Enum KnownVMScaleSetLifecycleHookEventType + - Enum KnownDiskSecurityTypes has a new value ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey + - Enum KnownNetworkApiVersion has a new value NetworkApiVersion20201101 + - Enum KnownNetworkApiVersion has a new value NetworkApiVersion20221101 + - Enum KnownSecurityTypes has a new value Standard + - Enum KnownZonalPlatformFaultDomainAlignMode has a new value BestEffortAligned + +### Breaking Changes + - Removed operation VirtualMachineScaleSets.listOSUpgradeHistory + - Operation AvailabilitySets.beginConvertToVirtualMachineScaleSetAndWait has a new signature + - Operation DedicatedHosts.beginRedeployAndWait has a new signature + - Operation DedicatedHosts.beginRestartAndWait has a new signature + - Operation GalleryInVMAccessControlProfiles.beginDeleteAndWait has a new signature + - Operation GalleryInVMAccessControlProfileVersions.beginDeleteAndWait has a new signature + - Operation GalleryScripts.beginDeleteAndWait has a new signature + - Operation GalleryScriptVersions.beginDeleteAndWait has a new signature + - Operation VirtualMachines.beginMigrateToVMScaleSetAndWait has a new signature + - Operation VirtualMachineScaleSets.beginApproveRollingUpgradeAndWait has a new signature + - Operation VirtualMachineScaleSetVMs.beginApproveRollingUpgradeAndWait has a new signature + - Removed Interface CloudService + - Removed Interface CloudServiceExtensionProfile + - Removed Interface CloudServiceExtensionProperties + - Removed Interface CloudServiceInstanceView + - Removed Interface CloudServiceNetworkProfile + - Removed Interface CloudServiceOperatingSystems + - Removed Interface CloudServiceOperatingSystemsGetOSFamilyOptionalParams + - Removed Interface CloudServiceOperatingSystemsGetOSVersionOptionalParams + - Removed Interface CloudServiceOperatingSystemsListOSFamiliesOptionalParams + - Removed Interface CloudServiceOperatingSystemsListOSVersionsOptionalParams + - Removed Interface CloudServiceOsProfile + - Removed Interface CloudServiceProperties + - Removed Interface CloudServiceRole + - Removed Interface CloudServiceRoleInstances + - Removed Interface CloudServiceRoleInstancesDeleteOptionalParams + - Removed Interface CloudServiceRoleInstancesGetInstanceViewOptionalParams + - Removed Interface CloudServiceRoleInstancesGetOptionalParams + - Removed Interface CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams + - Removed Interface CloudServiceRoleInstancesListOptionalParams + - Removed Interface CloudServiceRoleInstancesRebuildOptionalParams + - Removed Interface CloudServiceRoleInstancesReimageOptionalParams + - Removed Interface CloudServiceRoleInstancesRestartOptionalParams + - Removed Interface CloudServiceRoleProfile + - Removed Interface CloudServiceRoleProfileProperties + - Removed Interface CloudServiceRoleProperties + - Removed Interface CloudServiceRoles + - Removed Interface CloudServiceRolesGetOptionalParams + - Removed Interface CloudServiceRoleSku + - Removed Interface CloudServiceRolesListOptionalParams + - Removed Interface CloudServices + - Removed Interface CloudServicesCreateOrUpdateOptionalParams + - Removed Interface CloudServicesDeleteInstancesOptionalParams + - Removed Interface CloudServicesDeleteOptionalParams + - Removed Interface CloudServicesGetInstanceViewOptionalParams + - Removed Interface CloudServicesGetOptionalParams + - Removed Interface CloudServicesListAllOptionalParams + - Removed Interface CloudServicesListOptionalParams + - Removed Interface CloudServicesPowerOffOptionalParams + - Removed Interface CloudServicesRebuildOptionalParams + - Removed Interface CloudServicesReimageOptionalParams + - Removed Interface CloudServicesRestartOptionalParams + - Removed Interface CloudServicesStartOptionalParams + - Removed Interface CloudServicesUpdateDomain + - Removed Interface CloudServicesUpdateDomainGetUpdateDomainOptionalParams + - Removed Interface CloudServicesUpdateDomainListUpdateDomainsOptionalParams + - Removed Interface CloudServicesUpdateDomainWalkUpdateDomainOptionalParams + - Removed Interface CloudServicesUpdateOptionalParams + - Removed Interface CloudServiceUpdate + - Removed Interface CloudServiceVaultAndSecretReference + - Removed Interface CloudServiceVaultCertificate + - Removed Interface CloudServiceVaultSecretGroup + - Removed Interface CommunityGalleryImageList + - Removed Interface CommunityGalleryImageVersionList + - Removed Interface DiskAccessList + - Removed Interface DiskEncryptionSetList + - Removed Interface DiskList + - Removed Interface DiskRestorePointList + - Removed Interface Extension + - Removed Interface GalleryApplicationList + - Removed Interface GalleryApplicationVersionList + - Removed Interface GalleryImageList + - Removed Interface GalleryImageVersionList + - Removed Interface GalleryInVMAccessControlProfileList + - Removed Interface GalleryInVMAccessControlProfileVersionList + - Removed Interface GalleryList + - Removed Interface GalleryScriptList + - Removed Interface GalleryScriptVersionList + - Removed Interface GallerySoftDeletedResourceList + - Removed Interface InstanceSku + - Removed Interface InstanceViewStatusesSummary + - Removed Interface LoadBalancerConfiguration + - Removed Interface LoadBalancerConfigurationProperties + - Removed Interface LoadBalancerFrontendIpConfiguration + - Removed Interface LoadBalancerFrontendIpConfigurationProperties + - Removed Interface OSFamily + - Removed Interface OSFamilyProperties + - Removed Interface OSVersion + - Removed Interface OSVersionProperties + - Removed Interface OSVersionPropertiesBase + - Removed Interface ResourceInstanceViewStatus + - Removed Interface ResourceUriList + - Removed Interface ResourceWithOptionalLocation + - Removed Interface RoleInstance + - Removed Interface RoleInstanceNetworkProfile + - Removed Interface RoleInstanceProperties + - Removed Interface RoleInstances + - Removed Interface RoleInstanceView + - Removed Interface SharedGalleryImageList + - Removed Interface SharedGalleryImageVersionList + - Removed Interface SharedGalleryList + - Removed Interface SnapshotList + - Removed Interface StatusCodeCount + - Removed Interface UpdateDomain + - Removed Interface VirtualMachineScaleSetListOSUpgradeHistory + - Removed Type Alias AvailabilitySetSkuTypes + - Removed Type Alias CloudServiceSlotType + - Removed Type Alias CloudServiceUpgradeMode + - Removed Enum KnownAvailabilitySetSkuTypes + - Removed Enum KnownCloudServiceSlotType + - Removed Enum KnownCloudServiceUpgradeMode + - Enum KnownDiskSecurityTypes no longer has value ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey + - Enum KnownNetworkApiVersion no longer has value TwoThousandTwenty1101 + - Enum KnownNetworkApiVersion no longer has value TwoThousandTwentyTwo1101 + ## 23.3.0 (2026-01-07) ### Features Added diff --git a/sdk/compute/arm-compute/README.md b/sdk/compute/arm-compute/README.md index c15637da217d..03ac36ebd28b 100644 --- a/sdk/compute/arm-compute/README.md +++ b/sdk/compute/arm-compute/README.md @@ -4,10 +4,12 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f Compute Client -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-compute) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-compute) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-compute) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-compute) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute/samples) ## Getting started @@ -35,7 +37,7 @@ npm install @azure/arm-compute To create a client object to access the Azure ComputeManagement API, you will need the `endpoint` of your Azure ComputeManagement resource and a `credential`. The Azure ComputeManagement client can use Azure Active Directory credentials to authenticate. You can find the endpoint for your Azure ComputeManagement resource in the [Azure Portal][azure_portal]. -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). +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: @@ -63,14 +65,15 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { ComputeManagementClient } from "@azure/arm-compute"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ComputeManagementClient(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). @@ -96,7 +99,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute/samples) directory for detailed examples on how to use this library. ## Contributing @@ -106,9 +109,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/compute/arm-compute/_meta.json b/sdk/compute/arm-compute/_meta.json deleted file mode 100644 index d840da775374..000000000000 --- a/sdk/compute/arm-compute/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "217f332d35760fbe2034475504284f5d84bdd968", - "readme": "specification/compute/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=C:\\Users\\v-ziweichen.FAREAST\\Documents\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.54 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.15.1", - "use": "@autorest/typescript@6.0.54" -} diff --git a/sdk/compute/arm-compute/api-extractor.json b/sdk/compute/arm-compute/api-extractor.json index 16d81e2eb512..870d6d399477 100644 --- a/sdk/compute/arm-compute/api-extractor.json +++ b/sdk/compute/arm-compute/api-extractor.json @@ -1,3 +1 @@ -{ - "extends": "../../../api-extractor-base.json" -} +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/compute/arm-compute/eslint.config.mjs b/sdk/compute/arm-compute/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/compute/arm-compute/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/compute/arm-compute/metadata.json b/sdk/compute/arm-compute/metadata.json new file mode 100644 index 000000000000..a96643b78c76 --- /dev/null +++ b/sdk/compute/arm-compute/metadata.json @@ -0,0 +1,998 @@ +{ + "apiVersions": { + "Compute": "2025-11-01", + "ComputeDisk": "2025-01-02", + "ComputeGallery": "2025-03-03", + "ComputeSku": "2021-07-01" + }, + "emitterVersion": "0.52.2", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Compute", + "CrossLanguageDefinitionId": { + "@azure/arm-compute!OperationListResult:interface": "Azure.ResourceManager.CommonTypes.OperationListResult", + "@azure/arm-compute!Operation:interface": "Azure.ResourceManager.CommonTypes.Operation", + "@azure/arm-compute!OperationDisplay:interface": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "@azure/arm-compute!CloudError:interface": "Common.CloudError", + "@azure/arm-compute!ApiError:interface": "Common.ApiError", + "@azure/arm-compute!ApiErrorBase:interface": "Common.ApiErrorBase", + "@azure/arm-compute!InnerError:interface": "Common.InnerError", + "@azure/arm-compute!VirtualMachineScaleSet:interface": "Compute.VirtualMachineScaleSet", + "@azure/arm-compute!Sku:interface": "Compute.Sku", + "@azure/arm-compute!Plan:interface": "Compute.Plan", + "@azure/arm-compute!VirtualMachineScaleSetProperties:interface": "Compute.VirtualMachineScaleSetProperties", + "@azure/arm-compute!UpgradePolicy:interface": "Compute.UpgradePolicy", + "@azure/arm-compute!RollingUpgradePolicy:interface": "Compute.RollingUpgradePolicy", + "@azure/arm-compute!AutomaticOSUpgradePolicy:interface": "Compute.AutomaticOSUpgradePolicy", + "@azure/arm-compute!ScheduledEventsPolicy:interface": "Compute.ScheduledEventsPolicy", + "@azure/arm-compute!UserInitiatedRedeploy:interface": "Compute.UserInitiatedRedeploy", + "@azure/arm-compute!UserInitiatedReboot:interface": "Compute.UserInitiatedReboot", + "@azure/arm-compute!ScheduledEventsAdditionalPublishingTargets:interface": "Compute.ScheduledEventsAdditionalPublishingTargets", + "@azure/arm-compute!EventGridAndResourceGraph:interface": "Compute.EventGridAndResourceGraph", + "@azure/arm-compute!AllInstancesDown:interface": "Compute.AllInstancesDown", + "@azure/arm-compute!AutomaticRepairsPolicy:interface": "Compute.AutomaticRepairsPolicy", + "@azure/arm-compute!VirtualMachineScaleSetVMProfile:interface": "Compute.VirtualMachineScaleSetVMProfile", + "@azure/arm-compute!VirtualMachineScaleSetOSProfile:interface": "Compute.VirtualMachineScaleSetOSProfile", + "@azure/arm-compute!WindowsConfiguration:interface": "Compute.WindowsConfiguration", + "@azure/arm-compute!AdditionalUnattendContent:interface": "Compute.AdditionalUnattendContent", + "@azure/arm-compute!PatchSettings:interface": "Compute.PatchSettings", + "@azure/arm-compute!WindowsVMGuestPatchAutomaticByPlatformSettings:interface": "Compute.WindowsVMGuestPatchAutomaticByPlatformSettings", + "@azure/arm-compute!WinRMConfiguration:interface": "Compute.WinRMConfiguration", + "@azure/arm-compute!WinRMListener:interface": "Compute.WinRMListener", + "@azure/arm-compute!LinuxConfiguration:interface": "Compute.LinuxConfiguration", + "@azure/arm-compute!SshConfiguration:interface": "Compute.SshConfiguration", + "@azure/arm-compute!SshPublicKey:interface": "Compute.SshPublicKey", + "@azure/arm-compute!LinuxPatchSettings:interface": "Compute.LinuxPatchSettings", + "@azure/arm-compute!LinuxVMGuestPatchAutomaticByPlatformSettings:interface": "Compute.LinuxVMGuestPatchAutomaticByPlatformSettings", + "@azure/arm-compute!VaultSecretGroup:interface": "Compute.VaultSecretGroup", + "@azure/arm-compute!SubResource:interface": "Common.SubResource", + "@azure/arm-compute!VaultCertificate:interface": "Compute.VaultCertificate", + "@azure/arm-compute!VirtualMachineScaleSetStorageProfile:interface": "Compute.VirtualMachineScaleSetStorageProfile", + "@azure/arm-compute!ImageReference:interface": "Compute.ImageReference", + "@azure/arm-compute!VirtualMachineScaleSetOSDisk:interface": "Compute.VirtualMachineScaleSetOSDisk", + "@azure/arm-compute!DiffDiskSettings:interface": "Compute.DiffDiskSettings", + "@azure/arm-compute!VirtualHardDisk:interface": "Compute.VirtualHardDisk", + "@azure/arm-compute!VirtualMachineScaleSetManagedDiskParameters:interface": "Compute.VirtualMachineScaleSetManagedDiskParameters", + "@azure/arm-compute!DiskEncryptionSetParameters:interface": "Compute.DiskEncryptionSetParameters", + "@azure/arm-compute!VMDiskSecurityProfile:interface": "Compute.VMDiskSecurityProfile", + "@azure/arm-compute!VirtualMachineScaleSetDataDisk:interface": "Compute.VirtualMachineScaleSetDataDisk", + "@azure/arm-compute!VirtualMachineScaleSetNetworkProfile:interface": "Compute.VirtualMachineScaleSetNetworkProfile", + "@azure/arm-compute!ApiEntityReference:interface": "Compute.ApiEntityReference", + "@azure/arm-compute!VirtualMachineScaleSetNetworkConfiguration:interface": "Compute.VirtualMachineScaleSetNetworkConfiguration", + "@azure/arm-compute!VirtualMachineScaleSetNetworkConfigurationProperties:interface": "Compute.VirtualMachineScaleSetNetworkConfigurationProperties", + "@azure/arm-compute!VirtualMachineScaleSetNetworkConfigurationDnsSettings:interface": "Compute.VirtualMachineScaleSetNetworkConfigurationDnsSettings", + "@azure/arm-compute!VirtualMachineScaleSetIPConfiguration:interface": "Compute.VirtualMachineScaleSetIPConfiguration", + "@azure/arm-compute!VirtualMachineScaleSetIPConfigurationProperties:interface": "Compute.VirtualMachineScaleSetIPConfigurationProperties", + "@azure/arm-compute!VirtualMachineScaleSetPublicIPAddressConfiguration:interface": "Compute.VirtualMachineScaleSetPublicIPAddressConfiguration", + "@azure/arm-compute!VirtualMachineScaleSetPublicIPAddressConfigurationProperties:interface": "Compute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties", + "@azure/arm-compute!VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings:interface": "Compute.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings", + "@azure/arm-compute!VirtualMachineScaleSetIpTag:interface": "Compute.VirtualMachineScaleSetIpTag", + "@azure/arm-compute!PublicIPAddressSku:interface": "Compute.PublicIPAddressSku", + "@azure/arm-compute!SecurityProfile:interface": "Compute.SecurityProfile", + "@azure/arm-compute!UefiSettings:interface": "Compute.UefiSettings", + "@azure/arm-compute!EncryptionIdentity:interface": "Compute.EncryptionIdentity", + "@azure/arm-compute!ProxyAgentSettings:interface": "Compute.ProxyAgentSettings", + "@azure/arm-compute!HostEndpointSettings:interface": "Compute.HostEndpointSettings", + "@azure/arm-compute!DiagnosticsProfile:interface": "Compute.DiagnosticsProfile", + "@azure/arm-compute!BootDiagnostics:interface": "Compute.BootDiagnostics", + "@azure/arm-compute!VirtualMachineScaleSetExtensionProfile:interface": "Compute.VirtualMachineScaleSetExtensionProfile", + "@azure/arm-compute!VirtualMachineScaleSetExtension:interface": "Compute.VirtualMachineScaleSetExtension", + "@azure/arm-compute!VirtualMachineScaleSetExtensionProperties:interface": "Compute.VirtualMachineScaleSetExtensionProperties", + "@azure/arm-compute!KeyVaultSecretReference:interface": "Compute.KeyVaultSecretReference", + "@azure/arm-compute!SubResourceReadOnly:interface": "Common.SubResourceReadOnly", + "@azure/arm-compute!BillingProfile:interface": "Compute.BillingProfile", + "@azure/arm-compute!ScheduledEventsProfile:interface": "Compute.ScheduledEventsProfile", + "@azure/arm-compute!TerminateNotificationProfile:interface": "Compute.TerminateNotificationProfile", + "@azure/arm-compute!OSImageNotificationProfile:interface": "Compute.OSImageNotificationProfile", + "@azure/arm-compute!CapacityReservationProfile:interface": "Compute.CapacityReservationProfile", + "@azure/arm-compute!ApplicationProfile:interface": "Compute.ApplicationProfile", + "@azure/arm-compute!VMGalleryApplication:interface": "Compute.VMGalleryApplication", + "@azure/arm-compute!VirtualMachineScaleSetHardwareProfile:interface": "Compute.VirtualMachineScaleSetHardwareProfile", + "@azure/arm-compute!VMSizeProperties:interface": "Compute.VMSizeProperties", + "@azure/arm-compute!ServiceArtifactReference:interface": "Compute.ServiceArtifactReference", + "@azure/arm-compute!SecurityPostureReference:interface": "Compute.SecurityPostureReference", + "@azure/arm-compute!AdditionalCapabilities:interface": "Compute.AdditionalCapabilities", + "@azure/arm-compute!ScaleInPolicy:interface": "Compute.ScaleInPolicy", + "@azure/arm-compute!SpotRestorePolicy:interface": "Compute.SpotRestorePolicy", + "@azure/arm-compute!PriorityMixPolicy:interface": "Compute.PriorityMixPolicy", + "@azure/arm-compute!ResiliencyPolicy:interface": "Compute.ResiliencyPolicy", + "@azure/arm-compute!ResilientVMCreationPolicy:interface": "Compute.ResilientVMCreationPolicy", + "@azure/arm-compute!ResilientVMDeletionPolicy:interface": "Compute.ResilientVMDeletionPolicy", + "@azure/arm-compute!AutomaticZoneRebalancingPolicy:interface": "Compute.AutomaticZoneRebalancingPolicy", + "@azure/arm-compute!ZoneAllocationPolicy:interface": "Compute.ZoneAllocationPolicy", + "@azure/arm-compute!MaxInstancePercentPerZonePolicy:interface": "Compute.MaxInstancePercentPerZonePolicy", + "@azure/arm-compute!OperationRecoverySettings:interface": "Compute.OperationRecoverySettings", + "@azure/arm-compute!RestartRecoveryPolicy:interface": "Compute.RestartRecoveryPolicy", + "@azure/arm-compute!StartRecoveryPolicy:interface": "Compute.StartRecoveryPolicy", + "@azure/arm-compute!ReimageRecoveryPolicy:interface": "Compute.ReimageRecoveryPolicy", + "@azure/arm-compute!SkuProfile:interface": "Compute.SkuProfile", + "@azure/arm-compute!SkuProfileVMSize:interface": "Compute.SkuProfileVMSize", + "@azure/arm-compute!LifecycleHooksProfile:interface": "Compute.LifecycleHooksProfile", + "@azure/arm-compute!LifecycleHook:interface": "Compute.LifecycleHook", + "@azure/arm-compute!ExternalHealthPolicy:interface": "Compute.ExternalHealthPolicy", + "@azure/arm-compute!VirtualMachineScaleSetIdentity:interface": "Compute.VirtualMachineScaleSetIdentity", + "@azure/arm-compute!UserAssignedIdentitiesValue:interface": "Common.UserAssignedIdentitiesValue", + "@azure/arm-compute!ExtendedLocation:interface": "Common.ExtendedLocation", + "@azure/arm-compute!Placement:interface": "Compute.Placement", + "@azure/arm-compute!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", + "@azure/arm-compute!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-compute!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-compute!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-compute!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-compute!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-compute!VirtualMachineScaleSetUpdate:interface": "Compute.VirtualMachineScaleSetUpdate", + "@azure/arm-compute!VirtualMachineScaleSetUpdateProperties:interface": "Compute.VirtualMachineScaleSetUpdateProperties", + "@azure/arm-compute!VirtualMachineScaleSetUpdateVMProfile:interface": "Compute.VirtualMachineScaleSetUpdateVMProfile", + "@azure/arm-compute!VirtualMachineScaleSetUpdateOSProfile:interface": "Compute.VirtualMachineScaleSetUpdateOSProfile", + "@azure/arm-compute!VirtualMachineScaleSetUpdateStorageProfile:interface": "Compute.VirtualMachineScaleSetUpdateStorageProfile", + "@azure/arm-compute!VirtualMachineScaleSetUpdateOSDisk:interface": "Compute.VirtualMachineScaleSetUpdateOSDisk", + "@azure/arm-compute!VirtualMachineScaleSetUpdateNetworkProfile:interface": "Compute.VirtualMachineScaleSetUpdateNetworkProfile", + "@azure/arm-compute!VirtualMachineScaleSetUpdateNetworkConfiguration:interface": "Compute.VirtualMachineScaleSetUpdateNetworkConfiguration", + "@azure/arm-compute!VirtualMachineScaleSetUpdateNetworkConfigurationProperties:interface": "Compute.VirtualMachineScaleSetUpdateNetworkConfigurationProperties", + "@azure/arm-compute!VirtualMachineScaleSetUpdateIPConfiguration:interface": "Compute.VirtualMachineScaleSetUpdateIPConfiguration", + "@azure/arm-compute!VirtualMachineScaleSetUpdateIPConfigurationProperties:interface": "Compute.VirtualMachineScaleSetUpdateIPConfigurationProperties", + "@azure/arm-compute!VirtualMachineScaleSetUpdatePublicIPAddressConfiguration:interface": "Compute.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration", + "@azure/arm-compute!VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties:interface": "Compute.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties", + "@azure/arm-compute!SecurityPostureReferenceUpdate:interface": "Compute.SecurityPostureReferenceUpdate", + "@azure/arm-compute!UpdateResource:interface": "Compute.UpdateResource", + "@azure/arm-compute!VirtualMachineScaleSetListResult:interface": "Compute.VirtualMachineScaleSetListResult", + "@azure/arm-compute!VirtualMachineScaleSetListWithLinkResult:interface": "Compute.VirtualMachineScaleSetListWithLinkResult", + "@azure/arm-compute!VirtualMachineScaleSetVMInstanceIDs:interface": "Compute.VirtualMachineScaleSetVMInstanceIDs", + "@azure/arm-compute!VMScaleSetConvertToSinglePlacementGroupInput:interface": "Compute.VMScaleSetConvertToSinglePlacementGroupInput", + "@azure/arm-compute!VirtualMachineScaleSetVMInstanceRequiredIDs:interface": "Compute.VirtualMachineScaleSetVMInstanceRequiredIDs", + "@azure/arm-compute!RecoveryWalkResponse:interface": "Compute.RecoveryWalkResponse", + "@azure/arm-compute!VirtualMachineScaleSetInstanceView:interface": "Compute.VirtualMachineScaleSetInstanceView", + "@azure/arm-compute!VirtualMachineScaleSetInstanceViewStatusesSummary:interface": "Compute.VirtualMachineScaleSetInstanceViewStatusesSummary", + "@azure/arm-compute!VirtualMachineStatusCodeCount:interface": "Compute.VirtualMachineStatusCodeCount", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionsSummary:interface": "Compute.VirtualMachineScaleSetVMExtensionsSummary", + "@azure/arm-compute!InstanceViewStatus:interface": "Compute.InstanceViewStatus", + "@azure/arm-compute!OrchestrationServiceSummary:interface": "Compute.OrchestrationServiceSummary", + "@azure/arm-compute!VirtualMachineScaleSetListOSUpgradeHistory:interface": "Compute.VirtualMachineScaleSetListOSUpgradeHistory", + "@azure/arm-compute!UpgradeOperationHistoricalStatusInfo:interface": "Compute.UpgradeOperationHistoricalStatusInfo", + "@azure/arm-compute!UpgradeOperationHistoricalStatusInfoProperties:interface": "Compute.UpgradeOperationHistoricalStatusInfoProperties", + "@azure/arm-compute!UpgradeOperationHistoryStatus:interface": "Compute.UpgradeOperationHistoryStatus", + "@azure/arm-compute!RollingUpgradeProgressInfo:interface": "Compute.RollingUpgradeProgressInfo", + "@azure/arm-compute!RollbackStatusInfo:interface": "Compute.RollbackStatusInfo", + "@azure/arm-compute!VirtualMachineScaleSetReimageParameters:interface": "Compute.VirtualMachineScaleSetReimageParameters", + "@azure/arm-compute!VirtualMachineScaleSetVMReimageParameters:interface": "Compute.VirtualMachineScaleSetVMReimageParameters", + "@azure/arm-compute!VirtualMachineReimageParameters:interface": "Compute.VirtualMachineReimageParameters", + "@azure/arm-compute!OSProfileProvisioningData:interface": "Compute.OSProfileProvisioningData", + "@azure/arm-compute!OrchestrationServiceStateInput:interface": "Compute.OrchestrationServiceStateInput", + "@azure/arm-compute!VirtualMachineScaleSetListSkusResult:interface": "Compute.VirtualMachineScaleSetListSkusResult", + "@azure/arm-compute!VirtualMachineScaleSetSku:interface": "Compute.VirtualMachineScaleSetSku", + "@azure/arm-compute!VirtualMachineScaleSetSkuCapacity:interface": "Compute.VirtualMachineScaleSetSkuCapacity", + "@azure/arm-compute!VMScaleSetScaleOutInput:interface": "Compute.VMScaleSetScaleOutInput", + "@azure/arm-compute!VMScaleSetScaleOutInputProperties:interface": "Compute.VMScaleSetScaleOutInputProperties", + "@azure/arm-compute!VirtualMachineScaleSetExtensionUpdate:interface": "Compute.VirtualMachineScaleSetExtensionUpdate", + "@azure/arm-compute!VirtualMachineScaleSetExtensionListResult:interface": "Compute.VirtualMachineScaleSetExtensionListResult", + "@azure/arm-compute!VMScaleSetLifecycleHookEvent:interface": "Compute.VMScaleSetLifecycleHookEvent", + "@azure/arm-compute!VMScaleSetLifecycleHookEventProperties:interface": "Compute.VMScaleSetLifecycleHookEventProperties", + "@azure/arm-compute!VMScaleSetLifecycleHookEventTargetResource:interface": "Compute.VMScaleSetLifecycleHookEventTargetResource", + "@azure/arm-compute!VMScaleSetLifecycleHookEventAdditionalContext:interface": "Compute.VMScaleSetLifecycleHookEventAdditionalContext", + "@azure/arm-compute!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-compute!VMScaleSetLifecycleHookEventUpdate:interface": "Compute.VMScaleSetLifecycleHookEventUpdate", + "@azure/arm-compute!VMScaleSetLifecycleHookEventListResult:interface": "Compute.VMScaleSetLifecycleHookEventListResult", + "@azure/arm-compute!VirtualMachineScaleSetVMExtension:interface": "Compute.VirtualMachineScaleSetVMExtension", + "@azure/arm-compute!VirtualMachineExtensionProperties:interface": "Compute.VirtualMachineExtensionProperties", + "@azure/arm-compute!VirtualMachineExtensionInstanceView:interface": "Compute.VirtualMachineExtensionInstanceView", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionUpdate:interface": "Compute.VirtualMachineScaleSetVMExtensionUpdate", + "@azure/arm-compute!VirtualMachineExtensionUpdateProperties:interface": "Compute.VirtualMachineExtensionUpdateProperties", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionsListResult:interface": "Compute.VirtualMachineScaleSetVMExtensionsListResult", + "@azure/arm-compute!VirtualMachine:interface": "Compute.VirtualMachine", + "@azure/arm-compute!VirtualMachineProperties:interface": "Compute.VirtualMachineProperties", + "@azure/arm-compute!HardwareProfile:interface": "Compute.HardwareProfile", + "@azure/arm-compute!StorageProfile:interface": "Compute.StorageProfile", + "@azure/arm-compute!OSDisk:interface": "Compute.OSDisk", + "@azure/arm-compute!DiskEncryptionSettings:interface": "Compute.DiskEncryptionSettings", + "@azure/arm-compute!KeyVaultKeyReference:interface": "Compute.KeyVaultKeyReference", + "@azure/arm-compute!ManagedDiskParameters:interface": "Compute.ManagedDiskParameters", + "@azure/arm-compute!DataDisk:interface": "Compute.DataDisk", + "@azure/arm-compute!OSProfile:interface": "Compute.OSProfile", + "@azure/arm-compute!NetworkProfile:interface": "Compute.NetworkProfile", + "@azure/arm-compute!NetworkInterfaceReference:interface": "Compute.NetworkInterfaceReference", + "@azure/arm-compute!NetworkInterfaceReferenceProperties:interface": "Compute.NetworkInterfaceReferenceProperties", + "@azure/arm-compute!VirtualMachineNetworkInterfaceConfiguration:interface": "Compute.VirtualMachineNetworkInterfaceConfiguration", + "@azure/arm-compute!VirtualMachineNetworkInterfaceConfigurationProperties:interface": "Compute.VirtualMachineNetworkInterfaceConfigurationProperties", + "@azure/arm-compute!VirtualMachineNetworkInterfaceDnsSettingsConfiguration:interface": "Compute.VirtualMachineNetworkInterfaceDnsSettingsConfiguration", + "@azure/arm-compute!VirtualMachineNetworkInterfaceIPConfiguration:interface": "Compute.VirtualMachineNetworkInterfaceIPConfiguration", + "@azure/arm-compute!VirtualMachineNetworkInterfaceIPConfigurationProperties:interface": "Compute.VirtualMachineNetworkInterfaceIPConfigurationProperties", + "@azure/arm-compute!VirtualMachinePublicIPAddressConfiguration:interface": "Compute.VirtualMachinePublicIPAddressConfiguration", + "@azure/arm-compute!VirtualMachinePublicIPAddressConfigurationProperties:interface": "Compute.VirtualMachinePublicIPAddressConfigurationProperties", + "@azure/arm-compute!VirtualMachinePublicIPAddressDnsSettingsConfiguration:interface": "Compute.VirtualMachinePublicIPAddressDnsSettingsConfiguration", + "@azure/arm-compute!VirtualMachineIpTag:interface": "Compute.VirtualMachineIpTag", + "@azure/arm-compute!VirtualMachineInstanceView:interface": "Compute.VirtualMachineInstanceView", + "@azure/arm-compute!VirtualMachineAgentInstanceView:interface": "Compute.VirtualMachineAgentInstanceView", + "@azure/arm-compute!VirtualMachineExtensionHandlerInstanceView:interface": "Compute.VirtualMachineExtensionHandlerInstanceView", + "@azure/arm-compute!MaintenanceRedeployStatus:interface": "Compute.MaintenanceRedeployStatus", + "@azure/arm-compute!DiskInstanceView:interface": "Compute.DiskInstanceView", + "@azure/arm-compute!VirtualMachineHealthStatus:interface": "Compute.VirtualMachineHealthStatus", + "@azure/arm-compute!BootDiagnosticsInstanceView:interface": "Compute.BootDiagnosticsInstanceView", + "@azure/arm-compute!VirtualMachinePatchStatus:interface": "Compute.VirtualMachinePatchStatus", + "@azure/arm-compute!AvailablePatchSummary:interface": "Compute.AvailablePatchSummary", + "@azure/arm-compute!LastPatchInstallationSummary:interface": "Compute.LastPatchInstallationSummary", + "@azure/arm-compute!ResiliencyProfile:interface": "Compute.ResiliencyProfile", + "@azure/arm-compute!ZoneMovement:interface": "Compute.ZoneMovement", + "@azure/arm-compute!VirtualMachineExtension:interface": "Compute.VirtualMachineExtension", + "@azure/arm-compute!VirtualMachineIdentity:interface": "Compute.VirtualMachineIdentity", + "@azure/arm-compute!VirtualMachineUpdate:interface": "Compute.VirtualMachineUpdate", + "@azure/arm-compute!VirtualMachineListResult:interface": "Compute.VirtualMachineListResult", + "@azure/arm-compute!VirtualMachineAssessPatchesResult:interface": "Compute.VirtualMachineAssessPatchesResult", + "@azure/arm-compute!VirtualMachineSoftwarePatchProperties:interface": "Compute.VirtualMachineSoftwarePatchProperties", + "@azure/arm-compute!AttachDetachDataDisksRequest:interface": "Compute.AttachDetachDataDisksRequest", + "@azure/arm-compute!DataDisksToAttach:interface": "Compute.DataDisksToAttach", + "@azure/arm-compute!DataDisksToDetach:interface": "Compute.DataDisksToDetach", + "@azure/arm-compute!VirtualMachineCaptureParameters:interface": "Compute.VirtualMachineCaptureParameters", + "@azure/arm-compute!VirtualMachineCaptureResult:interface": "Compute.VirtualMachineCaptureResult", + "@azure/arm-compute!VirtualMachineInstallPatchesParameters:interface": "Compute.VirtualMachineInstallPatchesParameters", + "@azure/arm-compute!WindowsParameters:interface": "Compute.WindowsParameters", + "@azure/arm-compute!LinuxParameters:interface": "Compute.LinuxParameters", + "@azure/arm-compute!VirtualMachineInstallPatchesResult:interface": "Compute.VirtualMachineInstallPatchesResult", + "@azure/arm-compute!PatchInstallationDetail:interface": "Compute.PatchInstallationDetail", + "@azure/arm-compute!RetrieveBootDiagnosticsDataResult:interface": "Compute.RetrieveBootDiagnosticsDataResult", + "@azure/arm-compute!VirtualMachineSizeListResult:interface": "Compute.VirtualMachineSizeListResult", + "@azure/arm-compute!VirtualMachineSize:interface": "Compute.VirtualMachineSize", + "@azure/arm-compute!RunCommandInput:interface": "Compute.RunCommandInput", + "@azure/arm-compute!RunCommandInputParameter:interface": "Compute.RunCommandInputParameter", + "@azure/arm-compute!RunCommandResult:interface": "Compute.RunCommandResult", + "@azure/arm-compute!MigrateVMToVirtualMachineScaleSetInput:interface": "Compute.MigrateVMToVirtualMachineScaleSetInput", + "@azure/arm-compute!VirtualMachineExtensionUpdate:interface": "Compute.VirtualMachineExtensionUpdate", + "@azure/arm-compute!VirtualMachineExtensionsListResult:interface": "Compute.VirtualMachineExtensionsListResult", + "@azure/arm-compute!VirtualMachineExtensionImage:interface": "Compute.VirtualMachineExtensionImage", + "@azure/arm-compute!VirtualMachineExtensionImageProperties:interface": "Compute.VirtualMachineExtensionImageProperties", + "@azure/arm-compute!AvailabilitySet:interface": "Compute.AvailabilitySet", + "@azure/arm-compute!AvailabilitySetProperties:interface": "Compute.AvailabilitySetProperties", + "@azure/arm-compute!VirtualMachineScaleSetMigrationInfo:interface": "Compute.VirtualMachineScaleSetMigrationInfo", + "@azure/arm-compute!DefaultVirtualMachineScaleSetInfo:interface": "Compute.DefaultVirtualMachineScaleSetInfo", + "@azure/arm-compute!AvailabilitySetUpdate:interface": "Compute.AvailabilitySetUpdate", + "@azure/arm-compute!AvailabilitySetListResult:interface": "Compute.AvailabilitySetListResult", + "@azure/arm-compute!MigrateToVirtualMachineScaleSetInput:interface": "Compute.MigrateToVirtualMachineScaleSetInput", + "@azure/arm-compute!ConvertToVirtualMachineScaleSetInput:interface": "Compute.ConvertToVirtualMachineScaleSetInput", + "@azure/arm-compute!ProximityPlacementGroup:interface": "Compute.ProximityPlacementGroup", + "@azure/arm-compute!ProximityPlacementGroupProperties:interface": "Compute.ProximityPlacementGroupProperties", + "@azure/arm-compute!SubResourceWithColocationStatus:interface": "Compute.SubResourceWithColocationStatus", + "@azure/arm-compute!ProximityPlacementGroupPropertiesIntent:interface": "Compute.ProximityPlacementGroupPropertiesIntent", + "@azure/arm-compute!ProximityPlacementGroupUpdate:interface": "Compute.ProximityPlacementGroupUpdate", + "@azure/arm-compute!ProximityPlacementGroupListResult:interface": "Compute.ProximityPlacementGroupListResult", + "@azure/arm-compute!DedicatedHostGroup:interface": "Compute.DedicatedHostGroup", + "@azure/arm-compute!DedicatedHostGroupProperties:interface": "Compute.DedicatedHostGroupProperties", + "@azure/arm-compute!DedicatedHostGroupInstanceView:interface": "Compute.DedicatedHostGroupInstanceView", + "@azure/arm-compute!DedicatedHostInstanceViewWithName:interface": "Compute.DedicatedHostInstanceViewWithName", + "@azure/arm-compute!DedicatedHostInstanceView:interface": "Compute.DedicatedHostInstanceView", + "@azure/arm-compute!DedicatedHostAvailableCapacity:interface": "Compute.DedicatedHostAvailableCapacity", + "@azure/arm-compute!DedicatedHostAllocatableVM:interface": "Compute.DedicatedHostAllocatableVM", + "@azure/arm-compute!DedicatedHostGroupPropertiesAdditionalCapabilities:interface": "Compute.DedicatedHostGroupPropertiesAdditionalCapabilities", + "@azure/arm-compute!DedicatedHostGroupUpdate:interface": "Compute.DedicatedHostGroupUpdate", + "@azure/arm-compute!DedicatedHostGroupListResult:interface": "Compute.DedicatedHostGroupListResult", + "@azure/arm-compute!DedicatedHost:interface": "Compute.DedicatedHost", + "@azure/arm-compute!DedicatedHostProperties:interface": "Compute.DedicatedHostProperties", + "@azure/arm-compute!DedicatedHostUpdate:interface": "Compute.DedicatedHostUpdate", + "@azure/arm-compute!DedicatedHostListResult:interface": "Compute.DedicatedHostListResult", + "@azure/arm-compute!DedicatedHostSizeListResult:interface": "Compute.DedicatedHostSizeListResult", + "@azure/arm-compute!Image:interface": "Compute.Image", + "@azure/arm-compute!ImageProperties:interface": "Compute.ImageProperties", + "@azure/arm-compute!ImageStorageProfile:interface": "Compute.ImageStorageProfile", + "@azure/arm-compute!ImageOSDisk:interface": "Compute.ImageOSDisk", + "@azure/arm-compute!ImageDisk:interface": "Compute.ImageDisk", + "@azure/arm-compute!ImageDataDisk:interface": "Compute.ImageDataDisk", + "@azure/arm-compute!ImageUpdate:interface": "Compute.ImageUpdate", + "@azure/arm-compute!ImageListResult:interface": "Compute.ImageListResult", + "@azure/arm-compute!RestorePointCollection:interface": "Compute.RestorePointCollection", + "@azure/arm-compute!RestorePointCollectionProperties:interface": "Compute.RestorePointCollectionProperties", + "@azure/arm-compute!RestorePointCollectionSourceProperties:interface": "Compute.RestorePointCollectionSourceProperties", + "@azure/arm-compute!RestorePoint:interface": "Compute.RestorePoint", + "@azure/arm-compute!RestorePointProperties:interface": "Compute.RestorePointProperties", + "@azure/arm-compute!RestorePointSourceMetadata:interface": "Compute.RestorePointSourceMetadata", + "@azure/arm-compute!RestorePointSourceVMStorageProfile:interface": "Compute.RestorePointSourceVMStorageProfile", + "@azure/arm-compute!RestorePointSourceVMOSDisk:interface": "Compute.RestorePointSourceVMOSDisk", + "@azure/arm-compute!DiskRestorePointAttributes:interface": "Compute.DiskRestorePointAttributes", + "@azure/arm-compute!RestorePointEncryption:interface": "Compute.RestorePointEncryption", + "@azure/arm-compute!RestorePointSourceVMDataDisk:interface": "Compute.RestorePointSourceVMDataDisk", + "@azure/arm-compute!RestorePointInstanceView:interface": "Compute.RestorePointInstanceView", + "@azure/arm-compute!DiskRestorePointInstanceView:interface": "Compute.DiskRestorePointInstanceView", + "@azure/arm-compute!DiskRestorePointReplicationStatus:interface": "Compute.DiskRestorePointReplicationStatus", + "@azure/arm-compute!RestorePointCollectionUpdate:interface": "Compute.RestorePointCollectionUpdate", + "@azure/arm-compute!RestorePointCollectionListResult:interface": "Compute.RestorePointCollectionListResult", + "@azure/arm-compute!CapacityReservationGroup:interface": "Compute.CapacityReservationGroup", + "@azure/arm-compute!CapacityReservationGroupProperties:interface": "Compute.CapacityReservationGroupProperties", + "@azure/arm-compute!CapacityReservationGroupInstanceView:interface": "Compute.CapacityReservationGroupInstanceView", + "@azure/arm-compute!CapacityReservationInstanceViewWithName:interface": "Compute.CapacityReservationInstanceViewWithName", + "@azure/arm-compute!CapacityReservationInstanceView:interface": "Compute.CapacityReservationInstanceView", + "@azure/arm-compute!CapacityReservationUtilization:interface": "Compute.CapacityReservationUtilization", + "@azure/arm-compute!ResourceSharingProfile:interface": "Compute.ResourceSharingProfile", + "@azure/arm-compute!CapacityReservationGroupUpdate:interface": "Compute.CapacityReservationGroupUpdate", + "@azure/arm-compute!CapacityReservationGroupListResult:interface": "Compute.CapacityReservationGroupListResult", + "@azure/arm-compute!CapacityReservation:interface": "Compute.CapacityReservation", + "@azure/arm-compute!CapacityReservationProperties:interface": "Compute.CapacityReservationProperties", + "@azure/arm-compute!ScheduleProfile:interface": "Compute.ScheduleProfile", + "@azure/arm-compute!CapacityReservationUpdate:interface": "Compute.CapacityReservationUpdate", + "@azure/arm-compute!CapacityReservationListResult:interface": "Compute.CapacityReservationListResult", + "@azure/arm-compute!VirtualMachineRunCommand:interface": "Compute.VirtualMachineRunCommand", + "@azure/arm-compute!VirtualMachineRunCommandProperties:interface": "Compute.VirtualMachineRunCommandProperties", + "@azure/arm-compute!VirtualMachineRunCommandScriptSource:interface": "Compute.VirtualMachineRunCommandScriptSource", + "@azure/arm-compute!RunCommandManagedIdentity:interface": "Compute.RunCommandManagedIdentity", + "@azure/arm-compute!VirtualMachineRunCommandInstanceView:interface": "Compute.VirtualMachineRunCommandInstanceView", + "@azure/arm-compute!VirtualMachineRunCommandUpdate:interface": "Compute.VirtualMachineRunCommandUpdate", + "@azure/arm-compute!VirtualMachineRunCommandsListResult:interface": "Compute.VirtualMachineRunCommandsListResult", + "@azure/arm-compute!RunCommandListResult:interface": "Compute.RunCommandListResult", + "@azure/arm-compute!RunCommandDocumentBase:interface": "Compute.RunCommandDocumentBase", + "@azure/arm-compute!RunCommandDocument:interface": "Compute.RunCommandDocument", + "@azure/arm-compute!RunCommandParameterDefinition:interface": "Compute.RunCommandParameterDefinition", + "@azure/arm-compute!Disk:interface": "ComputeDisk.Disk", + "@azure/arm-compute!DiskProperties:interface": "ComputeDisk.DiskProperties", + "@azure/arm-compute!DiskPurchasePlan:interface": "ComputeDisk.DiskPurchasePlan", + "@azure/arm-compute!SupportedCapabilities:interface": "ComputeDisk.SupportedCapabilities", + "@azure/arm-compute!CreationData:interface": "ComputeDisk.CreationData", + "@azure/arm-compute!ImageDiskReference:interface": "ComputeDisk.ImageDiskReference", + "@azure/arm-compute!EncryptionSettingsCollection:interface": "ComputeDisk.EncryptionSettingsCollection", + "@azure/arm-compute!EncryptionSettingsElement:interface": "ComputeDisk.EncryptionSettingsElement", + "@azure/arm-compute!KeyVaultAndSecretReference:interface": "ComputeDisk.KeyVaultAndSecretReference", + "@azure/arm-compute!SourceVault:interface": "ComputeDisk.SourceVault", + "@azure/arm-compute!KeyVaultAndKeyReference:interface": "ComputeDisk.KeyVaultAndKeyReference", + "@azure/arm-compute!Encryption:interface": "ComputeDisk.Encryption", + "@azure/arm-compute!ShareInfoElement:interface": "ComputeDisk.ShareInfoElement", + "@azure/arm-compute!PropertyUpdatesInProgress:interface": "ComputeDisk.PropertyUpdatesInProgress", + "@azure/arm-compute!DiskSecurityProfile:interface": "ComputeDisk.DiskSecurityProfile", + "@azure/arm-compute!AvailabilityPolicy:interface": "ComputeDisk.AvailabilityPolicy", + "@azure/arm-compute!DiskSku:interface": "ComputeDisk.DiskSku", + "@azure/arm-compute!DiskUpdate:interface": "ComputeDisk.DiskUpdate", + "@azure/arm-compute!DiskUpdateProperties:interface": "ComputeDisk.DiskUpdateProperties", + "@azure/arm-compute!DiskList:interface": "ComputeDisk.DiskList", + "@azure/arm-compute!GrantAccessData:interface": "ComputeDisk.GrantAccessData", + "@azure/arm-compute!AccessUri:interface": "ComputeDisk.AccessUri", + "@azure/arm-compute!DiskAccess:interface": "ComputeDisk.DiskAccess", + "@azure/arm-compute!DiskAccessProperties:interface": "ComputeDisk.DiskAccessProperties", + "@azure/arm-compute!PrivateEndpointConnection:interface": "ComputeDisk.PrivateEndpointConnection", + "@azure/arm-compute!PrivateEndpointConnectionProperties:interface": "ComputeDisk.PrivateEndpointConnectionProperties", + "@azure/arm-compute!PrivateEndpoint:interface": "ComputeDisk.PrivateEndpoint", + "@azure/arm-compute!PrivateLinkServiceConnectionState:interface": "ComputeDisk.PrivateLinkServiceConnectionState", + "@azure/arm-compute!DiskAccessUpdate:interface": "ComputeDisk.DiskAccessUpdate", + "@azure/arm-compute!DiskAccessList:interface": "ComputeDisk.DiskAccessList", + "@azure/arm-compute!PrivateLinkResourceListResult:interface": "ComputeDisk.PrivateLinkResourceListResult", + "@azure/arm-compute!PrivateLinkResource:interface": "ComputeDisk.PrivateLinkResource", + "@azure/arm-compute!PrivateLinkResourceProperties:interface": "ComputeDisk.PrivateLinkResourceProperties", + "@azure/arm-compute!PrivateEndpointConnectionListResult:interface": "ComputeDisk.PrivateEndpointConnectionListResult", + "@azure/arm-compute!DiskEncryptionSet:interface": "ComputeDisk.DiskEncryptionSet", + "@azure/arm-compute!EncryptionSetProperties:interface": "ComputeDisk.EncryptionSetProperties", + "@azure/arm-compute!KeyForDiskEncryptionSet:interface": "ComputeDisk.KeyForDiskEncryptionSet", + "@azure/arm-compute!EncryptionSetIdentity:interface": "ComputeDisk.EncryptionSetIdentity", + "@azure/arm-compute!DiskEncryptionSetUpdate:interface": "ComputeDisk.DiskEncryptionSetUpdate", + "@azure/arm-compute!DiskEncryptionSetUpdateProperties:interface": "ComputeDisk.DiskEncryptionSetUpdateProperties", + "@azure/arm-compute!DiskEncryptionSetList:interface": "ComputeDisk.DiskEncryptionSetList", + "@azure/arm-compute!ResourceUriList:interface": "ComputeDisk.ResourceUriList", + "@azure/arm-compute!Snapshot:interface": "ComputeDisk.Snapshot", + "@azure/arm-compute!SnapshotProperties:interface": "ComputeDisk.SnapshotProperties", + "@azure/arm-compute!CopyCompletionError:interface": "ComputeDisk.CopyCompletionError", + "@azure/arm-compute!SnapshotSku:interface": "ComputeDisk.SnapshotSku", + "@azure/arm-compute!SnapshotUpdate:interface": "ComputeDisk.SnapshotUpdate", + "@azure/arm-compute!SnapshotUpdateProperties:interface": "ComputeDisk.SnapshotUpdateProperties", + "@azure/arm-compute!SnapshotList:interface": "ComputeDisk.SnapshotList", + "@azure/arm-compute!Gallery:interface": "ComputeGallery.Gallery", + "@azure/arm-compute!GalleryProperties:interface": "ComputeGallery.GalleryProperties", + "@azure/arm-compute!GalleryIdentifier:interface": "ComputeGallery.GalleryIdentifier", + "@azure/arm-compute!SharingProfile:interface": "ComputeGallery.SharingProfile", + "@azure/arm-compute!SharingProfileGroup:interface": "ComputeGallery.SharingProfileGroup", + "@azure/arm-compute!CommunityGalleryInfo:interface": "ComputeGallery.CommunityGalleryInfo", + "@azure/arm-compute!SoftDeletePolicy:interface": "ComputeGallery.SoftDeletePolicy", + "@azure/arm-compute!SharingStatus:interface": "ComputeGallery.SharingStatus", + "@azure/arm-compute!RegionalSharingStatus:interface": "ComputeGallery.RegionalSharingStatus", + "@azure/arm-compute!GalleryIdentity:interface": "ComputeGallery.GalleryIdentity", + "@azure/arm-compute!GalleryUpdate:interface": "ComputeGallery.GalleryUpdate", + "@azure/arm-compute!UpdateResourceDefinition:interface": "ComputeGallery.UpdateResourceDefinition", + "@azure/arm-compute!GalleryList:interface": "ComputeGallery.GalleryList", + "@azure/arm-compute!ImageVersionSecurityProfile:interface": "ComputeGallery.ImageVersionSecurityProfile", + "@azure/arm-compute!GalleryImageVersionUefiSettings:interface": "ComputeGallery.GalleryImageVersionUefiSettings", + "@azure/arm-compute!UefiKeySignatures:interface": "ComputeGallery.UefiKeySignatures", + "@azure/arm-compute!UefiKey:interface": "ComputeGallery.UefiKey", + "@azure/arm-compute!GalleryImage:interface": "ComputeGallery.GalleryImage", + "@azure/arm-compute!GalleryImageProperties:interface": "ComputeGallery.GalleryImageProperties", + "@azure/arm-compute!GalleryImageIdentifier:interface": "ComputeGallery.GalleryImageIdentifier", + "@azure/arm-compute!RecommendedMachineConfiguration:interface": "ComputeGallery.RecommendedMachineConfiguration", + "@azure/arm-compute!ResourceRange:interface": "ComputeGallery.ResourceRange", + "@azure/arm-compute!Disallowed:interface": "ComputeGallery.Disallowed", + "@azure/arm-compute!ImagePurchasePlan:interface": "ComputeGallery.ImagePurchasePlan", + "@azure/arm-compute!GalleryImageFeature:interface": "ComputeGallery.GalleryImageFeature", + "@azure/arm-compute!GalleryImageUpdate:interface": "ComputeGallery.GalleryImageUpdate", + "@azure/arm-compute!GalleryImageList:interface": "ComputeGallery.GalleryImageList", + "@azure/arm-compute!GalleryImageVersion:interface": "ComputeGallery.GalleryImageVersion", + "@azure/arm-compute!GalleryImageVersionProperties:interface": "ComputeGallery.GalleryImageVersionProperties", + "@azure/arm-compute!GalleryImageVersionPublishingProfile:interface": "ComputeGallery.GalleryImageVersionPublishingProfile", + "@azure/arm-compute!GalleryArtifactPublishingProfileBase:interface": "ComputeGallery.GalleryArtifactPublishingProfileBase", + "@azure/arm-compute!TargetRegion:interface": "ComputeGallery.TargetRegion", + "@azure/arm-compute!EncryptionImages:interface": "ComputeGallery.EncryptionImages", + "@azure/arm-compute!OSDiskImageEncryption:interface": "ComputeGallery.OSDiskImageEncryption", + "@azure/arm-compute!OSDiskImageSecurityProfile:interface": "ComputeGallery.OSDiskImageSecurityProfile", + "@azure/arm-compute!DiskImageEncryption:interface": "ComputeGallery.DiskImageEncryption", + "@azure/arm-compute!DataDiskImageEncryption:interface": "ComputeGallery.DataDiskImageEncryption", + "@azure/arm-compute!AdditionalReplicaSet:interface": "ComputeGallery.AdditionalReplicaSet", + "@azure/arm-compute!GalleryTargetExtendedLocation:interface": "ComputeGallery.GalleryTargetExtendedLocation", + "@azure/arm-compute!GalleryExtendedLocation:interface": "ComputeGallery.GalleryExtendedLocation", + "@azure/arm-compute!GalleryImageVersionStorageProfile:interface": "ComputeGallery.GalleryImageVersionStorageProfile", + "@azure/arm-compute!GalleryArtifactVersionFullSource:interface": "ComputeGallery.GalleryArtifactVersionFullSource", + "@azure/arm-compute!GalleryArtifactVersionSource:interface": "ComputeGallery.GalleryArtifactVersionSource", + "@azure/arm-compute!GalleryOSDiskImage:interface": "ComputeGallery.GalleryOSDiskImage", + "@azure/arm-compute!GalleryDiskImage:interface": "ComputeGallery.GalleryDiskImage", + "@azure/arm-compute!GalleryDiskImageSource:interface": "ComputeGallery.GalleryDiskImageSource", + "@azure/arm-compute!GalleryDataDiskImage:interface": "ComputeGallery.GalleryDataDiskImage", + "@azure/arm-compute!GalleryImageVersionSafetyProfile:interface": "ComputeGallery.GalleryImageVersionSafetyProfile", + "@azure/arm-compute!PolicyViolation:interface": "ComputeGallery.PolicyViolation", + "@azure/arm-compute!GalleryArtifactSafetyProfileBase:interface": "ComputeGallery.GalleryArtifactSafetyProfileBase", + "@azure/arm-compute!ReplicationStatus:interface": "ComputeGallery.ReplicationStatus", + "@azure/arm-compute!RegionalReplicationStatus:interface": "ComputeGallery.RegionalReplicationStatus", + "@azure/arm-compute!ValidationsProfile:interface": "ComputeGallery.ValidationsProfile", + "@azure/arm-compute!ExecutedValidation:interface": "ComputeGallery.ExecutedValidation", + "@azure/arm-compute!PlatformAttribute:interface": "ComputeGallery.PlatformAttribute", + "@azure/arm-compute!GalleryImageVersionUpdate:interface": "ComputeGallery.GalleryImageVersionUpdate", + "@azure/arm-compute!GalleryImageVersionList:interface": "ComputeGallery.GalleryImageVersionList", + "@azure/arm-compute!GalleryApplication:interface": "ComputeGallery.GalleryApplication", + "@azure/arm-compute!GalleryApplicationProperties:interface": "ComputeGallery.GalleryApplicationProperties", + "@azure/arm-compute!GalleryApplicationCustomAction:interface": "ComputeGallery.GalleryApplicationCustomAction", + "@azure/arm-compute!GalleryApplicationCustomActionParameter:interface": "ComputeGallery.GalleryApplicationCustomActionParameter", + "@azure/arm-compute!GalleryApplicationUpdate:interface": "ComputeGallery.GalleryApplicationUpdate", + "@azure/arm-compute!GalleryApplicationList:interface": "ComputeGallery.GalleryApplicationList", + "@azure/arm-compute!GalleryApplicationVersion:interface": "ComputeGallery.GalleryApplicationVersion", + "@azure/arm-compute!GalleryApplicationVersionProperties:interface": "ComputeGallery.GalleryApplicationVersionProperties", + "@azure/arm-compute!GalleryApplicationVersionPublishingProfile:interface": "ComputeGallery.GalleryApplicationVersionPublishingProfile", + "@azure/arm-compute!UserArtifactSource:interface": "ComputeGallery.UserArtifactSource", + "@azure/arm-compute!UserArtifactManage:interface": "ComputeGallery.UserArtifactManage", + "@azure/arm-compute!UserArtifactSettings:interface": "ComputeGallery.UserArtifactSettings", + "@azure/arm-compute!GalleryApplicationVersionSafetyProfile:interface": "ComputeGallery.GalleryApplicationVersionSafetyProfile", + "@azure/arm-compute!GalleryApplicationVersionUpdate:interface": "ComputeGallery.GalleryApplicationVersionUpdate", + "@azure/arm-compute!GalleryApplicationVersionList:interface": "ComputeGallery.GalleryApplicationVersionList", + "@azure/arm-compute!GalleryScript:interface": "ComputeGallery.GalleryScript", + "@azure/arm-compute!GalleryScriptProperties:interface": "ComputeGallery.GalleryScriptProperties", + "@azure/arm-compute!GalleryScriptUpdate:interface": "ComputeGallery.GalleryScriptUpdate", + "@azure/arm-compute!GalleryScriptList:interface": "ComputeGallery.GalleryScriptList", + "@azure/arm-compute!GalleryScriptVersion:interface": "ComputeGallery.GalleryScriptVersion", + "@azure/arm-compute!GalleryScriptVersionProperties:interface": "ComputeGallery.GalleryScriptVersionProperties", + "@azure/arm-compute!GalleryScriptVersionPublishingProfile:interface": "ComputeGallery.GalleryScriptVersionPublishingProfile", + "@azure/arm-compute!ScriptSource:interface": "ComputeGallery.ScriptSource", + "@azure/arm-compute!GalleryScriptParameter:interface": "ComputeGallery.GalleryScriptParameter", + "@azure/arm-compute!GenericGalleryParameter:interface": "ComputeGallery.GenericGalleryParameter", + "@azure/arm-compute!GalleryScriptVersionSafetyProfile:interface": "ComputeGallery.GalleryScriptVersionSafetyProfile", + "@azure/arm-compute!GalleryScriptVersionUpdate:interface": "ComputeGallery.GalleryScriptVersionUpdate", + "@azure/arm-compute!GalleryScriptVersionList:interface": "ComputeGallery.GalleryScriptVersionList", + "@azure/arm-compute!GalleryInVMAccessControlProfile:interface": "ComputeGallery.GalleryInVMAccessControlProfile", + "@azure/arm-compute!GalleryInVMAccessControlProfileProperties:interface": "ComputeGallery.GalleryInVMAccessControlProfileProperties", + "@azure/arm-compute!GalleryResourceProfilePropertiesBase:interface": "ComputeGallery.GalleryResourceProfilePropertiesBase", + "@azure/arm-compute!GalleryInVMAccessControlProfileUpdate:interface": "ComputeGallery.GalleryInVMAccessControlProfileUpdate", + "@azure/arm-compute!GalleryInVMAccessControlProfileList:interface": "ComputeGallery.GalleryInVMAccessControlProfileList", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersion:interface": "ComputeGallery.GalleryInVMAccessControlProfileVersion", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionProperties:interface": "ComputeGallery.GalleryInVMAccessControlProfileVersionProperties", + "@azure/arm-compute!AccessControlRules:interface": "ComputeGallery.AccessControlRules", + "@azure/arm-compute!AccessControlRulesPrivilege:interface": "ComputeGallery.AccessControlRulesPrivilege", + "@azure/arm-compute!AccessControlRulesRole:interface": "ComputeGallery.AccessControlRulesRole", + "@azure/arm-compute!AccessControlRulesIdentity:interface": "ComputeGallery.AccessControlRulesIdentity", + "@azure/arm-compute!AccessControlRulesRoleAssignment:interface": "ComputeGallery.AccessControlRulesRoleAssignment", + "@azure/arm-compute!GalleryResourceProfileVersionPropertiesBase:interface": "ComputeGallery.GalleryResourceProfileVersionPropertiesBase", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionUpdate:interface": "ComputeGallery.GalleryInVMAccessControlProfileVersionUpdate", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionList:interface": "ComputeGallery.GalleryInVMAccessControlProfileVersionList", + "@azure/arm-compute!SharedGallery:interface": "ComputeGallery.SharedGallery", + "@azure/arm-compute!SharedGalleryProperties:interface": "ComputeGallery.SharedGalleryProperties", + "@azure/arm-compute!PirSharedGalleryResource:interface": "ComputeGallery.PirSharedGalleryResource", + "@azure/arm-compute!SharedGalleryIdentifier:interface": "ComputeGallery.SharedGalleryIdentifier", + "@azure/arm-compute!PirResource:interface": "ComputeGallery.PirResource", + "@azure/arm-compute!SharedGalleryList:interface": "ComputeGallery.SharedGalleryList", + "@azure/arm-compute!SharedGalleryImage:interface": "ComputeGallery.SharedGalleryImage", + "@azure/arm-compute!SharedGalleryImageProperties:interface": "ComputeGallery.SharedGalleryImageProperties", + "@azure/arm-compute!SharedGalleryImageList:interface": "ComputeGallery.SharedGalleryImageList", + "@azure/arm-compute!SharedGalleryImageVersion:interface": "ComputeGallery.SharedGalleryImageVersion", + "@azure/arm-compute!SharedGalleryImageVersionProperties:interface": "ComputeGallery.SharedGalleryImageVersionProperties", + "@azure/arm-compute!SharedGalleryImageVersionStorageProfile:interface": "ComputeGallery.SharedGalleryImageVersionStorageProfile", + "@azure/arm-compute!SharedGalleryOSDiskImage:interface": "ComputeGallery.SharedGalleryOSDiskImage", + "@azure/arm-compute!SharedGalleryDiskImage:interface": "ComputeGallery.SharedGalleryDiskImage", + "@azure/arm-compute!SharedGalleryDataDiskImage:interface": "ComputeGallery.SharedGalleryDataDiskImage", + "@azure/arm-compute!SharedGalleryImageVersionList:interface": "ComputeGallery.SharedGalleryImageVersionList", + "@azure/arm-compute!CommunityGallery:interface": "ComputeGallery.CommunityGallery", + "@azure/arm-compute!CommunityGalleryProperties:interface": "ComputeGallery.CommunityGalleryProperties", + "@azure/arm-compute!CommunityGalleryMetadata:interface": "ComputeGallery.CommunityGalleryMetadata", + "@azure/arm-compute!PirCommunityGalleryResource:interface": "ComputeGallery.PirCommunityGalleryResource", + "@azure/arm-compute!CommunityGalleryIdentifier:interface": "ComputeGallery.CommunityGalleryIdentifier", + "@azure/arm-compute!CommunityGalleryImage:interface": "ComputeGallery.CommunityGalleryImage", + "@azure/arm-compute!CommunityGalleryImageProperties:interface": "ComputeGallery.CommunityGalleryImageProperties", + "@azure/arm-compute!CommunityGalleryImageIdentifier:interface": "ComputeGallery.CommunityGalleryImageIdentifier", + "@azure/arm-compute!CommunityGalleryImageList:interface": "ComputeGallery.CommunityGalleryImageList", + "@azure/arm-compute!CommunityGalleryImageVersion:interface": "ComputeGallery.CommunityGalleryImageVersion", + "@azure/arm-compute!CommunityGalleryImageVersionProperties:interface": "ComputeGallery.CommunityGalleryImageVersionProperties", + "@azure/arm-compute!CommunityGalleryImageVersionList:interface": "ComputeGallery.CommunityGalleryImageVersionList", + "@azure/arm-compute!ResourceSkusResult:interface": "ComputeSku.ResourceSkusResult", + "@azure/arm-compute!ResourceSku:interface": "ComputeSku.ResourceSku", + "@azure/arm-compute!ResourceSkuCapacity:interface": "ComputeSku.ResourceSkuCapacity", + "@azure/arm-compute!ResourceSkuLocationInfo:interface": "ComputeSku.ResourceSkuLocationInfo", + "@azure/arm-compute!ResourceSkuZoneDetails:interface": "ComputeSku.ResourceSkuZoneDetails", + "@azure/arm-compute!ResourceSkuCapabilities:interface": "ComputeSku.ResourceSkuCapabilities", + "@azure/arm-compute!ResourceSkuCosts:interface": "ComputeSku.ResourceSkuCosts", + "@azure/arm-compute!ResourceSkuRestrictions:interface": "ComputeSku.ResourceSkuRestrictions", + "@azure/arm-compute!ResourceSkuRestrictionInfo:interface": "ComputeSku.ResourceSkuRestrictionInfo", + "@azure/arm-compute!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-compute!RollingUpgradeStatusInfo:interface": "Compute.RollingUpgradeStatusInfo", + "@azure/arm-compute!RollingUpgradeStatusInfoProperties:interface": "Compute.RollingUpgradeStatusInfoProperties", + "@azure/arm-compute!RollingUpgradeRunningStatus:interface": "Compute.RollingUpgradeRunningStatus", + "@azure/arm-compute!VirtualMachineScaleSetVM:interface": "Compute.VirtualMachineScaleSetVM", + "@azure/arm-compute!VirtualMachineScaleSetVMProperties:interface": "Compute.VirtualMachineScaleSetVMProperties", + "@azure/arm-compute!VirtualMachineScaleSetVMInstanceView:interface": "Compute.VirtualMachineScaleSetVMInstanceView", + "@azure/arm-compute!VirtualMachineScaleSetVMNetworkProfileConfiguration:interface": "Compute.VirtualMachineScaleSetVMNetworkProfileConfiguration", + "@azure/arm-compute!VirtualMachineScaleSetVMProtectionPolicy:interface": "Compute.VirtualMachineScaleSetVMProtectionPolicy", + "@azure/arm-compute!VirtualMachineScaleSetVMListResult:interface": "Compute.VirtualMachineScaleSetVMListResult", + "@azure/arm-compute!SshPublicKeyResource:interface": "Compute.SshPublicKeyResource", + "@azure/arm-compute!SshPublicKeyResourceProperties:interface": "Compute.SshPublicKeyResourceProperties", + "@azure/arm-compute!SshPublicKeyUpdateResource:interface": "Compute.SshPublicKeyUpdateResource", + "@azure/arm-compute!SshPublicKeysGroupListResult:interface": "Compute.SshPublicKeysGroupListResult", + "@azure/arm-compute!SshGenerateKeyPairInputParameters:interface": "Compute.SshGenerateKeyPairInputParameters", + "@azure/arm-compute!SshPublicKeyGenerateKeyPairResult:interface": "Compute.SshPublicKeyGenerateKeyPairResult", + "@azure/arm-compute!ListUsagesResult:interface": "Compute.ListUsagesResult", + "@azure/arm-compute!Usage:interface": "Compute.Usage", + "@azure/arm-compute!UsageName:interface": "Compute.UsageName", + "@azure/arm-compute!VirtualMachineImageResource:interface": "Compute.VirtualMachineImageResource", + "@azure/arm-compute!VirtualMachineImage:interface": "Compute.VirtualMachineImage", + "@azure/arm-compute!VirtualMachineImageProperties:interface": "Compute.VirtualMachineImageProperties", + "@azure/arm-compute!PurchasePlan:interface": "Compute.PurchasePlan", + "@azure/arm-compute!OSDiskImage:interface": "Compute.OSDiskImage", + "@azure/arm-compute!DataDiskImage:interface": "Compute.DataDiskImage", + "@azure/arm-compute!AutomaticOSUpgradeProperties:interface": "Compute.AutomaticOSUpgradeProperties", + "@azure/arm-compute!DisallowedConfiguration:interface": "Compute.DisallowedConfiguration", + "@azure/arm-compute!VirtualMachineImageFeature:interface": "Compute.VirtualMachineImageFeature", + "@azure/arm-compute!ImageDeprecationStatus:interface": "Compute.ImageDeprecationStatus", + "@azure/arm-compute!AlternativeOption:interface": "Compute.AlternativeOption", + "@azure/arm-compute!VmImagesInEdgeZoneListResult:interface": "Compute.VmImagesInEdgeZoneListResult", + "@azure/arm-compute!RequestRateByIntervalInput:interface": "Compute.RequestRateByIntervalInput", + "@azure/arm-compute!LogAnalyticsInputBase:interface": "Compute.LogAnalyticsInputBase", + "@azure/arm-compute!LogAnalyticsOperationResult:interface": "Compute.LogAnalyticsOperationResult", + "@azure/arm-compute!LogAnalyticsOutput:interface": "Compute.LogAnalyticsOutput", + "@azure/arm-compute!ThrottledRequestsInput:interface": "Compute.ThrottledRequestsInput", + "@azure/arm-compute!DiskRestorePoint:interface": "ComputeDisk.DiskRestorePoint", + "@azure/arm-compute!DiskRestorePointProperties:interface": "ComputeDisk.DiskRestorePointProperties", + "@azure/arm-compute!DiskRestorePointList:interface": "ComputeDisk.DiskRestorePointList", + "@azure/arm-compute!GallerySoftDeletedResourceList:interface": "ComputeGallery.GallerySoftDeletedResourceList", + "@azure/arm-compute!GallerySoftDeletedResource:interface": "ComputeGallery.GallerySoftDeletedResource", + "@azure/arm-compute!GallerySoftDeletedResourceProperties:interface": "ComputeGallery.GallerySoftDeletedResourceProperties", + "@azure/arm-compute!SharingUpdate:interface": "ComputeGallery.SharingUpdate", + "@azure/arm-compute!KnownOrigin:enum": "Azure.ResourceManager.CommonTypes.Origin", + "@azure/arm-compute!KnownActionType:enum": "Azure.ResourceManager.CommonTypes.ActionType", + "@azure/arm-compute!KnownExpandTypesForGetVMScaleSets:enum": "Compute.ExpandTypesForGetVMScaleSets", + "@azure/arm-compute!KnownUpgradeMode:enum": "Compute.UpgradeMode", + "@azure/arm-compute!KnownRepairAction:enum": "Compute.RepairAction", + "@azure/arm-compute!KnownPassNames:enum": "Compute.PassNames", + "@azure/arm-compute!KnownComponentNames:enum": "Compute.ComponentNames", + "@azure/arm-compute!KnownSettingNames:enum": "Compute.SettingNames", + "@azure/arm-compute!KnownWindowsVMGuestPatchMode:enum": "Compute.WindowsVMGuestPatchMode", + "@azure/arm-compute!KnownWindowsPatchAssessmentMode:enum": "Compute.WindowsPatchAssessmentMode", + "@azure/arm-compute!KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting:enum": "Compute.WindowsVMGuestPatchAutomaticByPlatformRebootSetting", + "@azure/arm-compute!KnownProtocolTypes:enum": "Compute.ProtocolTypes", + "@azure/arm-compute!KnownLinuxVMGuestPatchMode:enum": "Compute.LinuxVMGuestPatchMode", + "@azure/arm-compute!KnownLinuxPatchAssessmentMode:enum": "Compute.LinuxPatchAssessmentMode", + "@azure/arm-compute!KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting:enum": "Compute.LinuxVMGuestPatchAutomaticByPlatformRebootSetting", + "@azure/arm-compute!KnownCachingTypes:enum": "Compute.CachingTypes", + "@azure/arm-compute!KnownDiskCreateOptionTypes:enum": "Compute.DiskCreateOptionTypes", + "@azure/arm-compute!KnownDiffDiskOptions:enum": "Compute.DiffDiskOptions", + "@azure/arm-compute!KnownDiffDiskPlacement:enum": "Compute.DiffDiskPlacement", + "@azure/arm-compute!KnownStorageFaultDomainAlignmentType:enum": "Compute.StorageFaultDomainAlignmentType", + "@azure/arm-compute!KnownOperatingSystemTypes:enum": "Common.OperatingSystemTypes", + "@azure/arm-compute!KnownStorageAccountTypes:enum": "Compute.StorageAccountTypes", + "@azure/arm-compute!KnownSecurityEncryptionTypes:enum": "Compute.SecurityEncryptionTypes", + "@azure/arm-compute!KnownDiskDeleteOptionTypes:enum": "Compute.DiskDeleteOptionTypes", + "@azure/arm-compute!KnownDiskControllerTypes:enum": "Compute.DiskControllerTypes", + "@azure/arm-compute!KnownDomainNameLabelScopeTypes:enum": "Compute.DomainNameLabelScopeTypes", + "@azure/arm-compute!KnownIPVersion:enum": "Compute.IPVersion", + "@azure/arm-compute!KnownDeleteOptions:enum": "Compute.DeleteOptions", + "@azure/arm-compute!KnownPublicIPAddressSkuName:enum": "Compute.PublicIPAddressSkuName", + "@azure/arm-compute!KnownPublicIPAddressSkuTier:enum": "Compute.PublicIPAddressSkuTier", + "@azure/arm-compute!KnownNetworkInterfaceAuxiliaryMode:enum": "Compute.NetworkInterfaceAuxiliaryMode", + "@azure/arm-compute!KnownNetworkInterfaceAuxiliarySku:enum": "Compute.NetworkInterfaceAuxiliarySku", + "@azure/arm-compute!KnownNetworkApiVersion:enum": "Compute.NetworkApiVersion", + "@azure/arm-compute!KnownSecurityTypes:enum": "Compute.SecurityTypes", + "@azure/arm-compute!KnownMode:enum": "Compute.Mode", + "@azure/arm-compute!KnownModes:enum": "Compute.Modes", + "@azure/arm-compute!KnownVirtualMachinePriorityTypes:enum": "Compute.VirtualMachinePriorityTypes", + "@azure/arm-compute!KnownVirtualMachineEvictionPolicyTypes:enum": "Compute.VirtualMachineEvictionPolicyTypes", + "@azure/arm-compute!KnownVirtualMachineScaleSetScaleInRules:enum": "Compute.VirtualMachineScaleSetScaleInRules", + "@azure/arm-compute!KnownOrchestrationMode:enum": "Compute.OrchestrationMode", + "@azure/arm-compute!KnownRebalanceStrategy:enum": "Compute.RebalanceStrategy", + "@azure/arm-compute!KnownRebalanceBehavior:enum": "Compute.RebalanceBehavior", + "@azure/arm-compute!KnownZonalPlatformFaultDomainAlignMode:enum": "Compute.ZonalPlatformFaultDomainAlignMode", + "@azure/arm-compute!KnownAllocationStrategy:enum": "Compute.AllocationStrategy", + "@azure/arm-compute!KnownHighSpeedInterconnectPlacement:enum": "Compute.HighSpeedInterconnectPlacement", + "@azure/arm-compute!KnownVMScaleSetLifecycleHookEventType:enum": "Compute.VMScaleSetLifecycleHookEventType", + "@azure/arm-compute!KnownLifecycleHookAction:enum": "Compute.LifecycleHookAction", + "@azure/arm-compute!KnownResourceIdentityType:enum": "Common.ResourceIdentityType", + "@azure/arm-compute!KnownExtendedLocationTypes:enum": "Common.ExtendedLocationTypes", + "@azure/arm-compute!KnownZonePlacementPolicyType:enum": "Compute.ZonePlacementPolicyType", + "@azure/arm-compute!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-compute!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-compute!KnownStatusLevelTypes:enum": "Compute.StatusLevelTypes", + "@azure/arm-compute!KnownOrchestrationServiceNames:enum": "Compute.OrchestrationServiceNames", + "@azure/arm-compute!KnownOrchestrationServiceState:enum": "Compute.OrchestrationServiceState", + "@azure/arm-compute!KnownOrchestrationServiceOperationStatus:enum": "Compute.OrchestrationServiceOperationStatus", + "@azure/arm-compute!KnownUpgradeState:enum": "Compute.UpgradeState", + "@azure/arm-compute!KnownUpgradeOperationInvoker:enum": "Compute.UpgradeOperationInvoker", + "@azure/arm-compute!KnownOrchestrationServiceStateAction:enum": "Compute.OrchestrationServiceStateAction", + "@azure/arm-compute!KnownVirtualMachineScaleSetSkuScaleType:enum": "Compute.VirtualMachineScaleSetSkuScaleType", + "@azure/arm-compute!KnownLifecycleHookActionState:enum": "Compute.LifecycleHookActionState", + "@azure/arm-compute!KnownVMScaleSetLifecycleHookEventState:enum": "Compute.VMScaleSetLifecycleHookEventState", + "@azure/arm-compute!KnownInstanceViewTypes:enum": "Compute.InstanceViewTypes", + "@azure/arm-compute!KnownVirtualMachineSizeTypes:enum": "Compute.VirtualMachineSizeTypes", + "@azure/arm-compute!KnownDiskDetachOptionTypes:enum": "Compute.DiskDetachOptionTypes", + "@azure/arm-compute!KnownIPVersions:enum": "Compute.IPVersions", + "@azure/arm-compute!KnownPublicIPAllocationMethod:enum": "Compute.PublicIPAllocationMethod", + "@azure/arm-compute!KnownHyperVGenerationType:enum": "Compute.HyperVGenerationType", + "@azure/arm-compute!KnownMaintenanceOperationResultCodeTypes:enum": "Compute.MaintenanceOperationResultCodeTypes", + "@azure/arm-compute!KnownStorageAlignmentStatus:enum": "Compute.StorageAlignmentStatus", + "@azure/arm-compute!KnownPatchOperationStatus:enum": "Compute.PatchOperationStatus", + "@azure/arm-compute!KnownExpandTypeForListVMs:enum": "Compute.ExpandTypeForListVMs", + "@azure/arm-compute!KnownExpandTypesForListVMs:enum": "Compute.ExpandTypesForListVMs", + "@azure/arm-compute!KnownVMGuestPatchRebootBehavior:enum": "Compute.VMGuestPatchRebootBehavior", + "@azure/arm-compute!KnownPatchAssessmentState:enum": "Compute.PatchAssessmentState", + "@azure/arm-compute!KnownVMGuestPatchRebootSetting:enum": "Compute.VMGuestPatchRebootSetting", + "@azure/arm-compute!KnownVMGuestPatchClassificationWindows:enum": "Compute.VMGuestPatchClassificationWindows", + "@azure/arm-compute!KnownVMGuestPatchClassificationLinux:enum": "Compute.VMGuestPatchClassificationLinux", + "@azure/arm-compute!KnownVMGuestPatchRebootStatus:enum": "Compute.VMGuestPatchRebootStatus", + "@azure/arm-compute!KnownPatchInstallationState:enum": "Compute.PatchInstallationState", + "@azure/arm-compute!KnownProximityPlacementGroupType:enum": "Compute.ProximityPlacementGroupType", + "@azure/arm-compute!KnownDedicatedHostLicenseTypes:enum": "Compute.DedicatedHostLicenseTypes", + "@azure/arm-compute!KnownOperatingSystemStateTypes:enum": "Common.OperatingSystemStateTypes", + "@azure/arm-compute!KnownHyperVGenerationTypes:enum": "Compute.HyperVGenerationTypes", + "@azure/arm-compute!KnownRestorePointCollectionExpandOptions:enum": "Compute.RestorePointCollectionExpandOptions", + "@azure/arm-compute!KnownOperatingSystemType:enum": "Compute.OperatingSystemType", + "@azure/arm-compute!KnownRestorePointEncryptionType:enum": "Compute.RestorePointEncryptionType", + "@azure/arm-compute!KnownConsistencyModeTypes:enum": "Compute.ConsistencyModeTypes", + "@azure/arm-compute!KnownSnapshotAccessState:enum": "Common.SnapshotAccessState", + "@azure/arm-compute!KnownRestorePointExpandOptions:enum": "Compute.RestorePointExpandOptions", + "@azure/arm-compute!KnownCapacityReservationGroupInstanceViewTypes:enum": "Compute.CapacityReservationGroupInstanceViewTypes", + "@azure/arm-compute!KnownReservationType:enum": "Compute.ReservationType", + "@azure/arm-compute!KnownExpandTypesForGetCapacityReservationGroups:enum": "Compute.ExpandTypesForGetCapacityReservationGroups", + "@azure/arm-compute!KnownResourceIdOptionsForGetCapacityReservationGroups:enum": "Compute.ResourceIdOptionsForGetCapacityReservationGroups", + "@azure/arm-compute!KnownCapacityReservationInstanceViewTypes:enum": "Compute.CapacityReservationInstanceViewTypes", + "@azure/arm-compute!KnownScriptShellTypes:enum": "Compute.ScriptShellTypes", + "@azure/arm-compute!KnownExecutionState:enum": "Compute.ExecutionState", + "@azure/arm-compute!KnownHyperVGeneration:enum": "Common.HyperVGeneration", + "@azure/arm-compute!KnownArchitecture:enum": "Common.Architecture", + "@azure/arm-compute!KnownSupportedSecurityOption:enum": "ComputeDisk.SupportedSecurityOption", + "@azure/arm-compute!KnownDiskCreateOption:enum": "ComputeDisk.DiskCreateOption", + "@azure/arm-compute!KnownProvisionedBandwidthCopyOption:enum": "ComputeDisk.ProvisionedBandwidthCopyOption", + "@azure/arm-compute!KnownDiskState:enum": "ComputeDisk.DiskState", + "@azure/arm-compute!KnownEncryptionType:enum": "ComputeDisk.EncryptionType", + "@azure/arm-compute!KnownNetworkAccessPolicy:enum": "ComputeDisk.NetworkAccessPolicy", + "@azure/arm-compute!KnownDiskSecurityTypes:enum": "ComputeDisk.DiskSecurityTypes", + "@azure/arm-compute!KnownPublicNetworkAccess:enum": "ComputeDisk.PublicNetworkAccess", + "@azure/arm-compute!KnownDataAccessAuthMode:enum": "ComputeDisk.DataAccessAuthMode", + "@azure/arm-compute!KnownAvailabilityPolicyDiskDelay:enum": "ComputeDisk.AvailabilityPolicyDiskDelay", + "@azure/arm-compute!KnownDiskStorageAccountTypes:enum": "ComputeDisk.DiskStorageAccountTypes", + "@azure/arm-compute!KnownAccessLevel:enum": "ComputeDisk.AccessLevel", + "@azure/arm-compute!KnownFileFormat:enum": "ComputeDisk.FileFormat", + "@azure/arm-compute!KnownPrivateEndpointServiceConnectionStatus:enum": "ComputeDisk.PrivateEndpointServiceConnectionStatus", + "@azure/arm-compute!KnownPrivateEndpointConnectionProvisioningState:enum": "ComputeDisk.PrivateEndpointConnectionProvisioningState", + "@azure/arm-compute!KnownDiskEncryptionSetType:enum": "ComputeDisk.DiskEncryptionSetType", + "@azure/arm-compute!KnownDiskEncryptionSetIdentityType:enum": "ComputeDisk.DiskEncryptionSetIdentityType", + "@azure/arm-compute!KnownCopyCompletionErrorReason:enum": "ComputeDisk.CopyCompletionErrorReason", + "@azure/arm-compute!KnownSnapshotStorageAccountTypes:enum": "ComputeDisk.SnapshotStorageAccountTypes", + "@azure/arm-compute!KnownSelectPermissions:enum": "ComputeGallery.SelectPermissions", + "@azure/arm-compute!KnownGalleryExpandParams:enum": "ComputeGallery.GalleryExpandParams", + "@azure/arm-compute!KnownGalleryProvisioningState:enum": "ComputeGallery.GalleryProvisioningState", + "@azure/arm-compute!KnownGallerySharingPermissionTypes:enum": "ComputeGallery.GallerySharingPermissionTypes", + "@azure/arm-compute!KnownSharingProfileGroupTypes:enum": "ComputeGallery.SharingProfileGroupTypes", + "@azure/arm-compute!KnownSharingState:enum": "ComputeGallery.SharingState", + "@azure/arm-compute!KnownUefiSignatureTemplateName:enum": "ComputeGallery.UefiSignatureTemplateName", + "@azure/arm-compute!KnownUefiKeyType:enum": "ComputeGallery.UefiKeyType", + "@azure/arm-compute!KnownReplicationStatusTypes:enum": "ComputeGallery.ReplicationStatusTypes", + "@azure/arm-compute!KnownStorageAccountType:enum": "ComputeGallery.StorageAccountType", + "@azure/arm-compute!KnownConfidentialVMEncryptionType:enum": "ComputeGallery.ConfidentialVMEncryptionType", + "@azure/arm-compute!KnownReplicationMode:enum": "ComputeGallery.ReplicationMode", + "@azure/arm-compute!KnownGalleryExtendedLocationType:enum": "ComputeGallery.GalleryExtendedLocationType", + "@azure/arm-compute!KnownEdgeZoneStorageAccountType:enum": "ComputeGallery.EdgeZoneStorageAccountType", + "@azure/arm-compute!KnownStorageAccountStrategy:enum": "ComputeGallery.StorageAccountStrategy", + "@azure/arm-compute!KnownHostCaching:enum": "ComputeGallery.HostCaching", + "@azure/arm-compute!KnownPolicyViolationCategory:enum": "ComputeGallery.PolicyViolationCategory", + "@azure/arm-compute!KnownAggregatedReplicationState:enum": "ComputeGallery.AggregatedReplicationState", + "@azure/arm-compute!KnownReplicationState:enum": "ComputeGallery.ReplicationState", + "@azure/arm-compute!KnownValidationStatus:enum": "ComputeGallery.ValidationStatus", + "@azure/arm-compute!KnownGalleryApplicationCustomActionParameterType:enum": "ComputeGallery.GalleryApplicationCustomActionParameterType", + "@azure/arm-compute!KnownGalleryApplicationScriptRebootBehavior:enum": "ComputeGallery.GalleryApplicationScriptRebootBehavior", + "@azure/arm-compute!KnownGalleryScriptParameterType:enum": "ComputeGallery.GalleryScriptParameterType", + "@azure/arm-compute!KnownEndpointTypes:enum": "ComputeGallery.EndpointTypes", + "@azure/arm-compute!KnownAccessControlRulesMode:enum": "ComputeGallery.AccessControlRulesMode", + "@azure/arm-compute!KnownEndpointAccess:enum": "ComputeGallery.EndpointAccess", + "@azure/arm-compute!KnownSharedToValues:enum": "ComputeGallery.SharedToValues", + "@azure/arm-compute!KnownSharedGalleryHostCaching:enum": "ComputeGallery.SharedGalleryHostCaching", + "@azure/arm-compute!KnownResourceSkuCapacityScaleType:enum": "ComputeSku.ResourceSkuCapacityScaleType", + "@azure/arm-compute!KnownExtendedLocationType:enum": "ComputeSku.ExtendedLocationType", + "@azure/arm-compute!KnownResourceSkuRestrictionsType:enum": "ComputeSku.ResourceSkuRestrictionsType", + "@azure/arm-compute!KnownResourceSkuRestrictionsReasonCode:enum": "ComputeSku.ResourceSkuRestrictionsReasonCode", + "@azure/arm-compute!KnownRollingUpgradeStatusCode:enum": "Compute.RollingUpgradeStatusCode", + "@azure/arm-compute!KnownRollingUpgradeActionType:enum": "Compute.RollingUpgradeActionType", + "@azure/arm-compute!KnownResilientVMDeletionStatus:enum": "Compute.ResilientVMDeletionStatus", + "@azure/arm-compute!KnownSshEncryptionTypes:enum": "Compute.SshEncryptionTypes", + "@azure/arm-compute!KnownVmDiskTypes:enum": "Compute.VmDiskTypes", + "@azure/arm-compute!KnownArchitectureTypes:enum": "Compute.ArchitectureTypes", + "@azure/arm-compute!KnownImageState:enum": "Compute.ImageState", + "@azure/arm-compute!KnownAlternativeType:enum": "Compute.AlternativeType", + "@azure/arm-compute!KnownIntervalInMins:enum": "Compute.IntervalInMins", + "@azure/arm-compute!KnownSoftDeletedArtifactTypes:enum": "ComputeGallery.SoftDeletedArtifactTypes", + "@azure/arm-compute!KnownSharingUpdateOperationTypes:enum": "ComputeGallery.SharingUpdateOperationTypes", + "@azure/arm-compute!GallerySharingProfileOperations#update:member": "ComputeGallery.Galleries.gallerySharingProfileUpdate", + "@azure/arm-compute!SoftDeletedResourceOperations#listByArtifactName:member": "ComputeGallery.Galleries.listByArtifactName", + "@azure/arm-compute!DiskRestorePointOperations#revokeAccess:member": "ComputeDisk.DiskRestorePoints.revokeAccess", + "@azure/arm-compute!DiskRestorePointOperations#grantAccess:member": "ComputeDisk.DiskRestorePoints.grantAccess", + "@azure/arm-compute!DiskRestorePointOperations#listByRestorePoint:member": "ComputeDisk.DiskRestorePoints.listByRestorePoint", + "@azure/arm-compute!DiskRestorePointOperations#get:member": "ComputeDisk.DiskRestorePoints.get", + "@azure/arm-compute!LogAnalyticsOperations#exportThrottledRequests:member": "Compute.LogAnalyticsOperationGroup.exportThrottledRequests", + "@azure/arm-compute!LogAnalyticsOperations#exportRequestRateByInterval:member": "Compute.LogAnalyticsOperationGroup.exportRequestRateByInterval", + "@azure/arm-compute!VirtualMachineImagesOperations#get:member": "Compute.VirtualMachineImagesOperationGroup.get", + "@azure/arm-compute!VirtualMachineImagesOperations#listWithProperties:member": "Compute.VirtualMachineImagesOperationGroup.listWithProperties", + "@azure/arm-compute!VirtualMachineImagesOperations#list:member": "Compute.VirtualMachineImagesOperationGroup.list", + "@azure/arm-compute!VirtualMachineImagesOperations#listSkus:member": "Compute.VirtualMachineImagesOperationGroup.listSkus", + "@azure/arm-compute!VirtualMachineImagesOperations#listOffers:member": "Compute.VirtualMachineImagesOperationGroup.listOffers", + "@azure/arm-compute!VirtualMachineImagesOperations#listPublishers:member": "Compute.VirtualMachineImagesOperationGroup.listPublishers", + "@azure/arm-compute!VirtualMachineImagesOperations#listByEdgeZone:member": "Compute.VirtualMachineImagesOperationGroup.listByEdgeZone", + "@azure/arm-compute!VirtualMachineImagesEdgeZoneOperations#get:member": "Compute.VirtualMachineImagesEdgeZoneOperationGroup.get", + "@azure/arm-compute!VirtualMachineImagesEdgeZoneOperations#list:member": "Compute.VirtualMachineImagesEdgeZoneOperationGroup.list", + "@azure/arm-compute!VirtualMachineImagesEdgeZoneOperations#listSkus:member": "Compute.VirtualMachineImagesEdgeZoneOperationGroup.listSkus", + "@azure/arm-compute!VirtualMachineImagesEdgeZoneOperations#listOffers:member": "Compute.VirtualMachineImagesEdgeZoneOperationGroup.listOffers", + "@azure/arm-compute!VirtualMachineImagesEdgeZoneOperations#listPublishers:member": "Compute.VirtualMachineImagesEdgeZoneOperationGroup.listPublishers", + "@azure/arm-compute!VirtualMachineSizesOperations#list:member": "Compute.VirtualMachineSizesOperationGroup.list", + "@azure/arm-compute!UsageOperations#list:member": "Compute.UsageOperationGroup.list", + "@azure/arm-compute!SshPublicKeysOperations#generateKeyPair:member": "Compute.SshPublicKeyResources.generateKeyPair", + "@azure/arm-compute!SshPublicKeysOperations#listBySubscription:member": "Compute.SshPublicKeyResources.listBySubscription", + "@azure/arm-compute!SshPublicKeysOperations#listByResourceGroup:member": "Compute.SshPublicKeyResources.listByResourceGroup", + "@azure/arm-compute!SshPublicKeysOperations#delete:member": "Compute.SshPublicKeyResources.delete", + "@azure/arm-compute!SshPublicKeysOperations#update:member": "Compute.SshPublicKeyResources.update", + "@azure/arm-compute!SshPublicKeysOperations#create:member": "Compute.SshPublicKeyResources.create", + "@azure/arm-compute!SshPublicKeysOperations#get:member": "Compute.SshPublicKeyResources.get", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#runCommand:member": "Compute.VirtualMachineScaleSetVMS.runCommand", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#start:member": "Compute.VirtualMachineScaleSetVMS.start", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#retrieveBootDiagnosticsData:member": "Compute.VirtualMachineScaleSetVMS.retrieveBootDiagnosticsData", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#restart:member": "Compute.VirtualMachineScaleSetVMS.restart", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#redeploy:member": "Compute.VirtualMachineScaleSetVMS.redeploy", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#powerOff:member": "Compute.VirtualMachineScaleSetVMS.powerOff", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#performMaintenance:member": "Compute.VirtualMachineScaleSetVMS.performMaintenance", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#attachDetachDataDisks:member": "Compute.VirtualMachineScaleSetVMS.attachDetachDataDisks", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#simulateEviction:member": "Compute.VirtualMachineScaleSetVMS.simulateEviction", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#reimageAll:member": "Compute.VirtualMachineScaleSetVMS.reimageAll", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#reimage:member": "Compute.VirtualMachineScaleSetVMS.reimage", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#getInstanceView:member": "Compute.VirtualMachineScaleSetVMS.getInstanceView", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#deallocate:member": "Compute.VirtualMachineScaleSetVMS.deallocate", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#approveRollingUpgrade:member": "Compute.VirtualMachineScaleSetVMS.approveRollingUpgrade", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#list:member": "Compute.VirtualMachineScaleSetVMS.list", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#delete:member": "Compute.VirtualMachineScaleSetVMS.delete", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#update:member": "Compute.VirtualMachineScaleSetVMS.update", + "@azure/arm-compute!VirtualMachineScaleSetVMsOperations#get:member": "Compute.VirtualMachineScaleSetVMS.get", + "@azure/arm-compute!VirtualMachineScaleSetRollingUpgradesOperations#getLatest:member": "Compute.RollingUpgradeStatusInfos.getLatest", + "@azure/arm-compute!VirtualMachineScaleSetRollingUpgradesOperations#cancel:member": "Compute.VirtualMachineScaleSets.cancel", + "@azure/arm-compute!VirtualMachineScaleSetRollingUpgradesOperations#startOSUpgrade:member": "Compute.VirtualMachineScaleSets.startOSUpgrade", + "@azure/arm-compute!VirtualMachineScaleSetRollingUpgradesOperations#startExtensionUpgrade:member": "Compute.VirtualMachineScaleSets.startExtensionUpgrade", + "@azure/arm-compute!ResourceSkusOperations#list:member": "ComputeSku.ResourceSkus.list", + "@azure/arm-compute!CommunityGalleryImageVersionsOperations#list:member": "ComputeGallery.CommunityGalleryImageVersions.list", + "@azure/arm-compute!CommunityGalleryImageVersionsOperations#get:member": "ComputeGallery.CommunityGalleryImageVersions.get", + "@azure/arm-compute!CommunityGalleryImagesOperations#list:member": "ComputeGallery.CommunityGalleryImages.list", + "@azure/arm-compute!CommunityGalleryImagesOperations#get:member": "ComputeGallery.CommunityGalleryImages.get", + "@azure/arm-compute!CommunityGalleriesOperations#get:member": "ComputeGallery.CommunityGalleries.get", + "@azure/arm-compute!SharedGalleryImageVersionsOperations#list:member": "ComputeGallery.SharedGalleryImageVersions.list", + "@azure/arm-compute!SharedGalleryImageVersionsOperations#get:member": "ComputeGallery.SharedGalleryImageVersions.get", + "@azure/arm-compute!SharedGalleryImagesOperations#list:member": "ComputeGallery.SharedGalleryImages.list", + "@azure/arm-compute!SharedGalleryImagesOperations#get:member": "ComputeGallery.SharedGalleryImages.get", + "@azure/arm-compute!SharedGalleriesOperations#list:member": "ComputeGallery.SharedGalleries.list", + "@azure/arm-compute!SharedGalleriesOperations#get:member": "ComputeGallery.SharedGalleries.get", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionsOperations#listByGalleryInVMAccessControlProfile:member": "ComputeGallery.GalleryInVMAccessControlProfileVersions.listByGalleryInVMAccessControlProfile", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionsOperations#delete:member": "ComputeGallery.GalleryInVMAccessControlProfileVersions.delete", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionsOperations#update:member": "ComputeGallery.GalleryInVMAccessControlProfileVersions.update", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionsOperations#createOrUpdate:member": "ComputeGallery.GalleryInVMAccessControlProfileVersions.createOrUpdate", + "@azure/arm-compute!GalleryInVMAccessControlProfileVersionsOperations#get:member": "ComputeGallery.GalleryInVMAccessControlProfileVersions.get", + "@azure/arm-compute!GalleryInVMAccessControlProfilesOperations#listByGallery:member": "ComputeGallery.GalleryInVMAccessControlProfiles.listByGallery", + "@azure/arm-compute!GalleryInVMAccessControlProfilesOperations#delete:member": "ComputeGallery.GalleryInVMAccessControlProfiles.delete", + "@azure/arm-compute!GalleryInVMAccessControlProfilesOperations#update:member": "ComputeGallery.GalleryInVMAccessControlProfiles.update", + "@azure/arm-compute!GalleryInVMAccessControlProfilesOperations#createOrUpdate:member": "ComputeGallery.GalleryInVMAccessControlProfiles.createOrUpdate", + "@azure/arm-compute!GalleryInVMAccessControlProfilesOperations#get:member": "ComputeGallery.GalleryInVMAccessControlProfiles.get", + "@azure/arm-compute!GalleryScriptVersionsOperations#listByGalleryScript:member": "ComputeGallery.GalleryScriptVersions.listByGalleryScript", + "@azure/arm-compute!GalleryScriptVersionsOperations#delete:member": "ComputeGallery.GalleryScriptVersions.delete", + "@azure/arm-compute!GalleryScriptVersionsOperations#update:member": "ComputeGallery.GalleryScriptVersions.update", + "@azure/arm-compute!GalleryScriptVersionsOperations#createOrUpdate:member": "ComputeGallery.GalleryScriptVersions.createOrUpdate", + "@azure/arm-compute!GalleryScriptVersionsOperations#get:member": "ComputeGallery.GalleryScriptVersions.get", + "@azure/arm-compute!GalleryScriptsOperations#listByGallery:member": "ComputeGallery.GalleryScripts.listByGallery", + "@azure/arm-compute!GalleryScriptsOperations#delete:member": "ComputeGallery.GalleryScripts.delete", + "@azure/arm-compute!GalleryScriptsOperations#update:member": "ComputeGallery.GalleryScripts.update", + "@azure/arm-compute!GalleryScriptsOperations#createOrUpdate:member": "ComputeGallery.GalleryScripts.createOrUpdate", + "@azure/arm-compute!GalleryScriptsOperations#get:member": "ComputeGallery.GalleryScripts.get", + "@azure/arm-compute!GalleryApplicationVersionsOperations#listByGalleryApplication:member": "ComputeGallery.GalleryApplicationVersions.listByGalleryApplication", + "@azure/arm-compute!GalleryApplicationVersionsOperations#delete:member": "ComputeGallery.GalleryApplicationVersions.delete", + "@azure/arm-compute!GalleryApplicationVersionsOperations#update:member": "ComputeGallery.GalleryApplicationVersions.update", + "@azure/arm-compute!GalleryApplicationVersionsOperations#createOrUpdate:member": "ComputeGallery.GalleryApplicationVersions.createOrUpdate", + "@azure/arm-compute!GalleryApplicationVersionsOperations#get:member": "ComputeGallery.GalleryApplicationVersions.get", + "@azure/arm-compute!GalleryApplicationsOperations#listByGallery:member": "ComputeGallery.GalleryApplications.listByGallery", + "@azure/arm-compute!GalleryApplicationsOperations#delete:member": "ComputeGallery.GalleryApplications.delete", + "@azure/arm-compute!GalleryApplicationsOperations#update:member": "ComputeGallery.GalleryApplications.update", + "@azure/arm-compute!GalleryApplicationsOperations#createOrUpdate:member": "ComputeGallery.GalleryApplications.createOrUpdate", + "@azure/arm-compute!GalleryApplicationsOperations#get:member": "ComputeGallery.GalleryApplications.get", + "@azure/arm-compute!GalleryImageVersionsOperations#listByGalleryImage:member": "ComputeGallery.GalleryImageVersions.listByGalleryImage", + "@azure/arm-compute!GalleryImageVersionsOperations#delete:member": "ComputeGallery.GalleryImageVersions.delete", + "@azure/arm-compute!GalleryImageVersionsOperations#update:member": "ComputeGallery.GalleryImageVersions.update", + "@azure/arm-compute!GalleryImageVersionsOperations#createOrUpdate:member": "ComputeGallery.GalleryImageVersions.createOrUpdate", + "@azure/arm-compute!GalleryImageVersionsOperations#get:member": "ComputeGallery.GalleryImageVersions.get", + "@azure/arm-compute!GalleryImagesOperations#listByGallery:member": "ComputeGallery.GalleryImages.listByGallery", + "@azure/arm-compute!GalleryImagesOperations#delete:member": "ComputeGallery.GalleryImages.delete", + "@azure/arm-compute!GalleryImagesOperations#update:member": "ComputeGallery.GalleryImages.update", + "@azure/arm-compute!GalleryImagesOperations#createOrUpdate:member": "ComputeGallery.GalleryImages.createOrUpdate", + "@azure/arm-compute!GalleryImagesOperations#get:member": "ComputeGallery.GalleryImages.get", + "@azure/arm-compute!GalleriesOperations#list:member": "ComputeGallery.Galleries.list", + "@azure/arm-compute!GalleriesOperations#listByResourceGroup:member": "ComputeGallery.Galleries.listByResourceGroup", + "@azure/arm-compute!GalleriesOperations#delete:member": "ComputeGallery.Galleries.delete", + "@azure/arm-compute!GalleriesOperations#update:member": "ComputeGallery.Galleries.update", + "@azure/arm-compute!GalleriesOperations#createOrUpdate:member": "ComputeGallery.Galleries.createOrUpdate", + "@azure/arm-compute!GalleriesOperations#get:member": "ComputeGallery.Galleries.get", + "@azure/arm-compute!SnapshotsOperations#revokeAccess:member": "ComputeDisk.Snapshots.revokeAccess", + "@azure/arm-compute!SnapshotsOperations#grantAccess:member": "ComputeDisk.Snapshots.grantAccess", + "@azure/arm-compute!SnapshotsOperations#list:member": "ComputeDisk.Snapshots.list", + "@azure/arm-compute!SnapshotsOperations#listByResourceGroup:member": "ComputeDisk.Snapshots.listByResourceGroup", + "@azure/arm-compute!SnapshotsOperations#delete:member": "ComputeDisk.Snapshots.delete", + "@azure/arm-compute!SnapshotsOperations#update:member": "ComputeDisk.Snapshots.update", + "@azure/arm-compute!SnapshotsOperations#createOrUpdate:member": "ComputeDisk.Snapshots.createOrUpdate", + "@azure/arm-compute!SnapshotsOperations#get:member": "ComputeDisk.Snapshots.get", + "@azure/arm-compute!DiskEncryptionSetsOperations#listAssociatedResources:member": "ComputeDisk.DiskEncryptionSets.listAssociatedResources", + "@azure/arm-compute!DiskEncryptionSetsOperations#list:member": "ComputeDisk.DiskEncryptionSets.list", + "@azure/arm-compute!DiskEncryptionSetsOperations#listByResourceGroup:member": "ComputeDisk.DiskEncryptionSets.listByResourceGroup", + "@azure/arm-compute!DiskEncryptionSetsOperations#delete:member": "ComputeDisk.DiskEncryptionSets.delete", + "@azure/arm-compute!DiskEncryptionSetsOperations#update:member": "ComputeDisk.DiskEncryptionSets.update", + "@azure/arm-compute!DiskEncryptionSetsOperations#createOrUpdate:member": "ComputeDisk.DiskEncryptionSets.createOrUpdate", + "@azure/arm-compute!DiskEncryptionSetsOperations#get:member": "ComputeDisk.DiskEncryptionSets.get", + "@azure/arm-compute!DiskAccessesOperations#listPrivateEndpointConnections:member": "ComputeDisk.PrivateEndpointConnections.listPrivateEndpointConnections", + "@azure/arm-compute!DiskAccessesOperations#deleteAPrivateEndpointConnection:member": "ComputeDisk.PrivateEndpointConnections.deleteAPrivateEndpointConnection", + "@azure/arm-compute!DiskAccessesOperations#updateAPrivateEndpointConnection:member": "ComputeDisk.PrivateEndpointConnections.updateAPrivateEndpointConnection", + "@azure/arm-compute!DiskAccessesOperations#getAPrivateEndpointConnection:member": "ComputeDisk.PrivateEndpointConnections.getAPrivateEndpointConnection", + "@azure/arm-compute!DiskAccessesOperations#getPrivateLinkResources:member": "ComputeDisk.DiskAccesses.getPrivateLinkResources", + "@azure/arm-compute!DiskAccessesOperations#list:member": "ComputeDisk.DiskAccesses.list", + "@azure/arm-compute!DiskAccessesOperations#listByResourceGroup:member": "ComputeDisk.DiskAccesses.listByResourceGroup", + "@azure/arm-compute!DiskAccessesOperations#delete:member": "ComputeDisk.DiskAccesses.delete", + "@azure/arm-compute!DiskAccessesOperations#update:member": "ComputeDisk.DiskAccesses.update", + "@azure/arm-compute!DiskAccessesOperations#createOrUpdate:member": "ComputeDisk.DiskAccesses.createOrUpdate", + "@azure/arm-compute!DiskAccessesOperations#get:member": "ComputeDisk.DiskAccesses.get", + "@azure/arm-compute!DisksOperations#revokeAccess:member": "ComputeDisk.Disks.revokeAccess", + "@azure/arm-compute!DisksOperations#grantAccess:member": "ComputeDisk.Disks.grantAccess", + "@azure/arm-compute!DisksOperations#list:member": "ComputeDisk.Disks.list", + "@azure/arm-compute!DisksOperations#listByResourceGroup:member": "ComputeDisk.Disks.listByResourceGroup", + "@azure/arm-compute!DisksOperations#delete:member": "ComputeDisk.Disks.delete", + "@azure/arm-compute!DisksOperations#update:member": "ComputeDisk.Disks.update", + "@azure/arm-compute!DisksOperations#createOrUpdate:member": "ComputeDisk.Disks.createOrUpdate", + "@azure/arm-compute!DisksOperations#get:member": "ComputeDisk.Disks.get", + "@azure/arm-compute!VirtualMachineScaleSetVMRunCommandsOperations#list:member": "Compute.VirtualMachineScaleSetVMRunCommands.list", + "@azure/arm-compute!VirtualMachineScaleSetVMRunCommandsOperations#delete:member": "Compute.VirtualMachineScaleSetVMRunCommands.delete", + "@azure/arm-compute!VirtualMachineScaleSetVMRunCommandsOperations#update:member": "Compute.VirtualMachineScaleSetVMRunCommands.update", + "@azure/arm-compute!VirtualMachineScaleSetVMRunCommandsOperations#createOrUpdate:member": "Compute.VirtualMachineScaleSetVMRunCommands.createOrUpdate", + "@azure/arm-compute!VirtualMachineScaleSetVMRunCommandsOperations#get:member": "Compute.VirtualMachineScaleSetVMRunCommands.get", + "@azure/arm-compute!VirtualMachineRunCommandsOperations#get:member": "Compute.VirtualMachineRunCommandsOperationGroup.get", + "@azure/arm-compute!VirtualMachineRunCommandsOperations#list:member": "Compute.VirtualMachineRunCommandsOperationGroup.list", + "@azure/arm-compute!VirtualMachineRunCommandsOperations#listByVirtualMachine:member": "Compute.VirtualMachineRunCommands.listByVirtualMachine", + "@azure/arm-compute!VirtualMachineRunCommandsOperations#delete:member": "Compute.VirtualMachineRunCommands.delete", + "@azure/arm-compute!VirtualMachineRunCommandsOperations#update:member": "Compute.VirtualMachineRunCommands.update", + "@azure/arm-compute!VirtualMachineRunCommandsOperations#createOrUpdate:member": "Compute.VirtualMachineRunCommands.createOrUpdate", + "@azure/arm-compute!VirtualMachineRunCommandsOperations#getByVirtualMachine:member": "Compute.VirtualMachineRunCommands.getByVirtualMachine", + "@azure/arm-compute!CapacityReservationsOperations#listByCapacityReservationGroup:member": "Compute.CapacityReservations.listByCapacityReservationGroup", + "@azure/arm-compute!CapacityReservationsOperations#delete:member": "Compute.CapacityReservations.delete", + "@azure/arm-compute!CapacityReservationsOperations#update:member": "Compute.CapacityReservations.update", + "@azure/arm-compute!CapacityReservationsOperations#createOrUpdate:member": "Compute.CapacityReservations.createOrUpdate", + "@azure/arm-compute!CapacityReservationsOperations#get:member": "Compute.CapacityReservations.get", + "@azure/arm-compute!CapacityReservationGroupsOperations#listBySubscription:member": "Compute.CapacityReservationGroups.listBySubscription", + "@azure/arm-compute!CapacityReservationGroupsOperations#listByResourceGroup:member": "Compute.CapacityReservationGroups.listByResourceGroup", + "@azure/arm-compute!CapacityReservationGroupsOperations#delete:member": "Compute.CapacityReservationGroups.delete", + "@azure/arm-compute!CapacityReservationGroupsOperations#update:member": "Compute.CapacityReservationGroups.update", + "@azure/arm-compute!CapacityReservationGroupsOperations#createOrUpdate:member": "Compute.CapacityReservationGroups.createOrUpdate", + "@azure/arm-compute!CapacityReservationGroupsOperations#get:member": "Compute.CapacityReservationGroups.get", + "@azure/arm-compute!RestorePointsOperations#delete:member": "Compute.RestorePoints.delete", + "@azure/arm-compute!RestorePointsOperations#create:member": "Compute.RestorePoints.create", + "@azure/arm-compute!RestorePointsOperations#get:member": "Compute.RestorePoints.get", + "@azure/arm-compute!RestorePointCollectionsOperations#listAll:member": "Compute.RestorePointCollections.listAll", + "@azure/arm-compute!RestorePointCollectionsOperations#list:member": "Compute.RestorePointCollections.list", + "@azure/arm-compute!RestorePointCollectionsOperations#delete:member": "Compute.RestorePointCollections.delete", + "@azure/arm-compute!RestorePointCollectionsOperations#update:member": "Compute.RestorePointCollections.update", + "@azure/arm-compute!RestorePointCollectionsOperations#createOrUpdate:member": "Compute.RestorePointCollections.createOrUpdate", + "@azure/arm-compute!RestorePointCollectionsOperations#get:member": "Compute.RestorePointCollections.get", + "@azure/arm-compute!ImagesOperations#list:member": "Compute.Images.list", + "@azure/arm-compute!ImagesOperations#listByResourceGroup:member": "Compute.Images.listByResourceGroup", + "@azure/arm-compute!ImagesOperations#delete:member": "Compute.Images.delete", + "@azure/arm-compute!ImagesOperations#update:member": "Compute.Images.update", + "@azure/arm-compute!ImagesOperations#createOrUpdate:member": "Compute.Images.createOrUpdate", + "@azure/arm-compute!ImagesOperations#get:member": "Compute.Images.get", + "@azure/arm-compute!DedicatedHostsOperations#restart:member": "Compute.DedicatedHosts.restart", + "@azure/arm-compute!DedicatedHostsOperations#redeploy:member": "Compute.DedicatedHosts.redeploy", + "@azure/arm-compute!DedicatedHostsOperations#listAvailableSizes:member": "Compute.DedicatedHosts.listAvailableSizes", + "@azure/arm-compute!DedicatedHostsOperations#listByHostGroup:member": "Compute.DedicatedHosts.listByHostGroup", + "@azure/arm-compute!DedicatedHostsOperations#delete:member": "Compute.DedicatedHosts.delete", + "@azure/arm-compute!DedicatedHostsOperations#update:member": "Compute.DedicatedHosts.update", + "@azure/arm-compute!DedicatedHostsOperations#createOrUpdate:member": "Compute.DedicatedHosts.createOrUpdate", + "@azure/arm-compute!DedicatedHostsOperations#get:member": "Compute.DedicatedHosts.get", + "@azure/arm-compute!DedicatedHostGroupsOperations#listBySubscription:member": "Compute.DedicatedHostGroups.listBySubscription", + "@azure/arm-compute!DedicatedHostGroupsOperations#listByResourceGroup:member": "Compute.DedicatedHostGroups.listByResourceGroup", + "@azure/arm-compute!DedicatedHostGroupsOperations#delete:member": "Compute.DedicatedHostGroups.delete", + "@azure/arm-compute!DedicatedHostGroupsOperations#update:member": "Compute.DedicatedHostGroups.update", + "@azure/arm-compute!DedicatedHostGroupsOperations#createOrUpdate:member": "Compute.DedicatedHostGroups.createOrUpdate", + "@azure/arm-compute!DedicatedHostGroupsOperations#get:member": "Compute.DedicatedHostGroups.get", + "@azure/arm-compute!ProximityPlacementGroupsOperations#listBySubscription:member": "Compute.ProximityPlacementGroups.listBySubscription", + "@azure/arm-compute!ProximityPlacementGroupsOperations#listByResourceGroup:member": "Compute.ProximityPlacementGroups.listByResourceGroup", + "@azure/arm-compute!ProximityPlacementGroupsOperations#delete:member": "Compute.ProximityPlacementGroups.delete", + "@azure/arm-compute!ProximityPlacementGroupsOperations#update:member": "Compute.ProximityPlacementGroups.update", + "@azure/arm-compute!ProximityPlacementGroupsOperations#createOrUpdate:member": "Compute.ProximityPlacementGroups.createOrUpdate", + "@azure/arm-compute!ProximityPlacementGroupsOperations#get:member": "Compute.ProximityPlacementGroups.get", + "@azure/arm-compute!AvailabilitySetsOperations#convertToVirtualMachineScaleSet:member": "Compute.AvailabilitySets.convertToVirtualMachineScaleSet", + "@azure/arm-compute!AvailabilitySetsOperations#validateMigrationToVirtualMachineScaleSet:member": "Compute.AvailabilitySets.validateMigrationToVirtualMachineScaleSet", + "@azure/arm-compute!AvailabilitySetsOperations#cancelMigrationToVirtualMachineScaleSet:member": "Compute.AvailabilitySets.cancelMigrationToVirtualMachineScaleSet", + "@azure/arm-compute!AvailabilitySetsOperations#startMigrationToVirtualMachineScaleSet:member": "Compute.AvailabilitySets.startMigrationToVirtualMachineScaleSet", + "@azure/arm-compute!AvailabilitySetsOperations#listAvailableSizes:member": "Compute.AvailabilitySets.listAvailableSizes", + "@azure/arm-compute!AvailabilitySetsOperations#listBySubscription:member": "Compute.AvailabilitySets.listBySubscription", + "@azure/arm-compute!AvailabilitySetsOperations#list:member": "Compute.AvailabilitySets.list", + "@azure/arm-compute!AvailabilitySetsOperations#delete:member": "Compute.AvailabilitySets.delete", + "@azure/arm-compute!AvailabilitySetsOperations#update:member": "Compute.AvailabilitySets.update", + "@azure/arm-compute!AvailabilitySetsOperations#createOrUpdate:member": "Compute.AvailabilitySets.createOrUpdate", + "@azure/arm-compute!AvailabilitySetsOperations#get:member": "Compute.AvailabilitySets.get", + "@azure/arm-compute!VirtualMachineExtensionImagesOperations#listVersions:member": "Compute.VirtualMachineExtensionImages.listVersions", + "@azure/arm-compute!VirtualMachineExtensionImagesOperations#listTypes:member": "Compute.VirtualMachineExtensionImages.listTypes", + "@azure/arm-compute!VirtualMachineExtensionImagesOperations#get:member": "Compute.VirtualMachineExtensionImages.get", + "@azure/arm-compute!VirtualMachineExtensionsOperations#list:member": "Compute.VirtualMachineExtensions.list", + "@azure/arm-compute!VirtualMachineExtensionsOperations#delete:member": "Compute.VirtualMachineExtensions.delete", + "@azure/arm-compute!VirtualMachineExtensionsOperations#update:member": "Compute.VirtualMachineExtensions.update", + "@azure/arm-compute!VirtualMachineExtensionsOperations#createOrUpdate:member": "Compute.VirtualMachineExtensions.createOrUpdate", + "@azure/arm-compute!VirtualMachineExtensionsOperations#get:member": "Compute.VirtualMachineExtensions.get", + "@azure/arm-compute!VirtualMachinesOperations#listByLocation:member": "Compute.VirtualMachinesOperationGroup.listByLocation", + "@azure/arm-compute!VirtualMachinesOperations#migrateToVMScaleSet:member": "Compute.VirtualMachines.migrateToVMScaleSet", + "@azure/arm-compute!VirtualMachinesOperations#runCommand:member": "Compute.VirtualMachines.runCommand", + "@azure/arm-compute!VirtualMachinesOperations#listAvailableSizes:member": "Compute.VirtualMachines.listAvailableSizes", + "@azure/arm-compute!VirtualMachinesOperations#start:member": "Compute.VirtualMachines.start", + "@azure/arm-compute!VirtualMachinesOperations#simulateEviction:member": "Compute.VirtualMachines.simulateEviction", + "@azure/arm-compute!VirtualMachinesOperations#retrieveBootDiagnosticsData:member": "Compute.VirtualMachines.retrieveBootDiagnosticsData", + "@azure/arm-compute!VirtualMachinesOperations#restart:member": "Compute.VirtualMachines.restart", + "@azure/arm-compute!VirtualMachinesOperations#reimage:member": "Compute.VirtualMachines.reimage", + "@azure/arm-compute!VirtualMachinesOperations#redeploy:member": "Compute.VirtualMachines.redeploy", + "@azure/arm-compute!VirtualMachinesOperations#reapply:member": "Compute.VirtualMachines.reapply", + "@azure/arm-compute!VirtualMachinesOperations#powerOff:member": "Compute.VirtualMachines.powerOff", + "@azure/arm-compute!VirtualMachinesOperations#performMaintenance:member": "Compute.VirtualMachines.performMaintenance", + "@azure/arm-compute!VirtualMachinesOperations#instanceView:member": "Compute.VirtualMachines.instanceView", + "@azure/arm-compute!VirtualMachinesOperations#installPatches:member": "Compute.VirtualMachines.installPatches", + "@azure/arm-compute!VirtualMachinesOperations#generalize:member": "Compute.VirtualMachines.generalize", + "@azure/arm-compute!VirtualMachinesOperations#deallocate:member": "Compute.VirtualMachines.deallocate", + "@azure/arm-compute!VirtualMachinesOperations#convertToManagedDisks:member": "Compute.VirtualMachines.convertToManagedDisks", + "@azure/arm-compute!VirtualMachinesOperations#capture:member": "Compute.VirtualMachines.capture", + "@azure/arm-compute!VirtualMachinesOperations#attachDetachDataDisks:member": "Compute.VirtualMachines.attachDetachDataDisks", + "@azure/arm-compute!VirtualMachinesOperations#assessPatches:member": "Compute.VirtualMachines.assessPatches", + "@azure/arm-compute!VirtualMachinesOperations#listAll:member": "Compute.VirtualMachines.listAll", + "@azure/arm-compute!VirtualMachinesOperations#list:member": "Compute.VirtualMachines.list", + "@azure/arm-compute!VirtualMachinesOperations#delete:member": "Compute.VirtualMachines.delete", + "@azure/arm-compute!VirtualMachinesOperations#update:member": "Compute.VirtualMachines.update", + "@azure/arm-compute!VirtualMachinesOperations#createOrUpdate:member": "Compute.VirtualMachines.createOrUpdate", + "@azure/arm-compute!VirtualMachinesOperations#get:member": "Compute.VirtualMachines.get", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionsOperations#list:member": "Compute.VirtualMachineScaleSetVMExtensions.list", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionsOperations#delete:member": "Compute.VirtualMachineScaleSetVMExtensions.delete", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionsOperations#update:member": "Compute.VirtualMachineScaleSetVMExtensions.update", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionsOperations#createOrUpdate:member": "Compute.VirtualMachineScaleSetVMExtensions.createOrUpdate", + "@azure/arm-compute!VirtualMachineScaleSetVMExtensionsOperations#get:member": "Compute.VirtualMachineScaleSetVMExtensions.get", + "@azure/arm-compute!VirtualMachineScaleSetLifeCycleHookEventsOperations#list:member": "Compute.VirtualMachineScaleSetLifeCycleHookEvents.list", + "@azure/arm-compute!VirtualMachineScaleSetLifeCycleHookEventsOperations#update:member": "Compute.VirtualMachineScaleSetLifeCycleHookEvents.update", + "@azure/arm-compute!VirtualMachineScaleSetLifeCycleHookEventsOperations#get:member": "Compute.VirtualMachineScaleSetLifeCycleHookEvents.get", + "@azure/arm-compute!VirtualMachineScaleSetExtensionsOperations#list:member": "Compute.VirtualMachineScaleSetExtensions.list", + "@azure/arm-compute!VirtualMachineScaleSetExtensionsOperations#delete:member": "Compute.VirtualMachineScaleSetExtensions.delete", + "@azure/arm-compute!VirtualMachineScaleSetExtensionsOperations#update:member": "Compute.VirtualMachineScaleSetExtensions.update", + "@azure/arm-compute!VirtualMachineScaleSetExtensionsOperations#createOrUpdate:member": "Compute.VirtualMachineScaleSetExtensions.createOrUpdate", + "@azure/arm-compute!VirtualMachineScaleSetExtensionsOperations#get:member": "Compute.VirtualMachineScaleSetExtensions.get", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#listByLocation:member": "Compute.VirtualMachineScaleSetsOperationGroup.listByLocation", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#scaleOut:member": "Compute.VirtualMachineScaleSets.scaleOut", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#start:member": "Compute.VirtualMachineScaleSets.start", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#listSkus:member": "Compute.VirtualMachineScaleSets.listSkus", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#setOrchestrationServiceState:member": "Compute.VirtualMachineScaleSets.setOrchestrationServiceState", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#restart:member": "Compute.VirtualMachineScaleSets.restart", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#reimageAll:member": "Compute.VirtualMachineScaleSets.reimageAll", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#reimage:member": "Compute.VirtualMachineScaleSets.reimage", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#redeploy:member": "Compute.VirtualMachineScaleSets.redeploy", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#reapply:member": "Compute.VirtualMachineScaleSets.reapply", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#powerOff:member": "Compute.VirtualMachineScaleSets.powerOff", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#performMaintenance:member": "Compute.VirtualMachineScaleSets.performMaintenance", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#getOSUpgradeHistory:member": "Compute.VirtualMachineScaleSets.getOSUpgradeHistory", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#updateInstances:member": "Compute.VirtualMachineScaleSets.updateInstances", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#getInstanceView:member": "Compute.VirtualMachineScaleSets.getInstanceView", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#forceRecoveryServiceFabricPlatformUpdateDomainWalk:member": "Compute.VirtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#deleteInstances:member": "Compute.VirtualMachineScaleSets.deleteInstances", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#deallocate:member": "Compute.VirtualMachineScaleSets.deallocate", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#convertToSinglePlacementGroup:member": "Compute.VirtualMachineScaleSets.convertToSinglePlacementGroup", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#approveRollingUpgrade:member": "Compute.VirtualMachineScaleSets.approveRollingUpgrade", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#listAll:member": "Compute.VirtualMachineScaleSets.listAll", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#list:member": "Compute.VirtualMachineScaleSets.list", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#delete:member": "Compute.VirtualMachineScaleSets.delete", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#update:member": "Compute.VirtualMachineScaleSets.update", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#createOrUpdate:member": "Compute.VirtualMachineScaleSets.createOrUpdate", + "@azure/arm-compute!VirtualMachineScaleSetsOperations#get:member": "Compute.VirtualMachineScaleSets.get", + "@azure/arm-compute!OperationsOperations#list:member": "Azure.ResourceManager.Legacy.Operations.list" + } + } +} diff --git a/sdk/compute/arm-compute/package.json b/sdk/compute/arm-compute/package.json index df1992eee32f..09962bbbe53f 100644 --- a/sdk/compute/arm-compute/package.json +++ b/sdk/compute/arm-compute/package.json @@ -1,119 +1,249 @@ { "name": "@azure/arm-compute", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", + "version": "24.0.0", "description": "A generated SDK for ComputeManagementClient.", - "version": "23.3.0", "engines": { "node": ">=20.0.0" }, - "dependencies": { - "@azure/core-lro": "^2.5.4", - "@azure/abort-controller": "^2.1.2", - "@azure/core-paging": "^1.6.2", - "@azure/core-client": "^1.9.3", - "@azure/core-auth": "^1.9.0", - "@azure/core-rest-pipeline": "^1.19.1", - "tslib": "^2.8.1" + "sideEffects": false, + "autoPublish": false, + "type": "module", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./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" + } + }, + "./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" + } + }, + "./models/common": { + "browser": { + "types": "./dist/browser/models/common/index.d.ts", + "default": "./dist/browser/models/common/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/common/index.d.ts", + "default": "./dist/react-native/models/common/index.js" + }, + "import": { + "types": "./dist/esm/models/common/index.d.ts", + "default": "./dist/esm/models/common/index.js" + }, + "require": { + "types": "./dist/commonjs/models/common/index.d.ts", + "default": "./dist/commonjs/models/common/index.js" + } + }, + "./models/compute": { + "browser": { + "types": "./dist/browser/models/compute/index.d.ts", + "default": "./dist/browser/models/compute/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/compute/index.d.ts", + "default": "./dist/react-native/models/compute/index.js" + }, + "import": { + "types": "./dist/esm/models/compute/index.d.ts", + "default": "./dist/esm/models/compute/index.js" + }, + "require": { + "types": "./dist/commonjs/models/compute/index.d.ts", + "default": "./dist/commonjs/models/compute/index.js" + } + }, + "./models/computeDisk": { + "browser": { + "types": "./dist/browser/models/computeDisk/index.d.ts", + "default": "./dist/browser/models/computeDisk/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/computeDisk/index.d.ts", + "default": "./dist/react-native/models/computeDisk/index.js" + }, + "import": { + "types": "./dist/esm/models/computeDisk/index.d.ts", + "default": "./dist/esm/models/computeDisk/index.js" + }, + "require": { + "types": "./dist/commonjs/models/computeDisk/index.d.ts", + "default": "./dist/commonjs/models/computeDisk/index.js" + } + }, + "./models/computeGallery": { + "browser": { + "types": "./dist/browser/models/computeGallery/index.d.ts", + "default": "./dist/browser/models/computeGallery/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/computeGallery/index.d.ts", + "default": "./dist/react-native/models/computeGallery/index.js" + }, + "import": { + "types": "./dist/esm/models/computeGallery/index.d.ts", + "default": "./dist/esm/models/computeGallery/index.js" + }, + "require": { + "types": "./dist/commonjs/models/computeGallery/index.d.ts", + "default": "./dist/commonjs/models/computeGallery/index.js" + } + }, + "./models/computeSku": { + "browser": { + "types": "./dist/browser/models/computeSku/index.d.ts", + "default": "./dist/browser/models/computeSku/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/computeSku/index.d.ts", + "default": "./dist/react-native/models/computeSku/index.js" + }, + "import": { + "types": "./dist/esm/models/computeSku/index.d.ts", + "default": "./dist/esm/models/computeSku/index.js" + }, + "require": { + "types": "./dist/commonjs/models/computeSku/index.d.ts", + "default": "./dist/commonjs/models/computeSku/index.js" + } + } }, "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/commonjs/index.d.ts", - "type": "module", + "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/compute/arm-compute/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/computeManagementContext.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/arm-network": "^32.2.0", "@azure/dev-tool": "workspace:^", + "@azure/eslint-plugin-azure-sdk": "workspace:^", "@azure/identity": "catalog:internal", - "@azure/logger": "workspace:^", "@types/node": "catalog:", - "@vitest/browser-playwright": "catalog:testing", - "@vitest/coverage-istanbul": "catalog:testing", "cross-env": "catalog:", - "dotenv": "catalog:testing", "eslint": "catalog:", - "playwright": "catalog:testing", "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" }, - "repository": "github:Azure/azure-sdk-for-js", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "files": [ - "dist/", - "README.md", - "LICENSE" - ], "scripts": { - "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "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", - "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "lint:fix": "echo skipped", "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", - "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}\" ", - "test": "npm run test:node && npm run test:browser", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", "test:node": "dev-tool run test:vitest", - "test:browser": "echo skipped", - "update-snippets": "dev-tool run update-snippets", - "test:node:esm": "dev-tool run test:vitest --esm" - }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/computeManagementClient.ts", - "prefix": "packageDetails" - } - ] + "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" }, - "autoPublish": true, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute", "//sampleConfiguration": { - "productName": "", + "productName": "@azure/arm-compute", "productSlugs": [ "azure" ], "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview" - }, - "exports": { - "./package.json": "./package.json", - ".": { - "browser": { - "types": "./dist/browser/index.d.ts", - "default": "./dist/browser/index.js" - }, - "react-native": { - "types": "./dist/react-native/index.d.ts", - "default": "./dist/react-native/index.js" - }, - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/commonjs/index.d.ts", - "default": "./dist/commonjs/index.js" - } - } + "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-compute" } } diff --git a/sdk/compute/arm-compute/review/arm-compute-api-node.api.md b/sdk/compute/arm-compute/review/arm-compute-api-node.api.md new file mode 100644 index 000000000000..5ec6e2096ddc --- /dev/null +++ b/sdk/compute/arm-compute/review/arm-compute-api-node.api.md @@ -0,0 +1,26 @@ +## API Report File for "@azure/arm-compute" + +> 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 ComputeManagementClientOptionalParams extends ClientOptions { + cloudSetting?: AzureSupportedClouds; +} + +// @public +export interface ComputeManagementContext extends Client { + subscriptionId: string; +} + +// @public +export function createComputeManagement(credential: TokenCredential, subscriptionId: string, options?: ComputeManagementClientOptionalParams): ComputeManagementContext; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute/review/arm-compute-models-common-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-common-node.api.md new file mode 100644 index 000000000000..3e9c41fc3401 --- /dev/null +++ b/sdk/compute/arm-compute/review/arm-compute-models-common-node.api.md @@ -0,0 +1,105 @@ +## API Report File for "@azure/arm-compute" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @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 type Architecture = string; + +// @public +export interface CloudError { + error?: ApiError; +} + +// @public +export interface ExtendedLocation { + name?: string; + type?: ExtendedLocationTypes; +} + +// @public +export type ExtendedLocationTypes = string; + +// @public +export type HyperVGeneration = string; + +// @public +export interface InnerError { + errordetail?: string; + exceptiontype?: string; +} + +// @public +export enum KnownArchitecture { + Arm64 = "Arm64", + X64 = "x64" +} + +// @public +export enum KnownExtendedLocationTypes { + EdgeZone = "EdgeZone" +} + +// @public +export enum KnownHyperVGeneration { + V1 = "V1", + V2 = "V2" +} + +// @public +export enum KnownSnapshotAccessState { + Available = "Available", + AvailableWithInstantAccess = "AvailableWithInstantAccess", + InstantAccess = "InstantAccess", + Pending = "Pending", + Unknown = "Unknown" +} + +// @public +export type OperatingSystemStateTypes = "Generalized" | "Specialized"; + +// @public +export type OperatingSystemTypes = "Windows" | "Linux"; + +// @public +export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; + +// @public +export type SnapshotAccessState = string; + +// @public +export interface SubResource { + id?: string; +} + +// @public +export interface SubResourceReadOnly { + readonly id?: string; +} + +// @public +export interface UserAssignedIdentitiesValue { + readonly clientId?: string; + readonly principalId?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md new file mode 100644 index 000000000000..84f95fee4f2d --- /dev/null +++ b/sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md @@ -0,0 +1,3737 @@ +## API Report File for "@azure/arm-compute" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export interface AdditionalCapabilities { + enableFips1403Encryption?: boolean; + hibernationEnabled?: boolean; + ultraSSDEnabled?: boolean; +} + +// @public +export interface AdditionalUnattendContent { + componentName?: ComponentNames; + content?: string; + passName?: PassNames; + settingName?: SettingNames; +} + +// @public +export interface AllInstancesDown { + automaticallyApprove?: boolean; +} + +// @public +export type AllocationStrategy = string; + +// @public +export interface AlternativeOption { + type?: AlternativeType; + value?: string; +} + +// @public +export type AlternativeType = string; + +// @public +export interface ApiEntityReference { + id?: string; +} + +// @public +export interface ApplicationProfile { + galleryApplications?: VMGalleryApplication[]; +} + +// @public +export type ArchitectureTypes = string; + +// @public +export interface AttachDetachDataDisksRequest { + dataDisksToAttach?: DataDisksToAttach[]; + dataDisksToDetach?: DataDisksToDetach[]; +} + +// @public +export interface AutomaticOSUpgradePolicy { + disableAutomaticRollback?: boolean; + enableAutomaticOSUpgrade?: boolean; + osRollingUpgradeDeferral?: boolean; + useRollingUpgradePolicy?: boolean; +} + +// @public +export interface AutomaticOSUpgradeProperties { + automaticOSUpgradeSupported: boolean; +} + +// @public +export interface AutomaticRepairsPolicy { + enabled?: boolean; + gracePeriod?: string; + repairAction?: RepairAction; +} + +// @public +export interface AutomaticZoneRebalancingPolicy { + enabled?: boolean; + rebalanceBehavior?: RebalanceBehavior; + rebalanceStrategy?: RebalanceStrategy; +} + +// @public +export interface AvailabilitySet extends TrackedResource { + platformFaultDomainCount?: number; + platformUpdateDomainCount?: number; + proximityPlacementGroup?: SubResource; + scheduledEventsPolicy?: ScheduledEventsPolicy; + sku?: Sku; + readonly statuses?: InstanceViewStatus[]; + virtualMachines?: SubResource[]; + readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; +} + +// @public +export interface AvailabilitySetProperties { + platformFaultDomainCount?: number; + platformUpdateDomainCount?: number; + proximityPlacementGroup?: SubResource; + scheduledEventsPolicy?: ScheduledEventsPolicy; + readonly statuses?: InstanceViewStatus[]; + virtualMachines?: SubResource[]; + readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; +} + +// @public +export interface AvailabilitySetUpdate extends UpdateResource { + platformFaultDomainCount?: number; + platformUpdateDomainCount?: number; + proximityPlacementGroup?: SubResource; + scheduledEventsPolicy?: ScheduledEventsPolicy; + sku?: Sku; + readonly statuses?: InstanceViewStatus[]; + virtualMachines?: SubResource[]; + readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; +} + +// @public +export interface AvailablePatchSummary { + readonly assessmentActivityId?: string; + readonly criticalAndSecurityPatchCount?: number; + readonly error?: ApiError; + readonly lastModifiedTime?: Date; + readonly otherPatchCount?: number; + readonly rebootPending?: boolean; + readonly startTime?: Date; + readonly status?: PatchOperationStatus; +} + +// @public +export interface BillingProfile { + maxPrice?: number; +} + +// @public +export interface BootDiagnostics { + enabled?: boolean; + storageUri?: string; +} + +// @public +export interface BootDiagnosticsInstanceView { + readonly consoleScreenshotBlobUri?: string; + readonly serialConsoleLogBlobUri?: string; + readonly status?: InstanceViewStatus; +} + +// @public +export type CachingTypes = "None" | "ReadOnly" | "ReadWrite"; + +// @public +export interface CapacityReservation extends TrackedResource { + readonly instanceView?: CapacityReservationInstanceView; + readonly platformFaultDomainCount?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly reservationId?: string; + scheduleProfile?: ScheduleProfile; + sku: Sku; + readonly timeCreated?: Date; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + zones?: string[]; +} + +// @public +export interface CapacityReservationGroup extends TrackedResource { + readonly capacityReservations?: SubResourceReadOnly[]; + readonly instanceView?: CapacityReservationGroupInstanceView; + reservationType?: ReservationType; + sharingProfile?: ResourceSharingProfile; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + zones?: string[]; +} + +// @public +export interface CapacityReservationGroupInstanceView { + readonly capacityReservations?: CapacityReservationInstanceViewWithName[]; + readonly sharedSubscriptionIds?: SubResourceReadOnly[]; +} + +// @public +export type CapacityReservationGroupInstanceViewTypes = string; + +// @public +export interface CapacityReservationGroupProperties { + readonly capacityReservations?: SubResourceReadOnly[]; + readonly instanceView?: CapacityReservationGroupInstanceView; + reservationType?: ReservationType; + sharingProfile?: ResourceSharingProfile; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; +} + +// @public +export interface CapacityReservationGroupUpdate extends UpdateResource { + readonly capacityReservations?: SubResourceReadOnly[]; + readonly instanceView?: CapacityReservationGroupInstanceView; + reservationType?: ReservationType; + sharingProfile?: ResourceSharingProfile; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; +} + +// @public +export interface CapacityReservationInstanceView { + statuses?: InstanceViewStatus[]; + utilizationInfo?: CapacityReservationUtilization; +} + +// @public +export type CapacityReservationInstanceViewTypes = string; + +// @public +export interface CapacityReservationInstanceViewWithName extends CapacityReservationInstanceView { + readonly name?: string; +} + +// @public +export interface CapacityReservationProfile { + capacityReservationGroup?: SubResource; +} + +// @public +export interface CapacityReservationProperties { + readonly instanceView?: CapacityReservationInstanceView; + readonly platformFaultDomainCount?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly reservationId?: string; + scheduleProfile?: ScheduleProfile; + readonly timeCreated?: Date; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; +} + +// @public +export interface CapacityReservationUpdate extends UpdateResource { + readonly instanceView?: CapacityReservationInstanceView; + readonly platformFaultDomainCount?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly reservationId?: string; + scheduleProfile?: ScheduleProfile; + sku?: Sku; + readonly timeCreated?: Date; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; +} + +// @public +export interface CapacityReservationUtilization { + readonly currentCapacity?: number; + readonly virtualMachinesAllocated?: SubResourceReadOnly[]; +} + +// @public +export type ComponentNames = "Microsoft-Windows-Shell-Setup"; + +// @public +export type ConsistencyModeTypes = string; + +// @public +export interface ConvertToVirtualMachineScaleSetInput { + virtualMachineScaleSetName?: string; +} + +// @public +export interface DataDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + detachOption?: DiskDetachOptionTypes; + diskIopsReadWrite?: number; + diskMBpsReadWrite?: number; + diskSizeGB?: number; + image?: VirtualHardDisk; + lun: number; + managedDisk?: ManagedDiskParameters; + name?: string; + sourceResource?: ApiEntityReference; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + toBeDetached?: boolean; + vhd?: VirtualHardDisk; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface DataDiskImage { + readonly lun?: number; +} + +// @public +export interface DataDisksToAttach { + caching?: CachingTypes; + deleteOption?: DiskDeleteOptionTypes; + diskEncryptionSet?: DiskEncryptionSetParameters; + diskId: string; + lun?: number; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface DataDisksToDetach { + detachOption?: DiskDetachOptionTypes; + diskId: string; +} + +// @public +export interface DedicatedHost extends TrackedResource { + autoReplaceOnFailure?: boolean; + readonly hostId?: string; + readonly instanceView?: DedicatedHostInstanceView; + licenseType?: DedicatedHostLicenseTypes; + platformFaultDomain?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + sku: Sku; + readonly timeCreated?: Date; + readonly virtualMachines?: SubResourceReadOnly[]; +} + +// @public +export interface DedicatedHostAllocatableVM { + count?: number; + vmSize?: string; +} + +// @public +export interface DedicatedHostAvailableCapacity { + allocatableVMs?: DedicatedHostAllocatableVM[]; +} + +// @public +export interface DedicatedHostGroup extends TrackedResource { + additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; + readonly hosts?: SubResourceReadOnly[]; + readonly instanceView?: DedicatedHostGroupInstanceView; + platformFaultDomainCount?: number; + supportAutomaticPlacement?: boolean; + zones?: string[]; +} + +// @public +export interface DedicatedHostGroupInstanceView { + hosts?: DedicatedHostInstanceViewWithName[]; +} + +// @public +export interface DedicatedHostGroupProperties { + additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; + readonly hosts?: SubResourceReadOnly[]; + readonly instanceView?: DedicatedHostGroupInstanceView; + platformFaultDomainCount: number; + supportAutomaticPlacement?: boolean; +} + +// @public +export interface DedicatedHostGroupPropertiesAdditionalCapabilities { + ultraSSDEnabled?: boolean; +} + +// @public +export interface DedicatedHostGroupUpdate extends UpdateResource { + additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; + readonly hosts?: SubResourceReadOnly[]; + readonly instanceView?: DedicatedHostGroupInstanceView; + platformFaultDomainCount?: number; + supportAutomaticPlacement?: boolean; + zones?: string[]; +} + +// @public +export interface DedicatedHostInstanceView { + readonly assetId?: string; + availableCapacity?: DedicatedHostAvailableCapacity; + statuses?: InstanceViewStatus[]; +} + +// @public +export interface DedicatedHostInstanceViewWithName extends DedicatedHostInstanceView { + readonly name?: string; +} + +// @public +export type DedicatedHostLicenseTypes = "None" | "Windows_Server_Hybrid" | "Windows_Server_Perpetual"; + +// @public +export interface DedicatedHostProperties { + autoReplaceOnFailure?: boolean; + readonly hostId?: string; + readonly instanceView?: DedicatedHostInstanceView; + licenseType?: DedicatedHostLicenseTypes; + platformFaultDomain?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly timeCreated?: Date; + readonly virtualMachines?: SubResourceReadOnly[]; +} + +// @public +export interface DedicatedHostUpdate extends UpdateResource { + autoReplaceOnFailure?: boolean; + readonly hostId?: string; + readonly instanceView?: DedicatedHostInstanceView; + licenseType?: DedicatedHostLicenseTypes; + platformFaultDomain?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + sku?: Sku; + readonly timeCreated?: Date; + readonly virtualMachines?: SubResourceReadOnly[]; +} + +// @public +export interface DefaultVirtualMachineScaleSetInfo { + readonly constrainedMaximumCapacity?: boolean; + readonly defaultVirtualMachineScaleSet?: SubResource; +} + +// @public +export type DeleteOptions = string; + +// @public +export interface DiagnosticsProfile { + bootDiagnostics?: BootDiagnostics; +} + +// @public +export type DiffDiskOptions = string; + +// @public +export type DiffDiskPlacement = string; + +// @public +export interface DiffDiskSettings { + enableFullCaching?: boolean; + option?: DiffDiskOptions; + placement?: DiffDiskPlacement; +} + +// @public +export interface DisallowedConfiguration { + vmDiskType?: VmDiskTypes; +} + +// @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 interface DiskInstanceView { + encryptionSettings?: DiskEncryptionSettings[]; + name?: string; + statuses?: InstanceViewStatus[]; + storageAlignmentStatus?: StorageAlignmentStatus; +} + +// @public +export interface DiskRestorePointAttributes extends SubResourceReadOnly { + encryption?: RestorePointEncryption; + sourceDiskRestorePoint?: ApiEntityReference; +} + +// @public +export interface DiskRestorePointInstanceView { + id?: string; + replicationStatus?: DiskRestorePointReplicationStatus; + snapshotAccessState?: SnapshotAccessState; +} + +// @public +export interface DiskRestorePointReplicationStatus { + completionPercent?: number; + status?: InstanceViewStatus; +} + +// @public +export type DomainNameLabelScopeTypes = string; + +// @public +export interface EncryptionIdentity { + userAssignedIdentityResourceId?: string; +} + +// @public +export interface EventGridAndResourceGraph { + enable?: boolean; + scheduledEventsApiVersion?: string; +} + +// @public +export type ExecutionState = string; + +// @public +export type ExpandTypeForListVMs = string; + +// @public +export type ExpandTypesForGetCapacityReservationGroups = string; + +// @public +export type ExpandTypesForGetVMScaleSets = string; + +// @public +export type ExpandTypesForListVMs = string; + +// @public +export interface ExternalHealthPolicy { + enabled?: boolean; + expiryDuration?: string; + gracePeriod?: string; +} + +// @public +export interface HardwareProfile { + vmSize?: VirtualMachineSizeTypes; + vmSizeProperties?: VMSizeProperties; +} + +// @public +export type HighSpeedInterconnectPlacement = string; + +// @public +export interface HostEndpointSettings { + inVMAccessControlProfileReferenceId?: string; + mode?: Modes; +} + +// @public +export type HyperVGenerationType = string; + +// @public +export type HyperVGenerationTypes = string; + +// @public +export interface Image extends TrackedResource { + extendedLocation?: ExtendedLocation; + hyperVGeneration?: HyperVGenerationTypes; + readonly provisioningState?: string; + sourceVirtualMachine?: SubResource; + storageProfile?: ImageStorageProfile; +} + +// @public +export interface ImageDataDisk extends ImageDisk { + lun: number; +} + +// @public +export interface ImageDeprecationStatus { + alternativeOption?: AlternativeOption; + imageState?: ImageState; + scheduledDeprecationTime?: Date; +} + +// @public +export interface ImageDisk { + blobUri?: string; + caching?: CachingTypes; + diskEncryptionSet?: DiskEncryptionSetParameters; + diskSizeGB?: number; + managedDisk?: SubResource; + snapshot?: SubResource; + storageAccountType?: StorageAccountTypes; +} + +// @public +export interface ImageOSDisk extends ImageDisk { + osState: OperatingSystemStateTypes; + osType: OperatingSystemTypes; +} + +// @public +export interface ImageProperties { + hyperVGeneration?: HyperVGenerationTypes; + readonly provisioningState?: string; + sourceVirtualMachine?: SubResource; + storageProfile?: ImageStorageProfile; +} + +// @public +export interface ImageReference extends SubResource { + communityGalleryImageId?: string; + readonly exactVersion?: string; + offer?: string; + publisher?: string; + sharedGalleryImageId?: string; + sku?: string; + version?: string; +} + +// @public +export type ImageState = string; + +// @public +export interface ImageStorageProfile { + dataDisks?: ImageDataDisk[]; + osDisk?: ImageOSDisk; + zoneResilient?: boolean; +} + +// @public +export interface ImageUpdate extends UpdateResource { + hyperVGeneration?: HyperVGenerationTypes; + readonly provisioningState?: string; + sourceVirtualMachine?: SubResource; + storageProfile?: ImageStorageProfile; +} + +// @public +export interface InstanceViewStatus { + code?: string; + displayStatus?: string; + level?: StatusLevelTypes; + message?: string; + time?: Date; +} + +// @public +export type InstanceViewTypes = "instanceView" | "userData" | "resiliencyView"; + +// @public +export type IntervalInMins = "ThreeMins" | "FiveMins" | "ThirtyMins" | "SixtyMins"; + +// @public +export type IPVersion = 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 KnownAllocationStrategy { + CapacityOptimized = "CapacityOptimized", + LowestPrice = "LowestPrice", + Prioritized = "Prioritized" +} + +// @public +export enum KnownAlternativeType { + None = "None", + Offer = "Offer", + Plan = "Plan" +} + +// @public +export enum KnownArchitectureTypes { + Arm64 = "Arm64", + X64 = "x64" +} + +// @public +export enum KnownCapacityReservationGroupInstanceViewTypes { + InstanceView = "instanceView" +} + +// @public +export enum KnownCapacityReservationInstanceViewTypes { + InstanceView = "instanceView" +} + +// @public +export enum KnownConsistencyModeTypes { + ApplicationConsistent = "ApplicationConsistent", + CrashConsistent = "CrashConsistent", + FileSystemConsistent = "FileSystemConsistent" +} + +// @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 KnownExecutionState { + Canceled = "Canceled", + Failed = "Failed", + Pending = "Pending", + Running = "Running", + Succeeded = "Succeeded", + TimedOut = "TimedOut", + Unknown = "Unknown" +} + +// @public +export enum KnownExpandTypeForListVMs { + InstanceView = "instanceView" +} + +// @public +export enum KnownExpandTypesForGetCapacityReservationGroups { + VirtualMachineScaleSetVMsRef = "virtualMachineScaleSetVMs/$ref", + VirtualMachinesRef = "virtualMachines/$ref" +} + +// @public +export enum KnownExpandTypesForGetVMScaleSets { + UserData = "userData" +} + +// @public +export enum KnownExpandTypesForListVMs { + InstanceView = "instanceView" +} + +// @public +export enum KnownHighSpeedInterconnectPlacement { + None = "None", + Trunk = "Trunk" +} + +// @public +export enum KnownHyperVGenerationType { + V1 = "V1", + V2 = "V2" +} + +// @public +export enum KnownHyperVGenerationTypes { + V1 = "V1", + V2 = "V2" +} + +// @public +export enum KnownImageState { + Active = "Active", + Deprecated = "Deprecated", + ScheduledForDeprecation = "ScheduledForDeprecation" +} + +// @public +export enum KnownIPVersion { + IPv4 = "IPv4", + IPv6 = "IPv6" +} + +// @public +export enum KnownIPVersions { + IPv4 = "IPv4", + IPv6 = "IPv6" +} + +// @public +export enum KnownLifecycleHookAction { + Approve = "Approve", + Reject = "Reject" +} + +// @public +export enum KnownLifecycleHookActionState { + Approved = "Approved", + Rejected = "Rejected", + Waiting = "Waiting" +} + +// @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 KnownMode { + Audit = "Audit", + Enforce = "Enforce" +} + +// @public +export enum KnownModes { + Audit = "Audit", + Disabled = "Disabled", + Enforce = "Enforce" +} + +// @public +export enum KnownNetworkApiVersion { + NetworkApiVersion20201101 = "2020-11-01", + NetworkApiVersion20221101 = "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 KnownOperatingSystemType { + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownOrchestrationMode { + Flexible = "Flexible", + Uniform = "Uniform" +} + +// @public +export enum KnownOrchestrationServiceNames { + AutomaticRepairs = "AutomaticRepairs", + AutomaticZoneRebalancing = "AutomaticZoneRebalancing" +} + +// @public +export enum KnownOrchestrationServiceOperationStatus { + Completed = "Completed", + InProgress = "InProgress" +} + +// @public +export enum KnownOrchestrationServiceState { + NotRunning = "NotRunning", + Running = "Running", + Suspended = "Suspended" +} + +// @public +export enum KnownOrchestrationServiceStateAction { + Resume = "Resume", + Suspend = "Suspend" +} + +// @public +export enum KnownPatchAssessmentState { + Available = "Available", + Unknown = "Unknown" +} + +// @public +export enum KnownPatchInstallationState { + Excluded = "Excluded", + Failed = "Failed", + Installed = "Installed", + NotSelected = "NotSelected", + Pending = "Pending", + Unknown = "Unknown" +} + +// @public +export enum KnownPatchOperationStatus { + CompletedWithWarnings = "CompletedWithWarnings", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export enum KnownProximityPlacementGroupType { + Standard = "Standard", + Ultra = "Ultra" +} + +// @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 KnownRebalanceBehavior { + CreateBeforeDelete = "CreateBeforeDelete" +} + +// @public +export enum KnownRebalanceStrategy { + Recreate = "Recreate" +} + +// @public +export enum KnownRepairAction { + Reimage = "Reimage", + Replace = "Replace", + Restart = "Restart" +} + +// @public +export enum KnownReservationType { + Block = "Block", + Targeted = "Targeted" +} + +// @public +export enum KnownResilientVMDeletionStatus { + Disabled = "Disabled", + Enabled = "Enabled", + Failed = "Failed", + InProgress = "InProgress" +} + +// @public +export enum KnownResourceIdOptionsForGetCapacityReservationGroups { + All = "All", + CreatedInSubscription = "CreatedInSubscription", + SharedWithSubscription = "SharedWithSubscription" +} + +// @public +export enum KnownRestorePointCollectionExpandOptions { + RestorePoints = "restorePoints" +} + +// @public +export enum KnownRestorePointEncryptionType { + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" +} + +// @public +export enum KnownRestorePointExpandOptions { + InstanceView = "instanceView" +} + +// @public +export enum KnownScriptShellTypes { + Default = "Default", + Powershell7 = "Powershell7" +} + +// @public +export enum KnownSecurityEncryptionTypes { + DiskWithVMGuestState = "DiskWithVMGuestState", + NonPersistedTPM = "NonPersistedTPM", + VMGuestStateOnly = "VMGuestStateOnly" +} + +// @public +export enum KnownSecurityTypes { + ConfidentialVM = "ConfidentialVM", + Standard = "Standard", + TrustedLaunch = "TrustedLaunch" +} + +// @public +export enum KnownSshEncryptionTypes { + Ed25519 = "Ed25519", + RSA = "RSA" +} + +// @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 KnownStorageAlignmentStatus { + Aligned = "Aligned", + Unaligned = "Unaligned" +} + +// @public +export enum KnownStorageFaultDomainAlignmentType { + Aligned = "Aligned", + BestEffortAligned = "BestEffortAligned" +} + +// @public +export enum KnownVirtualMachineEvictionPolicyTypes { + Deallocate = "Deallocate", + Delete = "Delete" +} + +// @public +export enum KnownVirtualMachinePriorityTypes { + Low = "Low", + Regular = "Regular", + Spot = "Spot" +} + +// @public +export enum KnownVirtualMachineScaleSetScaleInRules { + Default = "Default", + NewestVM = "NewestVM", + OldestVM = "OldestVM" +} + +// @public +export enum KnownVirtualMachineSizeTypes { + BasicA0 = "Basic_A0", + BasicA1 = "Basic_A1", + BasicA2 = "Basic_A2", + BasicA3 = "Basic_A3", + BasicA4 = "Basic_A4", + StandardA0 = "Standard_A0", + StandardA1 = "Standard_A1", + StandardA10 = "Standard_A10", + StandardA11 = "Standard_A11", + StandardA1V2 = "Standard_A1_v2", + StandardA2 = "Standard_A2", + StandardA2MV2 = "Standard_A2m_v2", + StandardA2V2 = "Standard_A2_v2", + StandardA3 = "Standard_A3", + StandardA4 = "Standard_A4", + StandardA4MV2 = "Standard_A4m_v2", + StandardA4V2 = "Standard_A4_v2", + StandardA5 = "Standard_A5", + StandardA6 = "Standard_A6", + StandardA7 = "Standard_A7", + StandardA8 = "Standard_A8", + StandardA8MV2 = "Standard_A8m_v2", + StandardA8V2 = "Standard_A8_v2", + StandardA9 = "Standard_A9", + StandardB1Ms = "Standard_B1ms", + StandardB1S = "Standard_B1s", + StandardB2Ms = "Standard_B2ms", + StandardB2S = "Standard_B2s", + StandardB4Ms = "Standard_B4ms", + StandardB8Ms = "Standard_B8ms", + StandardD1 = "Standard_D1", + StandardD11 = "Standard_D11", + StandardD11V2 = "Standard_D11_v2", + StandardD12 = "Standard_D12", + StandardD12V2 = "Standard_D12_v2", + StandardD13 = "Standard_D13", + StandardD13V2 = "Standard_D13_v2", + StandardD14 = "Standard_D14", + StandardD14V2 = "Standard_D14_v2", + StandardD15V2 = "Standard_D15_v2", + StandardD16SV3 = "Standard_D16s_v3", + StandardD16V3 = "Standard_D16_v3", + StandardD1V2 = "Standard_D1_v2", + StandardD2 = "Standard_D2", + StandardD2SV3 = "Standard_D2s_v3", + StandardD2V2 = "Standard_D2_v2", + StandardD2V3 = "Standard_D2_v3", + StandardD3 = "Standard_D3", + StandardD32SV3 = "Standard_D32s_v3", + StandardD32V3 = "Standard_D32_v3", + StandardD3V2 = "Standard_D3_v2", + StandardD4 = "Standard_D4", + StandardD4SV3 = "Standard_D4s_v3", + StandardD4V2 = "Standard_D4_v2", + StandardD4V3 = "Standard_D4_v3", + StandardD5V2 = "Standard_D5_v2", + StandardD64SV3 = "Standard_D64s_v3", + StandardD64V3 = "Standard_D64_v3", + StandardD8SV3 = "Standard_D8s_v3", + StandardD8V3 = "Standard_D8_v3", + StandardDS1 = "Standard_DS1", + StandardDS11 = "Standard_DS11", + StandardDS11V2 = "Standard_DS11_v2", + StandardDS12 = "Standard_DS12", + StandardDS12V2 = "Standard_DS12_v2", + StandardDS13 = "Standard_DS13", + StandardDS132V2 = "Standard_DS13-2_v2", + StandardDS134V2 = "Standard_DS13-4_v2", + StandardDS13V2 = "Standard_DS13_v2", + StandardDS14 = "Standard_DS14", + StandardDS144V2 = "Standard_DS14-4_v2", + StandardDS148V2 = "Standard_DS14-8_v2", + StandardDS14V2 = "Standard_DS14_v2", + StandardDS15V2 = "Standard_DS15_v2", + StandardDS1V2 = "Standard_DS1_v2", + StandardDS2 = "Standard_DS2", + StandardDS2V2 = "Standard_DS2_v2", + StandardDS3 = "Standard_DS3", + StandardDS3V2 = "Standard_DS3_v2", + StandardDS4 = "Standard_DS4", + StandardDS4V2 = "Standard_DS4_v2", + StandardDS5V2 = "Standard_DS5_v2", + StandardE16SV3 = "Standard_E16s_v3", + StandardE16V3 = "Standard_E16_v3", + StandardE2SV3 = "Standard_E2s_v3", + StandardE2V3 = "Standard_E2_v3", + StandardE3216V3 = "Standard_E32-16_v3", + StandardE328SV3 = "Standard_E32-8s_v3", + StandardE32SV3 = "Standard_E32s_v3", + StandardE32V3 = "Standard_E32_v3", + StandardE4SV3 = "Standard_E4s_v3", + StandardE4V3 = "Standard_E4_v3", + StandardE6416SV3 = "Standard_E64-16s_v3", + StandardE6432SV3 = "Standard_E64-32s_v3", + StandardE64SV3 = "Standard_E64s_v3", + StandardE64V3 = "Standard_E64_v3", + StandardE8SV3 = "Standard_E8s_v3", + StandardE8V3 = "Standard_E8_v3", + StandardF1 = "Standard_F1", + StandardF16 = "Standard_F16", + StandardF16S = "Standard_F16s", + StandardF16SV2 = "Standard_F16s_v2", + StandardF1S = "Standard_F1s", + StandardF2 = "Standard_F2", + StandardF2S = "Standard_F2s", + StandardF2SV2 = "Standard_F2s_v2", + StandardF32SV2 = "Standard_F32s_v2", + StandardF4 = "Standard_F4", + StandardF4S = "Standard_F4s", + StandardF4SV2 = "Standard_F4s_v2", + StandardF64SV2 = "Standard_F64s_v2", + StandardF72SV2 = "Standard_F72s_v2", + StandardF8 = "Standard_F8", + StandardF8S = "Standard_F8s", + StandardF8SV2 = "Standard_F8s_v2", + StandardG1 = "Standard_G1", + StandardG2 = "Standard_G2", + StandardG3 = "Standard_G3", + StandardG4 = "Standard_G4", + StandardG5 = "Standard_G5", + StandardGS1 = "Standard_GS1", + StandardGS2 = "Standard_GS2", + StandardGS3 = "Standard_GS3", + StandardGS4 = "Standard_GS4", + StandardGS44 = "Standard_GS4-4", + StandardGS48 = "Standard_GS4-8", + StandardGS5 = "Standard_GS5", + StandardGS516 = "Standard_GS5-16", + StandardGS58 = "Standard_GS5-8", + StandardH16 = "Standard_H16", + StandardH16M = "Standard_H16m", + StandardH16Mr = "Standard_H16mr", + StandardH16R = "Standard_H16r", + StandardH8 = "Standard_H8", + StandardH8M = "Standard_H8m", + StandardL16S = "Standard_L16s", + StandardL32S = "Standard_L32s", + StandardL4S = "Standard_L4s", + StandardL8S = "Standard_L8s", + StandardM12832Ms = "Standard_M128-32ms", + StandardM12864Ms = "Standard_M128-64ms", + StandardM128Ms = "Standard_M128ms", + StandardM128S = "Standard_M128s", + StandardM6416Ms = "Standard_M64-16ms", + StandardM6432Ms = "Standard_M64-32ms", + StandardM64Ms = "Standard_M64ms", + StandardM64S = "Standard_M64s", + StandardNC12 = "Standard_NC12", + StandardNC12SV2 = "Standard_NC12s_v2", + StandardNC12SV3 = "Standard_NC12s_v3", + StandardNC24 = "Standard_NC24", + StandardNC24R = "Standard_NC24r", + StandardNC24RsV2 = "Standard_NC24rs_v2", + StandardNC24RsV3 = "Standard_NC24rs_v3", + StandardNC24SV2 = "Standard_NC24s_v2", + StandardNC24SV3 = "Standard_NC24s_v3", + StandardNC6 = "Standard_NC6", + StandardNC6SV2 = "Standard_NC6s_v2", + StandardNC6SV3 = "Standard_NC6s_v3", + StandardND12S = "Standard_ND12s", + StandardND24Rs = "Standard_ND24rs", + StandardND24S = "Standard_ND24s", + StandardND6S = "Standard_ND6s", + StandardNV12 = "Standard_NV12", + StandardNV24 = "Standard_NV24", + StandardNV6 = "Standard_NV6" +} + +// @public +export enum KnownVmDiskTypes { + None = "None", + Unmanaged = "Unmanaged" +} + +// @public +export enum KnownVMGuestPatchClassificationLinux { + Critical = "Critical", + Other = "Other", + Security = "Security" +} + +// @public +export enum KnownVMGuestPatchClassificationWindows { + Critical = "Critical", + Definition = "Definition", + FeaturePack = "FeaturePack", + Security = "Security", + ServicePack = "ServicePack", + Tools = "Tools", + UpdateRollUp = "UpdateRollUp", + Updates = "Updates" +} + +// @public +export enum KnownVMGuestPatchRebootBehavior { + AlwaysRequiresReboot = "AlwaysRequiresReboot", + CanRequestReboot = "CanRequestReboot", + NeverReboots = "NeverReboots", + Unknown = "Unknown" +} + +// @public +export enum KnownVMGuestPatchRebootSetting { + Always = "Always", + IfRequired = "IfRequired", + Never = "Never" +} + +// @public +export enum KnownVMGuestPatchRebootStatus { + Completed = "Completed", + Failed = "Failed", + NotNeeded = "NotNeeded", + Required = "Required", + Started = "Started", + Unknown = "Unknown" +} + +// @public +export enum KnownVMScaleSetLifecycleHookEventState { + Active = "Active", + Completed = "Completed" +} + +// @public +export enum KnownVMScaleSetLifecycleHookEventType { + UpgradeAutoOSRollingBatchStarting = "UpgradeAutoOSRollingBatchStarting", + UpgradeAutoOSScheduling = "UpgradeAutoOSScheduling" +} + +// @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 KnownZonalPlatformFaultDomainAlignMode { + Aligned = "Aligned", + BestEffortAligned = "BestEffortAligned", + Unaligned = "Unaligned" +} + +// @public +export enum KnownZonePlacementPolicyType { + Any = "Any", + Auto = "Auto" +} + +// @public +export interface LastPatchInstallationSummary { + readonly error?: ApiError; + readonly excludedPatchCount?: number; + readonly failedPatchCount?: number; + readonly installationActivityId?: string; + readonly installedPatchCount?: number; + readonly lastModifiedTime?: Date; + readonly maintenanceWindowExceeded?: boolean; + readonly notSelectedPatchCount?: number; + readonly pendingPatchCount?: number; + readonly startTime?: Date; + readonly status?: PatchOperationStatus; +} + +// @public +export interface LifecycleHook { + defaultAction?: LifecycleHookAction; + type?: VMScaleSetLifecycleHookEventType; + waitDuration?: string; +} + +// @public +export type LifecycleHookAction = string; + +// @public +export type LifecycleHookActionState = string; + +// @public +export interface LifecycleHooksProfile { + lifecycleHooks?: LifecycleHook[]; +} + +// @public +export interface LinuxConfiguration { + disablePasswordAuthentication?: boolean; + enableVMAgentPlatformUpdates?: boolean; + patchSettings?: LinuxPatchSettings; + provisionVMAgent?: boolean; + ssh?: SshConfiguration; +} + +// @public +export interface LinuxParameters { + classificationsToInclude?: VMGuestPatchClassificationLinux[]; + maintenanceRunId?: string; + packageNameMasksToExclude?: string[]; + packageNameMasksToInclude?: string[]; +} + +// @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 interface LogAnalyticsInputBase { + blobContainerSasUri: string; + fromTime: Date; + groupByClientApplicationId?: boolean; + groupByOperationName?: boolean; + groupByResourceName?: boolean; + groupByThrottlePolicy?: boolean; + groupByUserAgent?: boolean; + toTime: Date; +} + +// @public +export interface LogAnalyticsOperationResult { + readonly properties?: LogAnalyticsOutput; +} + +// @public +export interface LogAnalyticsOutput { + readonly output?: string; +} + +// @public +export type MaintenanceOperationResultCodeTypes = "None" | "RetryLater" | "MaintenanceAborted" | "MaintenanceCompleted"; + +// @public +export interface MaintenanceRedeployStatus { + isCustomerInitiatedMaintenanceAllowed?: boolean; + lastOperationMessage?: string; + lastOperationResultCode?: MaintenanceOperationResultCodeTypes; + maintenanceWindowEndTime?: Date; + maintenanceWindowStartTime?: Date; + preMaintenanceWindowEndTime?: Date; + preMaintenanceWindowStartTime?: Date; +} + +// @public +export interface ManagedDiskParameters extends SubResource { + diskEncryptionSet?: DiskEncryptionSetParameters; + securityProfile?: VMDiskSecurityProfile; + storageAccountType?: StorageAccountTypes; +} + +// @public +export interface MaxInstancePercentPerZonePolicy { + enabled?: boolean; + value?: number; +} + +// @public +export interface MigrateToVirtualMachineScaleSetInput { + virtualMachineScaleSetFlexible: SubResource; +} + +// @public +export interface MigrateVMToVirtualMachineScaleSetInput { + targetFaultDomain?: number; + targetVMSize?: string; + targetZone?: 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 { + deleteOption?: DeleteOptions; + primary?: boolean; +} + +// @public +export interface NetworkInterfaceReferenceProperties { + deleteOption?: DeleteOptions; + primary?: boolean; +} + +// @public +export interface NetworkProfile { + networkApiVersion?: NetworkApiVersion; + networkInterfaceConfigurations?: VirtualMachineNetworkInterfaceConfiguration[]; + networkInterfaces?: NetworkInterfaceReference[]; +} + +// @public +export type OperatingSystemType = string; + +// @public +export interface OperationRecoverySettings { + reimageRecoveryPolicy?: ReimageRecoveryPolicy; + restartRecoveryPolicy?: RestartRecoveryPolicy; + startRecoveryPolicy?: StartRecoveryPolicy; +} + +// @public +export type OrchestrationMode = string; + +// @public +export type OrchestrationServiceNames = string; + +// @public +export type OrchestrationServiceOperationStatus = string; + +// @public +export type OrchestrationServiceState = string; + +// @public +export type OrchestrationServiceStateAction = string; + +// @public +export interface OrchestrationServiceStateInput { + action: OrchestrationServiceStateAction; + serviceName: OrchestrationServiceNames; +} + +// @public +export interface OrchestrationServiceSummary { + readonly lastStatusChangeTime?: Date; + readonly latestOperationStatus?: OrchestrationServiceOperationStatus; + readonly serviceName?: OrchestrationServiceNames; + readonly serviceState?: OrchestrationServiceState; +} + +// @public +export interface OSDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + diffDiskSettings?: DiffDiskSettings; + diskSizeGB?: number; + encryptionSettings?: DiskEncryptionSettings; + image?: VirtualHardDisk; + managedDisk?: ManagedDiskParameters; + name?: string; + osType?: OperatingSystemTypes; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + vhd?: VirtualHardDisk; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface OSDiskImage { + operatingSystem: OperatingSystemTypes; +} + +// @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 OSProfileProvisioningData { + adminPassword?: string; + customData?: string; +} + +// @public +export type PassNames = "OobeSystem"; + +// @public +export type PatchAssessmentState = string; + +// @public +export interface PatchInstallationDetail { + readonly classifications?: string[]; + readonly installationState?: PatchInstallationState; + readonly kbId?: string; + readonly name?: string; + readonly patchId?: string; + readonly version?: string; +} + +// @public +export type PatchInstallationState = string; + +// @public +export type PatchOperationStatus = string; + +// @public +export interface PatchSettings { + assessmentMode?: WindowsPatchAssessmentMode; + automaticByPlatformSettings?: WindowsVMGuestPatchAutomaticByPlatformSettings; + enableHotpatching?: boolean; + patchMode?: WindowsVMGuestPatchMode; +} + +// @public +export interface Placement { + excludeZones?: string[]; + includeZones?: string[]; + zonePlacementPolicy?: ZonePlacementPolicyType; +} + +// @public +export interface Plan { + name?: string; + product?: string; + promotionCode?: string; + publisher?: string; +} + +// @public +export interface PriorityMixPolicy { + baseRegularPriorityCount?: number; + regularPriorityPercentageAboveBase?: number; +} + +// @public +export type ProtocolTypes = "Http" | "Https"; + +// @public +export interface ProximityPlacementGroup extends TrackedResource { + readonly availabilitySets?: SubResourceWithColocationStatus[]; + colocationStatus?: InstanceViewStatus; + intent?: ProximityPlacementGroupPropertiesIntent; + proximityPlacementGroupType?: ProximityPlacementGroupType; + readonly virtualMachines?: SubResourceWithColocationStatus[]; + readonly virtualMachineScaleSets?: SubResourceWithColocationStatus[]; + zones?: string[]; +} + +// @public +export interface ProximityPlacementGroupProperties { + readonly availabilitySets?: SubResourceWithColocationStatus[]; + colocationStatus?: InstanceViewStatus; + intent?: ProximityPlacementGroupPropertiesIntent; + proximityPlacementGroupType?: ProximityPlacementGroupType; + readonly virtualMachines?: SubResourceWithColocationStatus[]; + readonly virtualMachineScaleSets?: SubResourceWithColocationStatus[]; +} + +// @public +export interface ProximityPlacementGroupPropertiesIntent { + vmSizes?: string[]; +} + +// @public +export type ProximityPlacementGroupType = string; + +// @public +export interface ProximityPlacementGroupUpdate extends UpdateResource { +} + +// @public +export interface ProxyAgentSettings { + addProxyAgentExtension?: boolean; + enabled?: boolean; + imds?: HostEndpointSettings; + keyIncarnationId?: number; + mode?: Mode; + wireServer?: HostEndpointSettings; +} + +// @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 PurchasePlan { + name: string; + product: string; + publisher: string; +} + +// @public +export type RebalanceBehavior = string; + +// @public +export type RebalanceStrategy = string; + +// @public +export interface RecoveryWalkResponse { + readonly nextPlatformUpdateDomain?: number; + readonly walkPerformed?: boolean; +} + +// @public +export interface ReimageRecoveryPolicy { + enabled?: boolean; +} + +// @public +export type RepairAction = string; + +// @public +export interface RequestRateByIntervalInput extends LogAnalyticsInputBase { + intervalLength: IntervalInMins; +} + +// @public +export type ReservationType = string; + +// @public +export interface ResiliencyPolicy { + automaticZoneRebalancingPolicy?: AutomaticZoneRebalancingPolicy; + operationRecoverySettings?: OperationRecoverySettings; + resilientVMCreationPolicy?: ResilientVMCreationPolicy; + resilientVMDeletionPolicy?: ResilientVMDeletionPolicy; + zoneAllocationPolicy?: ZoneAllocationPolicy; +} + +// @public +export interface ResiliencyProfile { + zoneMovement?: ZoneMovement; +} + +// @public +export interface ResilientVMCreationPolicy { + enabled?: boolean; +} + +// @public +export interface ResilientVMDeletionPolicy { + enabled?: boolean; +} + +// @public +export type ResilientVMDeletionStatus = string; + +// @public +export type ResourceIdOptionsForGetCapacityReservationGroups = string; + +// @public +export interface ResourceSharingProfile { + subscriptionIds?: SubResource[]; +} + +// @public +export interface RestartRecoveryPolicy { + enabled?: boolean; +} + +// @public +export interface RestorePoint extends ProxyResource { + consistencyMode?: ConsistencyModeTypes; + excludeDisks?: ApiEntityReference[]; + readonly instanceView?: RestorePointInstanceView; + instantAccessDurationMinutes?: number; + readonly provisioningState?: string; + sourceMetadata?: RestorePointSourceMetadata; + sourceRestorePoint?: ApiEntityReference; + timeCreated?: Date; +} + +// @public +export interface RestorePointCollection extends TrackedResource { + instantAccess?: boolean; + readonly provisioningState?: string; + readonly restorePointCollectionId?: string; + readonly restorePoints?: RestorePoint[]; + source?: RestorePointCollectionSourceProperties; +} + +// @public +export type RestorePointCollectionExpandOptions = string; + +// @public +export interface RestorePointCollectionProperties { + instantAccess?: boolean; + readonly provisioningState?: string; + readonly restorePointCollectionId?: string; + readonly restorePoints?: RestorePoint[]; + source?: RestorePointCollectionSourceProperties; +} + +// @public +export interface RestorePointCollectionSourceProperties { + id?: string; + readonly location?: string; +} + +// @public +export interface RestorePointCollectionUpdate extends UpdateResource { + instantAccess?: boolean; + readonly provisioningState?: string; + readonly restorePointCollectionId?: string; + readonly restorePoints?: RestorePoint[]; + source?: RestorePointCollectionSourceProperties; +} + +// @public +export interface RestorePointEncryption { + diskEncryptionSet?: DiskEncryptionSetParameters; + type?: RestorePointEncryptionType; +} + +// @public +export type RestorePointEncryptionType = string; + +// @public +export type RestorePointExpandOptions = string; + +// @public +export interface RestorePointInstanceView { + diskRestorePoints?: DiskRestorePointInstanceView[]; + statuses?: InstanceViewStatus[]; +} + +// @public +export interface RestorePointProperties { + consistencyMode?: ConsistencyModeTypes; + excludeDisks?: ApiEntityReference[]; + readonly instanceView?: RestorePointInstanceView; + instantAccessDurationMinutes?: number; + readonly provisioningState?: string; + sourceMetadata?: RestorePointSourceMetadata; + sourceRestorePoint?: ApiEntityReference; + timeCreated?: Date; +} + +// @public +export interface RestorePointSourceMetadata { + readonly diagnosticsProfile?: DiagnosticsProfile; + readonly hardwareProfile?: HardwareProfile; + readonly hyperVGeneration?: HyperVGenerationTypes; + readonly licenseType?: string; + readonly location?: string; + readonly osProfile?: OSProfile; + readonly securityProfile?: SecurityProfile; + storageProfile?: RestorePointSourceVMStorageProfile; + readonly userData?: string; + readonly vmId?: string; +} + +// @public +export interface RestorePointSourceVMDataDisk { + readonly caching?: CachingTypes; + diskRestorePoint?: DiskRestorePointAttributes; + readonly diskSizeGB?: number; + readonly lun?: number; + managedDisk?: ManagedDiskParameters; + readonly name?: string; + readonly writeAcceleratorEnabled?: boolean; +} + +// @public +export interface RestorePointSourceVmosDisk { + readonly caching?: CachingTypes; + diskRestorePoint?: DiskRestorePointAttributes; + readonly diskSizeGB?: number; + readonly encryptionSettings?: DiskEncryptionSettings; + managedDisk?: ManagedDiskParameters; + readonly name?: string; + readonly osType?: OperatingSystemType; + readonly writeAcceleratorEnabled?: boolean; +} + +// @public +export interface RestorePointSourceVMStorageProfile { + dataDisks?: RestorePointSourceVMDataDisk[]; + readonly diskControllerType?: DiskControllerTypes; + osDisk?: RestorePointSourceVmosDisk; +} + +// @public +export interface RetrieveBootDiagnosticsDataResult { + readonly consoleScreenshotBlobUri?: string; + readonly serialConsoleLogBlobUri?: string; +} + +// @public +export interface RollbackStatusInfo { + readonly failedRolledbackInstanceCount?: number; + readonly rollbackError?: ApiError; + readonly successfullyRolledbackInstanceCount?: number; +} + +// @public +export type RollingUpgradeActionType = "Start" | "Cancel"; + +// @public +export interface RollingUpgradePolicy { + enableCrossZoneUpgrade?: boolean; + maxBatchInstancePercent?: number; + maxSurge?: boolean; + maxUnhealthyInstancePercent?: number; + maxUnhealthyUpgradedInstancePercent?: number; + pauseTimeBetweenBatches?: string; + prioritizeUnhealthyInstances?: boolean; + rollbackFailedInstancesOnPolicyBreach?: boolean; +} + +// @public +export interface RollingUpgradeProgressInfo { + readonly failedInstanceCount?: number; + readonly inProgressInstanceCount?: number; + readonly pendingInstanceCount?: number; + readonly successfulInstanceCount?: number; +} + +// @public +export interface RollingUpgradeRunningStatus { + readonly code?: RollingUpgradeStatusCode; + readonly lastAction?: RollingUpgradeActionType; + readonly lastActionTime?: Date; + readonly startTime?: Date; +} + +// @public +export type RollingUpgradeStatusCode = "RollingForward" | "Cancelled" | "Completed" | "Faulted"; + +// @public +export interface RollingUpgradeStatusInfo extends TrackedResource { + readonly error?: ApiError; + readonly policy?: RollingUpgradePolicy; + readonly progress?: RollingUpgradeProgressInfo; + readonly runningStatus?: RollingUpgradeRunningStatus; +} + +// @public +export interface RollingUpgradeStatusInfoProperties { + readonly error?: ApiError; + readonly policy?: RollingUpgradePolicy; + readonly progress?: RollingUpgradeProgressInfo; + readonly runningStatus?: RollingUpgradeRunningStatus; +} + +// @public +export interface RunCommandDocument extends RunCommandDocumentBase { + parameters?: RunCommandParameterDefinition[]; + script: string[]; +} + +// @public +export interface RunCommandDocumentBase { + description: string; + id: string; + label: string; + osType: OperatingSystemTypes; + schema: string; +} + +// @public +export interface RunCommandInput { + commandId: string; + parameters?: RunCommandInputParameter[]; + script?: string[]; +} + +// @public +export interface RunCommandInputParameter { + name: string; + value: string; +} + +// @public +export interface RunCommandManagedIdentity { + clientId?: string; + objectId?: string; +} + +// @public +export interface RunCommandParameterDefinition { + defaultValue?: string; + name: string; + required?: boolean; + type: string; +} + +// @public +export interface RunCommandResult { + value?: InstanceViewStatus[]; +} + +// @public +export interface ScaleInPolicy { + forceDeletion?: boolean; + prioritizeUnhealthyVMs?: boolean; + rules?: VirtualMachineScaleSetScaleInRules[]; +} + +// @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 interface ScheduleProfile { + end?: string; + start?: string; +} + +// @public +export type ScriptShellTypes = string; + +// @public +export type SecurityEncryptionTypes = string; + +// @public +export interface SecurityPostureReference { + excludeExtensions?: string[]; + id: string; + isOverridable?: boolean; +} + +// @public +export interface SecurityPostureReferenceUpdate { + excludeExtensions?: string[]; + id?: string; + isOverridable?: boolean; +} + +// @public +export interface SecurityProfile { + encryptionAtHost?: boolean; + encryptionIdentity?: EncryptionIdentity; + proxyAgentSettings?: ProxyAgentSettings; + securityType?: SecurityTypes; + uefiSettings?: UefiSettings; +} + +// @public +export type SecurityTypes = string; + +// @public +export interface ServiceArtifactReference { + id?: string; +} + +// @public +export type SettingNames = "AutoLogon" | "FirstLogonCommands"; + +// @public +export interface Sku { + capacity?: number; + name?: string; + tier?: string; +} + +// @public +export interface SkuProfile { + allocationStrategy?: AllocationStrategy; + vmSizes?: SkuProfileVMSize[]; +} + +// @public +export interface SkuProfileVMSize { + name?: string; + rank?: number; +} + +// @public +export interface SpotRestorePolicy { + enabled?: boolean; + restoreTimeout?: string; +} + +// @public +export interface SshConfiguration { + publicKeys?: SshPublicKey[]; +} + +// @public +export type SshEncryptionTypes = string; + +// @public +export interface SshGenerateKeyPairInputParameters { + encryptionType?: SshEncryptionTypes; +} + +// @public +export interface SshPublicKey { + keyData?: string; + path?: string; +} + +// @public +export interface SshPublicKeyGenerateKeyPairResult { + id: string; + privateKey: string; + publicKey: string; +} + +// @public +export interface SshPublicKeyResource extends TrackedResource { + publicKey?: string; +} + +// @public +export interface SshPublicKeyResourceProperties { + publicKey?: string; +} + +// @public +export interface SshPublicKeyUpdateResource extends UpdateResource { + publicKey?: string; +} + +// @public +export interface StartRecoveryPolicy { + enabled?: boolean; +} + +// @public +export type StatusLevelTypes = "Info" | "Warning" | "Error"; + +// @public +export type StorageAccountTypes = string; + +// @public +export type StorageAlignmentStatus = string; + +// @public +export type StorageFaultDomainAlignmentType = string; + +// @public +export interface StorageProfile { + alignRegionalDisksToVMZone?: boolean; + dataDisks?: DataDisk[]; + diskControllerType?: DiskControllerTypes; + imageReference?: ImageReference; + osDisk?: OSDisk; +} + +// @public +export interface SubResourceWithColocationStatus extends SubResource { + colocationStatus?: InstanceViewStatus; +} + +// @public +export interface TerminateNotificationProfile { + enable?: boolean; + notBeforeTimeout?: string; +} + +// @public +export interface ThrottledRequestsInput extends LogAnalyticsInputBase { +} + +// @public +export interface UefiSettings { + secureBootEnabled?: boolean; + vTpmEnabled?: boolean; +} + +// @public +export interface UpdateResource { + tags?: Record; +} + +// @public +export type UpgradeMode = "Automatic" | "Manual" | "Rolling"; + +// @public +export interface UpgradeOperationHistoricalStatusInfo { + readonly location?: string; + readonly properties?: UpgradeOperationHistoricalStatusInfoProperties; + readonly type?: string; +} + +// @public +export interface UpgradeOperationHistoricalStatusInfoProperties { + readonly error?: ApiError; + readonly progress?: RollingUpgradeProgressInfo; + readonly rollbackInfo?: RollbackStatusInfo; + readonly runningStatus?: UpgradeOperationHistoryStatus; + readonly startedBy?: UpgradeOperationInvoker; + readonly targetImageReference?: ImageReference; +} + +// @public +export interface UpgradeOperationHistoryStatus { + readonly code?: UpgradeState; + readonly endTime?: Date; + readonly startTime?: Date; +} + +// @public +export type UpgradeOperationInvoker = "Unknown" | "User" | "Platform"; + +// @public +export interface UpgradePolicy { + automaticOSUpgradePolicy?: AutomaticOSUpgradePolicy; + mode?: UpgradeMode; + rollingUpgradePolicy?: RollingUpgradePolicy; +} + +// @public +export type UpgradeState = "RollingForward" | "Cancelled" | "Completed" | "Faulted"; + +// @public +export interface Usage { + currentValue: number; + limit: number; + name: UsageName; + unit: "Count"; +} + +// @public +export interface UsageName { + localizedValue?: string; + value?: 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 extends TrackedResource { + additionalCapabilities?: AdditionalCapabilities; + applicationProfile?: ApplicationProfile; + availabilitySet?: SubResource; + billingProfile?: BillingProfile; + capacityReservation?: CapacityReservationProfile; + diagnosticsProfile?: DiagnosticsProfile; + readonly etag?: string; + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + extendedLocation?: ExtendedLocation; + extensionsTimeBudget?: string; + hardwareProfile?: HardwareProfile; + host?: SubResource; + hostGroup?: SubResource; + identity?: VirtualMachineIdentity; + readonly instanceView?: VirtualMachineInstanceView; + licenseType?: string; + readonly managedBy?: string; + networkProfile?: NetworkProfile; + osProfile?: OSProfile; + placement?: Placement; + plan?: Plan; + platformFaultDomain?: number; + priority?: VirtualMachinePriorityTypes; + readonly provisioningState?: string; + proximityPlacementGroup?: SubResource; + resiliencyProfile?: ResiliencyProfile; + readonly resources?: VirtualMachineExtension[]; + scheduledEventsPolicy?: ScheduledEventsPolicy; + scheduledEventsProfile?: ScheduledEventsProfile; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + readonly timeCreated?: Date; + userData?: string; + virtualMachineScaleSet?: SubResource; + readonly vmId?: string; + zones?: string[]; +} + +// @public +export interface VirtualMachineAgentInstanceView { + extensionHandlers?: VirtualMachineExtensionHandlerInstanceView[]; + statuses?: InstanceViewStatus[]; + vmAgentVersion?: string; +} + +// @public +export interface VirtualMachineAssessPatchesResult { + readonly assessmentActivityId?: string; + readonly availablePatches?: VirtualMachineSoftwarePatchProperties[]; + readonly criticalAndSecurityPatchCount?: number; + readonly error?: ApiError; + readonly otherPatchCount?: number; + readonly rebootPending?: boolean; + readonly startDateTime?: Date; + readonly status?: PatchOperationStatus; +} + +// @public +export interface VirtualMachineCaptureParameters { + destinationContainerName: string; + overwriteVhds: boolean; + vhdPrefix: string; +} + +// @public +export interface VirtualMachineCaptureResult extends SubResource { + readonly contentVersion?: string; + readonly parameters?: any; + readonly resources?: any[]; + readonly schema?: string; +} + +// @public +export type VirtualMachineEvictionPolicyTypes = string; + +// @public +export interface VirtualMachineExtension extends TrackedResource { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + instanceView?: VirtualMachineExtensionInstanceView; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + typeHandlerVersion?: string; + typePropertiesType?: string; +} + +// @public +export interface VirtualMachineExtensionHandlerInstanceView { + status?: InstanceViewStatus; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineExtensionImage extends TrackedResource { + computeRole?: string; + handlerSchema?: string; + operatingSystem?: string; + supportsMultipleExtensions?: boolean; + vmScaleSetEnabled?: boolean; +} + +// @public +export interface VirtualMachineExtensionImageProperties { + computeRole: string; + handlerSchema: string; + operatingSystem: string; + supportsMultipleExtensions?: boolean; + vmScaleSetEnabled?: boolean; +} + +// @public +export interface VirtualMachineExtensionInstanceView { + name?: string; + statuses?: InstanceViewStatus[]; + substatuses?: InstanceViewStatus[]; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineExtensionProperties { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + instanceView?: VirtualMachineExtensionInstanceView; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineExtensionsListResult { + value?: VirtualMachineExtension[]; +} + +// @public +export interface VirtualMachineExtensionUpdate extends UpdateResource { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineExtensionUpdateProperties { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineHealthStatus { + readonly status?: InstanceViewStatus; +} + +// @public +export interface VirtualMachineIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export interface VirtualMachineImage extends VirtualMachineImageResource { + architecture?: ArchitectureTypes; + automaticOSUpgradeProperties?: AutomaticOSUpgradeProperties; + dataDiskImages?: DataDiskImage[]; + disallowed?: DisallowedConfiguration; + // (undocumented) + features?: VirtualMachineImageFeature[]; + hyperVGeneration?: HyperVGenerationTypes; + imageDeprecationStatus?: ImageDeprecationStatus; + osDiskImage?: OSDiskImage; + plan?: PurchasePlan; +} + +// @public +export interface VirtualMachineImageFeature { + name?: string; + value?: string; +} + +// @public +export interface VirtualMachineImageProperties { + architecture?: ArchitectureTypes; + automaticOSUpgradeProperties?: AutomaticOSUpgradeProperties; + dataDiskImages?: DataDiskImage[]; + disallowed?: DisallowedConfiguration; + // (undocumented) + features?: VirtualMachineImageFeature[]; + hyperVGeneration?: HyperVGenerationTypes; + imageDeprecationStatus?: ImageDeprecationStatus; + osDiskImage?: OSDiskImage; + plan?: PurchasePlan; +} + +// @public +export interface VirtualMachineImageResource extends SubResource { + extendedLocation?: ExtendedLocation; + location: string; + name: string; + tags?: Record; +} + +// @public +export interface VirtualMachineInstallPatchesParameters { + linuxParameters?: LinuxParameters; + maximumDuration?: string; + rebootSetting: VMGuestPatchRebootSetting; + windowsParameters?: WindowsParameters; +} + +// @public +export interface VirtualMachineInstallPatchesResult { + readonly error?: ApiError; + readonly excludedPatchCount?: number; + readonly failedPatchCount?: number; + readonly installationActivityId?: string; + readonly installedPatchCount?: number; + readonly maintenanceWindowExceeded?: boolean; + readonly notSelectedPatchCount?: number; + readonly patches?: PatchInstallationDetail[]; + readonly pendingPatchCount?: number; + readonly rebootStatus?: VMGuestPatchRebootStatus; + readonly startDateTime?: Date; + readonly status?: PatchOperationStatus; +} + +// @public +export interface VirtualMachineInstanceView { + readonly assignedHost?: string; + bootDiagnostics?: BootDiagnosticsInstanceView; + computerName?: string; + disks?: DiskInstanceView[]; + extensions?: VirtualMachineExtensionInstanceView[]; + hyperVGeneration?: HyperVGenerationType; + readonly isVMInStandbyPool?: boolean; + maintenanceRedeployStatus?: MaintenanceRedeployStatus; + osName?: string; + osVersion?: string; + patchStatus?: VirtualMachinePatchStatus; + platformFaultDomain?: number; + platformUpdateDomain?: number; + rdpThumbPrint?: string; + statuses?: InstanceViewStatus[]; + vmAgent?: VirtualMachineAgentInstanceView; + readonly vmHealth?: VirtualMachineHealthStatus; +} + +// @public +export interface VirtualMachineIpTag { + ipTagType?: string; + tag?: string; +} + +// @public +export interface VirtualMachineNetworkInterfaceConfiguration { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineNetworkInterfaceDnsSettingsConfiguration; + // (undocumented) + dscpConfiguration?: SubResource; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations?: VirtualMachineNetworkInterfaceIPConfiguration[]; + name: string; + networkSecurityGroup?: SubResource; + primary?: boolean; + tags?: Record; +} + +// @public +export interface VirtualMachineNetworkInterfaceConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineNetworkInterfaceDnsSettingsConfiguration; + // (undocumented) + dscpConfiguration?: SubResource; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations: VirtualMachineNetworkInterfaceIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; +} + +// @public +export interface VirtualMachineNetworkInterfaceDnsSettingsConfiguration { + dnsServers?: string[]; +} + +// @public +export interface VirtualMachineNetworkInterfaceIPConfiguration { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + name: string; + primary?: boolean; + privateIPAddressVersion?: IPVersions; + publicIPAddressConfiguration?: VirtualMachinePublicIPAddressConfiguration; + subnet?: SubResource; +} + +// @public +export interface VirtualMachineNetworkInterfaceIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersions; + publicIPAddressConfiguration?: VirtualMachinePublicIPAddressConfiguration; + subnet?: SubResource; +} + +// @public +export interface VirtualMachinePatchStatus { + availablePatchSummary?: AvailablePatchSummary; + readonly configurationStatuses?: InstanceViewStatus[]; + lastPatchInstallationSummary?: LastPatchInstallationSummary; +} + +// @public +export type VirtualMachinePriorityTypes = string; + +// @public +export interface VirtualMachineProperties { + additionalCapabilities?: AdditionalCapabilities; + applicationProfile?: ApplicationProfile; + availabilitySet?: SubResource; + billingProfile?: BillingProfile; + capacityReservation?: CapacityReservationProfile; + diagnosticsProfile?: DiagnosticsProfile; + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + extensionsTimeBudget?: string; + hardwareProfile?: HardwareProfile; + host?: SubResource; + hostGroup?: SubResource; + readonly instanceView?: VirtualMachineInstanceView; + licenseType?: string; + networkProfile?: NetworkProfile; + osProfile?: OSProfile; + platformFaultDomain?: number; + priority?: VirtualMachinePriorityTypes; + readonly provisioningState?: string; + proximityPlacementGroup?: SubResource; + resiliencyProfile?: ResiliencyProfile; + scheduledEventsPolicy?: ScheduledEventsPolicy; + scheduledEventsProfile?: ScheduledEventsProfile; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + readonly timeCreated?: Date; + userData?: string; + virtualMachineScaleSet?: SubResource; + readonly vmId?: string; +} + +// @public +export interface VirtualMachinePublicIPAddressConfiguration { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachinePublicIPAddressDnsSettingsConfiguration; + idleTimeoutInMinutes?: number; + ipTags?: VirtualMachineIpTag[]; + name: string; + publicIPAddressVersion?: IPVersions; + publicIPAllocationMethod?: PublicIPAllocationMethod; + publicIPPrefix?: SubResource; + 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 interface VirtualMachineReimageParameters { + exactVersion?: string; + osProfile?: OSProfileProvisioningData; + tempDisk?: boolean; +} + +// @public +export interface VirtualMachineRunCommand extends TrackedResource { + asyncExecution?: boolean; + errorBlobManagedIdentity?: RunCommandManagedIdentity; + errorBlobUri?: string; + readonly instanceView?: VirtualMachineRunCommandInstanceView; + outputBlobManagedIdentity?: RunCommandManagedIdentity; + outputBlobUri?: string; + parameters?: RunCommandInputParameter[]; + protectedParameters?: RunCommandInputParameter[]; + readonly provisioningState?: string; + runAsPassword?: string; + runAsUser?: string; + source?: VirtualMachineRunCommandScriptSource; + timeoutInSeconds?: number; + treatFailureAsDeploymentFailure?: boolean; +} + +// @public +export interface VirtualMachineRunCommandInstanceView { + endTime?: Date; + error?: string; + executionMessage?: string; + executionState?: ExecutionState; + exitCode?: number; + output?: string; + startTime?: Date; + statuses?: InstanceViewStatus[]; +} + +// @public +export interface VirtualMachineRunCommandProperties { + asyncExecution?: boolean; + errorBlobManagedIdentity?: RunCommandManagedIdentity; + errorBlobUri?: string; + readonly instanceView?: VirtualMachineRunCommandInstanceView; + outputBlobManagedIdentity?: RunCommandManagedIdentity; + outputBlobUri?: string; + parameters?: RunCommandInputParameter[]; + protectedParameters?: RunCommandInputParameter[]; + readonly provisioningState?: string; + runAsPassword?: string; + runAsUser?: string; + source?: VirtualMachineRunCommandScriptSource; + timeoutInSeconds?: number; + treatFailureAsDeploymentFailure?: boolean; +} + +// @public +export interface VirtualMachineRunCommandScriptSource { + commandId?: string; + galleryScriptReferenceId?: string; + script?: string; + scriptShell?: ScriptShellTypes; + scriptUri?: string; + scriptUriManagedIdentity?: RunCommandManagedIdentity; +} + +// @public +export interface VirtualMachineRunCommandUpdate extends UpdateResource { + asyncExecution?: boolean; + errorBlobManagedIdentity?: RunCommandManagedIdentity; + errorBlobUri?: string; + readonly instanceView?: VirtualMachineRunCommandInstanceView; + outputBlobManagedIdentity?: RunCommandManagedIdentity; + outputBlobUri?: string; + parameters?: RunCommandInputParameter[]; + protectedParameters?: RunCommandInputParameter[]; + readonly provisioningState?: string; + runAsPassword?: string; + runAsUser?: string; + source?: VirtualMachineRunCommandScriptSource; + timeoutInSeconds?: number; + treatFailureAsDeploymentFailure?: boolean; +} + +// @public +export interface VirtualMachineScaleSet extends TrackedResource { + additionalCapabilities?: AdditionalCapabilities; + automaticRepairsPolicy?: AutomaticRepairsPolicy; + constrainedMaximumCapacity?: boolean; + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + readonly etag?: string; + extendedLocation?: ExtendedLocation; + externalHealthPolicy?: ExternalHealthPolicy; + highSpeedInterconnectPlacement?: HighSpeedInterconnectPlacement; + hostGroup?: SubResource; + identity?: VirtualMachineScaleSetIdentity; + lifecycleHooksProfile?: LifecycleHooksProfile; + orchestrationMode?: OrchestrationMode; + overprovision?: boolean; + placement?: Placement; + plan?: Plan; + platformFaultDomainCount?: number; + priorityMixPolicy?: PriorityMixPolicy; + readonly provisioningState?: string; + proximityPlacementGroup?: SubResource; + resiliencyPolicy?: ResiliencyPolicy; + scaleInPolicy?: ScaleInPolicy; + scheduledEventsPolicy?: ScheduledEventsPolicy; + singlePlacementGroup?: boolean; + sku?: Sku; + skuProfile?: SkuProfile; + spotRestorePolicy?: SpotRestorePolicy; + readonly timeCreated?: Date; + readonly uniqueId?: string; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetVMProfile; + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + zoneBalance?: boolean; + zones?: string[]; +} + +// @public +export interface VirtualMachineScaleSetDataDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + diskIopsReadWrite?: number; + diskMBpsReadWrite?: number; + diskSizeGB?: number; + lun: number; + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; + name?: string; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface VirtualMachineScaleSetExtension extends SubResourceReadOnly { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + name?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + readonly type?: string; + typeHandlerVersion?: string; + typePropertiesType?: string; +} + +// @public +export interface VirtualMachineScaleSetExtensionProfile { + extensions?: VirtualMachineScaleSetExtension[]; + extensionsTimeBudget?: string; +} + +// @public +export interface VirtualMachineScaleSetExtensionProperties { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; +} + +// @public +export interface VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + readonly name?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + readonly type?: string; + typeHandlerVersion?: string; + typePropertiesType?: string; +} + +// @public +export interface VirtualMachineScaleSetHardwareProfile { + vmSizeProperties?: VMSizeProperties; +} + +// @public +export interface VirtualMachineScaleSetIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export interface VirtualMachineScaleSetInstanceView { + readonly extensions?: VirtualMachineScaleSetVMExtensionsSummary[]; + readonly orchestrationServices?: OrchestrationServiceSummary[]; + statuses?: InstanceViewStatus[]; + readonly virtualMachine?: VirtualMachineScaleSetInstanceViewStatusesSummary; +} + +// @public +export interface VirtualMachineScaleSetInstanceViewStatusesSummary { + readonly statusesSummary?: VirtualMachineStatusCodeCount[]; +} + +// @public +export interface VirtualMachineScaleSetIPConfiguration { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; + name: string; + primary?: boolean; + privateIPAddressVersion?: IPVersion; + publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; + subnet?: ApiEntityReference; +} + +// @public +export interface VirtualMachineScaleSetIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersion; + publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; + subnet?: ApiEntityReference; +} + +// @public +export interface VirtualMachineScaleSetIpTag { + ipTagType?: string; + tag?: string; +} + +// @public +export interface VirtualMachineScaleSetManagedDiskParameters { + diskEncryptionSet?: DiskEncryptionSetParameters; + securityProfile?: VMDiskSecurityProfile; + storageAccountType?: StorageAccountTypes; +} + +// @public +export interface VirtualMachineScaleSetMigrationInfo { + readonly defaultVirtualMachineScaleSetInfo?: DefaultVirtualMachineScaleSetInfo; + readonly migrateToVirtualMachineScaleSet?: SubResource; +} + +// @public +export interface VirtualMachineScaleSetNetworkConfiguration { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations?: VirtualMachineScaleSetIPConfiguration[]; + name: string; + networkSecurityGroup?: SubResource; + primary?: boolean; + tags?: Record; +} + +// @public +export interface VirtualMachineScaleSetNetworkConfigurationDnsSettings { + dnsServers?: string[]; +} + +// @public +export interface VirtualMachineScaleSetNetworkConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations: VirtualMachineScaleSetIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; +} + +// @public +export interface VirtualMachineScaleSetNetworkProfile { + healthProbe?: ApiEntityReference; + networkApiVersion?: NetworkApiVersion; + networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; +} + +// @public +export interface VirtualMachineScaleSetOSDisk { + caching?: CachingTypes; + createOption: DiskCreateOptionTypes; + deleteOption?: DiskDeleteOptionTypes; + diffDiskSettings?: DiffDiskSettings; + diskSizeGB?: number; + image?: VirtualHardDisk; + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; + name?: string; + osType?: OperatingSystemTypes; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + vhdContainers?: string[]; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface VirtualMachineScaleSetOSProfile { + adminPassword?: string; + adminUsername?: string; + allowExtensionOperations?: boolean; + computerNamePrefix?: string; + customData?: string; + linuxConfiguration?: LinuxConfiguration; + requireGuestProvisionSignal?: boolean; + secrets?: VaultSecretGroup[]; + windowsConfiguration?: WindowsConfiguration; +} + +// @public +export interface VirtualMachineScaleSetProperties { + additionalCapabilities?: AdditionalCapabilities; + automaticRepairsPolicy?: AutomaticRepairsPolicy; + constrainedMaximumCapacity?: boolean; + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + externalHealthPolicy?: ExternalHealthPolicy; + highSpeedInterconnectPlacement?: HighSpeedInterconnectPlacement; + hostGroup?: SubResource; + lifecycleHooksProfile?: LifecycleHooksProfile; + orchestrationMode?: OrchestrationMode; + overprovision?: boolean; + platformFaultDomainCount?: number; + priorityMixPolicy?: PriorityMixPolicy; + readonly provisioningState?: string; + proximityPlacementGroup?: SubResource; + resiliencyPolicy?: ResiliencyPolicy; + scaleInPolicy?: ScaleInPolicy; + scheduledEventsPolicy?: ScheduledEventsPolicy; + singlePlacementGroup?: boolean; + skuProfile?: SkuProfile; + spotRestorePolicy?: SpotRestorePolicy; + readonly timeCreated?: Date; + readonly uniqueId?: string; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetVMProfile; + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + zoneBalance?: boolean; +} + +// @public +export interface VirtualMachineScaleSetPublicIPAddressConfiguration { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + idleTimeoutInMinutes?: number; + ipTags?: VirtualMachineScaleSetIpTag[]; + name: string; + publicIPAddressVersion?: IPVersion; + publicIPPrefix?: SubResource; + sku?: PublicIPAddressSku; + tags?: Record; +} + +// @public +export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { + domainNameLabel: string; + domainNameLabelScope?: DomainNameLabelScopeTypes; +} + +// @public +export interface VirtualMachineScaleSetPublicIPAddressConfigurationProperties { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + idleTimeoutInMinutes?: number; + ipTags?: VirtualMachineScaleSetIpTag[]; + publicIPAddressVersion?: IPVersion; + publicIPPrefix?: SubResource; +} + +// @public +export interface VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { + instanceIds?: string[]; +} + +// @public +export type VirtualMachineScaleSetScaleInRules = string; + +// @public +export interface VirtualMachineScaleSetSku { + readonly capacity?: VirtualMachineScaleSetSkuCapacity; + readonly resourceType?: string; + readonly sku?: Sku; +} + +// @public +export interface VirtualMachineScaleSetSkuCapacity { + readonly defaultCapacity?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly scaleType?: VirtualMachineScaleSetSkuScaleType; +} + +// @public +export type VirtualMachineScaleSetSkuScaleType = "Automatic" | "None"; + +// @public +export interface VirtualMachineScaleSetStorageProfile { + dataDisks?: VirtualMachineScaleSetDataDisk[]; + diskControllerType?: DiskControllerTypes; + imageReference?: ImageReference; + osDisk?: VirtualMachineScaleSetOSDisk; +} + +// @public +export interface VirtualMachineScaleSetUpdate extends UpdateResource { + additionalCapabilities?: AdditionalCapabilities; + automaticRepairsPolicy?: AutomaticRepairsPolicy; + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + identity?: VirtualMachineScaleSetIdentity; + lifecycleHooksProfile?: LifecycleHooksProfile; + overprovision?: boolean; + placement?: Placement; + plan?: Plan; + priorityMixPolicy?: PriorityMixPolicy; + proximityPlacementGroup?: SubResource; + resiliencyPolicy?: ResiliencyPolicy; + scaleInPolicy?: ScaleInPolicy; + singlePlacementGroup?: boolean; + sku?: Sku; + skuProfile?: SkuProfile; + spotRestorePolicy?: SpotRestorePolicy; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetUpdateVMProfile; + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + zones?: string[]; +} + +// @public +export interface VirtualMachineScaleSetUpdateIPConfiguration { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; + name?: string; + primary?: boolean; + privateIPAddressVersion?: IPVersion; + publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; + subnet?: ApiEntityReference; +} + +// @public +export interface VirtualMachineScaleSetUpdateIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersion; + publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; + subnet?: ApiEntityReference; +} + +// @public +export interface VirtualMachineScaleSetUpdateNetworkConfiguration { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations?: VirtualMachineScaleSetUpdateIPConfiguration[]; + name?: string; + networkSecurityGroup?: SubResource; + primary?: boolean; + tags?: Record; +} + +// @public +export interface VirtualMachineScaleSetUpdateNetworkConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations?: VirtualMachineScaleSetUpdateIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; +} + +// @public +export interface VirtualMachineScaleSetUpdateNetworkProfile { + healthProbe?: ApiEntityReference; + networkApiVersion?: NetworkApiVersion; + networkInterfaceConfigurations?: VirtualMachineScaleSetUpdateNetworkConfiguration[]; +} + +// @public +export interface VirtualMachineScaleSetUpdateOSDisk { + caching?: CachingTypes; + deleteOption?: DiskDeleteOptionTypes; + diffDiskSettings?: DiffDiskSettings; + diskSizeGB?: number; + image?: VirtualHardDisk; + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + vhdContainers?: string[]; + writeAcceleratorEnabled?: boolean; +} + +// @public +export interface VirtualMachineScaleSetUpdateOSProfile { + customData?: string; + linuxConfiguration?: LinuxConfiguration; + secrets?: VaultSecretGroup[]; + windowsConfiguration?: WindowsConfiguration; +} + +// @public +export interface VirtualMachineScaleSetUpdateProperties { + additionalCapabilities?: AdditionalCapabilities; + automaticRepairsPolicy?: AutomaticRepairsPolicy; + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + lifecycleHooksProfile?: LifecycleHooksProfile; + overprovision?: boolean; + priorityMixPolicy?: PriorityMixPolicy; + proximityPlacementGroup?: SubResource; + resiliencyPolicy?: ResiliencyPolicy; + scaleInPolicy?: ScaleInPolicy; + singlePlacementGroup?: boolean; + skuProfile?: SkuProfile; + spotRestorePolicy?: SpotRestorePolicy; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetUpdateVMProfile; + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; +} + +// @public +export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + idleTimeoutInMinutes?: number; + name?: string; + publicIPPrefix?: SubResource; + tags?: Record; +} + +// @public +export interface VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + idleTimeoutInMinutes?: number; + publicIPPrefix?: SubResource; +} + +// @public +export interface VirtualMachineScaleSetUpdateStorageProfile { + dataDisks?: VirtualMachineScaleSetDataDisk[]; + diskControllerType?: DiskControllerTypes; + imageReference?: ImageReference; + osDisk?: VirtualMachineScaleSetUpdateOSDisk; +} + +// @public +export interface VirtualMachineScaleSetUpdateVMProfile { + billingProfile?: BillingProfile; + diagnosticsProfile?: DiagnosticsProfile; + extensionProfile?: VirtualMachineScaleSetExtensionProfile; + hardwareProfile?: VirtualMachineScaleSetHardwareProfile; + licenseType?: string; + networkProfile?: VirtualMachineScaleSetUpdateNetworkProfile; + osProfile?: VirtualMachineScaleSetUpdateOSProfile; + scheduledEventsProfile?: ScheduledEventsProfile; + securityPostureReference?: SecurityPostureReferenceUpdate; + securityProfile?: SecurityProfile; + storageProfile?: VirtualMachineScaleSetUpdateStorageProfile; + userData?: string; +} + +// @public +export interface VirtualMachineScaleSetVM extends TrackedResource { + additionalCapabilities?: AdditionalCapabilities; + availabilitySet?: SubResource; + diagnosticsProfile?: DiagnosticsProfile; + readonly etag?: string; + hardwareProfile?: HardwareProfile; + identity?: VirtualMachineIdentity; + readonly instanceId?: string; + readonly instanceView?: VirtualMachineScaleSetVMInstanceView; + readonly latestModelApplied?: boolean; + licenseType?: string; + readonly modelDefinitionApplied?: string; + networkProfile?: NetworkProfile; + networkProfileConfiguration?: VirtualMachineScaleSetVMNetworkProfileConfiguration; + osProfile?: OSProfile; + plan?: Plan; + protectionPolicy?: VirtualMachineScaleSetVMProtectionPolicy; + readonly provisioningState?: string; + resilientVMDeletionStatus?: ResilientVMDeletionStatus; + readonly resources?: VirtualMachineExtension[]; + securityProfile?: SecurityProfile; + readonly sku?: Sku; + storageProfile?: StorageProfile; + readonly timeCreated?: Date; + userData?: string; + readonly virtualMachineResourceId?: string; + readonly vmId?: string; + readonly zones?: string[]; +} + +// @public +export interface VirtualMachineScaleSetVMExtension extends SubResourceReadOnly { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + instanceView?: VirtualMachineExtensionInstanceView; + location?: string; + readonly name?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + readonly type?: string; + typeHandlerVersion?: string; + typePropertiesType?: string; +} + +// @public +export interface VirtualMachineScaleSetVMExtensionsListResult { + value?: VirtualMachineScaleSetVMExtension[]; +} + +// @public +export interface VirtualMachineScaleSetVMExtensionsSummary { + readonly name?: string; + readonly statusesSummary?: VirtualMachineStatusCodeCount[]; +} + +// @public +export interface VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + readonly name?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + readonly type?: string; + typeHandlerVersion?: string; + typePropertiesType?: string; +} + +// @public +export interface VirtualMachineScaleSetVMInstanceIDs { + instanceIds?: string[]; +} + +// @public +export interface VirtualMachineScaleSetVMInstanceRequiredIDs { + instanceIds: string[]; +} + +// @public +export interface VirtualMachineScaleSetVMInstanceView { + readonly assignedHost?: string; + bootDiagnostics?: BootDiagnosticsInstanceView; + computerName?: string; + disks?: DiskInstanceView[]; + extensions?: VirtualMachineExtensionInstanceView[]; + hyperVGeneration?: HyperVGeneration; + maintenanceRedeployStatus?: MaintenanceRedeployStatus; + osName?: string; + osVersion?: string; + placementGroupId?: string; + platformFaultDomain?: number; + platformUpdateDomain?: number; + rdpThumbPrint?: string; + statuses?: InstanceViewStatus[]; + vmAgent?: VirtualMachineAgentInstanceView; + readonly vmHealth?: VirtualMachineHealthStatus; +} + +// @public +export interface VirtualMachineScaleSetVMNetworkProfileConfiguration { + networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; +} + +// @public +export interface VirtualMachineScaleSetVMProfile { + applicationProfile?: ApplicationProfile; + billingProfile?: BillingProfile; + capacityReservation?: CapacityReservationProfile; + diagnosticsProfile?: DiagnosticsProfile; + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + extensionProfile?: VirtualMachineScaleSetExtensionProfile; + hardwareProfile?: VirtualMachineScaleSetHardwareProfile; + licenseType?: string; + networkProfile?: VirtualMachineScaleSetNetworkProfile; + osProfile?: VirtualMachineScaleSetOSProfile; + priority?: VirtualMachinePriorityTypes; + scheduledEventsProfile?: ScheduledEventsProfile; + securityPostureReference?: SecurityPostureReference; + securityProfile?: SecurityProfile; + serviceArtifactReference?: ServiceArtifactReference; + storageProfile?: VirtualMachineScaleSetStorageProfile; + readonly timeCreated?: Date; + userData?: string; +} + +// @public +export interface VirtualMachineScaleSetVMProperties { + additionalCapabilities?: AdditionalCapabilities; + availabilitySet?: SubResource; + diagnosticsProfile?: DiagnosticsProfile; + hardwareProfile?: HardwareProfile; + readonly instanceView?: VirtualMachineScaleSetVMInstanceView; + readonly latestModelApplied?: boolean; + licenseType?: string; + readonly modelDefinitionApplied?: string; + networkProfile?: NetworkProfile; + networkProfileConfiguration?: VirtualMachineScaleSetVMNetworkProfileConfiguration; + osProfile?: OSProfile; + protectionPolicy?: VirtualMachineScaleSetVMProtectionPolicy; + readonly provisioningState?: string; + resilientVMDeletionStatus?: ResilientVMDeletionStatus; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + readonly timeCreated?: Date; + userData?: string; + readonly virtualMachineResourceId?: string; + readonly vmId?: string; +} + +// @public +export interface VirtualMachineScaleSetVMProtectionPolicy { + protectFromScaleIn?: boolean; + protectFromScaleSetActions?: boolean; +} + +// @public +export interface VirtualMachineScaleSetVMReimageParameters extends VirtualMachineReimageParameters { + forceUpdateOSDiskForEphemeral?: boolean; +} + +// @public +export interface VirtualMachineSize { + maxDataDiskCount?: number; + memoryInMB?: number; + name?: string; + numberOfCores?: number; + osDiskSizeInMB?: number; + resourceDiskSizeInMB?: number; +} + +// @public +export type VirtualMachineSizeTypes = string; + +// @public +export interface VirtualMachineSoftwarePatchProperties { + readonly activityId?: string; + readonly assessmentState?: PatchAssessmentState; + readonly classifications?: string[]; + readonly kbId?: string; + readonly lastModifiedDateTime?: Date; + readonly name?: string; + readonly patchId?: string; + readonly publishedDate?: Date; + readonly rebootBehavior?: VMGuestPatchRebootBehavior; + readonly version?: string; +} + +// @public +export interface VirtualMachineStatusCodeCount { + readonly code?: string; + readonly count?: number; +} + +// @public +export interface VirtualMachineUpdate extends UpdateResource { + additionalCapabilities?: AdditionalCapabilities; + applicationProfile?: ApplicationProfile; + availabilitySet?: SubResource; + billingProfile?: BillingProfile; + capacityReservation?: CapacityReservationProfile; + diagnosticsProfile?: DiagnosticsProfile; + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + extensionsTimeBudget?: string; + hardwareProfile?: HardwareProfile; + host?: SubResource; + hostGroup?: SubResource; + identity?: VirtualMachineIdentity; + readonly instanceView?: VirtualMachineInstanceView; + licenseType?: string; + networkProfile?: NetworkProfile; + osProfile?: OSProfile; + plan?: Plan; + platformFaultDomain?: number; + priority?: VirtualMachinePriorityTypes; + readonly provisioningState?: string; + proximityPlacementGroup?: SubResource; + resiliencyProfile?: ResiliencyProfile; + scheduledEventsPolicy?: ScheduledEventsPolicy; + scheduledEventsProfile?: ScheduledEventsProfile; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + readonly timeCreated?: Date; + userData?: string; + virtualMachineScaleSet?: SubResource; + readonly vmId?: string; + zones?: string[]; +} + +// @public +export interface VMDiskSecurityProfile { + diskEncryptionSet?: DiskEncryptionSetParameters; + securityEncryptionType?: SecurityEncryptionTypes; +} + +// @public +export type VmDiskTypes = string; + +// @public +export interface VMGalleryApplication { + configurationReference?: string; + enableAutomaticUpgrade?: boolean; + order?: number; + packageReferenceId: string; + tags?: string; + treatFailureAsDeploymentFailure?: boolean; +} + +// @public +export type VMGuestPatchClassificationLinux = string; + +// @public +export type VMGuestPatchClassificationWindows = string; + +// @public +export type VMGuestPatchRebootBehavior = string; + +// @public +export type VMGuestPatchRebootSetting = string; + +// @public +export type VMGuestPatchRebootStatus = string; + +// @public +export interface VmImagesInEdgeZoneListResult { + nextLink?: string; + value?: VirtualMachineImageResource[]; +} + +// @public +export interface VMScaleSetConvertToSinglePlacementGroupInput { + activePlacementGroupId?: string; +} + +// @public +export interface VMScaleSetLifecycleHookEvent extends ProxyResource { + properties?: VMScaleSetLifecycleHookEventProperties; +} + +// @public +export interface VMScaleSetLifecycleHookEventAdditionalContext { + priority?: string; +} + +// @public +export interface VMScaleSetLifecycleHookEventProperties { + additionalContext?: VMScaleSetLifecycleHookEventAdditionalContext; + readonly defaultAction?: LifecycleHookAction; + readonly maxWaitUntil?: string; + readonly state?: VMScaleSetLifecycleHookEventState; + targetResources?: VMScaleSetLifecycleHookEventTargetResource[]; + readonly timeCreated?: string; + type?: VMScaleSetLifecycleHookEventType; + waitUntil?: string; +} + +// @public +export type VMScaleSetLifecycleHookEventState = string; + +// @public +export interface VMScaleSetLifecycleHookEventTargetResource { + actionState?: LifecycleHookActionState; + resource?: ApiEntityReference; +} + +// @public +export type VMScaleSetLifecycleHookEventType = string; + +// @public +export interface VMScaleSetLifecycleHookEventUpdate { + additionalContext?: VMScaleSetLifecycleHookEventAdditionalContext; + readonly defaultAction?: LifecycleHookAction; + readonly maxWaitUntil?: string; + readonly state?: VMScaleSetLifecycleHookEventState; + targetResources?: VMScaleSetLifecycleHookEventTargetResource[]; + readonly timeCreated?: string; + type?: VMScaleSetLifecycleHookEventType; + waitUntil?: string; +} + +// @public +export interface VMScaleSetScaleOutInput { + capacity: number; + properties?: VMScaleSetScaleOutInputProperties; +} + +// @public +export interface VMScaleSetScaleOutInputProperties { + zone?: string; +} + +// @public +export interface VMSizeProperties { + vCPUsAvailable?: number; + vCPUsPerCore?: number; +} + +// @public +export interface WindowsConfiguration { + additionalUnattendContent?: AdditionalUnattendContent[]; + enableAutomaticUpdates?: boolean; + readonly enableVMAgentPlatformUpdates?: boolean; + patchSettings?: PatchSettings; + provisionVMAgent?: boolean; + timeZone?: string; + winRM?: WinRMConfiguration; +} + +// @public +export interface WindowsParameters { + classificationsToInclude?: VMGuestPatchClassificationWindows[]; + excludeKbsRequiringReboot?: boolean; + kbNumbersToExclude?: string[]; + kbNumbersToInclude?: string[]; + maxPatchPublishDate?: Date; + patchNameMasksToExclude?: string[]; + patchNameMasksToInclude?: string[]; +} + +// @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 type ZonalPlatformFaultDomainAlignMode = string; + +// @public +export interface ZoneAllocationPolicy { + maxInstancePercentPerZonePolicy?: MaxInstancePercentPerZonePolicy; + maxZoneCount?: number; +} + +// @public +export interface ZoneMovement { + isEnabled?: boolean; +} + +// @public +export type ZonePlacementPolicyType = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md new file mode 100644 index 000000000000..2ed5e237fea8 --- /dev/null +++ b/sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md @@ -0,0 +1,736 @@ +## API Report File for "@azure/arm-compute" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type AccessLevel = string; + +// @public +export interface AccessUri { + readonly accessSAS?: string; + readonly securityDataAccessSAS?: string; + readonly securityMetadataAccessSAS?: string; +} + +// @public +export interface AvailabilityPolicy { + actionOnDiskDelay?: AvailabilityPolicyDiskDelay; +} + +// @public +export type AvailabilityPolicyDiskDelay = string; + +// @public +export interface CopyCompletionError { + errorCode: CopyCompletionErrorReason; + errorMessage: string; +} + +// @public +export type CopyCompletionErrorReason = string; + +// @public +export interface CreationData { + createOption: DiskCreateOption; + elasticSanResourceId?: string; + galleryImageReference?: ImageDiskReference; + imageReference?: ImageDiskReference; + instantAccessDurationMinutes?: number; + logicalSectorSize?: number; + performancePlus?: boolean; + provisionedBandwidthCopySpeed?: ProvisionedBandwidthCopyOption; + securityDataUri?: string; + securityMetadataUri?: string; + sourceResourceId?: string; + readonly sourceUniqueId?: string; + sourceUri?: string; + storageAccountId?: string; + uploadSizeBytes?: number; +} + +// @public +export type DataAccessAuthMode = string; + +// @public +export interface Disk extends TrackedResource { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + readonly burstingEnabledTime?: Date; + completionPercent?: number; + creationData?: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + extendedLocation?: ExtendedLocation; + hyperVGeneration?: HyperVGeneration; + readonly lastOwnershipUpdateTime?: Date; + readonly managedBy?: string; + readonly managedByExtended?: string[]; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + readonly shareInfo?: ShareInfoElement[]; + sku?: DiskSku; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tier?: string; + readonly timeCreated?: Date; + readonly uniqueId?: string; + zones?: string[]; +} + +// @public +export interface DiskAccess extends TrackedResource { + extendedLocation?: ExtendedLocation; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: string; + readonly timeCreated?: Date; +} + +// @public +export interface DiskAccessProperties { + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: string; + readonly timeCreated?: Date; +} + +// @public +export interface DiskAccessUpdate { + tags?: Record; +} + +// @public +export type DiskCreateOption = string; + +// @public +export interface DiskEncryptionSet extends TrackedResource { + activeKey?: KeyForDiskEncryptionSet; + readonly autoKeyRotationError?: ApiError; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + identity?: EncryptionSetIdentity; + readonly lastKeyRotationTimestamp?: Date; + readonly previousKeys?: KeyForDiskEncryptionSet[]; + readonly provisioningState?: string; + rotationToLatestKeyVersionEnabled?: boolean; +} + +// @public +export type DiskEncryptionSetIdentityType = string; + +// @public +export type DiskEncryptionSetType = string; + +// @public +export interface DiskEncryptionSetUpdate { + activeKey?: KeyForDiskEncryptionSet; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + identity?: EncryptionSetIdentity; + rotationToLatestKeyVersionEnabled?: boolean; + tags?: Record; +} + +// @public +export interface DiskEncryptionSetUpdateProperties { + activeKey?: KeyForDiskEncryptionSet; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + rotationToLatestKeyVersionEnabled?: boolean; +} + +// @public +export interface DiskProperties { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + readonly burstingEnabledTime?: Date; + completionPercent?: number; + creationData: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + hyperVGeneration?: HyperVGeneration; + readonly lastOwnershipUpdateTime?: Date; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + readonly shareInfo?: ShareInfoElement[]; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tier?: string; + readonly timeCreated?: Date; + readonly uniqueId?: string; +} + +// @public +export interface DiskPurchasePlan { + name: string; + product: string; + promotionCode?: string; + publisher: string; +} + +// @public +export interface DiskRestorePoint extends ProxyResource { + completionPercent?: number; + diskAccessId?: string; + readonly encryption?: Encryption; + readonly familyId?: string; + hyperVGeneration?: HyperVGeneration; + readonly logicalSectorSize?: number; + networkAccessPolicy?: NetworkAccessPolicy; + readonly osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + readonly replicationState?: string; + securityProfile?: DiskSecurityProfile; + readonly sourceResourceId?: string; + readonly sourceResourceLocation?: string; + readonly sourceUniqueId?: string; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; +} + +// @public +export interface DiskRestorePointProperties { + completionPercent?: number; + diskAccessId?: string; + readonly encryption?: Encryption; + readonly familyId?: string; + hyperVGeneration?: HyperVGeneration; + readonly logicalSectorSize?: number; + networkAccessPolicy?: NetworkAccessPolicy; + readonly osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + readonly replicationState?: string; + securityProfile?: DiskSecurityProfile; + readonly sourceResourceId?: string; + readonly sourceResourceLocation?: string; + readonly sourceUniqueId?: string; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; +} + +// @public +export interface DiskSecurityProfile { + secureVMDiskEncryptionSetId?: string; + securityType?: DiskSecurityTypes; +} + +// @public +export type DiskSecurityTypes = string; + +// @public +export interface DiskSku { + name?: DiskStorageAccountTypes; + readonly tier?: string; +} + +// @public +export type DiskState = string; + +// @public +export type DiskStorageAccountTypes = string; + +// @public +export interface DiskUpdate { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + sku?: DiskSku; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tags?: Record; + tier?: string; +} + +// @public +export interface DiskUpdateProperties { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tier?: string; +} + +// @public +export interface Encryption { + diskEncryptionSetId?: string; + type?: EncryptionType; +} + +// @public +export interface EncryptionSetIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: DiskEncryptionSetIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export interface EncryptionSetProperties { + activeKey?: KeyForDiskEncryptionSet; + readonly autoKeyRotationError?: ApiError; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + readonly lastKeyRotationTimestamp?: Date; + readonly previousKeys?: KeyForDiskEncryptionSet[]; + readonly provisioningState?: string; + rotationToLatestKeyVersionEnabled?: boolean; +} + +// @public +export interface EncryptionSettingsCollection { + enabled: boolean; + encryptionSettings?: EncryptionSettingsElement[]; + encryptionSettingsVersion?: string; +} + +// @public +export interface EncryptionSettingsElement { + diskEncryptionKey?: KeyVaultAndSecretReference; + keyEncryptionKey?: KeyVaultAndKeyReference; +} + +// @public +export type EncryptionType = string; + +// @public +export type FileFormat = string; + +// @public +export interface GrantAccessData { + access: AccessLevel; + durationInSeconds: number; + fileFormat?: FileFormat; + getSecureVMGuestStateSAS?: boolean; +} + +// @public +export interface ImageDiskReference { + communityGalleryImageId?: string; + id?: string; + lun?: number; + sharedGalleryImageId?: string; +} + +// @public +export interface KeyForDiskEncryptionSet { + keyUrl: string; + sourceVault?: SourceVault; +} + +// @public +export interface KeyVaultAndKeyReference { + keyUrl: string; + sourceVault: SourceVault; +} + +// @public +export interface KeyVaultAndSecretReference { + secretUrl: string; + sourceVault: SourceVault; +} + +// @public +export enum KnownAccessLevel { + None = "None", + Read = "Read", + Write = "Write" +} + +// @public +export enum KnownAvailabilityPolicyDiskDelay { + AutomaticReattach = "AutomaticReattach", + None = "None" +} + +// @public +export enum KnownCopyCompletionErrorReason { + CopySourceNotFound = "CopySourceNotFound" +} + +// @public +export enum KnownDataAccessAuthMode { + AzureActiveDirectory = "AzureActiveDirectory", + None = "None" +} + +// @public +export enum KnownDiskCreateOption { + Attach = "Attach", + Copy = "Copy", + CopyFromSanSnapshot = "CopyFromSanSnapshot", + CopyStart = "CopyStart", + Empty = "Empty", + FromImage = "FromImage", + Import = "Import", + ImportSecure = "ImportSecure", + Restore = "Restore", + Upload = "Upload", + UploadPreparedSecure = "UploadPreparedSecure" +} + +// @public +export enum KnownDiskEncryptionSetIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownDiskEncryptionSetType { + ConfidentialVmEncryptedWithCustomerKey = "ConfidentialVmEncryptedWithCustomerKey", + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys" +} + +// @public +export enum KnownDiskSecurityTypes { + ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", + ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", + ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", + ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + TrustedLaunch = "TrustedLaunch" +} + +// @public +export enum KnownDiskState { + ActiveSAS = "ActiveSAS", + ActiveSASFrozen = "ActiveSASFrozen", + ActiveUpload = "ActiveUpload", + Attached = "Attached", + Frozen = "Frozen", + ReadyToUpload = "ReadyToUpload", + Reserved = "Reserved", + Unattached = "Unattached" +} + +// @public +export enum KnownDiskStorageAccountTypes { + PremiumLRS = "Premium_LRS", + PremiumV2LRS = "PremiumV2_LRS", + PremiumZRS = "Premium_ZRS", + StandardLRS = "Standard_LRS", + StandardSSDLRS = "StandardSSD_LRS", + StandardSSDZRS = "StandardSSD_ZRS", + UltraSSDLRS = "UltraSSD_LRS" +} + +// @public +export enum KnownEncryptionType { + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" +} + +// @public +export enum KnownFileFormat { + VHD = "VHD", + Vhdx = "VHDX" +} + +// @public +export enum KnownNetworkAccessPolicy { + AllowAll = "AllowAll", + AllowPrivate = "AllowPrivate", + DenyAll = "DenyAll" +} + +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownProvisionedBandwidthCopyOption { + Enhanced = "Enhanced", + None = "None" +} + +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownSnapshotStorageAccountTypes { + PremiumLRS = "Premium_LRS", + StandardLRS = "Standard_LRS", + StandardZRS = "Standard_ZRS" +} + +// @public +export enum KnownSupportedSecurityOption { + TrustedLaunchAndConfidentialVMSupported = "TrustedLaunchAndConfidentialVMSupported", + TrustedLaunchSupported = "TrustedLaunchSupported" +} + +// @public +export type NetworkAccessPolicy = string; + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends ProxyResource { + readonly privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export interface PrivateEndpointConnectionProperties { + readonly privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource { + readonly groupId?: string; + readonly id?: string; + readonly name?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; + readonly type?: string; +} + +// @public +export interface PrivateLinkResourceListResult { + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export interface PropertyUpdatesInProgress { + targetTier?: string; +} + +// @public +export type ProvisionedBandwidthCopyOption = string; + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface ShareInfoElement { + readonly vmUri?: string; +} + +// @public +export interface Snapshot extends TrackedResource { + completionPercent?: number; + copyCompletionError?: CopyCompletionError; + creationData?: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + extendedLocation?: ExtendedLocation; + hyperVGeneration?: HyperVGeneration; + incremental?: boolean; + readonly incrementalSnapshotFamilyId?: string; + readonly managedBy?: string; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + sku?: SnapshotSku; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; + readonly uniqueId?: string; +} + +// @public +export interface SnapshotProperties { + completionPercent?: number; + copyCompletionError?: CopyCompletionError; + creationData: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + hyperVGeneration?: HyperVGeneration; + incremental?: boolean; + readonly incrementalSnapshotFamilyId?: string; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; + readonly uniqueId?: string; +} + +// @public +export interface SnapshotSku { + name?: SnapshotStorageAccountTypes; + readonly tier?: string; +} + +// @public +export type SnapshotStorageAccountTypes = string; + +// @public +export interface SnapshotUpdate { + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + sku?: SnapshotSku; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tags?: Record; +} + +// @public +export interface SnapshotUpdateProperties { + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; +} + +// @public +export interface SourceVault { + id?: string; +} + +// @public +export interface SupportedCapabilities { + acceleratedNetwork?: boolean; + architecture?: Architecture; + diskControllerTypes?: string; + supportedSecurityOption?: SupportedSecurityOption; +} + +// @public +export type SupportedSecurityOption = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute/review/arm-compute-models-computeGallery-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-computeGallery-node.api.md new file mode 100644 index 000000000000..483d20b76ab6 --- /dev/null +++ b/sdk/compute/arm-compute/review/arm-compute-models-computeGallery-node.api.md @@ -0,0 +1,1212 @@ +## API Report File for "@azure/arm-compute" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export interface AccessControlRules { + identities?: AccessControlRulesIdentity[]; + privileges?: AccessControlRulesPrivilege[]; + roleAssignments?: AccessControlRulesRoleAssignment[]; + roles?: AccessControlRulesRole[]; +} + +// @public +export interface AccessControlRulesIdentity { + exePath?: string; + groupName?: string; + name: string; + processName?: string; + userName?: string; +} + +// @public +export type AccessControlRulesMode = string; + +// @public +export interface AccessControlRulesPrivilege { + name: string; + path: string; + queryParameters?: Record; +} + +// @public +export interface AccessControlRulesRole { + name: string; + privileges: string[]; +} + +// @public +export interface AccessControlRulesRoleAssignment { + identities: string[]; + role: string; +} + +// @public +export interface AdditionalReplicaSet { + regionalReplicaCount?: number; + storageAccountType?: StorageAccountType; +} + +// @public +export type AggregatedReplicationState = string; + +// @public +export interface CommunityGallery extends PirCommunityGalleryResource { + artifactTags?: Record; + communityMetadata?: CommunityGalleryMetadata; + disclaimer?: string; +} + +// @public +export interface CommunityGalleryIdentifier { + uniqueId?: string; +} + +// @public +export interface CommunityGalleryImage extends PirCommunityGalleryResource { + architecture?: Architecture; + artifactTags?: Record; + disallowed?: Disallowed; + disclaimer?: string; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier?: CommunityGalleryImageIdentifier; + osState?: OperatingSystemStateTypes; + osType?: OperatingSystemTypes; + privacyStatementUri?: string; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; +} + +// @public +export interface CommunityGalleryImageIdentifier { + offer?: string; + publisher?: string; + sku?: string; +} + +// @public +export interface CommunityGalleryImageProperties { + architecture?: Architecture; + artifactTags?: Record; + disallowed?: Disallowed; + disclaimer?: string; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier: CommunityGalleryImageIdentifier; + osState: OperatingSystemStateTypes; + osType: OperatingSystemTypes; + privacyStatementUri?: string; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; +} + +// @public +export interface CommunityGalleryImageVersion extends PirCommunityGalleryResource { + artifactTags?: Record; + disclaimer?: string; + endOfLifeDate?: Date; + excludeFromLatest?: boolean; + publishedDate?: Date; + storageProfile?: SharedGalleryImageVersionStorageProfile; +} + +// @public +export interface CommunityGalleryImageVersionProperties { + artifactTags?: Record; + disclaimer?: string; + endOfLifeDate?: Date; + excludeFromLatest?: boolean; + publishedDate?: Date; + storageProfile?: SharedGalleryImageVersionStorageProfile; +} + +// @public +export interface CommunityGalleryInfo { + readonly communityGalleryEnabled?: boolean; + eula?: string; + publicNamePrefix?: string; + readonly publicNames?: string[]; + publisherContact?: string; + publisherUri?: string; +} + +// @public +export interface CommunityGalleryMetadata { + eula?: string; + privacyStatementUri?: string; + publicNames: string[]; + publisherContact: string; + publisherUri?: string; +} + +// @public +export interface CommunityGalleryProperties { + artifactTags?: Record; + communityMetadata?: CommunityGalleryMetadata; + disclaimer?: string; +} + +// @public +export type ConfidentialVMEncryptionType = string; + +// @public +export interface DataDiskImageEncryption extends DiskImageEncryption { + lun: number; +} + +// @public +export interface Disallowed { + diskTypes?: string[]; +} + +// @public +export interface DiskImageEncryption { + diskEncryptionSetId?: string; +} + +// @public +export type EdgeZoneStorageAccountType = string; + +// @public +export interface EncryptionImages { + dataDiskImages?: DataDiskImageEncryption[]; + osDiskImage?: OSDiskImageEncryption; +} + +// @public +export type EndpointAccess = string; + +// @public +export type EndpointTypes = "WireServer" | "IMDS"; + +// @public +export interface ExecutedValidation { + executionTime?: Date; + status?: ValidationStatus; + type?: string; + version?: string; +} + +// @public +export interface Gallery extends TrackedResource { + description?: string; + identifier?: GalleryIdentifier; + identity?: GalleryIdentity; + readonly provisioningState?: GalleryProvisioningState; + sharingProfile?: SharingProfile; + readonly sharingStatus?: SharingStatus; + softDeletePolicy?: SoftDeletePolicy; +} + +// @public +export interface GalleryApplication extends TrackedResource { + customActions?: GalleryApplicationCustomAction[]; + description?: string; + endOfLifeDate?: Date; + eula?: string; + privacyStatementUri?: string; + releaseNoteUri?: string; + supportedOSType?: OperatingSystemTypes; +} + +// @public +export interface GalleryApplicationCustomAction { + description?: string; + name: string; + parameters?: GalleryApplicationCustomActionParameter[]; + script: string; +} + +// @public +export interface GalleryApplicationCustomActionParameter { + defaultValue?: string; + description?: string; + name: string; + required?: boolean; + type?: GalleryApplicationCustomActionParameterType; +} + +// @public +export type GalleryApplicationCustomActionParameterType = "String" | "ConfigurationDataBlob" | "LogOutputBlob"; + +// @public +export interface GalleryApplicationProperties { + customActions?: GalleryApplicationCustomAction[]; + description?: string; + endOfLifeDate?: Date; + eula?: string; + privacyStatementUri?: string; + releaseNoteUri?: string; + supportedOSType: OperatingSystemTypes; +} + +// @public +export type GalleryApplicationScriptRebootBehavior = string; + +// @public +export interface GalleryApplicationUpdate extends UpdateResourceDefinition { + customActions?: GalleryApplicationCustomAction[]; + description?: string; + endOfLifeDate?: Date; + eula?: string; + privacyStatementUri?: string; + releaseNoteUri?: string; + supportedOSType?: OperatingSystemTypes; +} + +// @public +export interface GalleryApplicationVersion extends TrackedResource { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile?: GalleryApplicationVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryApplicationVersionSafetyProfile; +} + +// @public +export interface GalleryApplicationVersionProperties { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile: GalleryApplicationVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryApplicationVersionSafetyProfile; +} + +// @public +export interface GalleryApplicationVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + advancedSettings?: Record; + customActions?: GalleryApplicationCustomAction[]; + enableHealthCheck?: boolean; + // (undocumented) + manageActions?: UserArtifactManage; + settings?: UserArtifactSettings; + source: UserArtifactSource; +} + +// @public +export interface GalleryApplicationVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { +} + +// @public +export interface GalleryApplicationVersionUpdate extends UpdateResourceDefinition { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile?: GalleryApplicationVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryApplicationVersionSafetyProfile; +} + +// @public +export interface GalleryArtifactPublishingProfileBase { + endOfLifeDate?: Date; + excludeFromLatest?: boolean; + readonly publishedDate?: Date; + replicaCount?: number; + replicationMode?: ReplicationMode; + storageAccountStrategy?: StorageAccountStrategy; + storageAccountType?: StorageAccountType; + targetExtendedLocations?: GalleryTargetExtendedLocation[]; + targetRegions?: TargetRegion[]; +} + +// @public +export interface GalleryArtifactSafetyProfileBase { + allowDeletionOfReplicatedLocations?: boolean; +} + +// @public +export interface GalleryArtifactVersionFullSource extends GalleryArtifactVersionSource { + communityGalleryImageId?: string; + virtualMachineId?: string; +} + +// @public +export interface GalleryArtifactVersionSource { + id?: string; +} + +// @public +export interface GalleryDataDiskImage extends GalleryDiskImage { + lun: number; +} + +// @public +export interface GalleryDiskImage { + hostCaching?: HostCaching; + readonly sizeInGB?: number; + source?: GalleryDiskImageSource; +} + +// @public +export interface GalleryDiskImageSource extends GalleryArtifactVersionSource { + storageAccountId?: string; + uri?: string; +} + +// @public +export type GalleryExpandParams = string; + +// @public +export interface GalleryExtendedLocation { + // (undocumented) + name?: string; + type?: GalleryExtendedLocationType; +} + +// @public +export type GalleryExtendedLocationType = string; + +// @public +export interface GalleryIdentifier { + readonly uniqueName?: string; +} + +// @public +export interface GalleryIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export interface GalleryImage extends TrackedResource { + allowUpdateImage?: boolean; + architecture?: Architecture; + description?: string; + disallowed?: Disallowed; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier?: GalleryImageIdentifier; + osState?: OperatingSystemStateTypes; + osType?: OperatingSystemTypes; + privacyStatementUri?: string; + readonly provisioningState?: GalleryProvisioningState; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; + releaseNoteUri?: string; +} + +// @public +export interface GalleryImageFeature { + name?: string; + startsAtVersion?: string; + value?: string; +} + +// @public +export interface GalleryImageIdentifier { + offer: string; + publisher: string; + sku: string; +} + +// @public +export interface GalleryImageProperties { + allowUpdateImage?: boolean; + architecture?: Architecture; + description?: string; + disallowed?: Disallowed; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier: GalleryImageIdentifier; + osState: OperatingSystemStateTypes; + osType: OperatingSystemTypes; + privacyStatementUri?: string; + readonly provisioningState?: GalleryProvisioningState; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; + releaseNoteUri?: string; +} + +// @public +export interface GalleryImageUpdate extends UpdateResourceDefinition { + allowUpdateImage?: boolean; + architecture?: Architecture; + description?: string; + disallowed?: Disallowed; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier?: GalleryImageIdentifier; + osState?: OperatingSystemStateTypes; + osType?: OperatingSystemTypes; + privacyStatementUri?: string; + readonly provisioningState?: GalleryProvisioningState; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; + releaseNoteUri?: string; +} + +// @public +export interface GalleryImageVersion extends TrackedResource { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile?: GalleryImageVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + restore?: boolean; + safetyProfile?: GalleryImageVersionSafetyProfile; + securityProfile?: ImageVersionSecurityProfile; + storageProfile?: GalleryImageVersionStorageProfile; + readonly validationsProfile?: ValidationsProfile; +} + +// @public +export interface GalleryImageVersionProperties { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile?: GalleryImageVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + restore?: boolean; + safetyProfile?: GalleryImageVersionSafetyProfile; + securityProfile?: ImageVersionSecurityProfile; + storageProfile: GalleryImageVersionStorageProfile; + readonly validationsProfile?: ValidationsProfile; +} + +// @public +export interface GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { +} + +// @public +export interface GalleryImageVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { + blockDeletionBeforeEndOfLife?: boolean; + readonly policyViolations?: PolicyViolation[]; + readonly reportedForPolicyViolation?: boolean; +} + +// @public +export interface GalleryImageVersionStorageProfile { + dataDiskImages?: GalleryDataDiskImage[]; + osDiskImage?: GalleryOSDiskImage; + source?: GalleryArtifactVersionFullSource; +} + +// @public +export interface GalleryImageVersionUefiSettings { + additionalSignatures?: UefiKeySignatures; + signatureTemplateNames?: UefiSignatureTemplateName[]; +} + +// @public +export interface GalleryImageVersionUpdate extends UpdateResourceDefinition { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile?: GalleryImageVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + restore?: boolean; + safetyProfile?: GalleryImageVersionSafetyProfile; + securityProfile?: ImageVersionSecurityProfile; + storageProfile?: GalleryImageVersionStorageProfile; + readonly validationsProfile?: ValidationsProfile; +} + +// @public +export interface GalleryInVMAccessControlProfile extends TrackedResource { + properties?: GalleryInVMAccessControlProfileProperties; +} + +// @public +export interface GalleryInVMAccessControlProfileProperties extends GalleryResourceProfilePropertiesBase { + applicableHostEndpoint: EndpointTypes; + description?: string; + osType: OperatingSystemTypes; +} + +// @public +export interface GalleryInVMAccessControlProfileUpdate extends UpdateResourceDefinition { + properties?: GalleryInVMAccessControlProfileProperties; +} + +// @public +export interface GalleryInVMAccessControlProfileVersion extends TrackedResource { + defaultAccess?: EndpointAccess; + excludeFromLatest?: boolean; + mode?: AccessControlRulesMode; + readonly provisioningState?: GalleryProvisioningState; + readonly publishedDate?: Date; + readonly replicationStatus?: ReplicationStatus; + rules?: AccessControlRules; + targetLocations?: TargetRegion[]; +} + +// @public +export interface GalleryInVMAccessControlProfileVersionProperties extends GalleryResourceProfileVersionPropertiesBase { + defaultAccess: EndpointAccess; + mode: AccessControlRulesMode; + rules?: AccessControlRules; +} + +// @public +export interface GalleryInVMAccessControlProfileVersionUpdate extends UpdateResourceDefinition { + defaultAccess?: EndpointAccess; + excludeFromLatest?: boolean; + mode?: AccessControlRulesMode; + readonly provisioningState?: GalleryProvisioningState; + readonly publishedDate?: Date; + readonly replicationStatus?: ReplicationStatus; + rules?: AccessControlRules; + targetLocations?: TargetRegion[]; +} + +// @public +export interface GalleryOSDiskImage extends GalleryDiskImage { +} + +// @public +export interface GalleryProperties { + description?: string; + identifier?: GalleryIdentifier; + readonly provisioningState?: GalleryProvisioningState; + sharingProfile?: SharingProfile; + readonly sharingStatus?: SharingStatus; + softDeletePolicy?: SoftDeletePolicy; +} + +// @public +export type GalleryProvisioningState = string; + +// @public +export interface GalleryResourceProfilePropertiesBase { + readonly provisioningState?: GalleryProvisioningState; +} + +// @public +export interface GalleryResourceProfileVersionPropertiesBase { + excludeFromLatest?: boolean; + readonly provisioningState?: GalleryProvisioningState; + readonly publishedDate?: Date; + readonly replicationStatus?: ReplicationStatus; + targetLocations?: TargetRegion[]; +} + +// @public +export interface GalleryScript extends TrackedResource { + properties?: GalleryScriptProperties; +} + +// @public +export interface GalleryScriptParameter extends GenericGalleryParameter { + enumValues?: string[]; + maxValue?: string; + minValue?: string; + type?: GalleryScriptParameterType; +} + +// @public +export type GalleryScriptParameterType = string; + +// @public +export interface GalleryScriptProperties { + description?: string; + endOfLifeDate?: Date; + eula?: string; + privacyStatementUri?: string; + readonly provisioningState?: GalleryProvisioningState; + releaseNoteUri?: string; + supportedOSType: OperatingSystemTypes; +} + +// @public +export interface GalleryScriptUpdate extends UpdateResourceDefinition { + description?: string; + endOfLifeDate?: Date; + eula?: string; + privacyStatementUri?: string; + readonly provisioningState?: GalleryProvisioningState; + releaseNoteUri?: string; + supportedOSType?: OperatingSystemTypes; +} + +// @public +export interface GalleryScriptVersion extends TrackedResource { + properties?: GalleryScriptVersionProperties; +} + +// @public +export interface GalleryScriptVersionProperties { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile: GalleryScriptVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryScriptVersionSafetyProfile; +} + +// @public +export interface GalleryScriptVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + source: ScriptSource; +} + +// @public +export interface GalleryScriptVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { +} + +// @public +export interface GalleryScriptVersionUpdate extends UpdateResourceDefinition { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile?: GalleryScriptVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryScriptVersionSafetyProfile; +} + +// @public +export type GallerySharingPermissionTypes = string; + +// @public +export interface GallerySoftDeletedResource extends TrackedResource { + resourceArmId?: string; + softDeletedArtifactType?: SoftDeletedArtifactTypes; + softDeletedTime?: string; +} + +// @public +export interface GallerySoftDeletedResourceProperties { + resourceArmId?: string; + softDeletedArtifactType?: SoftDeletedArtifactTypes; + softDeletedTime?: string; +} + +// @public +export interface GalleryTargetExtendedLocation { + encryption?: EncryptionImages; + extendedLocation?: GalleryExtendedLocation; + extendedLocationReplicaCount?: number; + name?: string; + storageAccountType?: EdgeZoneStorageAccountType; +} + +// @public +export interface GalleryUpdate extends UpdateResourceDefinition { + description?: string; + identifier?: GalleryIdentifier; + identity?: GalleryIdentity; + readonly provisioningState?: GalleryProvisioningState; + sharingProfile?: SharingProfile; + readonly sharingStatus?: SharingStatus; + softDeletePolicy?: SoftDeletePolicy; +} + +// @public +export interface GenericGalleryParameter { + defaultValue?: string; + description?: string; + name: string; + required?: boolean; +} + +// @public +export type HostCaching = "None" | "ReadOnly" | "ReadWrite"; + +// @public +export interface ImagePurchasePlan { + name?: string; + product?: string; + publisher?: string; +} + +// @public +export interface ImageVersionSecurityProfile { + uefiSettings?: GalleryImageVersionUefiSettings; +} + +// @public +export enum KnownAccessControlRulesMode { + Audit = "Audit", + Disabled = "Disabled", + Enforce = "Enforce" +} + +// @public +export enum KnownAggregatedReplicationState { + Completed = "Completed", + Failed = "Failed", + InProgress = "InProgress", + Unknown = "Unknown" +} + +// @public +export enum KnownConfidentialVMEncryptionType { + EncryptedVMGuestStateOnlyWithPmk = "EncryptedVMGuestStateOnlyWithPmk", + EncryptedWithCmk = "EncryptedWithCmk", + EncryptedWithPmk = "EncryptedWithPmk", + NonPersistedTPM = "NonPersistedTPM" +} + +// @public +export enum KnownEdgeZoneStorageAccountType { + PremiumLRS = "Premium_LRS", + StandardLRS = "Standard_LRS", + StandardSSDLRS = "StandardSSD_LRS", + StandardZRS = "Standard_ZRS" +} + +// @public +export enum KnownEndpointAccess { + Allow = "Allow", + Deny = "Deny" +} + +// @public +export enum KnownGalleryApplicationScriptRebootBehavior { + None = "None", + Rerun = "Rerun" +} + +// @public +export enum KnownGalleryExpandParams { + SharingProfileGroups = "SharingProfile/Groups" +} + +// @public +export enum KnownGalleryExtendedLocationType { + EdgeZone = "EdgeZone", + Unknown = "Unknown" +} + +// @public +export enum KnownGalleryProvisioningState { + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Migrating = "Migrating", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownGalleryScriptParameterType { + Boolean = "Boolean", + Double = "Double", + Enum = "Enum", + Int = "Int", + String = "String" +} + +// @public +export enum KnownGallerySharingPermissionTypes { + Community = "Community", + Groups = "Groups", + Private = "Private" +} + +// @public +export enum KnownPolicyViolationCategory { + CopyrightValidation = "CopyrightValidation", + ImageFlaggedUnsafe = "ImageFlaggedUnsafe", + IpTheft = "IpTheft", + Other = "Other" +} + +// @public +export enum KnownReplicationMode { + Full = "Full", + Shallow = "Shallow" +} + +// @public +export enum KnownReplicationState { + Completed = "Completed", + Failed = "Failed", + Replicating = "Replicating", + Unknown = "Unknown" +} + +// @public +export enum KnownReplicationStatusTypes { + ReplicationStatus = "ReplicationStatus", + UefiSettings = "UefiSettings" +} + +// @public +export enum KnownSelectPermissions { + Permissions = "Permissions" +} + +// @public +export enum KnownSharedGalleryHostCaching { + None = "None", + ReadOnly = "ReadOnly", + ReadWrite = "ReadWrite" +} + +// @public +export enum KnownSharedToValues { + Tenant = "tenant" +} + +// @public +export enum KnownSharingProfileGroupTypes { + AADTenants = "AADTenants", + Subscriptions = "Subscriptions" +} + +// @public +export enum KnownSharingState { + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export enum KnownSharingUpdateOperationTypes { + Add = "Add", + EnableCommunity = "EnableCommunity", + Remove = "Remove", + Reset = "Reset" +} + +// @public +export enum KnownSoftDeletedArtifactTypes { + Images = "Images" +} + +// @public +export enum KnownStorageAccountStrategy { + DefaultStandardLRS = "DefaultStandard_LRS", + PreferStandardZRS = "PreferStandard_ZRS" +} + +// @public +export enum KnownStorageAccountType { + PremiumLRS = "Premium_LRS", + PremiumV2LRS = "PremiumV2_LRS", + StandardLRS = "Standard_LRS", + StandardZRS = "Standard_ZRS" +} + +// @public +export enum KnownUefiKeyType { + Sha256 = "sha256", + X509 = "x509" +} + +// @public +export enum KnownUefiSignatureTemplateName { + MicrosoftUefiCertificateAuthorityTemplate = "MicrosoftUefiCertificateAuthorityTemplate", + MicrosoftWindowsTemplate = "MicrosoftWindowsTemplate", + NoSignatureTemplate = "NoSignatureTemplate" +} + +// @public +export enum KnownValidationStatus { + Failed = "Failed", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export interface OSDiskImageEncryption extends DiskImageEncryption { + securityProfile?: OSDiskImageSecurityProfile; +} + +// @public +export interface OSDiskImageSecurityProfile { + confidentialVMEncryptionType?: ConfidentialVMEncryptionType; + secureVMDiskEncryptionSetId?: string; +} + +// @public +export interface PirCommunityGalleryResource { + readonly location?: string; + readonly name?: string; + readonly type?: string; + uniqueId?: string; +} + +// @public +export interface PirResource { + readonly location?: string; + readonly name?: string; +} + +// @public +export interface PirSharedGalleryResource extends PirResource { + uniqueId?: string; +} + +// @public +export interface PlatformAttribute { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface PolicyViolation { + category?: PolicyViolationCategory; + details?: string; +} + +// @public +export type PolicyViolationCategory = string; + +// @public +export interface RecommendedMachineConfiguration { + memory?: ResourceRange; + vCPUs?: ResourceRange; +} + +// @public +export interface RegionalReplicationStatus { + readonly details?: string; + readonly progress?: number; + readonly region?: string; + readonly state?: ReplicationState; +} + +// @public +export interface RegionalSharingStatus { + details?: string; + region?: string; + readonly state?: SharingState; +} + +// @public +export type ReplicationMode = string; + +// @public +export type ReplicationState = string; + +// @public +export interface ReplicationStatus { + readonly aggregatedState?: AggregatedReplicationState; + readonly summary?: RegionalReplicationStatus[]; +} + +// @public +export type ReplicationStatusTypes = string; + +// @public +export interface ResourceRange { + max?: number; + min?: number; +} + +// @public +export interface ScriptSource { + parameters?: GalleryScriptParameter[]; + scriptLink: string; +} + +// @public +export type SelectPermissions = string; + +// @public +export interface SharedGallery extends PirSharedGalleryResource { + readonly artifactTags?: Record; +} + +// @public +export interface SharedGalleryDataDiskImage extends SharedGalleryDiskImage { + lun: number; +} + +// @public +export interface SharedGalleryDiskImage { + readonly diskSizeGB?: number; + hostCaching?: SharedGalleryHostCaching; +} + +// @public +export type SharedGalleryHostCaching = string; + +// @public +export interface SharedGalleryIdentifier { + uniqueId?: string; +} + +// @public +export interface SharedGalleryImage extends PirSharedGalleryResource { + architecture?: Architecture; + artifactTags?: Record; + disallowed?: Disallowed; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier?: GalleryImageIdentifier; + osState?: OperatingSystemStateTypes; + osType?: OperatingSystemTypes; + privacyStatementUri?: string; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; +} + +// @public +export interface SharedGalleryImageProperties { + architecture?: Architecture; + artifactTags?: Record; + disallowed?: Disallowed; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier: GalleryImageIdentifier; + osState: OperatingSystemStateTypes; + osType: OperatingSystemTypes; + privacyStatementUri?: string; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; +} + +// @public +export interface SharedGalleryImageVersion extends PirSharedGalleryResource { + artifactTags?: Record; + endOfLifeDate?: Date; + excludeFromLatest?: boolean; + publishedDate?: Date; + storageProfile?: SharedGalleryImageVersionStorageProfile; +} + +// @public +export interface SharedGalleryImageVersionProperties { + artifactTags?: Record; + endOfLifeDate?: Date; + excludeFromLatest?: boolean; + publishedDate?: Date; + storageProfile?: SharedGalleryImageVersionStorageProfile; +} + +// @public +export interface SharedGalleryImageVersionStorageProfile { + dataDiskImages?: SharedGalleryDataDiskImage[]; + osDiskImage?: SharedGalleryOSDiskImage; +} + +// @public +export interface SharedGalleryOSDiskImage extends SharedGalleryDiskImage { +} + +// @public +export interface SharedGalleryProperties { + readonly artifactTags?: Record; +} + +// @public +export type SharedToValues = string; + +// @public +export interface SharingProfile { + communityGalleryInfo?: CommunityGalleryInfo; + readonly groups?: SharingProfileGroup[]; + permissions?: GallerySharingPermissionTypes; +} + +// @public +export interface SharingProfileGroup { + ids?: string[]; + type?: SharingProfileGroupTypes; +} + +// @public +export type SharingProfileGroupTypes = string; + +// @public +export type SharingState = string; + +// @public +export interface SharingStatus { + readonly aggregatedState?: SharingState; + summary?: RegionalSharingStatus[]; +} + +// @public +export interface SharingUpdate { + groups?: SharingProfileGroup[]; + operationType: SharingUpdateOperationTypes; +} + +// @public +export type SharingUpdateOperationTypes = string; + +// @public +export type SoftDeletedArtifactTypes = string; + +// @public +export interface SoftDeletePolicy { + isSoftDeleteEnabled?: boolean; +} + +// @public +export type StorageAccountStrategy = string; + +// @public +export type StorageAccountType = string; + +// @public +export interface TargetRegion { + additionalReplicaSets?: AdditionalReplicaSet[]; + encryption?: EncryptionImages; + excludeFromLatest?: boolean; + name: string; + regionalReplicaCount?: number; + storageAccountType?: StorageAccountType; +} + +// @public +export interface UefiKey { + type?: UefiKeyType; + value?: string[]; +} + +// @public +export interface UefiKeySignatures { + db?: UefiKey[]; + dbx?: UefiKey[]; + kek?: UefiKey[]; + pk?: UefiKey; +} + +// @public +export type UefiKeyType = string; + +// @public +export type UefiSignatureTemplateName = string; + +// @public +export interface UpdateResourceDefinition { + readonly id?: string; + readonly name?: string; + tags?: Record; + readonly type?: string; +} + +// @public +export interface UserArtifactManage { + install: string; + remove: string; + update?: string; +} + +// @public +export interface UserArtifactSettings { + configFileName?: string; + packageFileName?: string; + scriptBehaviorAfterReboot?: GalleryApplicationScriptRebootBehavior; +} + +// @public +export interface UserArtifactSource { + defaultConfigurationLink?: string; + mediaLink: string; +} + +// @public +export interface ValidationsProfile { + // (undocumented) + executedValidations?: ExecutedValidation[]; + platformAttributes?: PlatformAttribute[]; + validationEtag?: string; +} + +// @public +export type ValidationStatus = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute/review/arm-compute-models-computeSku-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-computeSku-node.api.md new file mode 100644 index 000000000000..c1f4a58becfe --- /dev/null +++ b/sdk/compute/arm-compute/review/arm-compute-models-computeSku-node.api.md @@ -0,0 +1,93 @@ +## API Report File for "@azure/arm-compute" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type ExtendedLocationType = string; + +// @public +export enum KnownExtendedLocationType { + EdgeZone = "EdgeZone" +} + +// @public +export interface ResourceSku { + readonly apiVersions?: string[]; + readonly capabilities?: ResourceSkuCapabilities[]; + readonly capacity?: ResourceSkuCapacity; + readonly costs?: ResourceSkuCosts[]; + readonly family?: string; + readonly kind?: string; + readonly locationInfo?: ResourceSkuLocationInfo[]; + readonly locations?: string[]; + readonly name?: string; + readonly resourceType?: string; + readonly restrictions?: ResourceSkuRestrictions[]; + readonly size?: string; + readonly tier?: string; +} + +// @public +export interface ResourceSkuCapabilities { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface ResourceSkuCapacity { + readonly default?: number; + readonly maximum?: number; + readonly minimum?: number; + readonly scaleType?: ResourceSkuCapacityScaleType; +} + +// @public +export type ResourceSkuCapacityScaleType = "Automatic" | "Manual" | "None"; + +// @public +export interface ResourceSkuCosts { + readonly extendedUnit?: string; + readonly meterID?: string; + readonly quantity?: number; +} + +// @public +export interface ResourceSkuLocationInfo { + readonly extendedLocations?: string[]; + readonly location?: string; + readonly type?: ExtendedLocationType; + readonly zoneDetails?: ResourceSkuZoneDetails[]; + readonly zones?: string[]; +} + +// @public +export interface ResourceSkuRestrictionInfo { + readonly locations?: string[]; + readonly zones?: string[]; +} + +// @public +export interface ResourceSkuRestrictions { + readonly reasonCode?: ResourceSkuRestrictionsReasonCode; + readonly restrictionInfo?: ResourceSkuRestrictionInfo; + readonly type?: ResourceSkuRestrictionsType; + readonly values?: string[]; +} + +// @public +export type ResourceSkuRestrictionsReasonCode = "QuotaId" | "NotAvailableForSubscription"; + +// @public +export type ResourceSkuRestrictionsType = "Location" | "Zone"; + +// @public +export interface ResourceSkuZoneDetails { + readonly capabilities?: ResourceSkuCapabilities[]; + readonly name?: string[]; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute/review/arm-compute-models-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-node.api.md new file mode 100644 index 000000000000..07f8d605559c --- /dev/null +++ b/sdk/compute/arm-compute/review/arm-compute-models-node.api.md @@ -0,0 +1,103 @@ +## API Report File for "@azure/arm-compute" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type ActionType = string; + +// @public +export type CreatedByType = 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 enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @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 Origin = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute/review/arm-compute-node.api.md b/sdk/compute/arm-compute/review/arm-compute-node.api.md index 8d1012350998..36ca94ea3516 100644 --- a/sdk/compute/arm-compute/review/arm-compute-node.api.md +++ b/sdk/compute/arm-compute/review/arm-compute-node.api.md @@ -4,11 +4,15 @@ ```ts -import type * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { CancelOnProgress } from '@azure/core-lro'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; import type { OperationState } from '@azure/core-lro'; -import type { PagedAsyncIterableIterator } from '@azure/core-paging'; -import type { SimplePollerLike } 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 interface AccessControlRules { @@ -34,9 +38,7 @@ export type AccessControlRulesMode = string; export interface AccessControlRulesPrivilege { name: string; path: string; - queryParameters?: { - [propertyName: string]: string; - }; + queryParameters?: Record; } // @public @@ -79,9 +81,9 @@ export interface AdditionalReplicaSet { // @public export interface AdditionalUnattendContent { - componentName?: "Microsoft-Windows-Shell-Setup"; + componentName?: ComponentNames; content?: string; - passName?: "OobeSystem"; + passName?: PassNames; settingName?: SettingNames; } @@ -191,124 +193,80 @@ export interface AvailabilitySet extends TrackedResource { } // @public -export interface AvailabilitySetListResult { - nextLink?: string; - value: AvailabilitySet[]; -} - -// @public -export interface AvailabilitySets { - beginConvertToVirtualMachineScaleSet(resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams): Promise, AvailabilitySetsConvertToVirtualMachineScaleSetResponse>>; - beginConvertToVirtualMachineScaleSetAndWait(resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams): Promise; - cancelMigrationToVirtualMachineScaleSet(resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams): Promise; - createOrUpdate(resourceGroupName: string, availabilitySetName: string, parameters: AvailabilitySet, options?: AvailabilitySetsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsDeleteOptionalParams): Promise; - get(resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsGetOptionalParams): Promise; - list(resourceGroupName: string, options?: AvailabilitySetsListOptionalParams): PagedAsyncIterableIterator; - listAvailableSizes(resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsListAvailableSizesOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: AvailabilitySetsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - startMigrationToVirtualMachineScaleSet(resourceGroupName: string, availabilitySetName: string, parameters: MigrateToVirtualMachineScaleSetInput, options?: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams): Promise; - update(resourceGroupName: string, availabilitySetName: string, parameters: AvailabilitySetUpdate, options?: AvailabilitySetsUpdateOptionalParams): Promise; - validateMigrationToVirtualMachineScaleSet(resourceGroupName: string, availabilitySetName: string, parameters: MigrateToVirtualMachineScaleSetInput, options?: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams): Promise; +export interface AvailabilitySetProperties { + platformFaultDomainCount?: number; + platformUpdateDomainCount?: number; + proximityPlacementGroup?: SubResource; + scheduledEventsPolicy?: ScheduledEventsPolicy; + readonly statuses?: InstanceViewStatus[]; + virtualMachines?: SubResource[]; + readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; } // @public -export interface AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams extends OperationOptions { } // @public -export interface AvailabilitySetsConvertToVirtualMachineScaleSetHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams extends OperationOptions { parameters?: ConvertToVirtualMachineScaleSetInput; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type AvailabilitySetsConvertToVirtualMachineScaleSetResponse = AvailabilitySetsConvertToVirtualMachineScaleSetHeaders; - -// @public -export interface AvailabilitySetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsCreateOrUpdateOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsCreateOrUpdateResponse = AvailabilitySet; - -// @public -export interface AvailabilitySetsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface AvailabilitySetsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type AvailabilitySetsGetResponse = AvailabilitySet; - -// @public -export type AvailabilitySetSkuTypes = string; - -// @public -export interface AvailabilitySetsListAvailableSizesNextOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsDeleteOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsListAvailableSizesNextResponse = VirtualMachineSizeListResult; - -// @public -export interface AvailabilitySetsListAvailableSizesOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsGetOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsListAvailableSizesResponse = VirtualMachineSizeListResult; - -// @public -export interface AvailabilitySetsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsListAvailableSizesOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsListBySubscriptionNextResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsListBySubscriptionOptionalParams extends OperationOptions { expand?: string; } // @public -export type AvailabilitySetsListBySubscriptionResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsListNextOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsListOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsListNextResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsListOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsOperations { + // @deprecated (undocumented) + beginConvertToVirtualMachineScaleSet: (resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginConvertToVirtualMachineScaleSetAndWait: (resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams) => Promise; + cancelMigrationToVirtualMachineScaleSet: (resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams) => Promise; + convertToVirtualMachineScaleSet: (resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams) => PollerLike, void>; + createOrUpdate: (resourceGroupName: string, availabilitySetName: string, parameters: AvailabilitySet, options?: AvailabilitySetsCreateOrUpdateOptionalParams) => Promise; + delete: (resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsGetOptionalParams) => Promise; + list: (resourceGroupName: string, options?: AvailabilitySetsListOptionalParams) => PagedAsyncIterableIterator; + listAvailableSizes: (resourceGroupName: string, availabilitySetName: string, options?: AvailabilitySetsListAvailableSizesOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: AvailabilitySetsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + startMigrationToVirtualMachineScaleSet: (resourceGroupName: string, availabilitySetName: string, parameters: MigrateToVirtualMachineScaleSetInput, options?: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams) => Promise; + update: (resourceGroupName: string, availabilitySetName: string, parameters: AvailabilitySetUpdate, options?: AvailabilitySetsUpdateOptionalParams) => Promise; + validateMigrationToVirtualMachineScaleSet: (resourceGroupName: string, availabilitySetName: string, parameters: MigrateToVirtualMachineScaleSetInput, options?: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams) => Promise; } // @public -export type AvailabilitySetsListResponse = AvailabilitySetListResult; - -// @public -export interface AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams extends OperationOptions { } // @public -export interface AvailabilitySetsUpdateOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsUpdateOptionalParams extends OperationOptions { } // @public -export type AvailabilitySetsUpdateResponse = AvailabilitySet; - -// @public -export interface AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams extends coreClient.OperationOptions { +export interface AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams extends OperationOptions { } // @public @@ -324,777 +282,263 @@ export interface AvailabilitySetUpdate extends UpdateResource { } // @public -export interface AvailablePatchSummary { - readonly assessmentActivityId?: string; - readonly criticalAndSecurityPatchCount?: number; - readonly error?: ApiError; - readonly lastModifiedTime?: Date; - readonly otherPatchCount?: number; - readonly rebootPending?: boolean; - readonly startTime?: Date; - readonly status?: PatchOperationStatus; -} - -// @public -export interface BillingProfile { - maxPrice?: number; -} - -// @public -export interface BootDiagnostics { - enabled?: boolean; - storageUri?: string; -} - -// @public -export interface BootDiagnosticsInstanceView { - readonly consoleScreenshotBlobUri?: string; - readonly serialConsoleLogBlobUri?: string; - readonly status?: InstanceViewStatus; -} - -// @public -export type CachingTypes = "None" | "ReadOnly" | "ReadWrite"; - -// @public -export interface CapacityReservation extends TrackedResource { - readonly instanceView?: CapacityReservationInstanceView; - readonly platformFaultDomainCount?: number; - readonly provisioningState?: string; - readonly provisioningTime?: Date; - readonly reservationId?: string; - scheduleProfile?: ScheduleProfile; - sku: Sku; - readonly timeCreated?: Date; - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; - zones?: string[]; -} - -// @public -export interface CapacityReservationGroup extends TrackedResource { - readonly capacityReservations?: SubResourceReadOnly[]; - readonly instanceView?: CapacityReservationGroupInstanceView; - reservationType?: ReservationType; - sharingProfile?: ResourceSharingProfile; - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; - zones?: string[]; -} - -// @public (undocumented) -export interface CapacityReservationGroupInstanceView { - readonly capacityReservations?: CapacityReservationInstanceViewWithName[]; - readonly sharedSubscriptionIds?: SubResourceReadOnly[]; -} - -// @public -export type CapacityReservationGroupInstanceViewTypes = string; - -// @public -export interface CapacityReservationGroupListResult { - nextLink?: string; - value: CapacityReservationGroup[]; -} - -// @public -export interface CapacityReservationGroups { - createOrUpdate(resourceGroupName: string, capacityReservationGroupName: string, parameters: CapacityReservationGroup, options?: CapacityReservationGroupsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, capacityReservationGroupName: string, options?: CapacityReservationGroupsDeleteOptionalParams): Promise; - get(resourceGroupName: string, capacityReservationGroupName: string, options?: CapacityReservationGroupsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: CapacityReservationGroupsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: CapacityReservationGroupsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, capacityReservationGroupName: string, parameters: CapacityReservationGroupUpdate, options?: CapacityReservationGroupsUpdateOptionalParams): Promise; -} - -// @public -export interface CapacityReservationGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CapacityReservationGroupsCreateOrUpdateResponse = CapacityReservationGroup; - -// @public -export interface CapacityReservationGroupsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface CapacityReservationGroupsGetOptionalParams extends coreClient.OperationOptions { - expand?: CapacityReservationGroupInstanceViewTypes; -} - -// @public -export type CapacityReservationGroupsGetResponse = CapacityReservationGroup; - -// @public -export interface CapacityReservationGroupsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CapacityReservationGroupsListByResourceGroupNextResponse = CapacityReservationGroupListResult; - -// @public -export interface CapacityReservationGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions { - expand?: ExpandTypesForGetCapacityReservationGroups; -} - -// @public -export type CapacityReservationGroupsListByResourceGroupResponse = CapacityReservationGroupListResult; - -// @public -export interface CapacityReservationGroupsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CapacityReservationGroupsListBySubscriptionNextResponse = CapacityReservationGroupListResult; - -// @public -export interface CapacityReservationGroupsListBySubscriptionOptionalParams extends coreClient.OperationOptions { - expand?: ExpandTypesForGetCapacityReservationGroups; - resourceIdsOnly?: ResourceIdOptionsForGetCapacityReservationGroups; -} - -// @public -export type CapacityReservationGroupsListBySubscriptionResponse = CapacityReservationGroupListResult; - -// @public -export interface CapacityReservationGroupsUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CapacityReservationGroupsUpdateResponse = CapacityReservationGroup; - -// @public -export interface CapacityReservationGroupUpdate extends UpdateResource { - readonly capacityReservations?: SubResourceReadOnly[]; - readonly instanceView?: CapacityReservationGroupInstanceView; - reservationType?: ReservationType; - sharingProfile?: ResourceSharingProfile; - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; -} - -// @public -export interface CapacityReservationInstanceView { - statuses?: InstanceViewStatus[]; - utilizationInfo?: CapacityReservationUtilization; -} - -// @public -export type CapacityReservationInstanceViewTypes = string; - -// @public -export interface CapacityReservationInstanceViewWithName extends CapacityReservationInstanceView { - readonly name?: string; -} - -// @public -export interface CapacityReservationListResult { - nextLink?: string; - value: CapacityReservation[]; -} - -// @public -export interface CapacityReservationProfile { - capacityReservationGroup?: SubResource; -} - -// @public -export interface CapacityReservations { - beginCreateOrUpdate(resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservation, options?: CapacityReservationsCreateOrUpdateOptionalParams): Promise, CapacityReservationsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservation, options?: CapacityReservationsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, options?: CapacityReservationsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, options?: CapacityReservationsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservationUpdate, options?: CapacityReservationsUpdateOptionalParams): Promise, CapacityReservationsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservationUpdate, options?: CapacityReservationsUpdateOptionalParams): Promise; - get(resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, options?: CapacityReservationsGetOptionalParams): Promise; - listByCapacityReservationGroup(resourceGroupName: string, capacityReservationGroupName: string, options?: CapacityReservationsListByCapacityReservationGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface CapacityReservationsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface CapacityReservationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type CapacityReservationsCreateOrUpdateResponse = CapacityReservation; - -// @public -export interface CapacityReservationsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface CapacityReservationsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface CapacityReservationsGetOptionalParams extends coreClient.OperationOptions { - expand?: CapacityReservationInstanceViewTypes; -} - -// @public -export type CapacityReservationsGetResponse = CapacityReservation; - -// @public -export interface CapacityReservationsListByCapacityReservationGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CapacityReservationsListByCapacityReservationGroupNextResponse = CapacityReservationListResult; - -// @public -export interface CapacityReservationsListByCapacityReservationGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CapacityReservationsListByCapacityReservationGroupResponse = CapacityReservationListResult; - -// @public -export interface CapacityReservationsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface CapacityReservationsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type CapacityReservationsUpdateResponse = CapacityReservation; - -// @public -export interface CapacityReservationUpdate extends UpdateResource { - readonly instanceView?: CapacityReservationInstanceView; - readonly platformFaultDomainCount?: number; - readonly provisioningState?: string; - readonly provisioningTime?: Date; - readonly reservationId?: string; - scheduleProfile?: ScheduleProfile; - sku?: Sku; - readonly timeCreated?: Date; - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; -} - -// @public -export interface CapacityReservationUtilization { - readonly currentCapacity?: number; - readonly virtualMachinesAllocated?: SubResourceReadOnly[]; -} - -// @public -export interface CloudError { - error?: ApiError; -} - -// @public -export interface CloudService { - readonly id?: string; - location: string; - readonly name?: string; - properties?: CloudServiceProperties; - readonly systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; - zones?: string[]; -} - -// @public -export interface CloudServiceExtensionProfile { - extensions?: Extension[]; -} - -// @public -export interface CloudServiceExtensionProperties { - autoUpgradeMinorVersion?: boolean; - forceUpdateTag?: string; - protectedSettings?: any; - protectedSettingsFromKeyVault?: CloudServiceVaultAndSecretReference; - readonly provisioningState?: string; - publisher?: string; - rolesAppliedTo?: string[]; - settings?: any; - type?: string; - typeHandlerVersion?: string; -} - -// @public -export interface CloudServiceInstanceView { - readonly privateIds?: string[]; - roleInstance?: InstanceViewStatusesSummary; - readonly sdkVersion?: string; - readonly statuses?: ResourceInstanceViewStatus[]; -} - -// @public -export interface CloudServiceListResult { - nextLink?: string; - value: CloudService[]; -} - -// @public -export interface CloudServiceNetworkProfile { - loadBalancerConfigurations?: LoadBalancerConfiguration[]; - slotType?: CloudServiceSlotType; - swappableCloudService?: SubResource; -} - -// @public -export interface CloudServiceOperatingSystems { - getOSFamily(location: string, osFamilyName: string, options?: CloudServiceOperatingSystemsGetOSFamilyOptionalParams): Promise; - getOSVersion(location: string, osVersionName: string, options?: CloudServiceOperatingSystemsGetOSVersionOptionalParams): Promise; - listOSFamilies(location: string, options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams): PagedAsyncIterableIterator; - listOSVersions(location: string, options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface CloudServiceOperatingSystemsGetOSFamilyOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceOperatingSystemsGetOSFamilyResponse = OSFamily; - -// @public -export interface CloudServiceOperatingSystemsGetOSVersionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceOperatingSystemsGetOSVersionResponse = OSVersion; - -// @public -export interface CloudServiceOperatingSystemsListOSFamiliesNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceOperatingSystemsListOSFamiliesNextResponse = OSFamilyListResult; - -// @public -export interface CloudServiceOperatingSystemsListOSFamiliesOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceOperatingSystemsListOSFamiliesResponse = OSFamilyListResult; - -// @public -export interface CloudServiceOperatingSystemsListOSVersionsNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceOperatingSystemsListOSVersionsNextResponse = OSVersionListResult; - -// @public -export interface CloudServiceOperatingSystemsListOSVersionsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceOperatingSystemsListOSVersionsResponse = OSVersionListResult; - -// @public -export interface CloudServiceOsProfile { - secrets?: CloudServiceVaultSecretGroup[]; -} - -// @public -export interface CloudServiceProperties { - allowModelOverride?: boolean; - configuration?: string; - configurationUrl?: string; - extensionProfile?: CloudServiceExtensionProfile; - networkProfile?: CloudServiceNetworkProfile; - osProfile?: CloudServiceOsProfile; - packageUrl?: string; - readonly provisioningState?: string; - roleProfile?: CloudServiceRoleProfile; - startCloudService?: boolean; - readonly uniqueId?: string; - upgradeMode?: CloudServiceUpgradeMode; -} - -// @public -export interface CloudServiceRole { - readonly id?: string; - readonly location?: string; - readonly name?: string; - properties?: CloudServiceRoleProperties; - sku?: CloudServiceRoleSku; - readonly type?: string; -} - -// @public -export interface CloudServiceRoleInstances { - beginDelete(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesDeleteOptionalParams): Promise; - beginRebuild(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesRebuildOptionalParams): Promise, void>>; - beginRebuildAndWait(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesRebuildOptionalParams): Promise; - beginReimage(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesReimageOptionalParams): Promise, void>>; - beginReimageAndWait(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesReimageOptionalParams): Promise; - beginRestart(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesRestartOptionalParams): Promise, void>>; - beginRestartAndWait(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesRestartOptionalParams): Promise; - get(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesGetOptionalParams): Promise; - getInstanceView(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesGetInstanceViewOptionalParams): Promise; - getRemoteDesktopFile(roleInstanceName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams): Promise; - list(resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRoleInstancesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface CloudServiceRoleInstancesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface CloudServiceRoleInstancesGetInstanceViewOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceRoleInstancesGetInstanceViewResponse = RoleInstanceView; - -// @public -export interface CloudServiceRoleInstancesGetOptionalParams extends coreClient.OperationOptions { - expand?: InstanceViewTypes; -} - -// @public -export interface CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceRoleInstancesGetRemoteDesktopFileResponse = { - blobBody?: Promise; - readableStreamBody?: NodeJS.ReadableStream; -}; - -// @public -export type CloudServiceRoleInstancesGetResponse = RoleInstance; - -// @public -export interface CloudServiceRoleInstancesListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceRoleInstancesListNextResponse = RoleInstanceListResult; - -// @public -export interface CloudServiceRoleInstancesListOptionalParams extends coreClient.OperationOptions { - expand?: InstanceViewTypes; -} - -// @public -export type CloudServiceRoleInstancesListResponse = RoleInstanceListResult; - -// @public -export interface CloudServiceRoleInstancesRebuildOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface CloudServiceRoleInstancesReimageOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface CloudServiceRoleInstancesRestartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface CloudServiceRoleListResult { - nextLink?: string; - value: CloudServiceRole[]; -} - -// @public -export interface CloudServiceRoleProfile { - roles?: CloudServiceRoleProfileProperties[]; -} - -// @public -export interface CloudServiceRoleProfileProperties { - name?: string; - sku?: CloudServiceRoleSku; -} - -// @public -export interface CloudServiceRoleProperties { - readonly uniqueId?: string; -} - -// @public -export interface CloudServiceRoles { - get(roleName: string, resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRolesGetOptionalParams): Promise; - list(resourceGroupName: string, cloudServiceName: string, options?: CloudServiceRolesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface CloudServiceRolesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceRolesGetResponse = CloudServiceRole; - -// @public -export interface CloudServiceRoleSku { - capacity?: number; - name?: string; - tier?: string; -} - -// @public -export interface CloudServiceRolesListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceRolesListNextResponse = CloudServiceRoleListResult; - -// @public -export interface CloudServiceRolesListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CloudServiceRolesListResponse = CloudServiceRoleListResult; - -// @public -export interface CloudServices { - beginCreateOrUpdate(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesCreateOrUpdateOptionalParams): Promise, CloudServicesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesDeleteOptionalParams): Promise; - beginDeleteInstances(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesDeleteInstancesOptionalParams): Promise, void>>; - beginDeleteInstancesAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesDeleteInstancesOptionalParams): Promise; - beginPowerOff(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesPowerOffOptionalParams): Promise, void>>; - beginPowerOffAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesPowerOffOptionalParams): Promise; - beginRebuild(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesRebuildOptionalParams): Promise, void>>; - beginRebuildAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesRebuildOptionalParams): Promise; - beginReimage(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesReimageOptionalParams): Promise, void>>; - beginReimageAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesReimageOptionalParams): Promise; - beginRestart(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesRestartOptionalParams): Promise, void>>; - beginRestartAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesRestartOptionalParams): Promise; - beginStart(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesStartOptionalParams): Promise, void>>; - beginStartAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesStartOptionalParams): Promise; - beginUpdate(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesUpdateOptionalParams): Promise, CloudServicesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesUpdateOptionalParams): Promise; - get(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesGetOptionalParams): Promise; - getInstanceView(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesGetInstanceViewOptionalParams): Promise; - list(resourceGroupName: string, options?: CloudServicesListOptionalParams): PagedAsyncIterableIterator; - listAll(options?: CloudServicesListAllOptionalParams): PagedAsyncIterableIterator; +export interface AvailablePatchSummary { + readonly assessmentActivityId?: string; + readonly criticalAndSecurityPatchCount?: number; + readonly error?: ApiError; + readonly lastModifiedTime?: Date; + readonly otherPatchCount?: number; + readonly rebootPending?: boolean; + readonly startTime?: Date; + readonly status?: PatchOperationStatus; } // @public -export interface CloudServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - parameters?: CloudService; - resumeFrom?: string; - updateIntervalInMs?: number; +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" } // @public -export type CloudServicesCreateOrUpdateResponse = CloudService; +export type AzureSupportedClouds = `${AzureClouds}`; // @public -export interface CloudServicesDeleteInstancesOptionalParams extends coreClient.OperationOptions { - parameters?: RoleInstances; - resumeFrom?: string; - updateIntervalInMs?: number; +export interface BillingProfile { + maxPrice?: number; } // @public -export interface CloudServicesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface BootDiagnostics { + enabled?: boolean; + storageUri?: string; } // @public -export interface CloudServicesGetInstanceViewOptionalParams extends coreClient.OperationOptions { +export interface BootDiagnosticsInstanceView { + readonly consoleScreenshotBlobUri?: string; + readonly serialConsoleLogBlobUri?: string; + readonly status?: InstanceViewStatus; } // @public -export type CloudServicesGetInstanceViewResponse = CloudServiceInstanceView; +export type CachingTypes = "None" | "ReadOnly" | "ReadWrite"; // @public -export interface CloudServicesGetOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservation extends TrackedResource { + readonly instanceView?: CapacityReservationInstanceView; + readonly platformFaultDomainCount?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly reservationId?: string; + scheduleProfile?: ScheduleProfile; + sku: Sku; + readonly timeCreated?: Date; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + zones?: string[]; } // @public -export type CloudServicesGetResponse = CloudService; - -// @public -export interface CloudServicesListAllNextOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservationGroup extends TrackedResource { + readonly capacityReservations?: SubResourceReadOnly[]; + readonly instanceView?: CapacityReservationGroupInstanceView; + reservationType?: ReservationType; + sharingProfile?: ResourceSharingProfile; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + zones?: string[]; } // @public -export type CloudServicesListAllNextResponse = CloudServiceListResult; - -// @public -export interface CloudServicesListAllOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservationGroupInstanceView { + readonly capacityReservations?: CapacityReservationInstanceViewWithName[]; + readonly sharedSubscriptionIds?: SubResourceReadOnly[]; } // @public -export type CloudServicesListAllResponse = CloudServiceListResult; +export type CapacityReservationGroupInstanceViewTypes = string; // @public -export interface CloudServicesListNextOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservationGroupProperties { + readonly capacityReservations?: SubResourceReadOnly[]; + readonly instanceView?: CapacityReservationGroupInstanceView; + reservationType?: ReservationType; + sharingProfile?: ResourceSharingProfile; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; } // @public -export type CloudServicesListNextResponse = CloudServiceListResult; - -// @public -export interface CloudServicesListOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservationGroupsCreateOrUpdateOptionalParams extends OperationOptions { } // @public -export type CloudServicesListResponse = CloudServiceListResult; - -// @public -export type CloudServiceSlotType = string; +export interface CapacityReservationGroupsDeleteOptionalParams extends OperationOptions { +} // @public -export interface CloudServicesPowerOffOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface CapacityReservationGroupsGetOptionalParams extends OperationOptions { + expand?: CapacityReservationGroupInstanceViewTypes; } // @public -export interface CloudServicesRebuildOptionalParams extends coreClient.OperationOptions { - parameters?: RoleInstances; - resumeFrom?: string; - updateIntervalInMs?: number; +export interface CapacityReservationGroupsListByResourceGroupOptionalParams extends OperationOptions { + expand?: ExpandTypesForGetCapacityReservationGroups; } // @public -export interface CloudServicesReimageOptionalParams extends coreClient.OperationOptions { - parameters?: RoleInstances; - resumeFrom?: string; - updateIntervalInMs?: number; +export interface CapacityReservationGroupsListBySubscriptionOptionalParams extends OperationOptions { + expand?: ExpandTypesForGetCapacityReservationGroups; + resourceIdsOnly?: ResourceIdOptionsForGetCapacityReservationGroups; } // @public -export interface CloudServicesRestartOptionalParams extends coreClient.OperationOptions { - parameters?: RoleInstances; - resumeFrom?: string; - updateIntervalInMs?: number; +export interface CapacityReservationGroupsOperations { + createOrUpdate: (resourceGroupName: string, capacityReservationGroupName: string, parameters: CapacityReservationGroup, options?: CapacityReservationGroupsCreateOrUpdateOptionalParams) => Promise; + delete: (resourceGroupName: string, capacityReservationGroupName: string, options?: CapacityReservationGroupsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, capacityReservationGroupName: string, options?: CapacityReservationGroupsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: CapacityReservationGroupsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: CapacityReservationGroupsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, capacityReservationGroupName: string, parameters: CapacityReservationGroupUpdate, options?: CapacityReservationGroupsUpdateOptionalParams) => Promise; } // @public -export interface CloudServicesStartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface CapacityReservationGroupsUpdateOptionalParams extends OperationOptions { } // @public -export interface CloudServicesUpdateDomain { - beginWalkUpdateDomain(resourceGroupName: string, cloudServiceName: string, updateDomain: number, options?: CloudServicesUpdateDomainWalkUpdateDomainOptionalParams): Promise, void>>; - beginWalkUpdateDomainAndWait(resourceGroupName: string, cloudServiceName: string, updateDomain: number, options?: CloudServicesUpdateDomainWalkUpdateDomainOptionalParams): Promise; - getUpdateDomain(resourceGroupName: string, cloudServiceName: string, updateDomain: number, options?: CloudServicesUpdateDomainGetUpdateDomainOptionalParams): Promise; - listUpdateDomains(resourceGroupName: string, cloudServiceName: string, options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams): PagedAsyncIterableIterator; +export interface CapacityReservationGroupUpdate extends UpdateResource { + readonly capacityReservations?: SubResourceReadOnly[]; + readonly instanceView?: CapacityReservationGroupInstanceView; + reservationType?: ReservationType; + sharingProfile?: ResourceSharingProfile; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; } // @public -export interface CloudServicesUpdateDomainGetUpdateDomainOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservationInstanceView { + statuses?: InstanceViewStatus[]; + utilizationInfo?: CapacityReservationUtilization; } // @public -export type CloudServicesUpdateDomainGetUpdateDomainResponse = UpdateDomain; +export type CapacityReservationInstanceViewTypes = string; // @public -export interface CloudServicesUpdateDomainListUpdateDomainsNextOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservationInstanceViewWithName extends CapacityReservationInstanceView { + readonly name?: string; } // @public -export type CloudServicesUpdateDomainListUpdateDomainsNextResponse = UpdateDomainListResult; - -// @public -export interface CloudServicesUpdateDomainListUpdateDomainsOptionalParams extends coreClient.OperationOptions { +export interface CapacityReservationProfile { + capacityReservationGroup?: SubResource; } // @public -export type CloudServicesUpdateDomainListUpdateDomainsResponse = UpdateDomainListResult; +export interface CapacityReservationProperties { + readonly instanceView?: CapacityReservationInstanceView; + readonly platformFaultDomainCount?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly reservationId?: string; + scheduleProfile?: ScheduleProfile; + readonly timeCreated?: Date; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; +} // @public -export interface CloudServicesUpdateDomainWalkUpdateDomainOptionalParams extends coreClient.OperationOptions { - parameters?: UpdateDomain; - resumeFrom?: string; +export interface CapacityReservationsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface CloudServicesUpdateOptionalParams extends coreClient.OperationOptions { - parameters?: CloudServiceUpdate; - resumeFrom?: string; +export interface CapacityReservationsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type CloudServicesUpdateResponse = CloudService; +export interface CapacityReservationsGetOptionalParams extends OperationOptions { + expand?: CapacityReservationInstanceViewTypes; +} -// @public (undocumented) -export interface CloudServiceUpdate { - tags?: { - [propertyName: string]: string; - }; +// @public +export interface CapacityReservationsListByCapacityReservationGroupOptionalParams extends OperationOptions { + expand?: ExpandTypesForGetCapacityReservationGroups; } // @public -export type CloudServiceUpgradeMode = string; +export interface CapacityReservationsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservation, options?: CapacityReservationsCreateOrUpdateOptionalParams) => Promise, CapacityReservation>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservation, options?: CapacityReservationsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, options?: CapacityReservationsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, options?: CapacityReservationsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservationUpdate, options?: CapacityReservationsUpdateOptionalParams) => Promise, CapacityReservation>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservationUpdate, options?: CapacityReservationsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservation, options?: CapacityReservationsCreateOrUpdateOptionalParams) => PollerLike, CapacityReservation>; + delete: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, options?: CapacityReservationsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, options?: CapacityReservationsGetOptionalParams) => Promise; + listByCapacityReservationGroup: (resourceGroupName: string, capacityReservationGroupName: string, options?: CapacityReservationsListByCapacityReservationGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, capacityReservationGroupName: string, capacityReservationName: string, parameters: CapacityReservationUpdate, options?: CapacityReservationsUpdateOptionalParams) => PollerLike, CapacityReservation>; +} // @public -export interface CloudServiceVaultAndSecretReference { - secretUrl?: string; - sourceVault?: SubResource; +export interface CapacityReservationsUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface CloudServiceVaultCertificate { - certificateUrl?: string; - isBootstrapCertificate?: boolean; +export interface CapacityReservationUpdate extends UpdateResource { + readonly instanceView?: CapacityReservationInstanceView; + readonly platformFaultDomainCount?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly reservationId?: string; + scheduleProfile?: ScheduleProfile; + sku?: Sku; + readonly timeCreated?: Date; + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; } // @public -export interface CloudServiceVaultSecretGroup { - sourceVault?: SubResource; - vaultCertificates?: CloudServiceVaultCertificate[]; +export interface CapacityReservationUtilization { + readonly currentCapacity?: number; + readonly virtualMachinesAllocated?: SubResourceReadOnly[]; } // @public -export interface CommunityGalleries { - get(location: string, publicGalleryName: string, options?: CommunityGalleriesGetOptionalParams): Promise; +export interface CloudError { + error?: ApiError; } // @public -export interface CommunityGalleriesGetOptionalParams extends coreClient.OperationOptions { +export interface CommunityGalleriesGetOptionalParams extends OperationOptions { } // @public -export type CommunityGalleriesGetResponse = CommunityGallery; +export interface CommunityGalleriesOperations { + get: (location: string, publicGalleryName: string, options?: CommunityGalleriesGetOptionalParams) => Promise; +} // @public export interface CommunityGallery extends PirCommunityGalleryResource { - artifactTags?: { - [propertyName: string]: string; - }; + artifactTags?: Record; communityMetadata?: CommunityGalleryMetadata; disclaimer?: string; } +// @public +export interface CommunityGalleryIdentifier { + uniqueId?: string; +} + // @public export interface CommunityGalleryImage extends PirCommunityGalleryResource { architecture?: Architecture; - artifactTags?: { - [propertyName: string]: string; - }; + artifactTags?: Record; disallowed?: Disallowed; disclaimer?: string; endOfLifeDate?: Date; @@ -1117,43 +561,40 @@ export interface CommunityGalleryImageIdentifier { } // @public -export interface CommunityGalleryImageList { - nextLink?: string; - value: CommunityGalleryImage[]; -} - -// @public -export interface CommunityGalleryImages { - get(location: string, publicGalleryName: string, galleryImageName: string, options?: CommunityGalleryImagesGetOptionalParams): Promise; - list(location: string, publicGalleryName: string, options?: CommunityGalleryImagesListOptionalParams): PagedAsyncIterableIterator; +export interface CommunityGalleryImageProperties { + architecture?: Architecture; + artifactTags?: Record; + disallowed?: Disallowed; + disclaimer?: string; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier: CommunityGalleryImageIdentifier; + osState: OperatingSystemStateTypes; + osType: OperatingSystemTypes; + privacyStatementUri?: string; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; } // @public -export interface CommunityGalleryImagesGetOptionalParams extends coreClient.OperationOptions { +export interface CommunityGalleryImagesGetOptionalParams extends OperationOptions { } // @public -export type CommunityGalleryImagesGetResponse = CommunityGalleryImage; - -// @public -export interface CommunityGalleryImagesListNextOptionalParams extends coreClient.OperationOptions { +export interface CommunityGalleryImagesListOptionalParams extends OperationOptions { } // @public -export type CommunityGalleryImagesListNextResponse = CommunityGalleryImageList; - -// @public -export interface CommunityGalleryImagesListOptionalParams extends coreClient.OperationOptions { +export interface CommunityGalleryImagesOperations { + get: (location: string, publicGalleryName: string, galleryImageName: string, options?: CommunityGalleryImagesGetOptionalParams) => Promise; + list: (location: string, publicGalleryName: string, options?: CommunityGalleryImagesListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type CommunityGalleryImagesListResponse = CommunityGalleryImageList; - // @public export interface CommunityGalleryImageVersion extends PirCommunityGalleryResource { - artifactTags?: { - [propertyName: string]: string; - }; + artifactTags?: Record; disclaimer?: string; endOfLifeDate?: Date; excludeFromLatest?: boolean; @@ -1162,38 +603,29 @@ export interface CommunityGalleryImageVersion extends PirCommunityGalleryResourc } // @public -export interface CommunityGalleryImageVersionList { - nextLink?: string; - value: CommunityGalleryImageVersion[]; -} - -// @public -export interface CommunityGalleryImageVersions { - get(location: string, publicGalleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: CommunityGalleryImageVersionsGetOptionalParams): Promise; - list(location: string, publicGalleryName: string, galleryImageName: string, options?: CommunityGalleryImageVersionsListOptionalParams): PagedAsyncIterableIterator; +export interface CommunityGalleryImageVersionProperties { + artifactTags?: Record; + disclaimer?: string; + endOfLifeDate?: Date; + excludeFromLatest?: boolean; + publishedDate?: Date; + storageProfile?: SharedGalleryImageVersionStorageProfile; } // @public -export interface CommunityGalleryImageVersionsGetOptionalParams extends coreClient.OperationOptions { +export interface CommunityGalleryImageVersionsGetOptionalParams extends OperationOptions { } // @public -export type CommunityGalleryImageVersionsGetResponse = CommunityGalleryImageVersion; - -// @public -export interface CommunityGalleryImageVersionsListNextOptionalParams extends coreClient.OperationOptions { +export interface CommunityGalleryImageVersionsListOptionalParams extends OperationOptions { } // @public -export type CommunityGalleryImageVersionsListNextResponse = CommunityGalleryImageVersionList; - -// @public -export interface CommunityGalleryImageVersionsListOptionalParams extends coreClient.OperationOptions { +export interface CommunityGalleryImageVersionsOperations { + get: (location: string, publicGalleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: CommunityGalleryImageVersionsGetOptionalParams) => Promise; + list: (location: string, publicGalleryName: string, galleryImageName: string, options?: CommunityGalleryImageVersionsListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type CommunityGalleryImageVersionsListResponse = CommunityGalleryImageVersionList; - // @public export interface CommunityGalleryInfo { readonly communityGalleryEnabled?: boolean; @@ -1213,127 +645,76 @@ export interface CommunityGalleryMetadata { publisherUri?: string; } -// @public (undocumented) -export class ComputeManagementClient extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ComputeManagementClientOptionalParams); - // (undocumented) - availabilitySets: AvailabilitySets; - // (undocumented) - capacityReservationGroups: CapacityReservationGroups; - // (undocumented) - capacityReservations: CapacityReservations; - // (undocumented) - cloudServiceOperatingSystems: CloudServiceOperatingSystems; - // (undocumented) - cloudServiceRoleInstances: CloudServiceRoleInstances; - // (undocumented) - cloudServiceRoles: CloudServiceRoles; - // (undocumented) - cloudServices: CloudServices; - // (undocumented) - cloudServicesUpdateDomain: CloudServicesUpdateDomain; - // (undocumented) - communityGalleries: CommunityGalleries; - // (undocumented) - communityGalleryImages: CommunityGalleryImages; - // (undocumented) - communityGalleryImageVersions: CommunityGalleryImageVersions; - // (undocumented) - dedicatedHostGroups: DedicatedHostGroups; - // (undocumented) - dedicatedHosts: DedicatedHosts; - // (undocumented) - diskAccesses: DiskAccesses; - // (undocumented) - diskEncryptionSets: DiskEncryptionSets; - // (undocumented) - diskRestorePointOperations: DiskRestorePointOperations; - // (undocumented) - disks: Disks; - // (undocumented) - galleries: Galleries; - // (undocumented) - galleryApplications: GalleryApplications; - // (undocumented) - galleryApplicationVersions: GalleryApplicationVersions; - // (undocumented) - galleryImages: GalleryImages; - // (undocumented) - galleryImageVersions: GalleryImageVersions; - // (undocumented) - galleryInVMAccessControlProfiles: GalleryInVMAccessControlProfiles; - // (undocumented) - galleryInVMAccessControlProfileVersions: GalleryInVMAccessControlProfileVersions; - // (undocumented) - galleryScripts: GalleryScripts; - // (undocumented) - galleryScriptVersions: GalleryScriptVersions; - // (undocumented) - gallerySharingProfile: GallerySharingProfile; - // (undocumented) - images: Images; - // (undocumented) - logAnalytics: LogAnalytics; - // (undocumented) - operations: Operations; - // (undocumented) - proximityPlacementGroups: ProximityPlacementGroups; - // (undocumented) - resourceSkus: ResourceSkus; - // (undocumented) - restorePointCollections: RestorePointCollections; - // (undocumented) - restorePoints: RestorePoints; - // (undocumented) - sharedGalleries: SharedGalleries; - // (undocumented) - sharedGalleryImages: SharedGalleryImages; - // (undocumented) - sharedGalleryImageVersions: SharedGalleryImageVersions; - // (undocumented) - snapshots: Snapshots; - // (undocumented) - softDeletedResource: SoftDeletedResource; - // (undocumented) - sshPublicKeys: SshPublicKeys; - // (undocumented) - subscriptionId: string; - // (undocumented) - usageOperations: UsageOperations; - // (undocumented) - virtualMachineExtensionImages: VirtualMachineExtensionImages; - // (undocumented) - virtualMachineExtensions: VirtualMachineExtensions; - // (undocumented) - virtualMachineImages: VirtualMachineImages; - // (undocumented) - virtualMachineImagesEdgeZone: VirtualMachineImagesEdgeZone; - // (undocumented) - virtualMachineRunCommands: VirtualMachineRunCommands; - // (undocumented) - virtualMachines: VirtualMachines; - // (undocumented) - virtualMachineScaleSetExtensions: VirtualMachineScaleSetExtensions; - // (undocumented) - virtualMachineScaleSetRollingUpgrades: VirtualMachineScaleSetRollingUpgrades; - // (undocumented) - virtualMachineScaleSets: VirtualMachineScaleSets; - // (undocumented) - virtualMachineScaleSetVMExtensions: VirtualMachineScaleSetVMExtensions; - // (undocumented) - virtualMachineScaleSetVMRunCommands: VirtualMachineScaleSetVMRunCommands; - // (undocumented) - virtualMachineScaleSetVMs: VirtualMachineScaleSetVMs; - // (undocumented) - virtualMachineSizes: VirtualMachineSizes; +// @public +export interface CommunityGalleryProperties { + artifactTags?: Record; + communityMetadata?: CommunityGalleryMetadata; + disclaimer?: string; } // @public -export interface ComputeManagementClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - endpoint?: string; +export type ComponentNames = "Microsoft-Windows-Shell-Setup"; + +// @public (undocumented) +export class ComputeManagementClient { + constructor(credential: TokenCredential, options?: ComputeManagementClientOptionalParams); + constructor(credential: TokenCredential, subscriptionId: string, options?: ComputeManagementClientOptionalParams); + readonly availabilitySets: AvailabilitySetsOperations; + readonly capacityReservationGroups: CapacityReservationGroupsOperations; + readonly capacityReservations: CapacityReservationsOperations; + readonly communityGalleries: CommunityGalleriesOperations; + readonly communityGalleryImages: CommunityGalleryImagesOperations; + readonly communityGalleryImageVersions: CommunityGalleryImageVersionsOperations; + readonly dedicatedHostGroups: DedicatedHostGroupsOperations; + readonly dedicatedHosts: DedicatedHostsOperations; + readonly diskAccesses: DiskAccessesOperations; + readonly diskEncryptionSets: DiskEncryptionSetsOperations; + readonly diskRestorePoint: DiskRestorePointOperations; + readonly disks: DisksOperations; + readonly galleries: GalleriesOperations; + readonly galleryApplications: GalleryApplicationsOperations; + readonly galleryApplicationVersions: GalleryApplicationVersionsOperations; + readonly galleryImages: GalleryImagesOperations; + readonly galleryImageVersions: GalleryImageVersionsOperations; + readonly galleryInVMAccessControlProfiles: GalleryInVMAccessControlProfilesOperations; + readonly galleryInVMAccessControlProfileVersions: GalleryInVMAccessControlProfileVersionsOperations; + readonly galleryScripts: GalleryScriptsOperations; + readonly galleryScriptVersions: GalleryScriptVersionsOperations; + readonly gallerySharingProfile: GallerySharingProfileOperations; + readonly images: ImagesOperations; + readonly logAnalytics: LogAnalyticsOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; + readonly proximityPlacementGroups: ProximityPlacementGroupsOperations; + readonly resourceSkus: ResourceSkusOperations; + readonly restorePointCollections: RestorePointCollectionsOperations; + readonly restorePoints: RestorePointsOperations; + readonly sharedGalleries: SharedGalleriesOperations; + readonly sharedGalleryImages: SharedGalleryImagesOperations; + readonly sharedGalleryImageVersions: SharedGalleryImageVersionsOperations; + readonly snapshots: SnapshotsOperations; + readonly softDeletedResource: SoftDeletedResourceOperations; + readonly sshPublicKeys: SshPublicKeysOperations; + readonly usage: UsageOperations; + readonly virtualMachineExtensionImages: VirtualMachineExtensionImagesOperations; + readonly virtualMachineExtensions: VirtualMachineExtensionsOperations; + readonly virtualMachineImages: VirtualMachineImagesOperations; + readonly virtualMachineImagesEdgeZone: VirtualMachineImagesEdgeZoneOperations; + readonly virtualMachineRunCommands: VirtualMachineRunCommandsOperations; + readonly virtualMachines: VirtualMachinesOperations; + readonly virtualMachineScaleSetExtensions: VirtualMachineScaleSetExtensionsOperations; + readonly virtualMachineScaleSetLifeCycleHookEvents: VirtualMachineScaleSetLifeCycleHookEventsOperations; + readonly virtualMachineScaleSetRollingUpgrades: VirtualMachineScaleSetRollingUpgradesOperations; + readonly virtualMachineScaleSets: VirtualMachineScaleSetsOperations; + readonly virtualMachineScaleSetVMExtensions: VirtualMachineScaleSetVMExtensionsOperations; + readonly virtualMachineScaleSetVMRunCommands: VirtualMachineScaleSetVMRunCommandsOperations; + readonly virtualMachineScaleSetVMs: VirtualMachineScaleSetVMsOperations; + readonly virtualMachineSizes: VirtualMachineSizesOperations; +} + +// @public +export interface ComputeManagementClientOptionalParams extends ClientOptions { + cloudSetting?: AzureSupportedClouds; } // @public @@ -1342,6 +723,11 @@ export type ConfidentialVMEncryptionType = string; // @public export type ConsistencyModeTypes = string; +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + // @public export interface ConvertToVirtualMachineScaleSetInput { virtualMachineScaleSetName?: string; @@ -1395,6 +781,7 @@ export interface DataDisk { managedDisk?: ManagedDiskParameters; name?: string; sourceResource?: ApiEntityReference; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; toBeDetached?: boolean; vhd?: VirtualHardDisk; writeAcceleratorEnabled?: boolean; @@ -1458,88 +845,62 @@ export interface DedicatedHostGroup extends TrackedResource { readonly instanceView?: DedicatedHostGroupInstanceView; platformFaultDomainCount?: number; supportAutomaticPlacement?: boolean; - zones?: string[]; -} - -// @public (undocumented) -export interface DedicatedHostGroupInstanceView { - hosts?: DedicatedHostInstanceViewWithName[]; -} - -// @public -export interface DedicatedHostGroupListResult { - nextLink?: string; - value: DedicatedHostGroup[]; -} - -// @public -export interface DedicatedHostGroupPropertiesAdditionalCapabilities { - ultraSSDEnabled?: boolean; -} - -// @public -export interface DedicatedHostGroups { - createOrUpdate(resourceGroupName: string, hostGroupName: string, parameters: DedicatedHostGroup, options?: DedicatedHostGroupsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, hostGroupName: string, options?: DedicatedHostGroupsDeleteOptionalParams): Promise; - get(resourceGroupName: string, hostGroupName: string, options?: DedicatedHostGroupsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: DedicatedHostGroupsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: DedicatedHostGroupsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, hostGroupName: string, parameters: DedicatedHostGroupUpdate, options?: DedicatedHostGroupsUpdateOptionalParams): Promise; -} - -// @public -export interface DedicatedHostGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DedicatedHostGroupsCreateOrUpdateResponse = DedicatedHostGroup; - -// @public -export interface DedicatedHostGroupsDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DedicatedHostGroupsGetOptionalParams extends coreClient.OperationOptions { - expand?: InstanceViewTypes; + zones?: string[]; } // @public -export type DedicatedHostGroupsGetResponse = DedicatedHostGroup; - -// @public -export interface DedicatedHostGroupsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostGroupInstanceView { + hosts?: DedicatedHostInstanceViewWithName[]; } // @public -export type DedicatedHostGroupsListByResourceGroupNextResponse = DedicatedHostGroupListResult; +export interface DedicatedHostGroupProperties { + additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; + readonly hosts?: SubResourceReadOnly[]; + readonly instanceView?: DedicatedHostGroupInstanceView; + platformFaultDomainCount: number; + supportAutomaticPlacement?: boolean; +} // @public -export interface DedicatedHostGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostGroupPropertiesAdditionalCapabilities { + ultraSSDEnabled?: boolean; } // @public -export type DedicatedHostGroupsListByResourceGroupResponse = DedicatedHostGroupListResult; +export interface DedicatedHostGroupsCreateOrUpdateOptionalParams extends OperationOptions { +} // @public -export interface DedicatedHostGroupsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostGroupsDeleteOptionalParams extends OperationOptions { } // @public -export type DedicatedHostGroupsListBySubscriptionNextResponse = DedicatedHostGroupListResult; +export interface DedicatedHostGroupsGetOptionalParams extends OperationOptions { + expand?: InstanceViewTypes; +} // @public -export interface DedicatedHostGroupsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostGroupsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type DedicatedHostGroupsListBySubscriptionResponse = DedicatedHostGroupListResult; +export interface DedicatedHostGroupsListBySubscriptionOptionalParams extends OperationOptions { +} // @public -export interface DedicatedHostGroupsUpdateOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostGroupsOperations { + createOrUpdate: (resourceGroupName: string, hostGroupName: string, parameters: DedicatedHostGroup, options?: DedicatedHostGroupsCreateOrUpdateOptionalParams) => Promise; + delete: (resourceGroupName: string, hostGroupName: string, options?: DedicatedHostGroupsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, hostGroupName: string, options?: DedicatedHostGroupsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: DedicatedHostGroupsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: DedicatedHostGroupsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, hostGroupName: string, parameters: DedicatedHostGroupUpdate, options?: DedicatedHostGroupsUpdateOptionalParams) => Promise; } // @public -export type DedicatedHostGroupsUpdateResponse = DedicatedHostGroup; +export interface DedicatedHostGroupsUpdateOptionalParams extends OperationOptions { +} // @public export interface DedicatedHostGroupUpdate extends UpdateResource { @@ -1567,142 +928,88 @@ export interface DedicatedHostInstanceViewWithName extends DedicatedHostInstance export type DedicatedHostLicenseTypes = "None" | "Windows_Server_Hybrid" | "Windows_Server_Perpetual"; // @public -export interface DedicatedHostListResult { - nextLink?: string; - value: DedicatedHost[]; -} - -// @public -export interface DedicatedHosts { - beginCreateOrUpdate(resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHost, options?: DedicatedHostsCreateOrUpdateOptionalParams): Promise, DedicatedHostsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHost, options?: DedicatedHostsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsDeleteOptionalParams): Promise; - beginRedeploy(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRedeployOptionalParams): Promise, DedicatedHostsRedeployResponse>>; - beginRedeployAndWait(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRedeployOptionalParams): Promise; - beginRestart(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRestartOptionalParams): Promise, DedicatedHostsRestartResponse>>; - beginRestartAndWait(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRestartOptionalParams): Promise; - beginUpdate(resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHostUpdate, options?: DedicatedHostsUpdateOptionalParams): Promise, DedicatedHostsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHostUpdate, options?: DedicatedHostsUpdateOptionalParams): Promise; - get(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsGetOptionalParams): Promise; - listAvailableSizes(resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsListAvailableSizesOptionalParams): PagedAsyncIterableIterator; - listByHostGroup(resourceGroupName: string, hostGroupName: string, options?: DedicatedHostsListByHostGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DedicatedHostsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface DedicatedHostProperties { + autoReplaceOnFailure?: boolean; + readonly hostId?: string; + readonly instanceView?: DedicatedHostInstanceView; + licenseType?: DedicatedHostLicenseTypes; + platformFaultDomain?: number; + readonly provisioningState?: string; + readonly provisioningTime?: Date; + readonly timeCreated?: Date; + readonly virtualMachines?: SubResourceReadOnly[]; } // @public -export interface DedicatedHostsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DedicatedHostsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DedicatedHostsCreateOrUpdateResponse = DedicatedHost; - -// @public -export interface DedicatedHostsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DedicatedHostsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DedicatedHostsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface DedicatedHostsGetOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostsGetOptionalParams extends OperationOptions { expand?: InstanceViewTypes; } // @public -export type DedicatedHostsGetResponse = DedicatedHost; - -// @public -export interface DedicatedHostSizeListResult { - nextLink?: string; - value?: string[]; -} - -// @public -export interface DedicatedHostsListAvailableSizesNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DedicatedHostsListAvailableSizesNextResponse = DedicatedHostSizeListResult; - -// @public -export interface DedicatedHostsListAvailableSizesOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DedicatedHostsListAvailableSizesResponse = DedicatedHostSizeListResult; - -// @public -export interface DedicatedHostsListByHostGroupNextOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostsListAvailableSizesOptionalParams extends OperationOptions { } // @public -export type DedicatedHostsListByHostGroupNextResponse = DedicatedHostListResult; - -// @public -export interface DedicatedHostsListByHostGroupOptionalParams extends coreClient.OperationOptions { +export interface DedicatedHostsListByHostGroupOptionalParams extends OperationOptions { } // @public -export type DedicatedHostsListByHostGroupResponse = DedicatedHostListResult; - -// @public -export interface DedicatedHostsRedeployHeaders { - location?: string; - retryAfter?: number; +export interface DedicatedHostsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHost, options?: DedicatedHostsCreateOrUpdateOptionalParams) => Promise, DedicatedHost>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHost, options?: DedicatedHostsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginRedeploy: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRedeployOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRedeployAndWait: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRedeployOptionalParams) => Promise; + // @deprecated (undocumented) + beginRestart: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRestartOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRestartAndWait: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRestartOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHostUpdate, options?: DedicatedHostsUpdateOptionalParams) => Promise, DedicatedHost>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHostUpdate, options?: DedicatedHostsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHost, options?: DedicatedHostsCreateOrUpdateOptionalParams) => PollerLike, DedicatedHost>; + delete: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsGetOptionalParams) => Promise; + listAvailableSizes: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsListAvailableSizesOptionalParams) => PagedAsyncIterableIterator; + listByHostGroup: (resourceGroupName: string, hostGroupName: string, options?: DedicatedHostsListByHostGroupOptionalParams) => PagedAsyncIterableIterator; + redeploy: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRedeployOptionalParams) => PollerLike, void>; + restart: (resourceGroupName: string, hostGroupName: string, hostName: string, options?: DedicatedHostsRestartOptionalParams) => PollerLike, void>; + update: (resourceGroupName: string, hostGroupName: string, hostName: string, parameters: DedicatedHostUpdate, options?: DedicatedHostsUpdateOptionalParams) => PollerLike, DedicatedHost>; } // @public -export interface DedicatedHostsRedeployOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DedicatedHostsRedeployOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DedicatedHostsRedeployResponse = DedicatedHostsRedeployHeaders; - -// @public -export interface DedicatedHostsRestartHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DedicatedHostsRestartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DedicatedHostsRestartOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DedicatedHostsRestartResponse = DedicatedHostsRestartHeaders; - -// @public -export interface DedicatedHostsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DedicatedHostsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DedicatedHostsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type DedicatedHostsUpdateResponse = DedicatedHostsUpdateHeaders & DedicatedHost; - // @public export interface DedicatedHostUpdate extends UpdateResource { autoReplaceOnFailure?: boolean; @@ -1739,6 +1046,7 @@ export type DiffDiskPlacement = string; // @public export interface DiffDiskSettings { + enableFullCaching?: boolean; option?: DiffDiskOptions; placement?: DiffDiskPlacement; } @@ -1804,168 +1112,99 @@ export interface DiskAccess extends TrackedResource { } // @public -export interface DiskAccesses { - beginCreateOrUpdate(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccess, options?: DiskAccessesCreateOrUpdateOptionalParams): Promise, DiskAccessesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccess, options?: DiskAccessesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesDeleteOptionalParams): Promise; - beginDeleteAPrivateEndpointConnection(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams): Promise, void>>; - beginDeleteAPrivateEndpointConnectionAndWait(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams): Promise; - beginUpdate(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccessUpdate, options?: DiskAccessesUpdateOptionalParams): Promise, DiskAccessesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccessUpdate, options?: DiskAccessesUpdateOptionalParams): Promise; - beginUpdateAPrivateEndpointConnection(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams): Promise, DiskAccessesUpdateAPrivateEndpointConnectionResponse>>; - beginUpdateAPrivateEndpointConnectionAndWait(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams): Promise; - get(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesGetOptionalParams): Promise; - getAPrivateEndpointConnection(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams): Promise; - getPrivateLinkResources(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesGetPrivateLinkResourcesOptionalParams): Promise; - list(options?: DiskAccessesListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: DiskAccessesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listPrivateEndpointConnections(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DiskAccessesCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DiskAccessesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskAccessesCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DiskAccessesCreateOrUpdateResponse = DiskAccess; - -// @public -export interface DiskAccessesDeleteAPrivateEndpointConnectionHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface DiskAccessesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DiskAccessesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskAccessesDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface DiskAccessesGetAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiskAccessesGetAPrivateEndpointConnectionResponse = PrivateEndpointConnection; - -// @public -export interface DiskAccessesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface DiskAccessesGetPrivateLinkResourcesOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiskAccessesGetPrivateLinkResourcesResponse = PrivateLinkResourceListResult; - -// @public -export type DiskAccessesGetResponse = DiskAccess; - -// @public -export interface DiskAccessesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface DiskAccessesGetAPrivateEndpointConnectionOptionalParams extends OperationOptions { } // @public -export type DiskAccessesListByResourceGroupNextResponse = DiskAccessList; - -// @public -export interface DiskAccessesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface DiskAccessesGetOptionalParams extends OperationOptions { } // @public -export type DiskAccessesListByResourceGroupResponse = DiskAccessList; - -// @public -export interface DiskAccessesListNextOptionalParams extends coreClient.OperationOptions { +export interface DiskAccessesGetPrivateLinkResourcesOptionalParams extends OperationOptions { } // @public -export type DiskAccessesListNextResponse = DiskAccessList; - -// @public -export interface DiskAccessesListOptionalParams extends coreClient.OperationOptions { +export interface DiskAccessesListByResourceGroupOptionalParams extends OperationOptions { } // @public -export interface DiskAccessesListPrivateEndpointConnectionsNextOptionalParams extends coreClient.OperationOptions { +export interface DiskAccessesListOptionalParams extends OperationOptions { } // @public -export type DiskAccessesListPrivateEndpointConnectionsNextResponse = PrivateEndpointConnectionListResult; - -// @public -export interface DiskAccessesListPrivateEndpointConnectionsOptionalParams extends coreClient.OperationOptions { +export interface DiskAccessesListPrivateEndpointConnectionsOptionalParams extends OperationOptions { } // @public -export type DiskAccessesListPrivateEndpointConnectionsResponse = PrivateEndpointConnectionListResult; - -// @public -export type DiskAccessesListResponse = DiskAccessList; - -// @public -export interface DiskAccessesUpdateAPrivateEndpointConnectionHeaders { - location?: string; - retryAfter?: number; +export interface DiskAccessesOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccess, options?: DiskAccessesCreateOrUpdateOptionalParams) => Promise, DiskAccess>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccess, options?: DiskAccessesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, diskAccessName: string, options?: DiskAccessesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, diskAccessName: string, options?: DiskAccessesDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginDeleteAPrivateEndpointConnection: (resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAPrivateEndpointConnectionAndWait: (resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccessUpdate, options?: DiskAccessesUpdateOptionalParams) => Promise, DiskAccess>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccessUpdate, options?: DiskAccessesUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdateAPrivateEndpointConnection: (resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams) => Promise, PrivateEndpointConnection>>; + // @deprecated (undocumented) + beginUpdateAPrivateEndpointConnectionAndWait: (resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccess, options?: DiskAccessesCreateOrUpdateOptionalParams) => PollerLike, DiskAccess>; + delete: (resourceGroupName: string, diskAccessName: string, options?: DiskAccessesDeleteOptionalParams) => PollerLike, void>; + deleteAPrivateEndpointConnection: (resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, diskAccessName: string, options?: DiskAccessesGetOptionalParams) => Promise; + getAPrivateEndpointConnection: (resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams) => Promise; + getPrivateLinkResources: (resourceGroupName: string, diskAccessName: string, options?: DiskAccessesGetPrivateLinkResourcesOptionalParams) => Promise; + list: (options?: DiskAccessesListOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: DiskAccessesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listPrivateEndpointConnections: (resourceGroupName: string, diskAccessName: string, options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccessUpdate, options?: DiskAccessesUpdateOptionalParams) => PollerLike, DiskAccess>; + updateAPrivateEndpointConnection: (resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams) => PollerLike, PrivateEndpointConnection>; } // @public -export interface DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DiskAccessesUpdateAPrivateEndpointConnectionResponse = PrivateEndpointConnection; - -// @public -export interface DiskAccessesUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DiskAccessesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskAccessesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DiskAccessesUpdateResponse = DiskAccess; - -// @public -export interface DiskAccessList { - nextLink?: string; - value: DiskAccess[]; +export interface DiskAccessProperties { + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: string; + readonly timeCreated?: Date; } // @public export interface DiskAccessUpdate { - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -1999,121 +1238,64 @@ export interface DiskEncryptionSet extends TrackedResource { // @public export type DiskEncryptionSetIdentityType = string; -// @public -export interface DiskEncryptionSetList { - nextLink?: string; - value: DiskEncryptionSet[]; -} - // @public export interface DiskEncryptionSetParameters extends SubResource { } // @public -export interface DiskEncryptionSets { - beginCreateOrUpdate(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSet, options?: DiskEncryptionSetsCreateOrUpdateOptionalParams): Promise, DiskEncryptionSetsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSet, options?: DiskEncryptionSetsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSetUpdate, options?: DiskEncryptionSetsUpdateOptionalParams): Promise, DiskEncryptionSetsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSetUpdate, options?: DiskEncryptionSetsUpdateOptionalParams): Promise; - get(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsGetOptionalParams): Promise; - list(options?: DiskEncryptionSetsListOptionalParams): PagedAsyncIterableIterator; - listAssociatedResources(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: DiskEncryptionSetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DiskEncryptionSetsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DiskEncryptionSetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskEncryptionSetsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DiskEncryptionSetsCreateOrUpdateResponse = DiskEncryptionSet; - -// @public -export interface DiskEncryptionSetsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DiskEncryptionSetsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskEncryptionSetsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface DiskEncryptionSetsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiskEncryptionSetsGetResponse = DiskEncryptionSet; - -// @public -export interface DiskEncryptionSetsListAssociatedResourcesNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiskEncryptionSetsListAssociatedResourcesNextResponse = ResourceUriList; - -// @public -export interface DiskEncryptionSetsListAssociatedResourcesOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiskEncryptionSetsListAssociatedResourcesResponse = ResourceUriList; - -// @public -export interface DiskEncryptionSetsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface DiskEncryptionSetsGetOptionalParams extends OperationOptions { } // @public -export type DiskEncryptionSetsListByResourceGroupNextResponse = DiskEncryptionSetList; - -// @public -export interface DiskEncryptionSetsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface DiskEncryptionSetsListAssociatedResourcesOptionalParams extends OperationOptions { } // @public -export type DiskEncryptionSetsListByResourceGroupResponse = DiskEncryptionSetList; - -// @public -export interface DiskEncryptionSetsListNextOptionalParams extends coreClient.OperationOptions { +export interface DiskEncryptionSetsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type DiskEncryptionSetsListNextResponse = DiskEncryptionSetList; - -// @public -export interface DiskEncryptionSetsListOptionalParams extends coreClient.OperationOptions { +export interface DiskEncryptionSetsListOptionalParams extends OperationOptions { } // @public -export type DiskEncryptionSetsListResponse = DiskEncryptionSetList; - -// @public -export interface DiskEncryptionSetsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface DiskEncryptionSetsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSet, options?: DiskEncryptionSetsCreateOrUpdateOptionalParams) => Promise, DiskEncryptionSet>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSet, options?: DiskEncryptionSetsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSetUpdate, options?: DiskEncryptionSetsUpdateOptionalParams) => Promise, DiskEncryptionSet>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSetUpdate, options?: DiskEncryptionSetsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSet, options?: DiskEncryptionSetsCreateOrUpdateOptionalParams) => PollerLike, DiskEncryptionSet>; + delete: (resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsGetOptionalParams) => Promise; + list: (options?: DiskEncryptionSetsListOptionalParams) => PagedAsyncIterableIterator; + listAssociatedResources: (resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: DiskEncryptionSetsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSetUpdate, options?: DiskEncryptionSetsUpdateOptionalParams) => PollerLike, DiskEncryptionSet>; } // @public -export interface DiskEncryptionSetsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskEncryptionSetsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type DiskEncryptionSetsUpdateResponse = DiskEncryptionSet; - // @public export interface DiskEncryptionSettings { diskEncryptionKey?: KeyVaultSecretReference; @@ -2131,9 +1313,15 @@ export interface DiskEncryptionSetUpdate { federatedClientId?: string; identity?: EncryptionSetIdentity; rotationToLatestKeyVersionEnabled?: boolean; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; +} + +// @public +export interface DiskEncryptionSetUpdateProperties { + activeKey?: KeyForDiskEncryptionSet; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + rotationToLatestKeyVersionEnabled?: boolean; } // @public @@ -2146,12 +1334,44 @@ export interface DiskInstanceView { encryptionSettings?: DiskEncryptionSettings[]; name?: string; statuses?: InstanceViewStatus[]; + storageAlignmentStatus?: StorageAlignmentStatus; } // @public -export interface DiskList { - nextLink?: string; - value: Disk[]; +export interface DiskProperties { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + readonly burstingEnabledTime?: Date; + completionPercent?: number; + creationData: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + hyperVGeneration?: HyperVGeneration; + readonly lastOwnershipUpdateTime?: Date; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + readonly shareInfo?: ShareInfoElement[]; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tier?: string; + readonly timeCreated?: Date; + readonly uniqueId?: string; } // @public @@ -2191,123 +1411,81 @@ export interface DiskRestorePointAttributes extends SubResourceReadOnly { } // @public -export interface DiskRestorePointGetOptionalParams extends coreClient.OperationOptions { +export interface DiskRestorePointGetOptionalParams extends OperationOptions { } // @public -export type DiskRestorePointGetResponse = DiskRestorePoint; - -// @public -export interface DiskRestorePointGrantAccessHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DiskRestorePointGrantAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskRestorePointGrantAccessOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DiskRestorePointGrantAccessResponse = AccessUri; - -// @public -export interface DiskRestorePointInstanceView { - id?: string; - replicationStatus?: DiskRestorePointReplicationStatus; - snapshotAccessState?: SnapshotAccessState; -} - -// @public -export interface DiskRestorePointList { - nextLink?: string; - value: DiskRestorePoint[]; -} - -// @public -export interface DiskRestorePointListByRestorePointNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiskRestorePointListByRestorePointNextResponse = DiskRestorePointList; - -// @public -export interface DiskRestorePointListByRestorePointOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DiskRestorePointListByRestorePointResponse = DiskRestorePointList; - -// @public -export interface DiskRestorePointOperations { - beginGrantAccess(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, grantAccessData: GrantAccessData, options?: DiskRestorePointGrantAccessOptionalParams): Promise, DiskRestorePointGrantAccessResponse>>; - beginGrantAccessAndWait(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, grantAccessData: GrantAccessData, options?: DiskRestorePointGrantAccessOptionalParams): Promise; - beginRevokeAccess(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointRevokeAccessOptionalParams): Promise, void>>; - beginRevokeAccessAndWait(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointRevokeAccessOptionalParams): Promise; - get(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointGetOptionalParams): Promise; - listByRestorePoint(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, options?: DiskRestorePointListByRestorePointOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface DiskRestorePointReplicationStatus { - completionPercent?: number; - status?: InstanceViewStatus; -} - -// @public -export interface DiskRestorePointRevokeAccessHeaders { - location?: string; - retryAfter?: number; +export interface DiskRestorePointInstanceView { + id?: string; + replicationStatus?: DiskRestorePointReplicationStatus; + snapshotAccessState?: SnapshotAccessState; } // @public -export interface DiskRestorePointRevokeAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; +export interface DiskRestorePointListByRestorePointOptionalParams extends OperationOptions { } // @public -export interface Disks { - beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: Disk, options?: DisksCreateOrUpdateOptionalParams): Promise, DisksCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, diskName: string, disk: Disk, options?: DisksCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams): Promise; - beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: GrantAccessData, options?: DisksGrantAccessOptionalParams): Promise, DisksGrantAccessResponse>>; - beginGrantAccessAndWait(resourceGroupName: string, diskName: string, grantAccessData: GrantAccessData, options?: DisksGrantAccessOptionalParams): Promise; - beginRevokeAccess(resourceGroupName: string, diskName: string, options?: DisksRevokeAccessOptionalParams): Promise, void>>; - beginRevokeAccessAndWait(resourceGroupName: string, diskName: string, options?: DisksRevokeAccessOptionalParams): Promise; - beginUpdate(resourceGroupName: string, diskName: string, disk: DiskUpdate, options?: DisksUpdateOptionalParams): Promise, DisksUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, diskName: string, disk: DiskUpdate, options?: DisksUpdateOptionalParams): Promise; - get(resourceGroupName: string, diskName: string, options?: DisksGetOptionalParams): Promise; - list(options?: DisksListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: DisksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +export interface DiskRestorePointOperations { + // @deprecated (undocumented) + beginGrantAccess: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, grantAccessData: GrantAccessData, options?: DiskRestorePointGrantAccessOptionalParams) => Promise, AccessUri>>; + // @deprecated (undocumented) + beginGrantAccessAndWait: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, grantAccessData: GrantAccessData, options?: DiskRestorePointGrantAccessOptionalParams) => Promise; + // @deprecated (undocumented) + beginRevokeAccess: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointRevokeAccessOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRevokeAccessAndWait: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointRevokeAccessOptionalParams) => Promise; + get: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointGetOptionalParams) => Promise; + grantAccess: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, grantAccessData: GrantAccessData, options?: DiskRestorePointGrantAccessOptionalParams) => PollerLike, AccessUri>; + listByRestorePoint: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, options?: DiskRestorePointListByRestorePointOptionalParams) => PagedAsyncIterableIterator; + revokeAccess: (resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointRevokeAccessOptionalParams) => PollerLike, void>; +} + +// @public +export interface DiskRestorePointProperties { + completionPercent?: number; + diskAccessId?: string; + readonly encryption?: Encryption; + readonly familyId?: string; + hyperVGeneration?: HyperVGeneration; + readonly logicalSectorSize?: number; + networkAccessPolicy?: NetworkAccessPolicy; + readonly osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + readonly replicationState?: string; + securityProfile?: DiskSecurityProfile; + readonly sourceResourceId?: string; + readonly sourceResourceLocation?: string; + readonly sourceUniqueId?: string; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; } // @public -export interface DisksCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface DiskRestorePointReplicationStatus { + completionPercent?: number; + status?: InstanceViewStatus; } // @public -export interface DisksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DiskRestorePointRevokeAccessOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type DisksCreateOrUpdateResponse = Disk; - -// @public -export interface DisksDeleteHeaders { - location?: string; - retryAfter?: number; +export interface DisksCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface DisksDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DisksDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } @@ -2321,27 +1499,14 @@ export interface DiskSecurityProfile { export type DiskSecurityTypes = string; // @public -export interface DisksGetOptionalParams extends coreClient.OperationOptions { +export interface DisksGetOptionalParams extends OperationOptions { } // @public -export type DisksGetResponse = Disk; - -// @public -export interface DisksGrantAccessHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DisksGrantAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DisksGrantAccessOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type DisksGrantAccessResponse = AccessUri; - // @public export interface DiskSku { name?: DiskStorageAccountTypes; @@ -2349,42 +1514,47 @@ export interface DiskSku { } // @public -export interface DisksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DisksListByResourceGroupNextResponse = DiskList; - -// @public -export interface DisksListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type DisksListByResourceGroupResponse = DiskList; - -// @public -export interface DisksListNextOptionalParams extends coreClient.OperationOptions { +export interface DisksListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type DisksListNextResponse = DiskList; - -// @public -export interface DisksListOptionalParams extends coreClient.OperationOptions { +export interface DisksListOptionalParams extends OperationOptions { } // @public -export type DisksListResponse = DiskList; - -// @public -export interface DisksRevokeAccessHeaders { - location?: string; - retryAfter?: number; +export interface DisksOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, diskName: string, disk: Disk, options?: DisksCreateOrUpdateOptionalParams) => Promise, Disk>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, diskName: string, disk: Disk, options?: DisksCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginGrantAccess: (resourceGroupName: string, diskName: string, grantAccessData: GrantAccessData, options?: DisksGrantAccessOptionalParams) => Promise, AccessUri>>; + // @deprecated (undocumented) + beginGrantAccessAndWait: (resourceGroupName: string, diskName: string, grantAccessData: GrantAccessData, options?: DisksGrantAccessOptionalParams) => Promise; + // @deprecated (undocumented) + beginRevokeAccess: (resourceGroupName: string, diskName: string, options?: DisksRevokeAccessOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRevokeAccessAndWait: (resourceGroupName: string, diskName: string, options?: DisksRevokeAccessOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, diskName: string, disk: DiskUpdate, options?: DisksUpdateOptionalParams) => Promise, Disk>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, diskName: string, disk: DiskUpdate, options?: DisksUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, diskName: string, disk: Disk, options?: DisksCreateOrUpdateOptionalParams) => PollerLike, Disk>; + delete: (resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, diskName: string, options?: DisksGetOptionalParams) => Promise; + grantAccess: (resourceGroupName: string, diskName: string, grantAccessData: GrantAccessData, options?: DisksGrantAccessOptionalParams) => PollerLike, AccessUri>; + list: (options?: DisksListOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: DisksListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + revokeAccess: (resourceGroupName: string, diskName: string, options?: DisksRevokeAccessOptionalParams) => PollerLike, void>; + update: (resourceGroupName: string, diskName: string, disk: DiskUpdate, options?: DisksUpdateOptionalParams) => PollerLike, Disk>; } // @public -export interface DisksRevokeAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DisksRevokeAccessOptionalParams extends OperationOptions { updateIntervalInMs?: number; } @@ -2395,20 +1565,10 @@ export type DiskState = string; export type DiskStorageAccountTypes = string; // @public -export interface DisksUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface DisksUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface DisksUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type DisksUpdateResponse = Disk; - // @public export interface DiskUpdate { availabilityPolicy?: AvailabilityPolicy; @@ -2432,9 +1592,32 @@ export interface DiskUpdate { sku?: DiskSku; supportedCapabilities?: SupportedCapabilities; supportsHibernation?: boolean; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; + tier?: string; +} + +// @public +export interface DiskUpdateProperties { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; tier?: string; } @@ -2466,9 +1649,19 @@ export interface EncryptionSetIdentity { readonly principalId?: string; readonly tenantId?: string; type?: DiskEncryptionSetIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; + userAssignedIdentities?: Record; +} + +// @public +export interface EncryptionSetProperties { + activeKey?: KeyForDiskEncryptionSet; + readonly autoKeyRotationError?: ApiError; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + readonly lastKeyRotationTimestamp?: Date; + readonly previousKeys?: KeyForDiskEncryptionSet[]; + readonly provisioningState?: string; + rotationToLatestKeyVersionEnabled?: boolean; } // @public @@ -2522,7 +1715,7 @@ export interface EventGridAndResourceGraph { // @public export interface ExecutedValidation { executionTime?: Date; - readonly status?: ValidationStatus; + status?: ValidationStatus; type?: string; version?: string; } @@ -2555,106 +1748,66 @@ export type ExtendedLocationType = string; export type ExtendedLocationTypes = string; // @public -export interface Extension { - name?: string; - properties?: CloudServiceExtensionProperties; +export interface ExternalHealthPolicy { + enabled?: boolean; + expiryDuration?: string; + gracePeriod?: string; } // @public export type FileFormat = string; // @public -export interface Galleries { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, gallery: Gallery, options?: GalleriesCreateOrUpdateOptionalParams): Promise, GalleriesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, gallery: Gallery, options?: GalleriesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, options?: GalleriesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, options?: GalleriesDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, gallery: GalleryUpdate, options?: GalleriesUpdateOptionalParams): Promise, GalleriesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, gallery: GalleryUpdate, options?: GalleriesUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, options?: GalleriesGetOptionalParams): Promise; - list(options?: GalleriesListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: GalleriesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GalleriesCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleriesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleriesCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleriesCreateOrUpdateResponse = Gallery; - -// @public -export interface GalleriesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleriesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleriesDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface GalleriesGetOptionalParams extends coreClient.OperationOptions { +export interface GalleriesGetOptionalParams extends OperationOptions { expand?: GalleryExpandParams; select?: SelectPermissions; } // @public -export type GalleriesGetResponse = Gallery; - -// @public -export interface GalleriesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleriesListByResourceGroupNextResponse = GalleryList; - -// @public -export interface GalleriesListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleriesListByResourceGroupResponse = GalleryList; - -// @public -export interface GalleriesListNextOptionalParams extends coreClient.OperationOptions { +export interface GalleriesListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type GalleriesListNextResponse = GalleryList; - -// @public -export interface GalleriesListOptionalParams extends coreClient.OperationOptions { +export interface GalleriesListOptionalParams extends OperationOptions { } // @public -export type GalleriesListResponse = GalleryList; - -// @public -export interface GalleriesUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleriesOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, gallery: Gallery, options?: GalleriesCreateOrUpdateOptionalParams) => Promise, Gallery>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, gallery: Gallery, options?: GalleriesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, options?: GalleriesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, options?: GalleriesDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, gallery: GalleryUpdate, options?: GalleriesUpdateOptionalParams) => Promise, Gallery>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, gallery: GalleryUpdate, options?: GalleriesUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, gallery: Gallery, options?: GalleriesCreateOrUpdateOptionalParams) => PollerLike, Gallery>; + delete: (resourceGroupName: string, galleryName: string, options?: GalleriesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, options?: GalleriesGetOptionalParams) => Promise; + list: (options?: GalleriesListOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: GalleriesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, gallery: GalleryUpdate, options?: GalleriesUpdateOptionalParams) => PollerLike, Gallery>; } // @public -export interface GalleriesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleriesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleriesUpdateResponse = GalleriesUpdateHeaders & Gallery; - // @public export interface Gallery extends TrackedResource { description?: string; @@ -2698,89 +1851,63 @@ export interface GalleryApplicationCustomActionParameter { export type GalleryApplicationCustomActionParameterType = "String" | "ConfigurationDataBlob" | "LogOutputBlob"; // @public -export interface GalleryApplicationList { - nextLink?: string; - value: GalleryApplication[]; -} - -// @public -export interface GalleryApplications { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplication, options?: GalleryApplicationsCreateOrUpdateOptionalParams): Promise, GalleryApplicationsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplication, options?: GalleryApplicationsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplicationUpdate, options?: GalleryApplicationsUpdateOptionalParams): Promise, GalleryApplicationsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplicationUpdate, options?: GalleryApplicationsUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationsGetOptionalParams): Promise; - listByGallery(resourceGroupName: string, galleryName: string, options?: GalleryApplicationsListByGalleryOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GalleryApplicationsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryApplicationProperties { + customActions?: GalleryApplicationCustomAction[]; + description?: string; + endOfLifeDate?: Date; + eula?: string; + privacyStatementUri?: string; + releaseNoteUri?: string; + supportedOSType: OperatingSystemTypes; } // @public -export interface GalleryApplicationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryApplicationsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryApplicationsCreateOrUpdateResponse = GalleryApplication; - // @public export type GalleryApplicationScriptRebootBehavior = string; // @public -export interface GalleryApplicationsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryApplicationsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryApplicationsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface GalleryApplicationsGetOptionalParams extends coreClient.OperationOptions { +export interface GalleryApplicationsGetOptionalParams extends OperationOptions { } // @public -export type GalleryApplicationsGetResponse = GalleryApplication; - -// @public -export interface GalleryApplicationsListByGalleryNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleryApplicationsListByGalleryNextResponse = GalleryApplicationList; - -// @public -export interface GalleryApplicationsListByGalleryOptionalParams extends coreClient.OperationOptions { +export interface GalleryApplicationsListByGalleryOptionalParams extends OperationOptions { } // @public -export type GalleryApplicationsListByGalleryResponse = GalleryApplicationList; - -// @public -export interface GalleryApplicationsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryApplicationsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplication, options?: GalleryApplicationsCreateOrUpdateOptionalParams) => Promise, GalleryApplication>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplication, options?: GalleryApplicationsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplicationUpdate, options?: GalleryApplicationsUpdateOptionalParams) => Promise, GalleryApplication>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplicationUpdate, options?: GalleryApplicationsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplication, options?: GalleryApplicationsCreateOrUpdateOptionalParams) => PollerLike, GalleryApplication>; + delete: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationsGetOptionalParams) => Promise; + listByGallery: (resourceGroupName: string, galleryName: string, options?: GalleryApplicationsListByGalleryOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplication: GalleryApplicationUpdate, options?: GalleryApplicationsUpdateOptionalParams) => PollerLike, GalleryApplication>; } // @public -export interface GalleryApplicationsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryApplicationsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryApplicationsUpdateResponse = GalleryApplicationsUpdateHeaders & GalleryApplication; - // @public export interface GalleryApplicationUpdate extends UpdateResourceDefinition { customActions?: GalleryApplicationCustomAction[]; @@ -2801,16 +1928,16 @@ export interface GalleryApplicationVersion extends TrackedResource { } // @public -export interface GalleryApplicationVersionList { - nextLink?: string; - value: GalleryApplicationVersion[]; +export interface GalleryApplicationVersionProperties { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile: GalleryApplicationVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryApplicationVersionSafetyProfile; } // @public export interface GalleryApplicationVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { - advancedSettings?: { - [propertyName: string]: string; - }; + advancedSettings?: Record; customActions?: GalleryApplicationCustomAction[]; enableHealthCheck?: boolean; // (undocumented) @@ -2819,86 +1946,55 @@ export interface GalleryApplicationVersionPublishingProfile extends GalleryArtif source: UserArtifactSource; } -// @public -export interface GalleryApplicationVersions { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersion, options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams): Promise, GalleryApplicationVersionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersion, options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, options?: GalleryApplicationVersionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, options?: GalleryApplicationVersionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersionUpdate, options?: GalleryApplicationVersionsUpdateOptionalParams): Promise, GalleryApplicationVersionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersionUpdate, options?: GalleryApplicationVersionsUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, options?: GalleryApplicationVersionsGetOptionalParams): Promise; - listByGalleryApplication(resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams): PagedAsyncIterableIterator; -} - // @public export interface GalleryApplicationVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { } // @public -export interface GalleryApplicationVersionsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryApplicationVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryApplicationVersionsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryApplicationVersionsCreateOrUpdateResponse = GalleryApplicationVersion; - -// @public -export interface GalleryApplicationVersionsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryApplicationVersionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryApplicationVersionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface GalleryApplicationVersionsGetOptionalParams extends coreClient.OperationOptions { +export interface GalleryApplicationVersionsGetOptionalParams extends OperationOptions { expand?: ReplicationStatusTypes; } // @public -export type GalleryApplicationVersionsGetResponse = GalleryApplicationVersion; - -// @public -export interface GalleryApplicationVersionsListByGalleryApplicationNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleryApplicationVersionsListByGalleryApplicationNextResponse = GalleryApplicationVersionList; - -// @public -export interface GalleryApplicationVersionsListByGalleryApplicationOptionalParams extends coreClient.OperationOptions { +export interface GalleryApplicationVersionsListByGalleryApplicationOptionalParams extends OperationOptions { } // @public -export type GalleryApplicationVersionsListByGalleryApplicationResponse = GalleryApplicationVersionList; - -// @public -export interface GalleryApplicationVersionsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryApplicationVersionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersion, options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams) => Promise, GalleryApplicationVersion>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersion, options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, options?: GalleryApplicationVersionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, options?: GalleryApplicationVersionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersionUpdate, options?: GalleryApplicationVersionsUpdateOptionalParams) => Promise, GalleryApplicationVersion>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersionUpdate, options?: GalleryApplicationVersionsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersion, options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams) => PollerLike, GalleryApplicationVersion>; + delete: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, options?: GalleryApplicationVersionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, options?: GalleryApplicationVersionsGetOptionalParams) => Promise; + listByGalleryApplication: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, galleryApplicationName: string, galleryApplicationVersionName: string, galleryApplicationVersion: GalleryApplicationVersionUpdate, options?: GalleryApplicationVersionsUpdateOptionalParams) => PollerLike, GalleryApplicationVersion>; } // @public -export interface GalleryApplicationVersionsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryApplicationVersionsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryApplicationVersionsUpdateResponse = GalleryApplicationVersionsUpdateHeaders & GalleryApplicationVersion; - // @public export interface GalleryApplicationVersionUpdate extends UpdateResourceDefinition { readonly provisioningState?: GalleryProvisioningState; @@ -2977,9 +2073,7 @@ export interface GalleryIdentity { readonly principalId?: string; readonly tenantId?: string; type?: ResourceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; + userAssignedIdentities?: Record; } // @public @@ -3017,86 +2111,69 @@ export interface GalleryImageIdentifier { } // @public -export interface GalleryImageList { - nextLink?: string; - value: GalleryImage[]; -} - -// @public -export interface GalleryImages { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImage, options?: GalleryImagesCreateOrUpdateOptionalParams): Promise, GalleryImagesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImage, options?: GalleryImagesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImagesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImagesDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImageUpdate, options?: GalleryImagesUpdateOptionalParams): Promise, GalleryImagesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImageUpdate, options?: GalleryImagesUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImagesGetOptionalParams): Promise; - listByGallery(resourceGroupName: string, galleryName: string, options?: GalleryImagesListByGalleryOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GalleryImagesCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryImageProperties { + allowUpdateImage?: boolean; + architecture?: Architecture; + description?: string; + disallowed?: Disallowed; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier: GalleryImageIdentifier; + osState: OperatingSystemStateTypes; + osType: OperatingSystemTypes; + privacyStatementUri?: string; + readonly provisioningState?: GalleryProvisioningState; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; + releaseNoteUri?: string; } // @public -export interface GalleryImagesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryImagesCreateOrUpdateResponse = GalleryImage; - -// @public -export interface GalleryImagesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryImagesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryImagesDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface GalleryImagesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleryImagesGetResponse = GalleryImage; - -// @public -export interface GalleryImagesListByGalleryNextOptionalParams extends coreClient.OperationOptions { +export interface GalleryImagesGetOptionalParams extends OperationOptions { } // @public -export type GalleryImagesListByGalleryNextResponse = GalleryImageList; - -// @public -export interface GalleryImagesListByGalleryOptionalParams extends coreClient.OperationOptions { +export interface GalleryImagesListByGalleryOptionalParams extends OperationOptions { } // @public -export type GalleryImagesListByGalleryResponse = GalleryImageList; - -// @public -export interface GalleryImagesUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryImagesOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImage, options?: GalleryImagesCreateOrUpdateOptionalParams) => Promise, GalleryImage>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImage, options?: GalleryImagesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImagesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImagesDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImageUpdate, options?: GalleryImagesUpdateOptionalParams) => Promise, GalleryImage>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImageUpdate, options?: GalleryImagesUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImage, options?: GalleryImagesCreateOrUpdateOptionalParams) => PollerLike, GalleryImage>; + delete: (resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImagesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImagesGetOptionalParams) => Promise; + listByGallery: (resourceGroupName: string, galleryName: string, options?: GalleryImagesListByGalleryOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImage: GalleryImageUpdate, options?: GalleryImagesUpdateOptionalParams) => PollerLike, GalleryImage>; } // @public -export interface GalleryImagesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryImagesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryImagesUpdateResponse = GalleryImagesUpdateHeaders & GalleryImage; - // @public export interface GalleryImageUpdate extends UpdateResourceDefinition { allowUpdateImage?: boolean; @@ -3130,83 +2207,68 @@ export interface GalleryImageVersion extends TrackedResource { } // @public -export interface GalleryImageVersionList { - nextLink?: string; - value: GalleryImageVersion[]; +export interface GalleryImageVersionProperties { + readonly provisioningState?: GalleryProvisioningState; + publishingProfile?: GalleryImageVersionPublishingProfile; + readonly replicationStatus?: ReplicationStatus; + restore?: boolean; + safetyProfile?: GalleryImageVersionSafetyProfile; + securityProfile?: ImageVersionSecurityProfile; + storageProfile: GalleryImageVersionStorageProfile; + readonly validationsProfile?: ValidationsProfile; } // @public export interface GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { } -// @public -export interface GalleryImageVersions { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersion, options?: GalleryImageVersionsCreateOrUpdateOptionalParams): Promise, GalleryImageVersionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersion, options?: GalleryImageVersionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersionUpdate, options?: GalleryImageVersionsUpdateOptionalParams): Promise, GalleryImageVersionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersionUpdate, options?: GalleryImageVersionsUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsGetOptionalParams): Promise; - listByGalleryImage(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImageVersionsListByGalleryImageOptionalParams): PagedAsyncIterableIterator; -} - // @public export interface GalleryImageVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { blockDeletionBeforeEndOfLife?: boolean; readonly policyViolations?: PolicyViolation[]; readonly reportedForPolicyViolation?: boolean; -} - -// @public -export interface GalleryImageVersionsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryImageVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type GalleryImageVersionsCreateOrUpdateResponse = GalleryImageVersion; +} // @public -export interface GalleryImageVersionsDeleteHeaders { - location?: string; - retryAfter?: number; +export interface GalleryImageVersionsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface GalleryImageVersionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryImageVersionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface GalleryImageVersionsGetOptionalParams extends coreClient.OperationOptions { +export interface GalleryImageVersionsGetOptionalParams extends OperationOptions { expand?: ReplicationStatusTypes; } // @public -export type GalleryImageVersionsGetResponse = GalleryImageVersion; - -// @public -export interface GalleryImageVersionsListByGalleryImageNextOptionalParams extends coreClient.OperationOptions { +export interface GalleryImageVersionsListByGalleryImageOptionalParams extends OperationOptions { } // @public -export type GalleryImageVersionsListByGalleryImageNextResponse = GalleryImageVersionList; - -// @public -export interface GalleryImageVersionsListByGalleryImageOptionalParams extends coreClient.OperationOptions { +export interface GalleryImageVersionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersion, options?: GalleryImageVersionsCreateOrUpdateOptionalParams) => Promise, GalleryImageVersion>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersion, options?: GalleryImageVersionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersionUpdate, options?: GalleryImageVersionsUpdateOptionalParams) => Promise, GalleryImageVersion>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersionUpdate, options?: GalleryImageVersionsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersion, options?: GalleryImageVersionsCreateOrUpdateOptionalParams) => PollerLike, GalleryImageVersion>; + delete: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsGetOptionalParams) => Promise; + listByGalleryImage: (resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImageVersionsListByGalleryImageOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersionUpdate, options?: GalleryImageVersionsUpdateOptionalParams) => PollerLike, GalleryImageVersion>; } -// @public -export type GalleryImageVersionsListByGalleryImageResponse = GalleryImageVersionList; - // @public export interface GalleryImageVersionStorageProfile { dataDiskImages?: GalleryDataDiskImage[]; @@ -3215,20 +2277,10 @@ export interface GalleryImageVersionStorageProfile { } // @public -export interface GalleryImageVersionsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryImageVersionsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryImageVersionsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryImageVersionsUpdateResponse = GalleryImageVersionsUpdateHeaders & GalleryImageVersion; - // @public export interface GalleryImageVersionUefiSettings { additionalSignatures?: UefiKeySignatures; @@ -3252,12 +2304,6 @@ export interface GalleryInVMAccessControlProfile extends TrackedResource { properties?: GalleryInVMAccessControlProfileProperties; } -// @public -export interface GalleryInVMAccessControlProfileList { - nextLink?: string; - value: GalleryInVMAccessControlProfile[]; -} - // @public export interface GalleryInVMAccessControlProfileProperties extends GalleryResourceProfilePropertiesBase { applicableHostEndpoint: EndpointTypes; @@ -3266,83 +2312,49 @@ export interface GalleryInVMAccessControlProfileProperties extends GalleryResour } // @public -export interface GalleryInVMAccessControlProfiles { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams): Promise, GalleryInVMAccessControlProfilesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesDeleteOptionalParams): Promise, GalleryInVMAccessControlProfilesDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, options?: GalleryInVMAccessControlProfilesUpdateOptionalParams): Promise, GalleryInVMAccessControlProfilesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, options?: GalleryInVMAccessControlProfilesUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesGetOptionalParams): Promise; - listByGallery(resourceGroupName: string, galleryName: string, options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GalleryInVMAccessControlProfilesCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryInVMAccessControlProfilesCreateOrUpdateResponse = GalleryInVMAccessControlProfile; - -// @public -export interface GalleryInVMAccessControlProfilesDeleteHeaders { - azureAsyncOperation?: string; - location?: string; -} - -// @public -export interface GalleryInVMAccessControlProfilesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryInVMAccessControlProfilesDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryInVMAccessControlProfilesDeleteResponse = GalleryInVMAccessControlProfilesDeleteHeaders; - -// @public -export interface GalleryInVMAccessControlProfilesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleryInVMAccessControlProfilesGetResponse = GalleryInVMAccessControlProfile; - -// @public -export interface GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams extends coreClient.OperationOptions { +export interface GalleryInVMAccessControlProfilesGetOptionalParams extends OperationOptions { } // @public -export type GalleryInVMAccessControlProfilesListByGalleryNextResponse = GalleryInVMAccessControlProfileList; - -// @public -export interface GalleryInVMAccessControlProfilesListByGalleryOptionalParams extends coreClient.OperationOptions { +export interface GalleryInVMAccessControlProfilesListByGalleryOptionalParams extends OperationOptions { } // @public -export type GalleryInVMAccessControlProfilesListByGalleryResponse = GalleryInVMAccessControlProfileList; - -// @public -export interface GalleryInVMAccessControlProfilesUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryInVMAccessControlProfilesOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams) => Promise, GalleryInVMAccessControlProfile>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, options?: GalleryInVMAccessControlProfilesUpdateOptionalParams) => Promise, GalleryInVMAccessControlProfile>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, options?: GalleryInVMAccessControlProfilesUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams) => PollerLike, GalleryInVMAccessControlProfile>; + delete: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesGetOptionalParams) => Promise; + listByGallery: (resourceGroupName: string, galleryName: string, options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, options?: GalleryInVMAccessControlProfilesUpdateOptionalParams) => PollerLike, GalleryInVMAccessControlProfile>; } // @public -export interface GalleryInVMAccessControlProfilesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryInVMAccessControlProfilesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryInVMAccessControlProfilesUpdateResponse = GalleryInVMAccessControlProfilesUpdateHeaders & GalleryInVMAccessControlProfile; - // @public export interface GalleryInVMAccessControlProfileUpdate extends UpdateResourceDefinition { properties?: GalleryInVMAccessControlProfileProperties; @@ -3360,12 +2372,6 @@ export interface GalleryInVMAccessControlProfileVersion extends TrackedResource targetLocations?: TargetRegion[]; } -// @public -export interface GalleryInVMAccessControlProfileVersionList { - nextLink?: string; - value: GalleryInVMAccessControlProfileVersion[]; -} - // @public export interface GalleryInVMAccessControlProfileVersionProperties extends GalleryResourceProfileVersionPropertiesBase { defaultAccess: EndpointAccess; @@ -3374,83 +2380,49 @@ export interface GalleryInVMAccessControlProfileVersionProperties extends Galler } // @public -export interface GalleryInVMAccessControlProfileVersions { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams): Promise, GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams): Promise, GalleryInVMAccessControlProfileVersionsDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams): Promise, GalleryInVMAccessControlProfileVersionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams): Promise; - listByGalleryInVMAccessControlProfile(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse = GalleryInVMAccessControlProfileVersion; - -// @public -export interface GalleryInVMAccessControlProfileVersionsDeleteHeaders { - azureAsyncOperation?: string; - location?: string; -} - -// @public -export interface GalleryInVMAccessControlProfileVersionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryInVMAccessControlProfileVersionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryInVMAccessControlProfileVersionsDeleteResponse = GalleryInVMAccessControlProfileVersionsDeleteHeaders; - -// @public -export interface GalleryInVMAccessControlProfileVersionsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleryInVMAccessControlProfileVersionsGetResponse = GalleryInVMAccessControlProfileVersion; - -// @public -export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams extends coreClient.OperationOptions { +export interface GalleryInVMAccessControlProfileVersionsGetOptionalParams extends OperationOptions { } // @public -export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextResponse = GalleryInVMAccessControlProfileVersionList; - -// @public -export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams extends coreClient.OperationOptions { +export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams extends OperationOptions { } // @public -export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse = GalleryInVMAccessControlProfileVersionList; - -// @public -export interface GalleryInVMAccessControlProfileVersionsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryInVMAccessControlProfileVersionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams) => Promise, GalleryInVMAccessControlProfileVersion>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams) => Promise, GalleryInVMAccessControlProfileVersion>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams) => PollerLike, GalleryInVMAccessControlProfileVersion>; + delete: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams) => Promise; + listByGalleryInVMAccessControlProfile: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams) => PollerLike, GalleryInVMAccessControlProfileVersion>; } // @public -export interface GalleryInVMAccessControlProfileVersionsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryInVMAccessControlProfileVersionsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryInVMAccessControlProfileVersionsUpdateResponse = GalleryInVMAccessControlProfileVersionsUpdateHeaders & GalleryInVMAccessControlProfileVersion; - // @public export interface GalleryInVMAccessControlProfileVersionUpdate extends UpdateResourceDefinition { defaultAccess?: EndpointAccess; @@ -3464,14 +2436,17 @@ export interface GalleryInVMAccessControlProfileVersionUpdate extends UpdateReso } // @public -export interface GalleryList { - nextLink?: string; - securityProfile?: ImageVersionSecurityProfile; - value: Gallery[]; +export interface GalleryOSDiskImage extends GalleryDiskImage { } // @public -export interface GalleryOSDiskImage extends GalleryDiskImage { +export interface GalleryProperties { + description?: string; + identifier?: GalleryIdentifier; + readonly provisioningState?: GalleryProvisioningState; + sharingProfile?: SharingProfile; + readonly sharingStatus?: SharingStatus; + softDeletePolicy?: SoftDeletePolicy; } // @public @@ -3496,12 +2471,6 @@ export interface GalleryScript extends TrackedResource { properties?: GalleryScriptProperties; } -// @public -export interface GalleryScriptList { - nextLink?: string; - value: GalleryScript[]; -} - // @public export interface GalleryScriptParameter extends GenericGalleryParameter { enumValues?: string[]; @@ -3525,83 +2494,49 @@ export interface GalleryScriptProperties { } // @public -export interface GalleryScripts { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScript, options?: GalleryScriptsCreateOrUpdateOptionalParams): Promise, GalleryScriptsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScript, options?: GalleryScriptsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptsDeleteOptionalParams): Promise, GalleryScriptsDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScriptUpdate, options?: GalleryScriptsUpdateOptionalParams): Promise, GalleryScriptsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScriptUpdate, options?: GalleryScriptsUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptsGetOptionalParams): Promise; - listByGallery(resourceGroupName: string, galleryName: string, options?: GalleryScriptsListByGalleryOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GalleryScriptsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryScriptsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryScriptsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryScriptsCreateOrUpdateResponse = GalleryScript; - -// @public -export interface GalleryScriptsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryScriptsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryScriptsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryScriptsDeleteResponse = GalleryScriptsDeleteHeaders; - -// @public -export interface GalleryScriptsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleryScriptsGetResponse = GalleryScript; - -// @public -export interface GalleryScriptsListByGalleryNextOptionalParams extends coreClient.OperationOptions { +export interface GalleryScriptsGetOptionalParams extends OperationOptions { } // @public -export type GalleryScriptsListByGalleryNextResponse = GalleryScriptList; - -// @public -export interface GalleryScriptsListByGalleryOptionalParams extends coreClient.OperationOptions { +export interface GalleryScriptsListByGalleryOptionalParams extends OperationOptions { } // @public -export type GalleryScriptsListByGalleryResponse = GalleryScriptList; - -// @public -export interface GalleryScriptsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GalleryScriptsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScript, options?: GalleryScriptsCreateOrUpdateOptionalParams) => Promise, GalleryScript>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScript, options?: GalleryScriptsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScriptUpdate, options?: GalleryScriptsUpdateOptionalParams) => Promise, GalleryScript>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScriptUpdate, options?: GalleryScriptsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScript, options?: GalleryScriptsCreateOrUpdateOptionalParams) => PollerLike, GalleryScript>; + delete: (resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptsGetOptionalParams) => Promise; + listByGallery: (resourceGroupName: string, galleryName: string, options?: GalleryScriptsListByGalleryOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScript: GalleryScriptUpdate, options?: GalleryScriptsUpdateOptionalParams) => PollerLike, GalleryScript>; } // @public -export interface GalleryScriptsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryScriptsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryScriptsUpdateResponse = GalleryScript; - // @public export interface GalleryScriptUpdate extends UpdateResourceDefinition { description?: string; @@ -3618,12 +2553,6 @@ export interface GalleryScriptVersion extends TrackedResource { properties?: GalleryScriptVersionProperties; } -// @public -export interface GalleryScriptVersionList { - nextLink?: string; - value: GalleryScriptVersion[]; -} - // @public export interface GalleryScriptVersionProperties { readonly provisioningState?: GalleryProvisioningState; @@ -3637,91 +2566,54 @@ export interface GalleryScriptVersionPublishingProfile extends GalleryArtifactPu source: ScriptSource; } -// @public -export interface GalleryScriptVersions { - beginCreateOrUpdate(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersion, options?: GalleryScriptVersionsCreateOrUpdateOptionalParams): Promise, GalleryScriptVersionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersion, options?: GalleryScriptVersionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, options?: GalleryScriptVersionsDeleteOptionalParams): Promise, GalleryScriptVersionsDeleteResponse>>; - beginDeleteAndWait(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, options?: GalleryScriptVersionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersionUpdate, options?: GalleryScriptVersionsUpdateOptionalParams): Promise, GalleryScriptVersionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersionUpdate, options?: GalleryScriptVersionsUpdateOptionalParams): Promise; - get(resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, options?: GalleryScriptVersionsGetOptionalParams): Promise; - listByGalleryScript(resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptVersionsListByGalleryScriptOptionalParams): PagedAsyncIterableIterator; -} - // @public export interface GalleryScriptVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { } // @public -export interface GalleryScriptVersionsCreateOrUpdateHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryScriptVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryScriptVersionsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryScriptVersionsCreateOrUpdateResponse = GalleryScriptVersion; - -// @public -export interface GalleryScriptVersionsDeleteHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface GalleryScriptVersionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryScriptVersionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type GalleryScriptVersionsDeleteResponse = GalleryScriptVersionsDeleteHeaders; - -// @public -export interface GalleryScriptVersionsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GalleryScriptVersionsGetResponse = GalleryScriptVersion; - -// @public -export interface GalleryScriptVersionsListByGalleryScriptNextOptionalParams extends coreClient.OperationOptions { +export interface GalleryScriptVersionsGetOptionalParams extends OperationOptions { } // @public -export type GalleryScriptVersionsListByGalleryScriptNextResponse = GalleryScriptVersionList; - -// @public -export interface GalleryScriptVersionsListByGalleryScriptOptionalParams extends coreClient.OperationOptions { +export interface GalleryScriptVersionsListByGalleryScriptOptionalParams extends OperationOptions { } // @public -export type GalleryScriptVersionsListByGalleryScriptResponse = GalleryScriptVersionList; - -// @public -export interface GalleryScriptVersionsUpdateHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; +export interface GalleryScriptVersionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersion, options?: GalleryScriptVersionsCreateOrUpdateOptionalParams) => Promise, GalleryScriptVersion>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersion, options?: GalleryScriptVersionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, options?: GalleryScriptVersionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, options?: GalleryScriptVersionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersionUpdate, options?: GalleryScriptVersionsUpdateOptionalParams) => Promise, GalleryScriptVersion>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersionUpdate, options?: GalleryScriptVersionsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersion, options?: GalleryScriptVersionsCreateOrUpdateOptionalParams) => PollerLike, GalleryScriptVersion>; + delete: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, options?: GalleryScriptVersionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, options?: GalleryScriptVersionsGetOptionalParams) => Promise; + listByGalleryScript: (resourceGroupName: string, galleryName: string, galleryScriptName: string, options?: GalleryScriptVersionsListByGalleryScriptOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, galleryName: string, galleryScriptName: string, galleryScriptVersionName: string, galleryScriptVersion: GalleryScriptVersionUpdate, options?: GalleryScriptVersionsUpdateOptionalParams) => PollerLike, GalleryScriptVersion>; } // @public -export interface GalleryScriptVersionsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GalleryScriptVersionsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GalleryScriptVersionsUpdateResponse = GalleryScriptVersion; - // @public export interface GalleryScriptVersionUpdate extends UpdateResourceDefinition { readonly provisioningState?: GalleryProvisioningState; @@ -3734,26 +2626,19 @@ export interface GalleryScriptVersionUpdate extends UpdateResourceDefinition { export type GallerySharingPermissionTypes = string; // @public -export interface GallerySharingProfile { - beginUpdate(resourceGroupName: string, galleryName: string, sharingUpdate: SharingUpdate, options?: GallerySharingProfileUpdateOptionalParams): Promise, GallerySharingProfileUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, galleryName: string, sharingUpdate: SharingUpdate, options?: GallerySharingProfileUpdateOptionalParams): Promise; -} - -// @public -export interface GallerySharingProfileUpdateHeaders { - location?: string; - retryAfter?: number; +export interface GallerySharingProfileOperations { + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, galleryName: string, sharingUpdate: SharingUpdate, options?: GallerySharingProfileUpdateOptionalParams) => Promise, SharingUpdate>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, galleryName: string, sharingUpdate: SharingUpdate, options?: GallerySharingProfileUpdateOptionalParams) => Promise; + update: (resourceGroupName: string, galleryName: string, sharingUpdate: SharingUpdate, options?: GallerySharingProfileUpdateOptionalParams) => PollerLike, SharingUpdate>; } // @public -export interface GallerySharingProfileUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface GallerySharingProfileUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type GallerySharingProfileUpdateResponse = SharingUpdate; - // @public export interface GallerySoftDeletedResource extends TrackedResource { resourceArmId?: string; @@ -3762,12 +2647,13 @@ export interface GallerySoftDeletedResource extends TrackedResource { } // @public -export interface GallerySoftDeletedResourceList { - nextLink?: string; - value: GallerySoftDeletedResource[]; +export interface GallerySoftDeletedResourceProperties { + resourceArmId?: string; + softDeletedArtifactType?: SoftDeletedArtifactTypes; + softDeletedTime?: string; } -// @public (undocumented) +// @public export interface GalleryTargetExtendedLocation { encryption?: EncryptionImages; extendedLocation?: GalleryExtendedLocation; @@ -3795,9 +2681,6 @@ export interface GenericGalleryParameter { required?: boolean; } -// @public -export function getContinuationToken(page: unknown): string | undefined; - // @public export interface GrantAccessData { access: AccessLevel; @@ -3873,18 +2756,20 @@ export interface ImageDiskReference { sharedGalleryImageId?: string; } -// @public -export interface ImageListResult { - nextLink?: string; - value: Image[]; -} - // @public export interface ImageOSDisk extends ImageDisk { osState: OperatingSystemStateTypes; osType: OperatingSystemTypes; } +// @public +export interface ImageProperties { + hyperVGeneration?: HyperVGenerationTypes; + readonly provisioningState?: string; + sourceVirtualMachine?: SubResource; + storageProfile?: ImageStorageProfile; +} + // @public export interface ImagePurchasePlan { name?: string; @@ -3904,81 +2789,50 @@ export interface ImageReference extends SubResource { } // @public -export interface Images { - beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: Image, options?: ImagesCreateOrUpdateOptionalParams): Promise, ImagesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, imageName: string, parameters: Image, options?: ImagesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, imageName: string, options?: ImagesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, imageName: string, options?: ImagesDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, imageName: string, parameters: ImageUpdate, options?: ImagesUpdateOptionalParams): Promise, ImagesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, imageName: string, parameters: ImageUpdate, options?: ImagesUpdateOptionalParams): Promise; - get(resourceGroupName: string, imageName: string, options?: ImagesGetOptionalParams): Promise; - list(options?: ImagesListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: ImagesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ImagesCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface ImagesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ImagesCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type ImagesCreateOrUpdateResponse = Image; - -// @public -export interface ImagesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface ImagesDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ImagesDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface ImagesGetOptionalParams extends coreClient.OperationOptions { +export interface ImagesGetOptionalParams extends OperationOptions { expand?: string; } // @public -export type ImagesGetResponse = Image; - -// @public -export interface ImagesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ImagesListByResourceGroupNextResponse = ImageListResult; - -// @public -export interface ImagesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface ImagesListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type ImagesListByResourceGroupResponse = ImageListResult; - -// @public -export interface ImagesListNextOptionalParams extends coreClient.OperationOptions { +export interface ImagesListOptionalParams extends OperationOptions { } // @public -export type ImagesListNextResponse = ImageListResult; - -// @public -export interface ImagesListOptionalParams extends coreClient.OperationOptions { +export interface ImagesOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, imageName: string, parameters: Image, options?: ImagesCreateOrUpdateOptionalParams) => Promise, Image>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, imageName: string, parameters: Image, options?: ImagesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, imageName: string, options?: ImagesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, imageName: string, options?: ImagesDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, imageName: string, parameters: ImageUpdate, options?: ImagesUpdateOptionalParams) => Promise, Image>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, imageName: string, parameters: ImageUpdate, options?: ImagesUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, imageName: string, parameters: Image, options?: ImagesCreateOrUpdateOptionalParams) => PollerLike, Image>; + delete: (resourceGroupName: string, imageName: string, options?: ImagesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, imageName: string, options?: ImagesGetOptionalParams) => Promise; + list: (options?: ImagesListOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: ImagesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, imageName: string, parameters: ImageUpdate, options?: ImagesUpdateOptionalParams) => PollerLike, Image>; } -// @public -export type ImagesListResponse = ImageListResult; - // @public export type ImageState = string; @@ -3990,20 +2844,10 @@ export interface ImageStorageProfile { } // @public -export interface ImagesUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface ImagesUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface ImagesUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type ImagesUpdateResponse = Image; - // @public export interface ImageUpdate extends UpdateResource { hyperVGeneration?: HyperVGenerationTypes; @@ -4023,12 +2867,6 @@ export interface InnerError { exceptiontype?: string; } -// @public -export interface InstanceSku { - readonly name?: string; - readonly tier?: string; -} - // @public export interface InstanceViewStatus { code?: string; @@ -4038,11 +2876,6 @@ export interface InstanceViewStatus { time?: Date; } -// @public -export interface InstanceViewStatusesSummary { - readonly statusesSummary?: StatusCodeCount[]; -} - // @public export type InstanceViewTypes = "instanceView" | "userData" | "resiliencyView"; @@ -4144,12 +2977,6 @@ export enum KnownAvailabilityPolicyDiskDelay { None = "None" } -// @public -export enum KnownAvailabilitySetSkuTypes { - Aligned = "Aligned", - Classic = "Classic" -} - // @public export enum KnownCapacityReservationGroupInstanceViewTypes { InstanceView = "instanceView" @@ -4160,19 +2987,6 @@ export enum KnownCapacityReservationInstanceViewTypes { InstanceView = "instanceView" } -// @public -export enum KnownCloudServiceSlotType { - Production = "Production", - Staging = "Staging" -} - -// @public -export enum KnownCloudServiceUpgradeMode { - Auto = "Auto", - Manual = "Manual", - Simultaneous = "Simultaneous" -} - // @public export enum KnownConfidentialVMEncryptionType { EncryptedVMGuestStateOnlyWithPmk = "EncryptedVMGuestStateOnlyWithPmk", @@ -4286,7 +3100,7 @@ export enum KnownDiskSecurityTypes { ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", - ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", TrustedLaunch = "TrustedLaunch" } @@ -4476,6 +3290,19 @@ export enum KnownIPVersions { IPv6 = "IPv6" } +// @public +export enum KnownLifecycleHookAction { + Approve = "Approve", + Reject = "Reject" +} + +// @public +export enum KnownLifecycleHookActionState { + Approved = "Approved", + Rejected = "Rejected", + Waiting = "Waiting" +} + // @public export enum KnownLinuxPatchAssessmentMode { AutomaticByPlatform = "AutomaticByPlatform", @@ -4518,8 +3345,8 @@ export enum KnownNetworkAccessPolicy { // @public export enum KnownNetworkApiVersion { - TwoThousandTwenty1101 = "2020-11-01", - TwoThousandTwentyTwo1101 = "2022-11-01" + NetworkApiVersion20201101 = "2020-11-01", + NetworkApiVersion20221101 = "2022-11-01" } // @public @@ -4757,6 +3584,7 @@ export enum KnownSecurityEncryptionTypes { // @public export enum KnownSecurityTypes { ConfidentialVM = "ConfidentialVM", + Standard = "Standard", TrustedLaunch = "TrustedLaunch" } @@ -4851,6 +3679,18 @@ export enum KnownStorageAccountTypes { UltraSSDLRS = "UltraSSD_LRS" } +// @public +export enum KnownStorageAlignmentStatus { + Aligned = "Aligned", + Unaligned = "Unaligned" +} + +// @public +export enum KnownStorageFaultDomainAlignmentType { + Aligned = "Aligned", + BestEffortAligned = "BestEffortAligned" +} + // @public export enum KnownSupportedSecurityOption { TrustedLaunchAndConfidentialVMSupported = "TrustedLaunchAndConfidentialVMSupported", @@ -5117,6 +3957,18 @@ export enum KnownVMGuestPatchRebootStatus { Unknown = "Unknown" } +// @public +export enum KnownVMScaleSetLifecycleHookEventState { + Active = "Active", + Completed = "Completed" +} + +// @public +export enum KnownVMScaleSetLifecycleHookEventType { + UpgradeAutoOSRollingBatchStarting = "UpgradeAutoOSRollingBatchStarting", + UpgradeAutoOSScheduling = "UpgradeAutoOSScheduling" +} + // @public export enum KnownWindowsPatchAssessmentMode { AutomaticByPlatform = "AutomaticByPlatform", @@ -5141,6 +3993,7 @@ export enum KnownWindowsVMGuestPatchMode { // @public export enum KnownZonalPlatformFaultDomainAlignMode { Aligned = "Aligned", + BestEffortAligned = "BestEffortAligned", Unaligned = "Unaligned" } @@ -5165,6 +4018,24 @@ export interface LastPatchInstallationSummary { readonly status?: PatchOperationStatus; } +// @public +export interface LifecycleHook { + defaultAction?: LifecycleHookAction; + type?: VMScaleSetLifecycleHookEventType; + waitDuration?: string; +} + +// @public +export type LifecycleHookAction = string; + +// @public +export type LifecycleHookActionState = string; + +// @public +export interface LifecycleHooksProfile { + lifecycleHooks?: LifecycleHook[]; +} + // @public export interface LinuxConfiguration { disablePasswordAuthentication?: boolean; @@ -5205,74 +4076,15 @@ export interface LinuxVMGuestPatchAutomaticByPlatformSettings { export type LinuxVMGuestPatchMode = string; // @public -export interface ListUsagesResult { - nextLink?: string; - value: Usage[]; -} - -// @public -export interface LoadBalancerConfiguration { - id?: string; - name: string; - properties: LoadBalancerConfigurationProperties; -} - -// @public -export interface LoadBalancerConfigurationProperties { - frontendIpConfigurations: LoadBalancerFrontendIpConfiguration[]; -} - -// @public -export interface LoadBalancerFrontendIpConfiguration { - name: string; - properties: LoadBalancerFrontendIpConfigurationProperties; -} - -// @public -export interface LoadBalancerFrontendIpConfigurationProperties { - privateIPAddress?: string; - publicIPAddress?: SubResource; - subnet?: SubResource; -} - -// @public -export interface LogAnalytics { - beginExportRequestRateByInterval(location: string, parameters: RequestRateByIntervalInput, options?: LogAnalyticsExportRequestRateByIntervalOptionalParams): Promise, LogAnalyticsExportRequestRateByIntervalResponse>>; - beginExportRequestRateByIntervalAndWait(location: string, parameters: RequestRateByIntervalInput, options?: LogAnalyticsExportRequestRateByIntervalOptionalParams): Promise; - beginExportThrottledRequests(location: string, parameters: ThrottledRequestsInput, options?: LogAnalyticsExportThrottledRequestsOptionalParams): Promise, LogAnalyticsExportThrottledRequestsResponse>>; - beginExportThrottledRequestsAndWait(location: string, parameters: ThrottledRequestsInput, options?: LogAnalyticsExportThrottledRequestsOptionalParams): Promise; -} - -// @public -export interface LogAnalyticsExportRequestRateByIntervalHeaders { - azureAsyncOperation?: string; - retryAfter?: number; -} - -// @public -export interface LogAnalyticsExportRequestRateByIntervalOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface LogAnalyticsExportRequestRateByIntervalOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type LogAnalyticsExportRequestRateByIntervalResponse = LogAnalyticsOperationResult; - -// @public -export interface LogAnalyticsExportThrottledRequestsHeaders { - azureAsyncOperation?: string; - retryAfter?: number; -} - -// @public -export interface LogAnalyticsExportThrottledRequestsOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface LogAnalyticsExportThrottledRequestsOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type LogAnalyticsExportThrottledRequestsResponse = LogAnalyticsOperationResult; - // @public export interface LogAnalyticsInputBase { blobContainerSasUri: string; @@ -5290,6 +4102,20 @@ export interface LogAnalyticsOperationResult { readonly properties?: LogAnalyticsOutput; } +// @public +export interface LogAnalyticsOperations { + // @deprecated (undocumented) + beginExportRequestRateByInterval: (location: string, parameters: RequestRateByIntervalInput, options?: LogAnalyticsExportRequestRateByIntervalOptionalParams) => Promise, LogAnalyticsOperationResult>>; + // @deprecated (undocumented) + beginExportRequestRateByIntervalAndWait: (location: string, parameters: RequestRateByIntervalInput, options?: LogAnalyticsExportRequestRateByIntervalOptionalParams) => Promise; + // @deprecated (undocumented) + beginExportThrottledRequests: (location: string, parameters: ThrottledRequestsInput, options?: LogAnalyticsExportThrottledRequestsOptionalParams) => Promise, LogAnalyticsOperationResult>>; + // @deprecated (undocumented) + beginExportThrottledRequestsAndWait: (location: string, parameters: ThrottledRequestsInput, options?: LogAnalyticsExportThrottledRequestsOptionalParams) => Promise; + exportRequestRateByInterval: (location: string, parameters: RequestRateByIntervalInput, options?: LogAnalyticsExportRequestRateByIntervalOptionalParams) => PollerLike, LogAnalyticsOperationResult>; + exportThrottledRequests: (location: string, parameters: ThrottledRequestsInput, options?: LogAnalyticsExportThrottledRequestsOptionalParams) => PollerLike, LogAnalyticsOperationResult>; +} + // @public export interface LogAnalyticsOutput { readonly output?: string; @@ -5358,6 +4184,12 @@ export interface NetworkInterfaceReference extends SubResource { primary?: boolean; } +// @public +export interface NetworkInterfaceReferenceProperties { + deleteOption?: DeleteOptions; + primary?: boolean; +} + // @public export interface NetworkProfile { networkApiVersion?: NetworkApiVersion; @@ -5392,30 +4224,21 @@ export interface OperationDisplay { } // @public -export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +export interface OperationRecoverySettings { + reimageRecoveryPolicy?: ReimageRecoveryPolicy; + restartRecoveryPolicy?: RestartRecoveryPolicy; + startRecoveryPolicy?: StartRecoveryPolicy; } // @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +export interface OperationsListOptionalParams extends OperationOptions { } // @public -export type OperationsListNextResponse = OperationListResult; - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type OperationsListResponse = OperationListResult; - // @public export type OrchestrationMode = string; @@ -5460,6 +4283,7 @@ export interface OSDisk { managedDisk?: ManagedDiskParameters; name?: string; osType?: OperatingSystemTypes; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; vhd?: VirtualHardDisk; writeAcceleratorEnabled?: boolean; } @@ -5481,28 +4305,6 @@ export interface OSDiskImageSecurityProfile { } // @public -export interface OSFamily { - readonly id?: string; - readonly location?: string; - readonly name?: string; - properties?: OSFamilyProperties; - readonly type?: string; -} - -// @public -export interface OSFamilyListResult { - nextLink?: string; - value: OSFamily[]; -} - -// @public -export interface OSFamilyProperties { - readonly label?: string; - readonly name?: string; - readonly versions?: OSVersionPropertiesBase[]; -} - -// @public (undocumented) export interface OSImageNotificationProfile { enable?: boolean; notBeforeTimeout?: string; @@ -5528,37 +4330,19 @@ export interface OSProfileProvisioningData { } // @public -export interface OSVersion { - readonly id?: string; - readonly location?: string; - readonly name?: string; - properties?: OSVersionProperties; - readonly type?: string; -} - -// @public -export interface OSVersionListResult { - nextLink?: string; - value: OSVersion[]; +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; } // @public -export interface OSVersionProperties { - readonly family?: string; - readonly familyLabel?: string; - readonly isActive?: boolean; - readonly isDefault?: boolean; - readonly label?: string; - readonly version?: string; +export interface PageSettings { + continuationToken?: string; } // @public -export interface OSVersionPropertiesBase { - readonly isActive?: boolean; - readonly isDefault?: boolean; - readonly label?: string; - readonly version?: string; -} +export type PassNames = "OobeSystem"; // @public export type PatchAssessmentState = string; @@ -5655,9 +4439,10 @@ export interface PrivateEndpointConnection extends ProxyResource { } // @public -export interface PrivateEndpointConnectionListResult { - nextLink?: string; - value: PrivateEndpointConnection[]; +export interface PrivateEndpointConnectionProperties { + readonly privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; } // @public @@ -5681,6 +4466,13 @@ export interface PrivateLinkResourceListResult { value?: PrivateLinkResource[]; } +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + // @public export interface PrivateLinkServiceConnectionState { actionsRequired?: string; @@ -5711,9 +4503,13 @@ export interface ProximityPlacementGroup extends TrackedResource { } // @public -export interface ProximityPlacementGroupListResult { - nextLink?: string; - value: ProximityPlacementGroup[]; +export interface ProximityPlacementGroupProperties { + readonly availabilitySets?: SubResourceWithColocationStatus[]; + colocationStatus?: InstanceViewStatus; + intent?: ProximityPlacementGroupPropertiesIntent; + proximityPlacementGroupType?: ProximityPlacementGroupType; + readonly virtualMachines?: SubResourceWithColocationStatus[]; + readonly virtualMachineScaleSets?: SubResourceWithColocationStatus[]; } // @public @@ -5722,69 +4518,40 @@ export interface ProximityPlacementGroupPropertiesIntent { } // @public -export interface ProximityPlacementGroups { - createOrUpdate(resourceGroupName: string, proximityPlacementGroupName: string, parameters: ProximityPlacementGroup, options?: ProximityPlacementGroupsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, proximityPlacementGroupName: string, options?: ProximityPlacementGroupsDeleteOptionalParams): Promise; - get(resourceGroupName: string, proximityPlacementGroupName: string, options?: ProximityPlacementGroupsGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: ProximityPlacementGroupsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: ProximityPlacementGroupsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, proximityPlacementGroupName: string, parameters: ProximityPlacementGroupUpdate, options?: ProximityPlacementGroupsUpdateOptionalParams): Promise; -} - -// @public -export interface ProximityPlacementGroupsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface ProximityPlacementGroupsCreateOrUpdateOptionalParams extends OperationOptions { } // @public -export type ProximityPlacementGroupsCreateOrUpdateResponse = ProximityPlacementGroup; - -// @public -export interface ProximityPlacementGroupsDeleteOptionalParams extends coreClient.OperationOptions { +export interface ProximityPlacementGroupsDeleteOptionalParams extends OperationOptions { } // @public -export interface ProximityPlacementGroupsGetOptionalParams extends coreClient.OperationOptions { +export interface ProximityPlacementGroupsGetOptionalParams extends OperationOptions { includeColocationStatus?: string; } // @public -export type ProximityPlacementGroupsGetResponse = ProximityPlacementGroup; - -// @public -export interface ProximityPlacementGroupsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ProximityPlacementGroupsListByResourceGroupNextResponse = ProximityPlacementGroupListResult; - -// @public -export interface ProximityPlacementGroupsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface ProximityPlacementGroupsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type ProximityPlacementGroupsListByResourceGroupResponse = ProximityPlacementGroupListResult; - -// @public -export interface ProximityPlacementGroupsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface ProximityPlacementGroupsListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type ProximityPlacementGroupsListBySubscriptionNextResponse = ProximityPlacementGroupListResult; - -// @public -export interface ProximityPlacementGroupsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface ProximityPlacementGroupsOperations { + createOrUpdate: (resourceGroupName: string, proximityPlacementGroupName: string, parameters: ProximityPlacementGroup, options?: ProximityPlacementGroupsCreateOrUpdateOptionalParams) => Promise; + delete: (resourceGroupName: string, proximityPlacementGroupName: string, options?: ProximityPlacementGroupsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, proximityPlacementGroupName: string, options?: ProximityPlacementGroupsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: ProximityPlacementGroupsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: ProximityPlacementGroupsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, proximityPlacementGroupName: string, parameters: ProximityPlacementGroupUpdate, options?: ProximityPlacementGroupsUpdateOptionalParams) => Promise; } // @public -export type ProximityPlacementGroupsListBySubscriptionResponse = ProximityPlacementGroupListResult; - -// @public -export interface ProximityPlacementGroupsUpdateOptionalParams extends coreClient.OperationOptions { +export interface ProximityPlacementGroupsUpdateOptionalParams extends OperationOptions { } -// @public -export type ProximityPlacementGroupsUpdateResponse = ProximityPlacementGroup; - // @public export type ProximityPlacementGroupType = string; @@ -5864,6 +4631,11 @@ export interface RegionalSharingStatus { readonly state?: SharingState; } +// @public +export interface ReimageRecoveryPolicy { + enabled?: boolean; +} + // @public export type RepairAction = string; @@ -5893,11 +4665,17 @@ export type ReservationType = string; // @public export interface ResiliencyPolicy { automaticZoneRebalancingPolicy?: AutomaticZoneRebalancingPolicy; + operationRecoverySettings?: OperationRecoverySettings; resilientVMCreationPolicy?: ResilientVMCreationPolicy; resilientVMDeletionPolicy?: ResilientVMDeletionPolicy; zoneAllocationPolicy?: ZoneAllocationPolicy; } +// @public +export interface ResiliencyProfile { + zoneMovement?: ZoneMovement; +} + // @public export interface ResilientVMCreationPolicy { enabled?: boolean; @@ -5925,22 +4703,13 @@ export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAs // @public export type ResourceIdOptionsForGetCapacityReservationGroups = string; -// @public -export interface ResourceInstanceViewStatus { - readonly code?: string; - readonly displayStatus?: string; - level?: StatusLevelTypes; - readonly message?: string; - readonly time?: Date; -} - // @public export interface ResourceRange { max?: number; min?: number; } -// @public (undocumented) +// @public export interface ResourceSharingProfile { subscriptionIds?: SubResource[]; } @@ -6016,30 +4785,14 @@ export type ResourceSkuRestrictionsReasonCode = "QuotaId" | "NotAvailableForSubs export type ResourceSkuRestrictionsType = "Location" | "Zone"; // @public -export interface ResourceSkus { - list(options?: ResourceSkusListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ResourceSkusListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ResourceSkusListNextResponse = ResourceSkusResult; - -// @public -export interface ResourceSkusListOptionalParams extends coreClient.OperationOptions { +export interface ResourceSkusListOptionalParams extends OperationOptions { filter?: string; includeExtendedLocations?: string; } // @public -export type ResourceSkusListResponse = ResourceSkusResult; - -// @public -export interface ResourceSkusResult { - nextLink?: string; - value: ResourceSku[]; +export interface ResourceSkusOperations { + list: (options?: ResourceSkusListOptionalParams) => PagedAsyncIterableIterator; } // @public @@ -6049,20 +4802,8 @@ export interface ResourceSkuZoneDetails { } // @public -export interface ResourceUriList { - nextLink?: string; - value: string[]; -} - -// @public -export interface ResourceWithOptionalLocation { - readonly id?: string; - location?: string; - readonly name?: string; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; +export interface RestartRecoveryPolicy { + enabled?: boolean; } // @public @@ -6090,77 +4831,50 @@ export interface RestorePointCollection extends TrackedResource { export type RestorePointCollectionExpandOptions = string; // @public -export interface RestorePointCollectionListResult { - nextLink?: string; - value: RestorePointCollection[]; -} - -// @public -export interface RestorePointCollections { - beginDelete(resourceGroupName: string, restorePointCollectionName: string, options?: RestorePointCollectionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, restorePointCollectionName: string, options?: RestorePointCollectionsDeleteOptionalParams): Promise; - createOrUpdate(resourceGroupName: string, restorePointCollectionName: string, parameters: RestorePointCollection, options?: RestorePointCollectionsCreateOrUpdateOptionalParams): Promise; - get(resourceGroupName: string, restorePointCollectionName: string, options?: RestorePointCollectionsGetOptionalParams): Promise; - list(resourceGroupName: string, options?: RestorePointCollectionsListOptionalParams): PagedAsyncIterableIterator; - listAll(options?: RestorePointCollectionsListAllOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, restorePointCollectionName: string, parameters: RestorePointCollectionUpdate, options?: RestorePointCollectionsUpdateOptionalParams): Promise; -} - -// @public -export interface RestorePointCollectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface RestorePointCollectionProperties { + instantAccess?: boolean; + readonly provisioningState?: string; + readonly restorePointCollectionId?: string; + readonly restorePoints?: RestorePoint[]; + source?: RestorePointCollectionSourceProperties; } // @public -export type RestorePointCollectionsCreateOrUpdateResponse = RestorePointCollection; - -// @public -export interface RestorePointCollectionsDeleteHeaders { - location?: string; - retryAfter?: number; +export interface RestorePointCollectionsCreateOrUpdateOptionalParams extends OperationOptions { } // @public -export interface RestorePointCollectionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RestorePointCollectionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface RestorePointCollectionsGetOptionalParams extends coreClient.OperationOptions { +export interface RestorePointCollectionsGetOptionalParams extends OperationOptions { expand?: RestorePointCollectionExpandOptions; } // @public -export type RestorePointCollectionsGetResponse = RestorePointCollection; - -// @public -export interface RestorePointCollectionsListAllNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type RestorePointCollectionsListAllNextResponse = RestorePointCollectionListResult; - -// @public -export interface RestorePointCollectionsListAllOptionalParams extends coreClient.OperationOptions { +export interface RestorePointCollectionsListAllOptionalParams extends OperationOptions { } // @public -export type RestorePointCollectionsListAllResponse = RestorePointCollectionListResult; - -// @public -export interface RestorePointCollectionsListNextOptionalParams extends coreClient.OperationOptions { +export interface RestorePointCollectionsListOptionalParams extends OperationOptions { } // @public -export type RestorePointCollectionsListNextResponse = RestorePointCollectionListResult; - -// @public -export interface RestorePointCollectionsListOptionalParams extends coreClient.OperationOptions { +export interface RestorePointCollectionsOperations { + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, restorePointCollectionName: string, options?: RestorePointCollectionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, restorePointCollectionName: string, options?: RestorePointCollectionsDeleteOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, restorePointCollectionName: string, parameters: RestorePointCollection, options?: RestorePointCollectionsCreateOrUpdateOptionalParams) => Promise; + delete: (resourceGroupName: string, restorePointCollectionName: string, options?: RestorePointCollectionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, restorePointCollectionName: string, options?: RestorePointCollectionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, options?: RestorePointCollectionsListOptionalParams) => PagedAsyncIterableIterator; + listAll: (options?: RestorePointCollectionsListAllOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, restorePointCollectionName: string, parameters: RestorePointCollectionUpdate, options?: RestorePointCollectionsUpdateOptionalParams) => Promise; } -// @public -export type RestorePointCollectionsListResponse = RestorePointCollectionListResult; - // @public export interface RestorePointCollectionSourceProperties { id?: string; @@ -6168,12 +4882,9 @@ export interface RestorePointCollectionSourceProperties { } // @public -export interface RestorePointCollectionsUpdateOptionalParams extends coreClient.OperationOptions { +export interface RestorePointCollectionsUpdateOptionalParams extends OperationOptions { } -// @public -export type RestorePointCollectionsUpdateResponse = RestorePointCollection; - // @public export interface RestorePointCollectionUpdate extends UpdateResource { instantAccess?: boolean; @@ -6202,48 +4913,46 @@ export interface RestorePointInstanceView { } // @public -export interface RestorePoints { - beginCreate(resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, parameters: RestorePoint, options?: RestorePointsCreateOptionalParams): Promise, RestorePointsCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, parameters: RestorePoint, options?: RestorePointsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, options?: RestorePointsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, options?: RestorePointsDeleteOptionalParams): Promise; - get(resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, options?: RestorePointsGetOptionalParams): Promise; -} - -// @public -export interface RestorePointsCreateHeaders { - location?: string; - retryAfter?: number; +export interface RestorePointProperties { + consistencyMode?: ConsistencyModeTypes; + excludeDisks?: ApiEntityReference[]; + readonly instanceView?: RestorePointInstanceView; + instantAccessDurationMinutes?: number; + readonly provisioningState?: string; + sourceMetadata?: RestorePointSourceMetadata; + sourceRestorePoint?: ApiEntityReference; + timeCreated?: Date; } // @public -export interface RestorePointsCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RestorePointsCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type RestorePointsCreateResponse = RestorePointsCreateHeaders & RestorePoint; - -// @public -export interface RestorePointsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface RestorePointsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RestorePointsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface RestorePointsGetOptionalParams extends coreClient.OperationOptions { +export interface RestorePointsGetOptionalParams extends OperationOptions { expand?: RestorePointExpandOptions; } // @public -export type RestorePointsGetResponse = RestorePoint; +export interface RestorePointsOperations { + // @deprecated (undocumented) + beginCreate: (resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, parameters: RestorePoint, options?: RestorePointsCreateOptionalParams) => Promise, RestorePoint>>; + // @deprecated (undocumented) + beginCreateAndWait: (resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, parameters: RestorePoint, options?: RestorePointsCreateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, options?: RestorePointsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, options?: RestorePointsDeleteOptionalParams) => Promise; + create: (resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, parameters: RestorePoint, options?: RestorePointsCreateOptionalParams) => PollerLike, RestorePoint>; + delete: (resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, options?: RestorePointsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, restorePointCollectionName: string, restorePointName: string, options?: RestorePointsGetOptionalParams) => Promise; +} // @public export interface RestorePointSourceMetadata { @@ -6290,52 +4999,19 @@ export interface RestorePointSourceVMStorageProfile { } // @public -export interface RetrieveBootDiagnosticsDataResult { - readonly consoleScreenshotBlobUri?: string; - readonly serialConsoleLogBlobUri?: string; -} - -// @public -export interface RoleInstance { - readonly id?: string; - readonly location?: string; - readonly name?: string; - properties?: RoleInstanceProperties; - sku?: InstanceSku; - readonly tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface RoleInstanceListResult { - nextLink?: string; - value: RoleInstance[]; -} - -// @public -export interface RoleInstanceNetworkProfile { - readonly networkInterfaces?: SubResource[]; -} - -// @public -export interface RoleInstanceProperties { - instanceView?: RoleInstanceView; - networkProfile?: RoleInstanceNetworkProfile; -} +export function restorePoller(client: ComputeManagementClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; -// @public -export interface RoleInstances { - roleInstances: string[]; +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; } // @public -export interface RoleInstanceView { - readonly platformFaultDomain?: number; - readonly platformUpdateDomain?: number; - readonly privateId?: string; - readonly statuses?: ResourceInstanceViewStatus[]; +export interface RetrieveBootDiagnosticsDataResult { + readonly consoleScreenshotBlobUri?: string; + readonly serialConsoleLogBlobUri?: string; } // @public @@ -6387,6 +5063,14 @@ export interface RollingUpgradeStatusInfo extends TrackedResource { readonly runningStatus?: RollingUpgradeRunningStatus; } +// @public +export interface RollingUpgradeStatusInfoProperties { + readonly error?: ApiError; + readonly policy?: RollingUpgradePolicy; + readonly progress?: RollingUpgradeProgressInfo; + readonly runningStatus?: RollingUpgradeRunningStatus; +} + // @public export interface RunCommandDocument extends RunCommandDocumentBase { parameters?: RunCommandParameterDefinition[]; @@ -6415,12 +5099,6 @@ export interface RunCommandInputParameter { value: string; } -// @public -export interface RunCommandListResult { - nextLink?: string; - value: RunCommandDocumentBase[]; -} - // @public export interface RunCommandManagedIdentity { clientId?: string; @@ -6435,7 +5113,7 @@ export interface RunCommandParameterDefinition { type: string; } -// @public (undocumented) +// @public export interface RunCommandResult { value?: InstanceViewStatus[]; } @@ -6447,7 +5125,7 @@ export interface ScaleInPolicy { rules?: VirtualMachineScaleSetScaleInRules[]; } -// @public (undocumented) +// @public export interface ScheduledEventsAdditionalPublishingTargets { eventGridAndResourceGraph?: EventGridAndResourceGraph; } @@ -6460,7 +5138,7 @@ export interface ScheduledEventsPolicy { userInitiatedRedeploy?: UserInitiatedRedeploy; } -// @public (undocumented) +// @public export interface ScheduledEventsProfile { osImageNotificationProfile?: OSImageNotificationProfile; terminateNotificationProfile?: TerminateNotificationProfile; @@ -6522,38 +5200,23 @@ export interface ServiceArtifactReference { export type SettingNames = "AutoLogon" | "FirstLogonCommands"; // @public -export interface SharedGalleries { - get(location: string, galleryUniqueName: string, options?: SharedGalleriesGetOptionalParams): Promise; - list(location: string, options?: SharedGalleriesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SharedGalleriesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SharedGalleriesGetResponse = SharedGallery; - -// @public -export interface SharedGalleriesListNextOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleriesGetOptionalParams extends OperationOptions { } // @public -export type SharedGalleriesListNextResponse = SharedGalleryList; - -// @public -export interface SharedGalleriesListOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleriesListOptionalParams extends OperationOptions { sharedTo?: SharedToValues; } // @public -export type SharedGalleriesListResponse = SharedGalleryList; +export interface SharedGalleriesOperations { + get: (location: string, galleryUniqueName: string, options?: SharedGalleriesGetOptionalParams) => Promise; + list: (location: string, options?: SharedGalleriesListOptionalParams) => PagedAsyncIterableIterator; +} // @public export interface SharedGallery extends PirSharedGalleryResource { - readonly artifactTags?: { - [propertyName: string]: string; - }; + readonly artifactTags?: Record; } // @public @@ -6570,12 +5233,15 @@ export interface SharedGalleryDiskImage { // @public export type SharedGalleryHostCaching = string; +// @public +export interface SharedGalleryIdentifier { + uniqueId?: string; +} + // @public export interface SharedGalleryImage extends PirSharedGalleryResource { architecture?: Architecture; - artifactTags?: { - [propertyName: string]: string; - }; + artifactTags?: Record; disallowed?: Disallowed; endOfLifeDate?: Date; eula?: string; @@ -6590,44 +5256,40 @@ export interface SharedGalleryImage extends PirSharedGalleryResource { } // @public -export interface SharedGalleryImageList { - nextLink?: string; - value: SharedGalleryImage[]; -} - -// @public -export interface SharedGalleryImages { - get(location: string, galleryUniqueName: string, galleryImageName: string, options?: SharedGalleryImagesGetOptionalParams): Promise; - list(location: string, galleryUniqueName: string, options?: SharedGalleryImagesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SharedGalleryImagesGetOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleryImageProperties { + architecture?: Architecture; + artifactTags?: Record; + disallowed?: Disallowed; + endOfLifeDate?: Date; + eula?: string; + features?: GalleryImageFeature[]; + hyperVGeneration?: HyperVGeneration; + identifier: GalleryImageIdentifier; + osState: OperatingSystemStateTypes; + osType: OperatingSystemTypes; + privacyStatementUri?: string; + purchasePlan?: ImagePurchasePlan; + recommended?: RecommendedMachineConfiguration; } // @public -export type SharedGalleryImagesGetResponse = SharedGalleryImage; - -// @public -export interface SharedGalleryImagesListNextOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleryImagesGetOptionalParams extends OperationOptions { } // @public -export type SharedGalleryImagesListNextResponse = SharedGalleryImageList; - -// @public -export interface SharedGalleryImagesListOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleryImagesListOptionalParams extends OperationOptions { sharedTo?: SharedToValues; } // @public -export type SharedGalleryImagesListResponse = SharedGalleryImageList; +export interface SharedGalleryImagesOperations { + get: (location: string, galleryUniqueName: string, galleryImageName: string, options?: SharedGalleryImagesGetOptionalParams) => Promise; + list: (location: string, galleryUniqueName: string, options?: SharedGalleryImagesListOptionalParams) => PagedAsyncIterableIterator; +} // @public export interface SharedGalleryImageVersion extends PirSharedGalleryResource { - artifactTags?: { - [propertyName: string]: string; - }; + artifactTags?: Record; endOfLifeDate?: Date; excludeFromLatest?: boolean; publishedDate?: Date; @@ -6635,38 +5297,28 @@ export interface SharedGalleryImageVersion extends PirSharedGalleryResource { } // @public -export interface SharedGalleryImageVersionList { - nextLink?: string; - value: SharedGalleryImageVersion[]; -} - -// @public -export interface SharedGalleryImageVersions { - get(location: string, galleryUniqueName: string, galleryImageName: string, galleryImageVersionName: string, options?: SharedGalleryImageVersionsGetOptionalParams): Promise; - list(location: string, galleryUniqueName: string, galleryImageName: string, options?: SharedGalleryImageVersionsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SharedGalleryImageVersionsGetOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleryImageVersionProperties { + artifactTags?: Record; + endOfLifeDate?: Date; + excludeFromLatest?: boolean; + publishedDate?: Date; + storageProfile?: SharedGalleryImageVersionStorageProfile; } // @public -export type SharedGalleryImageVersionsGetResponse = SharedGalleryImageVersion; - -// @public -export interface SharedGalleryImageVersionsListNextOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleryImageVersionsGetOptionalParams extends OperationOptions { } // @public -export type SharedGalleryImageVersionsListNextResponse = SharedGalleryImageVersionList; - -// @public -export interface SharedGalleryImageVersionsListOptionalParams extends coreClient.OperationOptions { +export interface SharedGalleryImageVersionsListOptionalParams extends OperationOptions { sharedTo?: SharedToValues; } // @public -export type SharedGalleryImageVersionsListResponse = SharedGalleryImageVersionList; +export interface SharedGalleryImageVersionsOperations { + get: (location: string, galleryUniqueName: string, galleryImageName: string, galleryImageVersionName: string, options?: SharedGalleryImageVersionsGetOptionalParams) => Promise; + list: (location: string, galleryUniqueName: string, galleryImageName: string, options?: SharedGalleryImageVersionsListOptionalParams) => PagedAsyncIterableIterator; +} // @public export interface SharedGalleryImageVersionStorageProfile { @@ -6675,19 +5327,18 @@ export interface SharedGalleryImageVersionStorageProfile { } // @public -export interface SharedGalleryList { - nextLink?: string; - value: SharedGallery[]; +export interface SharedGalleryOSDiskImage extends SharedGalleryDiskImage { } // @public -export interface SharedGalleryOSDiskImage extends SharedGalleryDiskImage { +export interface SharedGalleryProperties { + readonly artifactTags?: Record; } // @public export type SharedToValues = string; -// @public (undocumented) +// @public export interface ShareInfoElement { readonly vmUri?: string; } @@ -6726,6 +5377,28 @@ export interface SharingUpdate { // @public export type SharingUpdateOperationTypes = string; +// @public +export interface SimplePollerLike, TResult> { + getOperationState(): TState; + getResult(): TResult | undefined; + isDone(): boolean; + // @deprecated + isStopped(): boolean; + onProgress(callback: (state: TState) => void): CancelOnProgress; + poll(options?: { + abortSignal?: AbortSignalLike; + }): Promise; + pollUntilDone(pollOptions?: { + abortSignal?: AbortSignalLike; + }): Promise; + serialize(): Promise; + // @deprecated + stopPolling(): void; + submitted(): Promise; + // @deprecated + toString(): string; +} + // @public export interface Sku { capacity?: number; @@ -6780,77 +5453,52 @@ export interface Snapshot extends TrackedResource { export type SnapshotAccessState = string; // @public -export interface SnapshotList { - nextLink?: string; - value: Snapshot[]; -} - -// @public -export interface Snapshots { - beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: Snapshot, options?: SnapshotsCreateOrUpdateOptionalParams): Promise, SnapshotsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, snapshotName: string, snapshot: Snapshot, options?: SnapshotsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams): Promise; - beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: GrantAccessData, options?: SnapshotsGrantAccessOptionalParams): Promise, SnapshotsGrantAccessResponse>>; - beginGrantAccessAndWait(resourceGroupName: string, snapshotName: string, grantAccessData: GrantAccessData, options?: SnapshotsGrantAccessOptionalParams): Promise; - beginRevokeAccess(resourceGroupName: string, snapshotName: string, options?: SnapshotsRevokeAccessOptionalParams): Promise, void>>; - beginRevokeAccessAndWait(resourceGroupName: string, snapshotName: string, options?: SnapshotsRevokeAccessOptionalParams): Promise; - beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: SnapshotUpdate, options?: SnapshotsUpdateOptionalParams): Promise, SnapshotsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, snapshotName: string, snapshot: SnapshotUpdate, options?: SnapshotsUpdateOptionalParams): Promise; - get(resourceGroupName: string, snapshotName: string, options?: SnapshotsGetOptionalParams): Promise; - list(options?: SnapshotsListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: SnapshotsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface SnapshotsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface SnapshotProperties { + completionPercent?: number; + copyCompletionError?: CopyCompletionError; + creationData: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + hyperVGeneration?: HyperVGeneration; + incremental?: boolean; + readonly incrementalSnapshotFamilyId?: string; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; + readonly uniqueId?: string; } // @public -export interface SnapshotsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface SnapshotsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type SnapshotsCreateOrUpdateResponse = Snapshot; - -// @public -export interface SnapshotsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface SnapshotsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface SnapshotsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface SnapshotsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SnapshotsGetResponse = Snapshot; - -// @public -export interface SnapshotsGrantAccessHeaders { - location?: string; - retryAfter?: number; +export interface SnapshotsGetOptionalParams extends OperationOptions { } // @public -export interface SnapshotsGrantAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface SnapshotsGrantAccessOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type SnapshotsGrantAccessResponse = AccessUri; - // @public export interface SnapshotSku { name?: SnapshotStorageAccountTypes; @@ -6858,42 +5506,47 @@ export interface SnapshotSku { } // @public -export interface SnapshotsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SnapshotsListByResourceGroupNextResponse = SnapshotList; - -// @public -export interface SnapshotsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SnapshotsListByResourceGroupResponse = SnapshotList; - -// @public -export interface SnapshotsListNextOptionalParams extends coreClient.OperationOptions { +export interface SnapshotsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type SnapshotsListNextResponse = SnapshotList; - -// @public -export interface SnapshotsListOptionalParams extends coreClient.OperationOptions { +export interface SnapshotsListOptionalParams extends OperationOptions { } // @public -export type SnapshotsListResponse = SnapshotList; - -// @public -export interface SnapshotsRevokeAccessHeaders { - location?: string; - retryAfter?: number; +export interface SnapshotsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, snapshotName: string, snapshot: Snapshot, options?: SnapshotsCreateOrUpdateOptionalParams) => Promise, Snapshot>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, snapshotName: string, snapshot: Snapshot, options?: SnapshotsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginGrantAccess: (resourceGroupName: string, snapshotName: string, grantAccessData: GrantAccessData, options?: SnapshotsGrantAccessOptionalParams) => Promise, AccessUri>>; + // @deprecated (undocumented) + beginGrantAccessAndWait: (resourceGroupName: string, snapshotName: string, grantAccessData: GrantAccessData, options?: SnapshotsGrantAccessOptionalParams) => Promise; + // @deprecated (undocumented) + beginRevokeAccess: (resourceGroupName: string, snapshotName: string, options?: SnapshotsRevokeAccessOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRevokeAccessAndWait: (resourceGroupName: string, snapshotName: string, options?: SnapshotsRevokeAccessOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, snapshotName: string, snapshot: SnapshotUpdate, options?: SnapshotsUpdateOptionalParams) => Promise, Snapshot>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, snapshotName: string, snapshot: SnapshotUpdate, options?: SnapshotsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, snapshotName: string, snapshot: Snapshot, options?: SnapshotsCreateOrUpdateOptionalParams) => PollerLike, Snapshot>; + delete: (resourceGroupName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, snapshotName: string, options?: SnapshotsGetOptionalParams) => Promise; + grantAccess: (resourceGroupName: string, snapshotName: string, grantAccessData: GrantAccessData, options?: SnapshotsGrantAccessOptionalParams) => PollerLike, AccessUri>; + list: (options?: SnapshotsListOptionalParams) => PagedAsyncIterableIterator; + listByResourceGroup: (resourceGroupName: string, options?: SnapshotsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + revokeAccess: (resourceGroupName: string, snapshotName: string, options?: SnapshotsRevokeAccessOptionalParams) => PollerLike, void>; + update: (resourceGroupName: string, snapshotName: string, snapshot: SnapshotUpdate, options?: SnapshotsUpdateOptionalParams) => PollerLike, Snapshot>; } // @public -export interface SnapshotsRevokeAccessOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface SnapshotsRevokeAccessOptionalParams extends OperationOptions { updateIntervalInMs?: number; } @@ -6901,20 +5554,10 @@ export interface SnapshotsRevokeAccessOptionalParams extends coreClient.Operatio export type SnapshotStorageAccountTypes = string; // @public -export interface SnapshotsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface SnapshotsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface SnapshotsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type SnapshotsUpdateResponse = Snapshot; - // @public export interface SnapshotUpdate { dataAccessAuthMode?: DataAccessAuthMode; @@ -6929,32 +5572,35 @@ export interface SnapshotUpdate { readonly snapshotAccessState?: SnapshotAccessState; supportedCapabilities?: SupportedCapabilities; supportsHibernation?: boolean; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export type SoftDeletedArtifactTypes = string; - -// @public -export interface SoftDeletedResource { - listByArtifactName(resourceGroupName: string, galleryName: string, artifactType: string, artifactName: string, options?: SoftDeletedResourceListByArtifactNameOptionalParams): PagedAsyncIterableIterator; + tags?: Record; } // @public -export interface SoftDeletedResourceListByArtifactNameNextOptionalParams extends coreClient.OperationOptions { +export interface SnapshotUpdateProperties { + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; } // @public -export type SoftDeletedResourceListByArtifactNameNextResponse = GallerySoftDeletedResourceList; +export type SoftDeletedArtifactTypes = string; // @public -export interface SoftDeletedResourceListByArtifactNameOptionalParams extends coreClient.OperationOptions { +export interface SoftDeletedResourceListByArtifactNameOptionalParams extends OperationOptions { } // @public -export type SoftDeletedResourceListByArtifactNameResponse = GallerySoftDeletedResourceList; +export interface SoftDeletedResourceOperations { + listByArtifactName: (resourceGroupName: string, galleryName: string, artifactType: string, artifactName: string, options?: SoftDeletedResourceListByArtifactNameOptionalParams) => PagedAsyncIterableIterator; +} // @public export interface SoftDeletePolicy { @@ -7004,92 +5650,58 @@ export interface SshPublicKeyResource extends TrackedResource { } // @public -export interface SshPublicKeys { - create(resourceGroupName: string, sshPublicKeyName: string, parameters: SshPublicKeyResource, options?: SshPublicKeysCreateOptionalParams): Promise; - delete(resourceGroupName: string, sshPublicKeyName: string, options?: SshPublicKeysDeleteOptionalParams): Promise; - generateKeyPair(resourceGroupName: string, sshPublicKeyName: string, options?: SshPublicKeysGenerateKeyPairOptionalParams): Promise; - get(resourceGroupName: string, sshPublicKeyName: string, options?: SshPublicKeysGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: SshPublicKeysListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: SshPublicKeysListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, sshPublicKeyName: string, parameters: SshPublicKeyUpdateResource, options?: SshPublicKeysUpdateOptionalParams): Promise; +export interface SshPublicKeyResourceProperties { + publicKey?: string; } // @public -export interface SshPublicKeysCreateOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysCreateOptionalParams extends OperationOptions { } // @public -export type SshPublicKeysCreateResponse = SshPublicKeyResource; - -// @public -export interface SshPublicKeysDeleteOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysDeleteOptionalParams extends OperationOptions { } // @public -export interface SshPublicKeysGenerateKeyPairOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysGenerateKeyPairOptionalParams extends OperationOptions { parameters?: SshGenerateKeyPairInputParameters; } // @public -export type SshPublicKeysGenerateKeyPairResponse = SshPublicKeyGenerateKeyPairResult; - -// @public -export interface SshPublicKeysGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type SshPublicKeysGetResponse = SshPublicKeyResource; - -// @public -export interface SshPublicKeysGroupListResult { - nextLink?: string; - value: SshPublicKeyResource[]; -} - -// @public -export interface SshPublicKeysListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysGetOptionalParams extends OperationOptions { } // @public -export type SshPublicKeysListByResourceGroupNextResponse = SshPublicKeysGroupListResult; - -// @public -export interface SshPublicKeysListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type SshPublicKeysListByResourceGroupResponse = SshPublicKeysGroupListResult; - -// @public -export interface SshPublicKeysListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type SshPublicKeysListBySubscriptionNextResponse = SshPublicKeysGroupListResult; - -// @public -export interface SshPublicKeysListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysOperations { + create: (resourceGroupName: string, sshPublicKeyName: string, parameters: SshPublicKeyResource, options?: SshPublicKeysCreateOptionalParams) => Promise; + delete: (resourceGroupName: string, sshPublicKeyName: string, options?: SshPublicKeysDeleteOptionalParams) => Promise; + generateKeyPair: (resourceGroupName: string, sshPublicKeyName: string, options?: SshPublicKeysGenerateKeyPairOptionalParams) => Promise; + get: (resourceGroupName: string, sshPublicKeyName: string, options?: SshPublicKeysGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: SshPublicKeysListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: SshPublicKeysListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, sshPublicKeyName: string, parameters: SshPublicKeyUpdateResource, options?: SshPublicKeysUpdateOptionalParams) => Promise; } // @public -export type SshPublicKeysListBySubscriptionResponse = SshPublicKeysGroupListResult; - -// @public -export interface SshPublicKeysUpdateOptionalParams extends coreClient.OperationOptions { +export interface SshPublicKeysUpdateOptionalParams extends OperationOptions { } -// @public -export type SshPublicKeysUpdateResponse = SshPublicKeyResource; - // @public export interface SshPublicKeyUpdateResource extends UpdateResource { publicKey?: string; } // @public -export interface StatusCodeCount { - readonly code?: string; - readonly count?: number; +export interface StartRecoveryPolicy { + enabled?: boolean; } // @public @@ -7104,6 +5716,12 @@ export type StorageAccountType = string; // @public export type StorageAccountTypes = string; +// @public +export type StorageAlignmentStatus = string; + +// @public +export type StorageFaultDomainAlignmentType = string; + // @public export interface StorageProfile { alignRegionalDisksToVMZone?: boolean; @@ -7113,17 +5731,17 @@ export interface StorageProfile { osDisk?: OSDisk; } -// @public (undocumented) +// @public export interface SubResource { id?: string; } -// @public (undocumented) +// @public export interface SubResourceReadOnly { readonly id?: string; } -// @public (undocumented) +// @public export interface SubResourceWithColocationStatus extends SubResource { colocationStatus?: InstanceViewStatus; } @@ -7159,7 +5777,7 @@ export interface TargetRegion { storageAccountType?: StorageAccountType; } -// @public (undocumented) +// @public export interface TerminateNotificationProfile { enable?: boolean; notBeforeTimeout?: string; @@ -7172,9 +5790,7 @@ export interface ThrottledRequestsInput extends LogAnalyticsInputBase { // @public export interface TrackedResource extends Resource { location: string; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -7203,32 +5819,16 @@ export interface UefiSettings { // @public export type UefiSignatureTemplateName = string; -// @public -export interface UpdateDomain { - readonly id?: string; - readonly name?: string; -} - -// @public -export interface UpdateDomainListResult { - nextLink?: string; - value: UpdateDomain[]; -} - // @public export interface UpdateResource { - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public export interface UpdateResourceDefinition { readonly id?: string; readonly name?: string; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; readonly type?: string; } @@ -7281,19 +5881,9 @@ export interface Usage { } // @public -export interface UsageListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type UsageListNextResponse = ListUsagesResult; - -// @public -export interface UsageListOptionalParams extends coreClient.OperationOptions { +export interface UsageListOptionalParams extends OperationOptions { } -// @public -export type UsageListResponse = ListUsagesResult; - // @public export interface UsageName { localizedValue?: string; @@ -7302,10 +5892,10 @@ export interface UsageName { // @public export interface UsageOperations { - list(location: string, options?: UsageListOptionalParams): PagedAsyncIterableIterator; + list: (location: string, options?: UsageListOptionalParams) => PagedAsyncIterableIterator; } -// @public (undocumented) +// @public export interface UserArtifactManage { install: string; remove: string; @@ -7325,7 +5915,7 @@ export interface UserArtifactSource { mediaLink: string; } -// @public (undocumented) +// @public export interface UserAssignedIdentitiesValue { readonly clientId?: string; readonly principalId?: string; @@ -7396,6 +5986,7 @@ export interface VirtualMachine extends TrackedResource { priority?: VirtualMachinePriorityTypes; readonly provisioningState?: string; proximityPlacementGroup?: SubResource; + resiliencyProfile?: ResiliencyProfile; readonly resources?: VirtualMachineExtension[]; scheduledEventsPolicy?: ScheduledEventsPolicy; scheduledEventsProfile?: ScheduledEventsProfile; @@ -7479,35 +6070,37 @@ export interface VirtualMachineExtensionImage extends TrackedResource { } // @public -export interface VirtualMachineExtensionImages { - get(location: string, publisherName: string, typeParam: string, version: string, options?: VirtualMachineExtensionImagesGetOptionalParams): Promise; - listTypes(location: string, publisherName: string, options?: VirtualMachineExtensionImagesListTypesOptionalParams): Promise; - listVersions(location: string, publisherName: string, typeParam: string, options?: VirtualMachineExtensionImagesListVersionsOptionalParams): Promise; +export interface VirtualMachineExtensionImageProperties { + computeRole: string; + handlerSchema: string; + operatingSystem: string; + supportsMultipleExtensions?: boolean; + vmScaleSetEnabled?: boolean; } // @public -export interface VirtualMachineExtensionImagesGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineExtensionImagesGetOptionalParams extends OperationOptions { } // @public -export type VirtualMachineExtensionImagesGetResponse = VirtualMachineExtensionImage; - -// @public -export interface VirtualMachineExtensionImagesListTypesOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineExtensionImagesListTypesOptionalParams extends OperationOptions { } // @public -export type VirtualMachineExtensionImagesListTypesResponse = VirtualMachineExtensionImage[]; - -// @public -export interface VirtualMachineExtensionImagesListVersionsOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineExtensionImagesListVersionsOptionalParams extends OperationOptions { filter?: string; + // (undocumented) orderby?: string; + // (undocumented) top?: number; } // @public -export type VirtualMachineExtensionImagesListVersionsResponse = VirtualMachineExtensionImage[]; +export interface VirtualMachineExtensionImagesOperations { + get: (location: string, publisherName: string, typeParam: string, version: string, options?: VirtualMachineExtensionImagesGetOptionalParams) => Promise; + listTypes: (location: string, publisherName: string, options?: VirtualMachineExtensionImagesListTypesOptionalParams) => Promise; + listVersions: (location: string, publisherName: string, typeParam: string, options?: VirtualMachineExtensionImagesListVersionsOptionalParams) => Promise; +} // @public export interface VirtualMachineExtensionInstanceView { @@ -7519,82 +6112,89 @@ export interface VirtualMachineExtensionInstanceView { } // @public -export interface VirtualMachineExtensions { - beginCreateOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtension, options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams): Promise, VirtualMachineExtensionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtension, options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: VirtualMachineExtensionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: VirtualMachineExtensionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtensionUpdate, options?: VirtualMachineExtensionsUpdateOptionalParams): Promise, VirtualMachineExtensionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtensionUpdate, options?: VirtualMachineExtensionsUpdateOptionalParams): Promise; - get(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: VirtualMachineExtensionsGetOptionalParams): Promise; - list(resourceGroupName: string, vmName: string, options?: VirtualMachineExtensionsListOptionalParams): Promise; -} - -// @public -export interface VirtualMachineExtensionsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineExtensionProperties { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + instanceView?: VirtualMachineExtensionInstanceView; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; } // @public -export interface VirtualMachineExtensionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineExtensionsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineExtensionsCreateOrUpdateResponse = VirtualMachineExtension; - -// @public -export interface VirtualMachineExtensionsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineExtensionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineExtensionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineExtensionsGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineExtensionsGetOptionalParams extends OperationOptions { expand?: string; } // @public -export type VirtualMachineExtensionsGetResponse = VirtualMachineExtension; - -// @public -export interface VirtualMachineExtensionsListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineExtensionsListOptionalParams extends OperationOptions { expand?: string; } -// @public -export type VirtualMachineExtensionsListResponse = VirtualMachineExtensionsListResult; - // @public export interface VirtualMachineExtensionsListResult { value?: VirtualMachineExtension[]; } // @public -export interface VirtualMachineExtensionsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineExtensionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtension, options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams) => Promise, VirtualMachineExtension>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtension, options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmName: string, vmExtensionName: string, options?: VirtualMachineExtensionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmName: string, vmExtensionName: string, options?: VirtualMachineExtensionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtensionUpdate, options?: VirtualMachineExtensionsUpdateOptionalParams) => Promise, VirtualMachineExtension>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtensionUpdate, options?: VirtualMachineExtensionsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtension, options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineExtension>; + delete: (resourceGroupName: string, vmName: string, vmExtensionName: string, options?: VirtualMachineExtensionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, vmName: string, vmExtensionName: string, options?: VirtualMachineExtensionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, vmName: string, options?: VirtualMachineExtensionsListOptionalParams) => Promise; + update: (resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: VirtualMachineExtensionUpdate, options?: VirtualMachineExtensionsUpdateOptionalParams) => PollerLike, VirtualMachineExtension>; } // @public -export interface VirtualMachineExtensionsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineExtensionsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineExtensionsUpdateResponse = VirtualMachineExtensionsUpdateHeaders & VirtualMachineExtension; +export interface VirtualMachineExtensionUpdate extends UpdateResource { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; +} // @public -export interface VirtualMachineExtensionUpdate extends UpdateResource { +export interface VirtualMachineExtensionUpdateProperties { autoUpgradeMinorVersion?: boolean; enableAutomaticUpgrade?: boolean; forceUpdateTag?: string; @@ -7617,13 +6217,31 @@ export interface VirtualMachineIdentity { readonly principalId?: string; readonly tenantId?: string; type?: ResourceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; + userAssignedIdentities?: Record; +} + +// @public +export interface VirtualMachineImage extends VirtualMachineImageResource { + architecture?: ArchitectureTypes; + automaticOSUpgradeProperties?: AutomaticOSUpgradeProperties; + dataDiskImages?: DataDiskImage[]; + disallowed?: DisallowedConfiguration; + // (undocumented) + features?: VirtualMachineImageFeature[]; + hyperVGeneration?: HyperVGenerationTypes; + imageDeprecationStatus?: ImageDeprecationStatus; + osDiskImage?: OSDiskImage; + plan?: PurchasePlan; +} + +// @public +export interface VirtualMachineImageFeature { + name?: string; + value?: string; } // @public -export interface VirtualMachineImage extends VirtualMachineImageResource { +export interface VirtualMachineImageProperties { architecture?: ArchitectureTypes; automaticOSUpgradeProperties?: AutomaticOSUpgradeProperties; dataDiskImages?: DataDiskImage[]; @@ -7636,134 +6254,94 @@ export interface VirtualMachineImage extends VirtualMachineImageResource { plan?: PurchasePlan; } -// @public -export interface VirtualMachineImageFeature { - name?: string; - value?: string; -} - // @public export interface VirtualMachineImageResource extends SubResource { extendedLocation?: ExtendedLocation; location: string; name: string; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export interface VirtualMachineImages { - get(location: string, publisherName: string, offer: string, skus: string, version: string, options?: VirtualMachineImagesGetOptionalParams): Promise; - list(location: string, publisherName: string, offer: string, skus: string, options?: VirtualMachineImagesListOptionalParams): Promise; - listByEdgeZone(location: string, edgeZone: string, options?: VirtualMachineImagesListByEdgeZoneOptionalParams): Promise; - listOffers(location: string, publisherName: string, options?: VirtualMachineImagesListOffersOptionalParams): Promise; - listPublishers(location: string, options?: VirtualMachineImagesListPublishersOptionalParams): Promise; - listSkus(location: string, publisherName: string, offer: string, options?: VirtualMachineImagesListSkusOptionalParams): Promise; - // (undocumented) - listWithProperties(location: string, publisherName: string, offer: string, skus: string, expand: string, options?: VirtualMachineImagesListWithPropertiesOptionalParams): Promise; + tags?: Record; } // @public -export interface VirtualMachineImagesEdgeZone { - get(location: string, edgeZone: string, publisherName: string, offer: string, skus: string, version: string, options?: VirtualMachineImagesEdgeZoneGetOptionalParams): Promise; - list(location: string, edgeZone: string, publisherName: string, offer: string, skus: string, options?: VirtualMachineImagesEdgeZoneListOptionalParams): Promise; - listOffers(location: string, edgeZone: string, publisherName: string, options?: VirtualMachineImagesEdgeZoneListOffersOptionalParams): Promise; - listPublishers(location: string, edgeZone: string, options?: VirtualMachineImagesEdgeZoneListPublishersOptionalParams): Promise; - listSkus(location: string, edgeZone: string, publisherName: string, offer: string, options?: VirtualMachineImagesEdgeZoneListSkusOptionalParams): Promise; +export interface VirtualMachineImagesEdgeZoneGetOptionalParams extends OperationOptions { } // @public -export interface VirtualMachineImagesEdgeZoneGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesEdgeZoneListOffersOptionalParams extends OperationOptions { } // @public -export type VirtualMachineImagesEdgeZoneGetResponse = VirtualMachineImage; - -// @public -export interface VirtualMachineImagesEdgeZoneListOffersOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineImagesEdgeZoneListOffersResponse = VirtualMachineImageResource[]; - -// @public -export interface VirtualMachineImagesEdgeZoneListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesEdgeZoneListOptionalParams extends OperationOptions { expand?: string; orderby?: string; top?: number; } // @public -export interface VirtualMachineImagesEdgeZoneListPublishersOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesEdgeZoneListPublishersOptionalParams extends OperationOptions { } // @public -export type VirtualMachineImagesEdgeZoneListPublishersResponse = VirtualMachineImageResource[]; - -// @public -export type VirtualMachineImagesEdgeZoneListResponse = VirtualMachineImageResource[]; - -// @public -export interface VirtualMachineImagesEdgeZoneListSkusOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesEdgeZoneListSkusOptionalParams extends OperationOptions { } // @public -export type VirtualMachineImagesEdgeZoneListSkusResponse = VirtualMachineImageResource[]; - -// @public -export interface VirtualMachineImagesGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesEdgeZoneOperations { + get: (location: string, edgeZone: string, publisherName: string, offer: string, skus: string, version: string, options?: VirtualMachineImagesEdgeZoneGetOptionalParams) => Promise; + list: (location: string, edgeZone: string, publisherName: string, offer: string, skus: string, options?: VirtualMachineImagesEdgeZoneListOptionalParams) => Promise; + listOffers: (location: string, edgeZone: string, publisherName: string, options?: VirtualMachineImagesEdgeZoneListOffersOptionalParams) => Promise; + listPublishers: (location: string, edgeZone: string, options?: VirtualMachineImagesEdgeZoneListPublishersOptionalParams) => Promise; + listSkus: (location: string, edgeZone: string, publisherName: string, offer: string, options?: VirtualMachineImagesEdgeZoneListSkusOptionalParams) => Promise; } // @public -export type VirtualMachineImagesGetResponse = VirtualMachineImage; - -// @public -export interface VirtualMachineImagesListByEdgeZoneOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesGetOptionalParams extends OperationOptions { } // @public -export type VirtualMachineImagesListByEdgeZoneResponse = VmImagesInEdgeZoneListResult; - -// @public -export interface VirtualMachineImagesListOffersOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesListByEdgeZoneOptionalParams extends OperationOptions { } // @public -export type VirtualMachineImagesListOffersResponse = VirtualMachineImageResource[]; +export interface VirtualMachineImagesListOffersOptionalParams extends OperationOptions { +} // @public -export interface VirtualMachineImagesListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesListOptionalParams extends OperationOptions { expand?: string; + // (undocumented) orderby?: string; + // (undocumented) top?: number; } // @public -export interface VirtualMachineImagesListPublishersOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesListPublishersOptionalParams extends OperationOptions { } // @public -export type VirtualMachineImagesListPublishersResponse = VirtualMachineImageResource[]; - -// @public -export type VirtualMachineImagesListResponse = VirtualMachineImageResource[]; - -// @public -export interface VirtualMachineImagesListSkusOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesListSkusOptionalParams extends OperationOptions { } // @public -export type VirtualMachineImagesListSkusResponse = VirtualMachineImageResource[]; - -// @public -export interface VirtualMachineImagesListWithPropertiesOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineImagesListWithPropertiesOptionalParams extends OperationOptions { + // (undocumented) orderby?: string; + // (undocumented) top?: number; } // @public -export type VirtualMachineImagesListWithPropertiesResponse = VirtualMachineImage[]; +export interface VirtualMachineImagesOperations { + get: (location: string, publisherName: string, offer: string, skus: string, version: string, options?: VirtualMachineImagesGetOptionalParams) => Promise; + list: (location: string, publisherName: string, offer: string, skus: string, options?: VirtualMachineImagesListOptionalParams) => Promise; + listByEdgeZone: (location: string, edgeZone: string, options?: VirtualMachineImagesListByEdgeZoneOptionalParams) => Promise; + listOffers: (location: string, publisherName: string, options?: VirtualMachineImagesListOffersOptionalParams) => Promise; + listPublishers: (location: string, options?: VirtualMachineImagesListPublishersOptionalParams) => Promise; + listSkus: (location: string, publisherName: string, offer: string, options?: VirtualMachineImagesListSkusOptionalParams) => Promise; + // (undocumented) + listWithProperties: (location: string, publisherName: string, offer: string, skus: string, expand: string, options?: VirtualMachineImagesListWithPropertiesOptionalParams) => Promise; +} // @public export interface VirtualMachineInstallPatchesParameters { @@ -7816,12 +6394,6 @@ export interface VirtualMachineIpTag { tag?: string; } -// @public -export interface VirtualMachineListResult { - nextLink?: string; - value: VirtualMachine[]; -} - // @public export interface VirtualMachineNetworkInterfaceConfiguration { auxiliaryMode?: NetworkInterfaceAuxiliaryMode; @@ -7838,9 +6410,24 @@ export interface VirtualMachineNetworkInterfaceConfiguration { name: string; networkSecurityGroup?: SubResource; primary?: boolean; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; +} + +// @public +export interface VirtualMachineNetworkInterfaceConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineNetworkInterfaceDnsSettingsConfiguration; + // (undocumented) + dscpConfiguration?: SubResource; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations: VirtualMachineNetworkInterfaceIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; } // @public @@ -7860,6 +6447,17 @@ export interface VirtualMachineNetworkInterfaceIPConfiguration { subnet?: SubResource; } +// @public +export interface VirtualMachineNetworkInterfaceIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersions; + publicIPAddressConfiguration?: VirtualMachinePublicIPAddressConfiguration; + subnet?: SubResource; +} + // @public export interface VirtualMachinePatchStatus { availablePatchSummary?: AvailablePatchSummary; @@ -7870,6 +6468,38 @@ export interface VirtualMachinePatchStatus { // @public export type VirtualMachinePriorityTypes = string; +// @public +export interface VirtualMachineProperties { + additionalCapabilities?: AdditionalCapabilities; + applicationProfile?: ApplicationProfile; + availabilitySet?: SubResource; + billingProfile?: BillingProfile; + capacityReservation?: CapacityReservationProfile; + diagnosticsProfile?: DiagnosticsProfile; + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + extensionsTimeBudget?: string; + hardwareProfile?: HardwareProfile; + host?: SubResource; + hostGroup?: SubResource; + readonly instanceView?: VirtualMachineInstanceView; + licenseType?: string; + networkProfile?: NetworkProfile; + osProfile?: OSProfile; + platformFaultDomain?: number; + priority?: VirtualMachinePriorityTypes; + readonly provisioningState?: string; + proximityPlacementGroup?: SubResource; + resiliencyProfile?: ResiliencyProfile; + scheduledEventsPolicy?: ScheduledEventsPolicy; + scheduledEventsProfile?: ScheduledEventsProfile; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + readonly timeCreated?: Date; + userData?: string; + virtualMachineScaleSet?: SubResource; + readonly vmId?: string; +} + // @public export interface VirtualMachinePublicIPAddressConfiguration { deleteOption?: DeleteOptions; @@ -7881,9 +6511,18 @@ export interface VirtualMachinePublicIPAddressConfiguration { publicIPAllocationMethod?: PublicIPAllocationMethod; publicIPPrefix?: SubResource; sku?: PublicIPAddressSku; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; +} + +// @public +export interface VirtualMachinePublicIPAddressConfigurationProperties { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachinePublicIPAddressDnsSettingsConfiguration; + idleTimeoutInMinutes?: number; + ipTags?: VirtualMachineIpTag[]; + publicIPAddressVersion?: IPVersions; + publicIPAllocationMethod?: PublicIPAllocationMethod; + publicIPPrefix?: SubResource; } // @public @@ -7930,34 +6569,28 @@ export interface VirtualMachineRunCommandInstanceView { } // @public -export interface VirtualMachineRunCommands { - beginCreateOrUpdate(resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams): Promise, VirtualMachineRunCommandsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmName: string, runCommandName: string, options?: VirtualMachineRunCommandsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmName: string, runCommandName: string, options?: VirtualMachineRunCommandsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineRunCommandsUpdateOptionalParams): Promise, VirtualMachineRunCommandsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineRunCommandsUpdateOptionalParams): Promise; - get(location: string, commandId: string, options?: VirtualMachineRunCommandsGetOptionalParams): Promise; - getByVirtualMachine(resourceGroupName: string, vmName: string, runCommandName: string, options?: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams): Promise; - list(location: string, options?: VirtualMachineRunCommandsListOptionalParams): PagedAsyncIterableIterator; - listByVirtualMachine(resourceGroupName: string, vmName: string, options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualMachineRunCommandsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineRunCommandProperties { + asyncExecution?: boolean; + errorBlobManagedIdentity?: RunCommandManagedIdentity; + errorBlobUri?: string; + readonly instanceView?: VirtualMachineRunCommandInstanceView; + outputBlobManagedIdentity?: RunCommandManagedIdentity; + outputBlobUri?: string; + parameters?: RunCommandInputParameter[]; + protectedParameters?: RunCommandInputParameter[]; + readonly provisioningState?: string; + runAsPassword?: string; + runAsUser?: string; + source?: VirtualMachineRunCommandScriptSource; + timeoutInSeconds?: number; + treatFailureAsDeploymentFailure?: boolean; } // @public -export interface VirtualMachineRunCommandsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineRunCommandsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualMachineRunCommandsCreateOrUpdateResponse = VirtualMachineRunCommand; - // @public export interface VirtualMachineRunCommandScriptSource { commandId?: string; @@ -7969,82 +6602,56 @@ export interface VirtualMachineRunCommandScriptSource { } // @public -export interface VirtualMachineRunCommandsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineRunCommandsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineRunCommandsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineRunCommandsGetByVirtualMachineOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineRunCommandsGetByVirtualMachineOptionalParams extends OperationOptions { expand?: string; } // @public -export type VirtualMachineRunCommandsGetByVirtualMachineResponse = VirtualMachineRunCommand; - -// @public -export interface VirtualMachineRunCommandsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineRunCommandsGetResponse = RunCommandDocument; - -// @public -export interface VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineRunCommandsGetOptionalParams extends OperationOptions { } // @public -export type VirtualMachineRunCommandsListByVirtualMachineNextResponse = VirtualMachineRunCommandsListResult; - -// @public -export interface VirtualMachineRunCommandsListByVirtualMachineOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineRunCommandsListByVirtualMachineOptionalParams extends OperationOptions { expand?: string; } // @public -export type VirtualMachineRunCommandsListByVirtualMachineResponse = VirtualMachineRunCommandsListResult; - -// @public -export interface VirtualMachineRunCommandsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineRunCommandsListNextResponse = RunCommandListResult; - -// @public -export interface VirtualMachineRunCommandsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineRunCommandsListResponse = RunCommandListResult; - -// @public -export interface VirtualMachineRunCommandsListResult { - nextLink?: string; - value: VirtualMachineRunCommand[]; +export interface VirtualMachineRunCommandsListOptionalParams extends OperationOptions { } // @public -export interface VirtualMachineRunCommandsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineRunCommandsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams) => Promise, VirtualMachineRunCommand>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmName: string, runCommandName: string, options?: VirtualMachineRunCommandsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmName: string, runCommandName: string, options?: VirtualMachineRunCommandsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineRunCommandsUpdateOptionalParams) => Promise, VirtualMachineRunCommand>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineRunCommandsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineRunCommand>; + delete: (resourceGroupName: string, vmName: string, runCommandName: string, options?: VirtualMachineRunCommandsDeleteOptionalParams) => PollerLike, void>; + get: (location: string, commandId: string, options?: VirtualMachineRunCommandsGetOptionalParams) => Promise; + getByVirtualMachine: (resourceGroupName: string, vmName: string, runCommandName: string, options?: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams) => Promise; + list: (location: string, options?: VirtualMachineRunCommandsListOptionalParams) => PagedAsyncIterableIterator; + listByVirtualMachine: (resourceGroupName: string, vmName: string, options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, vmName: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineRunCommandsUpdateOptionalParams) => PollerLike, VirtualMachineRunCommand>; } // @public -export interface VirtualMachineRunCommandsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineRunCommandsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualMachineRunCommandsUpdateResponse = VirtualMachineRunCommandsUpdateHeaders & VirtualMachineRunCommand; - // @public export interface VirtualMachineRunCommandUpdate extends UpdateResource { asyncExecution?: boolean; @@ -8064,84 +6671,15 @@ export interface VirtualMachineRunCommandUpdate extends UpdateResource { } // @public -export interface VirtualMachines { - beginAssessPatches(resourceGroupName: string, vmName: string, options?: VirtualMachinesAssessPatchesOptionalParams): Promise, VirtualMachinesAssessPatchesResponse>>; - beginAssessPatchesAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesAssessPatchesOptionalParams): Promise; - beginAttachDetachDataDisks(resourceGroupName: string, vmName: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachinesAttachDetachDataDisksOptionalParams): Promise, VirtualMachinesAttachDetachDataDisksResponse>>; - beginAttachDetachDataDisksAndWait(resourceGroupName: string, vmName: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachinesAttachDetachDataDisksOptionalParams): Promise; - beginCapture(resourceGroupName: string, vmName: string, parameters: VirtualMachineCaptureParameters, options?: VirtualMachinesCaptureOptionalParams): Promise, VirtualMachinesCaptureResponse>>; - beginCaptureAndWait(resourceGroupName: string, vmName: string, parameters: VirtualMachineCaptureParameters, options?: VirtualMachinesCaptureOptionalParams): Promise; - beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: VirtualMachinesConvertToManagedDisksOptionalParams): Promise, void>>; - beginConvertToManagedDisksAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesConvertToManagedDisksOptionalParams): Promise; - beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise, VirtualMachinesCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmName: string, parameters: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams): Promise; - beginDeallocate(resourceGroupName: string, vmName: string, options?: VirtualMachinesDeallocateOptionalParams): Promise, void>>; - beginDeallocateAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesDeallocateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmName: string, options?: VirtualMachinesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesDeleteOptionalParams): Promise; - beginInstallPatches(resourceGroupName: string, vmName: string, installPatchesInput: VirtualMachineInstallPatchesParameters, options?: VirtualMachinesInstallPatchesOptionalParams): Promise, VirtualMachinesInstallPatchesResponse>>; - beginInstallPatchesAndWait(resourceGroupName: string, vmName: string, installPatchesInput: VirtualMachineInstallPatchesParameters, options?: VirtualMachinesInstallPatchesOptionalParams): Promise; - beginMigrateToVMScaleSet(resourceGroupName: string, vmName: string, options?: VirtualMachinesMigrateToVMScaleSetOptionalParams): Promise, VirtualMachinesMigrateToVMScaleSetResponse>>; - beginMigrateToVMScaleSetAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesMigrateToVMScaleSetOptionalParams): Promise; - beginPerformMaintenance(resourceGroupName: string, vmName: string, options?: VirtualMachinesPerformMaintenanceOptionalParams): Promise, void>>; - beginPerformMaintenanceAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesPerformMaintenanceOptionalParams): Promise; - beginPowerOff(resourceGroupName: string, vmName: string, options?: VirtualMachinesPowerOffOptionalParams): Promise, void>>; - beginPowerOffAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesPowerOffOptionalParams): Promise; - beginReapply(resourceGroupName: string, vmName: string, options?: VirtualMachinesReapplyOptionalParams): Promise, void>>; - beginReapplyAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesReapplyOptionalParams): Promise; - beginRedeploy(resourceGroupName: string, vmName: string, options?: VirtualMachinesRedeployOptionalParams): Promise, void>>; - beginRedeployAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesRedeployOptionalParams): Promise; - beginReimage(resourceGroupName: string, vmName: string, options?: VirtualMachinesReimageOptionalParams): Promise, void>>; - beginReimageAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesReimageOptionalParams): Promise; - beginRestart(resourceGroupName: string, vmName: string, options?: VirtualMachinesRestartOptionalParams): Promise, void>>; - beginRestartAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesRestartOptionalParams): Promise; - beginRunCommand(resourceGroupName: string, vmName: string, parameters: RunCommandInput, options?: VirtualMachinesRunCommandOptionalParams): Promise, VirtualMachinesRunCommandResponse>>; - beginRunCommandAndWait(resourceGroupName: string, vmName: string, parameters: RunCommandInput, options?: VirtualMachinesRunCommandOptionalParams): Promise; - beginStart(resourceGroupName: string, vmName: string, options?: VirtualMachinesStartOptionalParams): Promise, void>>; - beginStartAndWait(resourceGroupName: string, vmName: string, options?: VirtualMachinesStartOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmName: string, parameters: VirtualMachineUpdate, options?: VirtualMachinesUpdateOptionalParams): Promise, VirtualMachinesUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmName: string, parameters: VirtualMachineUpdate, options?: VirtualMachinesUpdateOptionalParams): Promise; - generalize(resourceGroupName: string, vmName: string, options?: VirtualMachinesGeneralizeOptionalParams): Promise; - get(resourceGroupName: string, vmName: string, options?: VirtualMachinesGetOptionalParams): Promise; - instanceView(resourceGroupName: string, vmName: string, options?: VirtualMachinesInstanceViewOptionalParams): Promise; - list(resourceGroupName: string, options?: VirtualMachinesListOptionalParams): PagedAsyncIterableIterator; - listAll(options?: VirtualMachinesListAllOptionalParams): PagedAsyncIterableIterator; - listAvailableSizes(resourceGroupName: string, vmName: string, options?: VirtualMachinesListAvailableSizesOptionalParams): PagedAsyncIterableIterator; - listByLocation(location: string, options?: VirtualMachinesListByLocationOptionalParams): PagedAsyncIterableIterator; - retrieveBootDiagnosticsData(resourceGroupName: string, vmName: string, options?: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams): Promise; - simulateEviction(resourceGroupName: string, vmName: string, options?: VirtualMachinesSimulateEvictionOptionalParams): Promise; -} - -// @public -export interface VirtualMachinesAssessPatchesHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesAssessPatchesOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesAssessPatchesOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachinesAssessPatchesResponse = VirtualMachineAssessPatchesResult; - -// @public -export interface VirtualMachinesAttachDetachDataDisksHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesAttachDetachDataDisksOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesAttachDetachDataDisksOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualMachinesAttachDetachDataDisksResponse = StorageProfile; - // @public export interface VirtualMachineScaleSet extends TrackedResource { additionalCapabilities?: AdditionalCapabilities; @@ -8150,9 +6688,11 @@ export interface VirtualMachineScaleSet extends TrackedResource { doNotRunExtensionsOnOverprovisionedVMs?: boolean; readonly etag?: string; extendedLocation?: ExtendedLocation; + externalHealthPolicy?: ExternalHealthPolicy; highSpeedInterconnectPlacement?: HighSpeedInterconnectPlacement; hostGroup?: SubResource; identity?: VirtualMachineScaleSetIdentity; + lifecycleHooksProfile?: LifecycleHooksProfile; orchestrationMode?: OrchestrationMode; overprovision?: boolean; placement?: Placement; @@ -8188,6 +6728,7 @@ export interface VirtualMachineScaleSetDataDisk { lun: number; managedDisk?: VirtualMachineScaleSetManagedDiskParameters; name?: string; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; writeAcceleratorEnabled?: boolean; } @@ -8209,12 +6750,6 @@ export interface VirtualMachineScaleSetExtension extends SubResourceReadOnly { typePropertiesType?: string; } -// @public -export interface VirtualMachineScaleSetExtensionListResult { - nextLink?: string; - value: VirtualMachineScaleSetExtension[]; -} - // @public export interface VirtualMachineScaleSetExtensionProfile { extensions?: VirtualMachineScaleSetExtension[]; @@ -8222,81 +6757,66 @@ export interface VirtualMachineScaleSetExtensionProfile { } // @public -export interface VirtualMachineScaleSetExtensions { - beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtension, options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams): Promise, VirtualMachineScaleSetExtensionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtension, options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtensionUpdate, options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams): Promise, VirtualMachineScaleSetExtensionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtensionUpdate, options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams): Promise; - get(resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: VirtualMachineScaleSetExtensionsGetOptionalParams): Promise; - list(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetExtensionsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetExtensionProperties { + autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; + forceUpdateTag?: string; + protectedSettings?: any; + protectedSettingsFromKeyVault?: KeyVaultSecretReference; + provisionAfterExtensions?: string[]; + readonly provisioningState?: string; + publisher?: string; + settings?: any; + suppressFailures?: boolean; + type?: string; + typeHandlerVersion?: string; } // @public -export interface VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetExtensionsCreateOrUpdateResponse = VirtualMachineScaleSetExtension; - -// @public -export interface VirtualMachineScaleSetExtensionsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetExtensionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetExtensionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetExtensionsGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetExtensionsGetOptionalParams extends OperationOptions { expand?: string; } // @public -export type VirtualMachineScaleSetExtensionsGetResponse = VirtualMachineScaleSetExtension; - -// @public -export interface VirtualMachineScaleSetExtensionsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetExtensionsListNextResponse = VirtualMachineScaleSetExtensionListResult; - -// @public -export interface VirtualMachineScaleSetExtensionsListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetExtensionsListOptionalParams extends OperationOptions { } // @public -export type VirtualMachineScaleSetExtensionsListResponse = VirtualMachineScaleSetExtensionListResult; - -// @public -export interface VirtualMachineScaleSetExtensionsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetExtensionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtension, options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams) => Promise, VirtualMachineScaleSetExtension>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtension, options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtensionUpdate, options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams) => Promise, VirtualMachineScaleSetExtension>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtensionUpdate, options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtension, options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineScaleSetExtension>; + delete: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, options?: VirtualMachineScaleSetExtensionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetExtensionsListOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, vmScaleSetName: string, vmssExtensionName: string, extensionParameters: VirtualMachineScaleSetExtensionUpdate, options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams) => PollerLike, VirtualMachineScaleSetExtension>; } // @public -export interface VirtualMachineScaleSetExtensionsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetExtensionsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualMachineScaleSetExtensionsUpdateResponse = VirtualMachineScaleSetExtension; - // @public export interface VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { autoUpgradeMinorVersion?: boolean; @@ -8325,9 +6845,7 @@ export interface VirtualMachineScaleSetIdentity { readonly principalId?: string; readonly tenantId?: string; type?: ResourceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; + userAssignedIdentities?: Record; } // @public @@ -8356,6 +6874,18 @@ export interface VirtualMachineScaleSetIPConfiguration { subnet?: ApiEntityReference; } +// @public +export interface VirtualMachineScaleSetIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersion; + publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; + subnet?: ApiEntityReference; +} + // @public export interface VirtualMachineScaleSetIpTag { ipTagType?: string; @@ -8363,27 +6893,22 @@ export interface VirtualMachineScaleSetIpTag { } // @public -export interface VirtualMachineScaleSetListOSUpgradeHistory { - nextLink?: string; - value: UpgradeOperationHistoricalStatusInfo[]; +export interface VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams extends OperationOptions { } // @public -export interface VirtualMachineScaleSetListResult { - nextLink?: string; - value: VirtualMachineScaleSet[]; +export interface VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams extends OperationOptions { } // @public -export interface VirtualMachineScaleSetListSkusResult { - nextLink?: string; - value: VirtualMachineScaleSetSku[]; +export interface VirtualMachineScaleSetLifeCycleHookEventsOperations { + get: (resourceGroupName: string, vmScaleSetName: string, lifecycleHookEventName: string, options?: VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams) => Promise; + list: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, vmScaleSetName: string, lifecycleHookEventName: string, properties: VMScaleSetLifecycleHookEventUpdate, options?: VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams) => Promise; } // @public -export interface VirtualMachineScaleSetListWithLinkResult { - nextLink?: string; - value: VirtualMachineScaleSet[]; +export interface VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams extends OperationOptions { } // @public @@ -8413,9 +6938,7 @@ export interface VirtualMachineScaleSetNetworkConfiguration { name: string; networkSecurityGroup?: SubResource; primary?: boolean; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -8423,6 +6946,21 @@ export interface VirtualMachineScaleSetNetworkConfigurationDnsSettings { dnsServers?: string[]; } +// @public +export interface VirtualMachineScaleSetNetworkConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations: VirtualMachineScaleSetIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; +} + // @public export interface VirtualMachineScaleSetNetworkProfile { healthProbe?: ApiEntityReference; @@ -8441,6 +6979,7 @@ export interface VirtualMachineScaleSetOSDisk { managedDisk?: VirtualMachineScaleSetManagedDiskParameters; name?: string; osType?: OperatingSystemTypes; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; vhdContainers?: string[]; writeAcceleratorEnabled?: boolean; } @@ -8458,6 +6997,36 @@ export interface VirtualMachineScaleSetOSProfile { windowsConfiguration?: WindowsConfiguration; } +// @public +export interface VirtualMachineScaleSetProperties { + additionalCapabilities?: AdditionalCapabilities; + automaticRepairsPolicy?: AutomaticRepairsPolicy; + constrainedMaximumCapacity?: boolean; + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + externalHealthPolicy?: ExternalHealthPolicy; + highSpeedInterconnectPlacement?: HighSpeedInterconnectPlacement; + hostGroup?: SubResource; + lifecycleHooksProfile?: LifecycleHooksProfile; + orchestrationMode?: OrchestrationMode; + overprovision?: boolean; + platformFaultDomainCount?: number; + priorityMixPolicy?: PriorityMixPolicy; + readonly provisioningState?: string; + proximityPlacementGroup?: SubResource; + resiliencyPolicy?: ResiliencyPolicy; + scaleInPolicy?: ScaleInPolicy; + scheduledEventsPolicy?: ScheduledEventsPolicy; + singlePlacementGroup?: boolean; + skuProfile?: SkuProfile; + spotRestorePolicy?: SpotRestorePolicy; + readonly timeCreated?: Date; + readonly uniqueId?: string; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetVMProfile; + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + zoneBalance?: boolean; +} + // @public export interface VirtualMachineScaleSetPublicIPAddressConfiguration { deleteOption?: DeleteOptions; @@ -8468,9 +7037,7 @@ export interface VirtualMachineScaleSetPublicIPAddressConfiguration { publicIPAddressVersion?: IPVersion; publicIPPrefix?: SubResource; sku?: PublicIPAddressSku; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -8480,229 +7047,117 @@ export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { } // @public -export interface VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { - instanceIds?: string[]; -} - -// @public -export interface VirtualMachineScaleSetRollingUpgrades { - beginCancel(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams): Promise, void>>; - beginCancelAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams): Promise; - beginStartExtensionUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams): Promise, void>>; - beginStartExtensionUpgradeAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams): Promise; - beginStartOSUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams): Promise, void>>; - beginStartOSUpgradeAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams): Promise; - getLatest(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams): Promise; +export interface VirtualMachineScaleSetPublicIPAddressConfigurationProperties { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + idleTimeoutInMinutes?: number; + ipTags?: VirtualMachineScaleSetIpTag[]; + publicIPAddressVersion?: IPVersion; + publicIPPrefix?: SubResource; } // @public -export interface VirtualMachineScaleSetRollingUpgradesCancelHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { + instanceIds?: string[]; } // @public -export interface VirtualMachineScaleSetRollingUpgradesCancelOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetRollingUpgradesCancelOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams extends OperationOptions { } // @public -export type VirtualMachineScaleSetRollingUpgradesGetLatestResponse = RollingUpgradeStatusInfo; - -// @public -export interface VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetRollingUpgradesOperations { + // @deprecated (undocumented) + beginCancel: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginCancelAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams) => Promise; + // @deprecated (undocumented) + beginStartExtensionUpgrade: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginStartExtensionUpgradeAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams) => Promise; + // @deprecated (undocumented) + beginStartOSUpgrade: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginStartOSUpgradeAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams) => Promise; + cancel: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams) => PollerLike, void>; + getLatest: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams) => Promise; + startExtensionUpgrade: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams) => PollerLike, void>; + startOSUpgrade: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams) => PollerLike, void>; } // @public -export interface VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetRollingUpgradesStartOSUpgradeHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface VirtualMachineScaleSets { - beginApproveRollingUpgrade(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams): Promise, VirtualMachineScaleSetsApproveRollingUpgradeResponse>>; - beginApproveRollingUpgradeAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams): Promise; - beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSet, options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams): Promise, VirtualMachineScaleSetsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSet, options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams): Promise; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeallocateOptionalParams): Promise, void>>; - beginDeallocateAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeallocateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeleteOptionalParams): Promise; - beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams): Promise, void>>; - beginDeleteInstancesAndWait(resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams): Promise; - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams): Promise, void>>; - beginPerformMaintenanceAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams): Promise; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPowerOffOptionalParams): Promise, void>>; - beginPowerOffAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPowerOffOptionalParams): Promise; - beginReapply(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReapplyOptionalParams): Promise, void>>; - beginReapplyAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReapplyOptionalParams): Promise; - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRedeployOptionalParams): Promise, void>>; - beginRedeployAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRedeployOptionalParams): Promise; - beginReimage(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageOptionalParams): Promise, void>>; - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageAllOptionalParams): Promise, void>>; - beginReimageAllAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageAllOptionalParams): Promise; - beginReimageAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageOptionalParams): Promise; - beginRestart(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRestartOptionalParams): Promise, void>>; - beginRestartAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRestartOptionalParams): Promise; - beginScaleOut(resourceGroupName: string, vmScaleSetName: string, parameters: VMScaleSetScaleOutInput, options?: VirtualMachineScaleSetsScaleOutOptionalParams): Promise, void>>; - beginScaleOutAndWait(resourceGroupName: string, vmScaleSetName: string, parameters: VMScaleSetScaleOutInput, options?: VirtualMachineScaleSetsScaleOutOptionalParams): Promise; - beginSetOrchestrationServiceState(resourceGroupName: string, vmScaleSetName: string, parameters: OrchestrationServiceStateInput, options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams): Promise, void>>; - beginSetOrchestrationServiceStateAndWait(resourceGroupName: string, vmScaleSetName: string, parameters: OrchestrationServiceStateInput, options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams): Promise; - beginStart(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsStartOptionalParams): Promise, void>>; - beginStartAndWait(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsStartOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSetUpdate, options?: VirtualMachineScaleSetsUpdateOptionalParams): Promise, VirtualMachineScaleSetsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSetUpdate, options?: VirtualMachineScaleSetsUpdateOptionalParams): Promise; - beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams): Promise, void>>; - beginUpdateInstancesAndWait(resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams): Promise; - convertToSinglePlacementGroup(resourceGroupName: string, vmScaleSetName: string, parameters: VMScaleSetConvertToSinglePlacementGroupInput, options?: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams): Promise; - forceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName: string, vmScaleSetName: string, platformUpdateDomain: number, options?: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams): Promise; - get(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsGetOptionalParams): Promise; - getInstanceView(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsGetInstanceViewOptionalParams): Promise; - list(resourceGroupName: string, options?: VirtualMachineScaleSetsListOptionalParams): PagedAsyncIterableIterator; - listAll(options?: VirtualMachineScaleSetsListAllOptionalParams): PagedAsyncIterableIterator; - listByLocation(location: string, options?: VirtualMachineScaleSetsListByLocationOptionalParams): PagedAsyncIterableIterator; - listOSUpgradeHistory(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams): PagedAsyncIterableIterator; - listSkus(resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsListSkusOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualMachineScaleSetsApproveRollingUpgradeHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams extends OperationOptions { + updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } -// @public -export type VirtualMachineScaleSetsApproveRollingUpgradeResponse = VirtualMachineScaleSetsApproveRollingUpgradeHeaders; - // @public export type VirtualMachineScaleSetScaleInRules = string; // @public -export interface VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface VirtualMachineScaleSetsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams extends OperationOptions { } // @public -export interface VirtualMachineScaleSetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsCreateOrUpdateOptionalParams extends OperationOptions { ifMatch?: string; ifNoneMatch?: string; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetsCreateOrUpdateResponse = VirtualMachineScaleSet; - -// @public -export interface VirtualMachineScaleSetsDeallocateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsDeallocateOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsDeallocateOptionalParams extends OperationOptions { hibernate?: boolean; - resumeFrom?: string; updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } // @public -export interface VirtualMachineScaleSetsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsDeleteInstancesHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsDeleteInstancesOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsDeleteInstancesOptionalParams extends OperationOptions { forceDeletion?: boolean; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetsDeleteOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsDeleteOptionalParams extends OperationOptions { forceDeletion?: boolean; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams extends OperationOptions { placementGroupId?: string; zone?: string; } // @public -export type VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse = RecoveryWalkResponse; - -// @public -export interface VirtualMachineScaleSetsGetInstanceViewOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsGetInstanceViewOptionalParams extends OperationOptions { } // @public -export type VirtualMachineScaleSetsGetInstanceViewResponse = VirtualMachineScaleSetInstanceView; - -// @public -export interface VirtualMachineScaleSetsGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsGetOptionalParams extends OperationOptions { expand?: ExpandTypesForGetVMScaleSets; } // @public -export interface VirtualMachineScaleSetsGetOSUpgradeHistoryNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsGetOSUpgradeHistoryNextResponse = VirtualMachineScaleSetListOSUpgradeHistory; - -// @public -export interface VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams extends OperationOptions { } -// @public -export type VirtualMachineScaleSetsGetOSUpgradeHistoryResponse = VirtualMachineScaleSetListOSUpgradeHistory; - -// @public -export type VirtualMachineScaleSetsGetResponse = VirtualMachineScaleSet; - // @public export interface VirtualMachineScaleSetSku { readonly capacity?: VirtualMachineScaleSetSkuCapacity; @@ -8722,185 +7177,173 @@ export interface VirtualMachineScaleSetSkuCapacity { export type VirtualMachineScaleSetSkuScaleType = "Automatic" | "None"; // @public -export interface VirtualMachineScaleSetsListAllNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListAllNextResponse = VirtualMachineScaleSetListWithLinkResult; - -// @public -export interface VirtualMachineScaleSetsListAllOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListAllResponse = VirtualMachineScaleSetListWithLinkResult; - -// @public -export interface VirtualMachineScaleSetsListByLocationNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListByLocationNextResponse = VirtualMachineScaleSetListResult; - -// @public -export interface VirtualMachineScaleSetsListByLocationOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListByLocationResponse = VirtualMachineScaleSetListResult; - -// @public -export interface VirtualMachineScaleSetsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListNextResponse = VirtualMachineScaleSetListResult; - -// @public -export interface VirtualMachineScaleSetsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListResponse = VirtualMachineScaleSetListResult; - -// @public -export interface VirtualMachineScaleSetsListSkusNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListSkusNextResponse = VirtualMachineScaleSetListSkusResult; - -// @public -export interface VirtualMachineScaleSetsListSkusOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetsListSkusResponse = VirtualMachineScaleSetListSkusResult; - -// @public -export interface VirtualMachineScaleSetsPerformMaintenanceHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsPerformMaintenanceOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsListAllOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineScaleSetsListByLocationOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineScaleSetsListOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineScaleSetsListSkusOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualMachineScaleSetsOperations { + approveRollingUpgrade: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams) => PollerLike, void>; + // @deprecated (undocumented) + beginApproveRollingUpgrade: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginApproveRollingUpgradeAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams) => Promise; + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSet, options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams) => Promise, VirtualMachineScaleSet>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSet, options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDeallocate: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeallocateOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeallocateAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeallocateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginDeleteInstances: (resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteInstancesAndWait: (resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams) => Promise; + // @deprecated (undocumented) + beginPerformMaintenance: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginPerformMaintenanceAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams) => Promise; + // @deprecated (undocumented) + beginPowerOff: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPowerOffOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginPowerOffAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPowerOffOptionalParams) => Promise; + // @deprecated (undocumented) + beginReapply: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReapplyOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginReapplyAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReapplyOptionalParams) => Promise; + // @deprecated (undocumented) + beginRedeploy: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRedeployOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRedeployAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRedeployOptionalParams) => Promise; + // @deprecated (undocumented) + beginReimage: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginReimageAll: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageAllOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginReimageAllAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageAllOptionalParams) => Promise; + // @deprecated (undocumented) + beginReimageAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageOptionalParams) => Promise; + // @deprecated (undocumented) + beginRestart: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRestartOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRestartAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRestartOptionalParams) => Promise; + // @deprecated (undocumented) + beginScaleOut: (resourceGroupName: string, vmScaleSetName: string, parameters: VMScaleSetScaleOutInput, options?: VirtualMachineScaleSetsScaleOutOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginScaleOutAndWait: (resourceGroupName: string, vmScaleSetName: string, parameters: VMScaleSetScaleOutInput, options?: VirtualMachineScaleSetsScaleOutOptionalParams) => Promise; + // @deprecated (undocumented) + beginSetOrchestrationServiceState: (resourceGroupName: string, vmScaleSetName: string, parameters: OrchestrationServiceStateInput, options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginSetOrchestrationServiceStateAndWait: (resourceGroupName: string, vmScaleSetName: string, parameters: OrchestrationServiceStateInput, options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams) => Promise; + // @deprecated (undocumented) + beginStart: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsStartOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginStartAndWait: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsStartOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSetUpdate, options?: VirtualMachineScaleSetsUpdateOptionalParams) => Promise, VirtualMachineScaleSet>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSetUpdate, options?: VirtualMachineScaleSetsUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdateInstances: (resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginUpdateInstancesAndWait: (resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams) => Promise; + convertToSinglePlacementGroup: (resourceGroupName: string, vmScaleSetName: string, parameters: VMScaleSetConvertToSinglePlacementGroupInput, options?: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSet, options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineScaleSet>; + deallocate: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeallocateOptionalParams) => PollerLike, void>; + delete: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsDeleteOptionalParams) => PollerLike, void>; + deleteInstances: (resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams) => PollerLike, void>; + forceRecoveryServiceFabricPlatformUpdateDomainWalk: (resourceGroupName: string, vmScaleSetName: string, platformUpdateDomain: number, options?: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams) => Promise; + get: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsGetOptionalParams) => Promise; + getInstanceView: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsGetInstanceViewOptionalParams) => Promise; + getOSUpgradeHistory: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams) => PagedAsyncIterableIterator; + list: (resourceGroupName: string, options?: VirtualMachineScaleSetsListOptionalParams) => PagedAsyncIterableIterator; + listAll: (options?: VirtualMachineScaleSetsListAllOptionalParams) => PagedAsyncIterableIterator; + listByLocation: (location: string, options?: VirtualMachineScaleSetsListByLocationOptionalParams) => PagedAsyncIterableIterator; + listSkus: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsListSkusOptionalParams) => PagedAsyncIterableIterator; + performMaintenance: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams) => PollerLike, void>; + powerOff: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsPowerOffOptionalParams) => PollerLike, void>; + reapply: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReapplyOptionalParams) => PollerLike, void>; + redeploy: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRedeployOptionalParams) => PollerLike, void>; + reimage: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageOptionalParams) => PollerLike, void>; + reimageAll: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsReimageAllOptionalParams) => PollerLike, void>; + restart: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsRestartOptionalParams) => PollerLike, void>; + scaleOut: (resourceGroupName: string, vmScaleSetName: string, parameters: VMScaleSetScaleOutInput, options?: VirtualMachineScaleSetsScaleOutOptionalParams) => PollerLike, void>; + setOrchestrationServiceState: (resourceGroupName: string, vmScaleSetName: string, parameters: OrchestrationServiceStateInput, options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams) => PollerLike, void>; + start: (resourceGroupName: string, vmScaleSetName: string, options?: VirtualMachineScaleSetsStartOptionalParams) => PollerLike, void>; + update: (resourceGroupName: string, vmScaleSetName: string, parameters: VirtualMachineScaleSetUpdate, options?: VirtualMachineScaleSetsUpdateOptionalParams) => PollerLike, VirtualMachineScaleSet>; + updateInstances: (resourceGroupName: string, vmScaleSetName: string, vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams) => PollerLike, void>; +} + +// @public +export interface VirtualMachineScaleSetsPerformMaintenanceOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } // @public -export interface VirtualMachineScaleSetsPowerOffHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsPowerOffOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsPowerOffOptionalParams extends OperationOptions { skipShutdown?: boolean; updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } // @public -export interface VirtualMachineScaleSetsReapplyHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsReapplyOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsReapplyOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetsRedeployHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsRedeployOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsRedeployOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } // @public -export interface VirtualMachineScaleSetsReimageAllHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsReimageAllOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsReimageAllOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } // @public -export interface VirtualMachineScaleSetsReimageHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsReimageOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsReimageOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmScaleSetReimageInput?: VirtualMachineScaleSetReimageParameters; } // @public -export interface VirtualMachineScaleSetsRestartHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsRestartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsRestartOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } // @public -export interface VirtualMachineScaleSetsScaleOutHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsScaleOutOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsScaleOutOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetsSetOrchestrationServiceStateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetsStartHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsStartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsStartOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; } @@ -8914,41 +7357,26 @@ export interface VirtualMachineScaleSetStorageProfile { } // @public -export interface VirtualMachineScaleSetsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsUpdateInstancesHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetsUpdateInstancesOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetsUpdateInstancesOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetsUpdateOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetsUpdateOptionalParams extends OperationOptions { ifMatch?: string; ifNoneMatch?: string; - resumeFrom?: string; updateIntervalInMs?: number; } -// @public -export type VirtualMachineScaleSetsUpdateResponse = VirtualMachineScaleSetsUpdateHeaders & VirtualMachineScaleSet; - // @public export interface VirtualMachineScaleSetUpdate extends UpdateResource { additionalCapabilities?: AdditionalCapabilities; automaticRepairsPolicy?: AutomaticRepairsPolicy; doNotRunExtensionsOnOverprovisionedVMs?: boolean; identity?: VirtualMachineScaleSetIdentity; + lifecycleHooksProfile?: LifecycleHooksProfile; overprovision?: boolean; + placement?: Placement; plan?: Plan; priorityMixPolicy?: PriorityMixPolicy; proximityPlacementGroup?: SubResource; @@ -8977,6 +7405,18 @@ export interface VirtualMachineScaleSetUpdateIPConfiguration { subnet?: ApiEntityReference; } +// @public +export interface VirtualMachineScaleSetUpdateIPConfigurationProperties { + applicationGatewayBackendAddressPools?: SubResource[]; + applicationSecurityGroups?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; + primary?: boolean; + privateIPAddressVersion?: IPVersion; + publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; + subnet?: ApiEntityReference; +} + // @public export interface VirtualMachineScaleSetUpdateNetworkConfiguration { auxiliaryMode?: NetworkInterfaceAuxiliaryMode; @@ -8991,9 +7431,22 @@ export interface VirtualMachineScaleSetUpdateNetworkConfiguration { name?: string; networkSecurityGroup?: SubResource; primary?: boolean; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; +} + +// @public +export interface VirtualMachineScaleSetUpdateNetworkConfigurationProperties { + auxiliaryMode?: NetworkInterfaceAuxiliaryMode; + auxiliarySku?: NetworkInterfaceAuxiliarySku; + deleteOption?: DeleteOptions; + disableTcpStateTracking?: boolean; + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + enableAcceleratedNetworking?: boolean; + enableFpga?: boolean; + enableIPForwarding?: boolean; + ipConfigurations?: VirtualMachineScaleSetUpdateIPConfiguration[]; + networkSecurityGroup?: SubResource; + primary?: boolean; } // @public @@ -9011,6 +7464,7 @@ export interface VirtualMachineScaleSetUpdateOSDisk { diskSizeGB?: number; image?: VirtualHardDisk; managedDisk?: VirtualMachineScaleSetManagedDiskParameters; + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; vhdContainers?: string[]; writeAcceleratorEnabled?: boolean; } @@ -9023,6 +7477,25 @@ export interface VirtualMachineScaleSetUpdateOSProfile { windowsConfiguration?: WindowsConfiguration; } +// @public +export interface VirtualMachineScaleSetUpdateProperties { + additionalCapabilities?: AdditionalCapabilities; + automaticRepairsPolicy?: AutomaticRepairsPolicy; + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + lifecycleHooksProfile?: LifecycleHooksProfile; + overprovision?: boolean; + priorityMixPolicy?: PriorityMixPolicy; + proximityPlacementGroup?: SubResource; + resiliencyPolicy?: ResiliencyPolicy; + scaleInPolicy?: ScaleInPolicy; + singlePlacementGroup?: boolean; + skuProfile?: SkuProfile; + spotRestorePolicy?: SpotRestorePolicy; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetUpdateVMProfile; + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; +} + // @public export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { deleteOption?: DeleteOptions; @@ -9030,9 +7503,15 @@ export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { idleTimeoutInMinutes?: number; name?: string; publicIPPrefix?: SubResource; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; +} + +// @public +export interface VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties { + deleteOption?: DeleteOptions; + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + idleTimeoutInMinutes?: number; + publicIPPrefix?: SubResource; } // @public @@ -9085,6 +7564,7 @@ export interface VirtualMachineScaleSetVM extends TrackedResource { storageProfile?: StorageProfile; readonly timeCreated?: Date; userData?: string; + readonly virtualMachineResourceId?: string; readonly vmId?: string; readonly zones?: string[]; } @@ -9110,86 +7590,62 @@ export interface VirtualMachineScaleSetVMExtension extends SubResourceReadOnly { } // @public -export interface VirtualMachineScaleSetVMExtensions { - beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtension, options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams): Promise, VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtension, options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams): Promise, VirtualMachineScaleSetVMExtensionsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams): Promise; - get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, options?: VirtualMachineScaleSetVMExtensionsGetOptionalParams): Promise; - list(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMExtensionsListOptionalParams): Promise; -} - -// @public -export interface VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse = VirtualMachineScaleSetVMExtension; - -// @public -export interface VirtualMachineScaleSetVMExtensionsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMExtensionsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMExtensionsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMExtensionsGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMExtensionsGetOptionalParams extends OperationOptions { expand?: string; } // @public -export type VirtualMachineScaleSetVMExtensionsGetResponse = VirtualMachineScaleSetVMExtension; - -// @public -export interface VirtualMachineScaleSetVMExtensionsListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMExtensionsListOptionalParams extends OperationOptions { expand?: string; } -// @public -export type VirtualMachineScaleSetVMExtensionsListResponse = VirtualMachineScaleSetVMExtensionsListResult; - // @public export interface VirtualMachineScaleSetVMExtensionsListResult { value?: VirtualMachineScaleSetVMExtension[]; } // @public -export interface VirtualMachineScaleSetVMExtensionsSummary { - readonly name?: string; - readonly statusesSummary?: VirtualMachineStatusCodeCount[]; +export interface VirtualMachineScaleSetVMExtensionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtension, options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams) => Promise, VirtualMachineScaleSetVMExtension>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtension, options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams) => Promise, VirtualMachineScaleSetVMExtension>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtension, options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineScaleSetVMExtension>; + delete: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, options?: VirtualMachineScaleSetVMExtensionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMExtensionsListOptionalParams) => Promise; + update: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, vmExtensionName: string, extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams) => PollerLike, VirtualMachineScaleSetVMExtension>; } // @public -export interface VirtualMachineScaleSetVMExtensionsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetVMExtensionsSummary { + readonly name?: string; + readonly statusesSummary?: VirtualMachineStatusCodeCount[]; } // @public -export interface VirtualMachineScaleSetVMExtensionsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMExtensionsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type VirtualMachineScaleSetVMExtensionsUpdateResponse = VirtualMachineScaleSetVMExtensionsUpdateHeaders & VirtualMachineScaleSetVMExtension; - // @public export interface VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { autoUpgradeMinorVersion?: boolean; @@ -9236,12 +7692,6 @@ export interface VirtualMachineScaleSetVMInstanceView { readonly vmHealth?: VirtualMachineHealthStatus; } -// @public -export interface VirtualMachineScaleSetVMListResult { - nextLink?: string; - value: VirtualMachineScaleSetVM[]; -} - // @public export interface VirtualMachineScaleSetVMNetworkProfileConfiguration { networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; @@ -9269,6 +7719,30 @@ export interface VirtualMachineScaleSetVMProfile { userData?: string; } +// @public +export interface VirtualMachineScaleSetVMProperties { + additionalCapabilities?: AdditionalCapabilities; + availabilitySet?: SubResource; + diagnosticsProfile?: DiagnosticsProfile; + hardwareProfile?: HardwareProfile; + readonly instanceView?: VirtualMachineScaleSetVMInstanceView; + readonly latestModelApplied?: boolean; + licenseType?: string; + readonly modelDefinitionApplied?: string; + networkProfile?: NetworkProfile; + networkProfileConfiguration?: VirtualMachineScaleSetVMNetworkProfileConfiguration; + osProfile?: OSProfile; + protectionPolicy?: VirtualMachineScaleSetVMProtectionPolicy; + readonly provisioningState?: string; + resilientVMDeletionStatus?: ResilientVMDeletionStatus; + securityProfile?: SecurityProfile; + storageProfile?: StorageProfile; + readonly timeCreated?: Date; + userData?: string; + readonly virtualMachineResourceId?: string; + readonly vmId?: string; +} + // @public export interface VirtualMachineScaleSetVMProtectionPolicy { protectFromScaleIn?: boolean; @@ -9281,438 +7755,268 @@ export interface VirtualMachineScaleSetVMReimageParameters extends VirtualMachin } // @public -export interface VirtualMachineScaleSetVMRunCommands { - beginCreateOrUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams): Promise, VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams): Promise, VirtualMachineScaleSetVMRunCommandsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams): Promise; - get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, options?: VirtualMachineScaleSetVMRunCommandsGetOptionalParams): Promise; - list(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse = VirtualMachineRunCommand; - -// @public -export interface VirtualMachineScaleSetVMRunCommandsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMRunCommandsGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMRunCommandsGetOptionalParams extends OperationOptions { expand?: string; } // @public -export type VirtualMachineScaleSetVMRunCommandsGetResponse = VirtualMachineRunCommand; - -// @public -export interface VirtualMachineScaleSetVMRunCommandsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetVMRunCommandsListNextResponse = VirtualMachineRunCommandsListResult; - -// @public -export interface VirtualMachineScaleSetVMRunCommandsListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMRunCommandsListOptionalParams extends OperationOptions { expand?: string; } // @public -export type VirtualMachineScaleSetVMRunCommandsListResponse = VirtualMachineRunCommandsListResult; - -// @public -export interface VirtualMachineScaleSetVMRunCommandsUpdateHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetVMRunCommandsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams) => Promise, VirtualMachineRunCommand>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams) => Promise, VirtualMachineRunCommand>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommand, options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams) => PollerLike, VirtualMachineRunCommand>; + delete: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, options?: VirtualMachineScaleSetVMRunCommandsGetOptionalParams) => Promise; + list: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, runCommandName: string, runCommand: VirtualMachineRunCommandUpdate, options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams) => PollerLike, VirtualMachineRunCommand>; } // @public -export interface VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetVMRunCommandsUpdateResponse = VirtualMachineScaleSetVMRunCommandsUpdateHeaders & VirtualMachineRunCommand; - -// @public -export interface VirtualMachineScaleSetVMs { - beginApproveRollingUpgrade(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams): Promise, VirtualMachineScaleSetVMsApproveRollingUpgradeResponse>>; - beginApproveRollingUpgradeAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams): Promise; - beginAttachDetachDataDisks(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams): Promise, VirtualMachineScaleSetVMsAttachDetachDataDisksResponse>>; - beginAttachDetachDataDisksAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams): Promise; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeallocateOptionalParams): Promise, void>>; - beginDeallocateAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeallocateOptionalParams): Promise; - beginDelete(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeleteOptionalParams): Promise; - beginPerformMaintenance(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams): Promise, void>>; - beginPerformMaintenanceAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams): Promise; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPowerOffOptionalParams): Promise, void>>; - beginPowerOffAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPowerOffOptionalParams): Promise; - beginRedeploy(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRedeployOptionalParams): Promise, void>>; - beginRedeployAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRedeployOptionalParams): Promise; - beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageOptionalParams): Promise, void>>; - beginReimageAll(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageAllOptionalParams): Promise, void>>; - beginReimageAllAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageAllOptionalParams): Promise; - beginReimageAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageOptionalParams): Promise; - beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRestartOptionalParams): Promise, void>>; - beginRestartAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRestartOptionalParams): Promise; - beginRunCommand(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: RunCommandInput, options?: VirtualMachineScaleSetVMsRunCommandOptionalParams): Promise, VirtualMachineScaleSetVMsRunCommandResponse>>; - beginRunCommandAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: RunCommandInput, options?: VirtualMachineScaleSetVMsRunCommandOptionalParams): Promise; - beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsStartOptionalParams): Promise, void>>; - beginStartAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsStartOptionalParams): Promise; - beginUpdate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: VirtualMachineScaleSetVM, options?: VirtualMachineScaleSetVMsUpdateOptionalParams): Promise, VirtualMachineScaleSetVMsUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: VirtualMachineScaleSetVM, options?: VirtualMachineScaleSetVMsUpdateOptionalParams): Promise; - get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsGetOptionalParams): Promise; - getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams): Promise; - list(resourceGroupName: string, virtualMachineScaleSetName: string, options?: VirtualMachineScaleSetVMsListOptionalParams): PagedAsyncIterableIterator; - retrieveBootDiagnosticsData(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams): Promise; - simulateEviction(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams): Promise; -} - -// @public -export interface VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetVMsApproveRollingUpgradeResponse = VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders; - -// @public -export interface VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetVMsAttachDetachDataDisksResponse = StorageProfile; - -// @public -export interface VirtualMachineScaleSetVMsDeallocateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsDeallocateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsDeallocateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMsDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsDeleteOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMsDeleteOptionalParams extends OperationOptions { forceDeletion?: boolean; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMsGetInstanceViewOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMsGetInstanceViewOptionalParams extends OperationOptions { } // @public -export type VirtualMachineScaleSetVMsGetInstanceViewResponse = VirtualMachineScaleSetVMInstanceView; - -// @public -export interface VirtualMachineScaleSetVMsGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMsGetOptionalParams extends OperationOptions { expand?: InstanceViewTypes; } // @public -export type VirtualMachineScaleSetVMsGetResponse = VirtualMachineScaleSetVM; - -// @public -export interface VirtualMachineScaleSetVMsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachineScaleSetVMsListNextResponse = VirtualMachineScaleSetVMListResult; - -// @public -export interface VirtualMachineScaleSetVMsListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMsListOptionalParams extends OperationOptions { expand?: string; filter?: string; select?: string; } // @public -export type VirtualMachineScaleSetVMsListResponse = VirtualMachineScaleSetVMListResult; - -// @public -export interface VirtualMachineScaleSetVMsPerformMaintenanceHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsPowerOffHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsPowerOffOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsOperations { + approveRollingUpgrade: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams) => PollerLike, void>; + attachDetachDataDisks: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams) => PollerLike, StorageProfile>; + // @deprecated (undocumented) + beginApproveRollingUpgrade: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginApproveRollingUpgradeAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams) => Promise; + // @deprecated (undocumented) + beginAttachDetachDataDisks: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams) => Promise, StorageProfile>>; + // @deprecated (undocumented) + beginAttachDetachDataDisksAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams) => Promise; + // @deprecated (undocumented) + beginDeallocate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeallocateOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeallocateAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeallocateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginPerformMaintenance: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginPerformMaintenanceAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams) => Promise; + // @deprecated (undocumented) + beginPowerOff: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPowerOffOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginPowerOffAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPowerOffOptionalParams) => Promise; + // @deprecated (undocumented) + beginRedeploy: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRedeployOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRedeployAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRedeployOptionalParams) => Promise; + // @deprecated (undocumented) + beginReimage: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginReimageAll: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageAllOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginReimageAllAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageAllOptionalParams) => Promise; + // @deprecated (undocumented) + beginReimageAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageOptionalParams) => Promise; + // @deprecated (undocumented) + beginRestart: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRestartOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRestartAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRestartOptionalParams) => Promise; + // @deprecated (undocumented) + beginRunCommand: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: RunCommandInput, options?: VirtualMachineScaleSetVMsRunCommandOptionalParams) => Promise, RunCommandResult>>; + // @deprecated (undocumented) + beginRunCommandAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: RunCommandInput, options?: VirtualMachineScaleSetVMsRunCommandOptionalParams) => Promise; + // @deprecated (undocumented) + beginStart: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsStartOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginStartAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsStartOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: VirtualMachineScaleSetVM, options?: VirtualMachineScaleSetVMsUpdateOptionalParams) => Promise, VirtualMachineScaleSetVM>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: VirtualMachineScaleSetVM, options?: VirtualMachineScaleSetVMsUpdateOptionalParams) => Promise; + deallocate: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeallocateOptionalParams) => PollerLike, void>; + delete: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsGetOptionalParams) => Promise; + getInstanceView: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams) => Promise; + list: (resourceGroupName: string, virtualMachineScaleSetName: string, options?: VirtualMachineScaleSetVMsListOptionalParams) => PagedAsyncIterableIterator; + performMaintenance: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams) => PollerLike, void>; + powerOff: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsPowerOffOptionalParams) => PollerLike, void>; + redeploy: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRedeployOptionalParams) => PollerLike, void>; + reimage: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageOptionalParams) => PollerLike, void>; + reimageAll: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsReimageAllOptionalParams) => PollerLike, void>; + restart: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRestartOptionalParams) => PollerLike, void>; + retrieveBootDiagnosticsData: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams) => Promise; + runCommand: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: RunCommandInput, options?: VirtualMachineScaleSetVMsRunCommandOptionalParams) => PollerLike, RunCommandResult>; + simulateEviction: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams) => Promise; + start: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, options?: VirtualMachineScaleSetVMsStartOptionalParams) => PollerLike, void>; + update: (resourceGroupName: string, vmScaleSetName: string, instanceId: string, parameters: VirtualMachineScaleSetVM, options?: VirtualMachineScaleSetVMsUpdateOptionalParams) => PollerLike, VirtualMachineScaleSetVM>; +} + +// @public +export interface VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachineScaleSetVMsPowerOffOptionalParams extends OperationOptions { skipShutdown?: boolean; updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMsRedeployHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsRedeployOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsRedeployOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMsReimageAllHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsReimageAllOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsReimageAllOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMsReimageHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsReimageOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsReimageOptionalParams extends OperationOptions { updateIntervalInMs?: number; vmScaleSetVMReimageInput?: VirtualMachineScaleSetVMReimageParameters; } // @public -export interface VirtualMachineScaleSetVMsRestartHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsRestartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsRestartOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams extends OperationOptions { sasUriExpirationTimeInMinutes?: number; } // @public -export type VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataResponse = RetrieveBootDiagnosticsDataResult; - -// @public -export interface VirtualMachineScaleSetVMsRunCommandHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsRunCommandOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsRunCommandOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetVMsRunCommandResponse = RunCommandResult; - -// @public -export interface VirtualMachineScaleSetVMsSimulateEvictionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface VirtualMachineScaleSetVMsStartHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachineScaleSetVMsSimulateEvictionOptionalParams extends OperationOptions { } // @public -export interface VirtualMachineScaleSetVMsStartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachineScaleSetVMsStartOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachineScaleSetVMsUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachineScaleSetVMsUpdateOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineScaleSetVMsUpdateOptionalParams extends OperationOptions { ifMatch?: string; ifNoneMatch?: string; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type VirtualMachineScaleSetVMsUpdateResponse = VirtualMachineScaleSetVM; - -// @public -export interface VirtualMachinesCaptureHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesCaptureOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesCaptureOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachinesCaptureResponse = VirtualMachineCaptureResult; - -// @public -export interface VirtualMachinesConvertToManagedDisksHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesConvertToManagedDisksOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesConvertToManagedDisksOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachinesCreateOrUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesCreateOrUpdateOptionalParams extends OperationOptions { ifMatch?: string; ifNoneMatch?: string; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type VirtualMachinesCreateOrUpdateResponse = VirtualMachine; - -// @public -export interface VirtualMachinesDeallocateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesDeallocateOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesDeallocateOptionalParams extends OperationOptions { + forceDeallocate?: boolean; hibernate?: boolean; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VirtualMachinesDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesDeleteOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesDeleteOptionalParams extends OperationOptions { forceDeletion?: boolean; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VirtualMachinesGeneralizeOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesGeneralizeOptionalParams extends OperationOptions { } // @public -export interface VirtualMachinesGetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesGetOptionalParams extends OperationOptions { expand?: InstanceViewTypes; } // @public -export type VirtualMachinesGetResponse = VirtualMachine; - -// @public -export interface VirtualMachinesInstallPatchesHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesInstallPatchesOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesInstallPatchesOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachinesInstallPatchesResponse = VirtualMachineInstallPatchesResult; - -// @public -export interface VirtualMachinesInstanceViewOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesInstanceViewOptionalParams extends OperationOptions { } -// @public -export type VirtualMachinesInstanceViewResponse = VirtualMachineInstanceView; - // @public export interface VirtualMachineSize { maxDataDiskCount?: number; @@ -9724,110 +8028,44 @@ export interface VirtualMachineSize { } // @public -export interface VirtualMachineSizeListResult { - nextLink?: string; - value?: VirtualMachineSize[]; -} - -// @public -export interface VirtualMachineSizes { - list(location: string, options?: VirtualMachineSizesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface VirtualMachineSizesListNextOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineSizesListOptionalParams extends OperationOptions { } // @public -export type VirtualMachineSizesListNextResponse = VirtualMachineSizeListResult; - -// @public -export interface VirtualMachineSizesListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachineSizesOperations { + list: (location: string, options?: VirtualMachineSizesListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type VirtualMachineSizesListResponse = VirtualMachineSizeListResult; - // @public export type VirtualMachineSizeTypes = string; // @public -export interface VirtualMachinesListAllNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachinesListAllNextResponse = VirtualMachineListResult; - -// @public -export interface VirtualMachinesListAllOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesListAllOptionalParams extends OperationOptions { expand?: ExpandTypesForListVMs; filter?: string; statusOnly?: string; } // @public -export type VirtualMachinesListAllResponse = VirtualMachineListResult; - -// @public -export interface VirtualMachinesListAvailableSizesNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachinesListAvailableSizesNextResponse = VirtualMachineSizeListResult; - -// @public -export interface VirtualMachinesListAvailableSizesOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachinesListAvailableSizesResponse = VirtualMachineSizeListResult; - -// @public -export interface VirtualMachinesListByLocationNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type VirtualMachinesListByLocationNextResponse = VirtualMachineListResult; - -// @public -export interface VirtualMachinesListByLocationOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesListAvailableSizesOptionalParams extends OperationOptions { } // @public -export type VirtualMachinesListByLocationResponse = VirtualMachineListResult; - -// @public -export interface VirtualMachinesListNextOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesListByLocationOptionalParams extends OperationOptions { } // @public -export type VirtualMachinesListNextResponse = VirtualMachineListResult; - -// @public -export interface VirtualMachinesListOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesListOptionalParams extends OperationOptions { expand?: ExpandTypeForListVMs; filter?: string; } // @public -export type VirtualMachinesListResponse = VirtualMachineListResult; - -// @public -export interface VirtualMachinesMigrateToVMScaleSetHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesMigrateToVMScaleSetOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesMigrateToVMScaleSetOptionalParams extends OperationOptions { parameters?: MigrateVMToVirtualMachineScaleSetInput; - resumeFrom?: string; updateIntervalInMs?: number; } -// @public -export type VirtualMachinesMigrateToVMScaleSetResponse = VirtualMachinesMigrateToVMScaleSetHeaders; - // @public export interface VirtualMachineSoftwarePatchProperties { readonly activityId?: string; @@ -9843,115 +8081,156 @@ export interface VirtualMachineSoftwarePatchProperties { } // @public -export interface VirtualMachinesPerformMaintenanceHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesPerformMaintenanceOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface VirtualMachinesPowerOffHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesPowerOffOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesOperations { + assessPatches: (resourceGroupName: string, vmName: string, options?: VirtualMachinesAssessPatchesOptionalParams) => PollerLike, VirtualMachineAssessPatchesResult>; + attachDetachDataDisks: (resourceGroupName: string, vmName: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachinesAttachDetachDataDisksOptionalParams) => PollerLike, StorageProfile>; + // @deprecated (undocumented) + beginAssessPatches: (resourceGroupName: string, vmName: string, options?: VirtualMachinesAssessPatchesOptionalParams) => Promise, VirtualMachineAssessPatchesResult>>; + // @deprecated (undocumented) + beginAssessPatchesAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesAssessPatchesOptionalParams) => Promise; + // @deprecated (undocumented) + beginAttachDetachDataDisks: (resourceGroupName: string, vmName: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachinesAttachDetachDataDisksOptionalParams) => Promise, StorageProfile>>; + // @deprecated (undocumented) + beginAttachDetachDataDisksAndWait: (resourceGroupName: string, vmName: string, parameters: AttachDetachDataDisksRequest, options?: VirtualMachinesAttachDetachDataDisksOptionalParams) => Promise; + // @deprecated (undocumented) + beginCapture: (resourceGroupName: string, vmName: string, parameters: VirtualMachineCaptureParameters, options?: VirtualMachinesCaptureOptionalParams) => Promise, VirtualMachineCaptureResult>>; + // @deprecated (undocumented) + beginCaptureAndWait: (resourceGroupName: string, vmName: string, parameters: VirtualMachineCaptureParameters, options?: VirtualMachinesCaptureOptionalParams) => Promise; + // @deprecated (undocumented) + beginConvertToManagedDisks: (resourceGroupName: string, vmName: string, options?: VirtualMachinesConvertToManagedDisksOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginConvertToManagedDisksAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesConvertToManagedDisksOptionalParams) => Promise; + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, vmName: string, parameters: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams) => Promise, VirtualMachine>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, vmName: string, parameters: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDeallocate: (resourceGroupName: string, vmName: string, options?: VirtualMachinesDeallocateOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeallocateAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesDeallocateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, vmName: string, options?: VirtualMachinesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginInstallPatches: (resourceGroupName: string, vmName: string, installPatchesInput: VirtualMachineInstallPatchesParameters, options?: VirtualMachinesInstallPatchesOptionalParams) => Promise, VirtualMachineInstallPatchesResult>>; + // @deprecated (undocumented) + beginInstallPatchesAndWait: (resourceGroupName: string, vmName: string, installPatchesInput: VirtualMachineInstallPatchesParameters, options?: VirtualMachinesInstallPatchesOptionalParams) => Promise; + // @deprecated (undocumented) + beginMigrateToVMScaleSet: (resourceGroupName: string, vmName: string, options?: VirtualMachinesMigrateToVMScaleSetOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginMigrateToVMScaleSetAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesMigrateToVMScaleSetOptionalParams) => Promise; + // @deprecated (undocumented) + beginPerformMaintenance: (resourceGroupName: string, vmName: string, options?: VirtualMachinesPerformMaintenanceOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginPerformMaintenanceAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesPerformMaintenanceOptionalParams) => Promise; + // @deprecated (undocumented) + beginPowerOff: (resourceGroupName: string, vmName: string, options?: VirtualMachinesPowerOffOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginPowerOffAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesPowerOffOptionalParams) => Promise; + // @deprecated (undocumented) + beginReapply: (resourceGroupName: string, vmName: string, options?: VirtualMachinesReapplyOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginReapplyAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesReapplyOptionalParams) => Promise; + // @deprecated (undocumented) + beginRedeploy: (resourceGroupName: string, vmName: string, options?: VirtualMachinesRedeployOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRedeployAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesRedeployOptionalParams) => Promise; + // @deprecated (undocumented) + beginReimage: (resourceGroupName: string, vmName: string, options?: VirtualMachinesReimageOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginReimageAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesReimageOptionalParams) => Promise; + // @deprecated (undocumented) + beginRestart: (resourceGroupName: string, vmName: string, options?: VirtualMachinesRestartOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRestartAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesRestartOptionalParams) => Promise; + // @deprecated (undocumented) + beginRunCommand: (resourceGroupName: string, vmName: string, parameters: RunCommandInput, options?: VirtualMachinesRunCommandOptionalParams) => Promise, RunCommandResult>>; + // @deprecated (undocumented) + beginRunCommandAndWait: (resourceGroupName: string, vmName: string, parameters: RunCommandInput, options?: VirtualMachinesRunCommandOptionalParams) => Promise; + // @deprecated (undocumented) + beginStart: (resourceGroupName: string, vmName: string, options?: VirtualMachinesStartOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginStartAndWait: (resourceGroupName: string, vmName: string, options?: VirtualMachinesStartOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdate: (resourceGroupName: string, vmName: string, parameters: VirtualMachineUpdate, options?: VirtualMachinesUpdateOptionalParams) => Promise, VirtualMachine>>; + // @deprecated (undocumented) + beginUpdateAndWait: (resourceGroupName: string, vmName: string, parameters: VirtualMachineUpdate, options?: VirtualMachinesUpdateOptionalParams) => Promise; + capture: (resourceGroupName: string, vmName: string, parameters: VirtualMachineCaptureParameters, options?: VirtualMachinesCaptureOptionalParams) => PollerLike, VirtualMachineCaptureResult>; + convertToManagedDisks: (resourceGroupName: string, vmName: string, options?: VirtualMachinesConvertToManagedDisksOptionalParams) => PollerLike, void>; + createOrUpdate: (resourceGroupName: string, vmName: string, parameters: VirtualMachine, options?: VirtualMachinesCreateOrUpdateOptionalParams) => PollerLike, VirtualMachine>; + deallocate: (resourceGroupName: string, vmName: string, options?: VirtualMachinesDeallocateOptionalParams) => PollerLike, void>; + delete: (resourceGroupName: string, vmName: string, options?: VirtualMachinesDeleteOptionalParams) => PollerLike, void>; + generalize: (resourceGroupName: string, vmName: string, options?: VirtualMachinesGeneralizeOptionalParams) => Promise; + get: (resourceGroupName: string, vmName: string, options?: VirtualMachinesGetOptionalParams) => Promise; + installPatches: (resourceGroupName: string, vmName: string, installPatchesInput: VirtualMachineInstallPatchesParameters, options?: VirtualMachinesInstallPatchesOptionalParams) => PollerLike, VirtualMachineInstallPatchesResult>; + instanceView: (resourceGroupName: string, vmName: string, options?: VirtualMachinesInstanceViewOptionalParams) => Promise; + list: (resourceGroupName: string, options?: VirtualMachinesListOptionalParams) => PagedAsyncIterableIterator; + listAll: (options?: VirtualMachinesListAllOptionalParams) => PagedAsyncIterableIterator; + listAvailableSizes: (resourceGroupName: string, vmName: string, options?: VirtualMachinesListAvailableSizesOptionalParams) => PagedAsyncIterableIterator; + listByLocation: (location: string, options?: VirtualMachinesListByLocationOptionalParams) => PagedAsyncIterableIterator; + migrateToVMScaleSet: (resourceGroupName: string, vmName: string, options?: VirtualMachinesMigrateToVMScaleSetOptionalParams) => PollerLike, void>; + performMaintenance: (resourceGroupName: string, vmName: string, options?: VirtualMachinesPerformMaintenanceOptionalParams) => PollerLike, void>; + powerOff: (resourceGroupName: string, vmName: string, options?: VirtualMachinesPowerOffOptionalParams) => PollerLike, void>; + reapply: (resourceGroupName: string, vmName: string, options?: VirtualMachinesReapplyOptionalParams) => PollerLike, void>; + redeploy: (resourceGroupName: string, vmName: string, options?: VirtualMachinesRedeployOptionalParams) => PollerLike, void>; + reimage: (resourceGroupName: string, vmName: string, options?: VirtualMachinesReimageOptionalParams) => PollerLike, void>; + restart: (resourceGroupName: string, vmName: string, options?: VirtualMachinesRestartOptionalParams) => PollerLike, void>; + retrieveBootDiagnosticsData: (resourceGroupName: string, vmName: string, options?: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams) => Promise; + runCommand: (resourceGroupName: string, vmName: string, parameters: RunCommandInput, options?: VirtualMachinesRunCommandOptionalParams) => PollerLike, RunCommandResult>; + simulateEviction: (resourceGroupName: string, vmName: string, options?: VirtualMachinesSimulateEvictionOptionalParams) => Promise; + start: (resourceGroupName: string, vmName: string, options?: VirtualMachinesStartOptionalParams) => PollerLike, void>; + update: (resourceGroupName: string, vmName: string, parameters: VirtualMachineUpdate, options?: VirtualMachinesUpdateOptionalParams) => PollerLike, VirtualMachine>; +} + +// @public +export interface VirtualMachinesPerformMaintenanceOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface VirtualMachinesPowerOffOptionalParams extends OperationOptions { skipShutdown?: boolean; updateIntervalInMs?: number; } // @public -export interface VirtualMachinesReapplyHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesReapplyOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesReapplyOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachinesRedeployHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesRedeployOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesRedeployOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachinesReimageHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesReimageOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesReimageOptionalParams extends OperationOptions { parameters?: VirtualMachineReimageParameters; - resumeFrom?: string; updateIntervalInMs?: number; } // @public -export interface VirtualMachinesRestartHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesRestartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesRestartOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams extends OperationOptions { sasUriExpirationTimeInMinutes?: number; } // @public -export type VirtualMachinesRetrieveBootDiagnosticsDataResponse = RetrieveBootDiagnosticsDataResult; - -// @public -export interface VirtualMachinesRunCommandHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesRunCommandOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesRunCommandOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type VirtualMachinesRunCommandResponse = RunCommandResult; - -// @public -export interface VirtualMachinesSimulateEvictionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface VirtualMachinesStartHeaders { - location?: string; - retryAfter?: number; +export interface VirtualMachinesSimulateEvictionOptionalParams extends OperationOptions { } // @public -export interface VirtualMachinesStartOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface VirtualMachinesStartOptionalParams extends OperationOptions { updateIntervalInMs?: number; } @@ -9962,22 +8241,12 @@ export interface VirtualMachineStatusCodeCount { } // @public -export interface VirtualMachinesUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface VirtualMachinesUpdateOptionalParams extends coreClient.OperationOptions { +export interface VirtualMachinesUpdateOptionalParams extends OperationOptions { ifMatch?: string; ifNoneMatch?: string; - resumeFrom?: string; updateIntervalInMs?: number; } -// @public -export type VirtualMachinesUpdateResponse = VirtualMachinesUpdateHeaders & VirtualMachine; - // @public export interface VirtualMachineUpdate extends UpdateResource { additionalCapabilities?: AdditionalCapabilities; @@ -10001,6 +8270,7 @@ export interface VirtualMachineUpdate extends UpdateResource { priority?: VirtualMachinePriorityTypes; readonly provisioningState?: string; proximityPlacementGroup?: SubResource; + resiliencyProfile?: ResiliencyProfile; scheduledEventsPolicy?: ScheduledEventsPolicy; scheduledEventsProfile?: ScheduledEventsProfile; securityProfile?: SecurityProfile; @@ -10052,11 +8322,57 @@ export interface VmImagesInEdgeZoneListResult { value?: VirtualMachineImageResource[]; } -// @public (undocumented) +// @public export interface VMScaleSetConvertToSinglePlacementGroupInput { activePlacementGroupId?: string; } +// @public +export interface VMScaleSetLifecycleHookEvent extends ProxyResource { + properties?: VMScaleSetLifecycleHookEventProperties; +} + +// @public +export interface VMScaleSetLifecycleHookEventAdditionalContext { + priority?: string; +} + +// @public +export interface VMScaleSetLifecycleHookEventProperties { + additionalContext?: VMScaleSetLifecycleHookEventAdditionalContext; + readonly defaultAction?: LifecycleHookAction; + readonly maxWaitUntil?: string; + readonly state?: VMScaleSetLifecycleHookEventState; + targetResources?: VMScaleSetLifecycleHookEventTargetResource[]; + readonly timeCreated?: string; + type?: VMScaleSetLifecycleHookEventType; + waitUntil?: string; +} + +// @public +export type VMScaleSetLifecycleHookEventState = string; + +// @public +export interface VMScaleSetLifecycleHookEventTargetResource { + actionState?: LifecycleHookActionState; + resource?: ApiEntityReference; +} + +// @public +export type VMScaleSetLifecycleHookEventType = string; + +// @public +export interface VMScaleSetLifecycleHookEventUpdate { + additionalContext?: VMScaleSetLifecycleHookEventAdditionalContext; + readonly defaultAction?: LifecycleHookAction; + readonly maxWaitUntil?: string; + readonly state?: VMScaleSetLifecycleHookEventState; + targetResources?: VMScaleSetLifecycleHookEventTargetResource[]; + readonly timeCreated?: string; + type?: VMScaleSetLifecycleHookEventType; + waitUntil?: string; +} + // @public export interface VMScaleSetScaleOutInput { capacity: number; @@ -10131,6 +8447,11 @@ export interface ZoneAllocationPolicy { maxZoneCount?: number; } +// @public +export interface ZoneMovement { + isEnabled?: boolean; +} + // @public export type ZonePlacementPolicyType = string; diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts index e5f83c32a932..e6359719685c 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts @@ -3,28 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Cancel the migration operation on an Availability Set. + * This sample demonstrates how to cancel the migration operation on an Availability Set. * - * @summary Cancel the migration operation on an Availability Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json + * @summary cancel the migration operation on an Availability Set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json */ async function availabilitySetCancelMigrationToVirtualMachineScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.cancelMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - ); - console.log(result); + await client.availabilitySets.cancelMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsConvertToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsConvertToVirtualMachineScaleSetSample.ts index 049bd23835ee..5ecaaf697dd5 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsConvertToVirtualMachineScaleSetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsConvertToVirtualMachineScaleSetSample.ts @@ -1,41 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ConvertToVirtualMachineScaleSetInput, - AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. + * This sample demonstrates how to create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. * - * @summary Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json + * @summary create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json */ async function availabilitySetConvertToVirtualMachineScaleSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: ConvertToVirtualMachineScaleSetInput = { - virtualMachineScaleSetName: "{vmss-name}", - }; - const options: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams = - { parameters }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.beginConvertToVirtualMachineScaleSetAndWait( - resourceGroupName, - availabilitySetName, - options, - ); - console.log(result); + await client.availabilitySets.convertToVirtualMachineScaleSet("rgcompute", "myAvailabilitySet", { + parameters: { virtualMachineScaleSetName: "{vmss-name}" }, + }); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsCreateOrUpdateSample.ts index 3b8ea81e8d56..7e3c2b6de4ce 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsCreateOrUpdateSample.ts @@ -1,68 +1,48 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { AvailabilitySet} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update an availability set. + * This sample demonstrates how to create or update an availability set. * - * @summary Create or update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json + * @summary create or update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create.json */ -async function createAnAvailabilitySetWithScheduledEventPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: AvailabilitySet = { - location: "westus", - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - }; +async function createAnAvailabilitySet(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.availabilitySets.createOrUpdate( - resourceGroupName, - availabilitySetName, - parameters, + "myResourceGroup", + "myAvailabilitySet", + { location: "westus", platformFaultDomainCount: 2, platformUpdateDomainCount: 20 }, ); console.log(result); } /** - * This sample demonstrates how to Create or update an availability set. + * This sample demonstrates how to create or update an availability set. * - * @summary Create or update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create.json + * @summary create or update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json */ -async function createAnAvailabilitySet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: AvailabilitySet = { - location: "westus", - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - }; +async function createAnAvailabilitySetWithScheduledEventPolicy(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.availabilitySets.createOrUpdate( - resourceGroupName, - availabilitySetName, - parameters, + "myResourceGroup", + "myAvailabilitySet", + { location: "westus", platformFaultDomainCount: 2, platformUpdateDomainCount: 20 }, ); console.log(result); } async function main(): Promise { - await createAnAvailabilitySetWithScheduledEventPolicy(); await createAnAvailabilitySet(); + await createAnAvailabilitySetWithScheduledEventPolicy(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsDeleteSample.ts index 01ea82836020..dd4ca2aedf2c 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsDeleteSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete an availability set. + * This sample demonstrates how to delete an availability set. * - * @summary Delete an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json + * @summary delete an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json */ async function availabilitySetDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.delete( - resourceGroupName, - availabilitySetName, - ); - console.log(result); + await client.availabilitySets.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); } /** - * This sample demonstrates how to Delete an availability set. + * This sample demonstrates how to delete an availability set. * - * @summary Delete an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json + * @summary delete an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json */ async function availabilitySetDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.delete( - resourceGroupName, - availabilitySetName, - ); - console.log(result); + await client.availabilitySets.delete("rgcompute", "aaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsGetSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsGetSample.ts index 1404f5116783..c6473d383405 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsGetSample.ts @@ -3,47 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about an availability set. + * This sample demonstrates how to retrieves information about an availability set. * - * @summary Retrieves information about an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + * @summary retrieves information about an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json */ async function availabilitySetGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetName, - ); + const result = await client.availabilitySets.get("rgcompute", "aaaaaaaaaaaa"); console.log(result); } /** - * This sample demonstrates how to Retrieves information about an availability set. + * This sample demonstrates how to retrieves information about an availability set. * - * @summary Retrieves information about an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + * @summary retrieves information about an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json */ async function availabilitySetGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetName, - ); + const result = await client.availabilitySets.get("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsListAvailableSizesSample.ts index 6947686cf2b8..ed8a1e27336e 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsListAvailableSizesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsListAvailableSizesSample.ts @@ -3,53 +3,43 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * This sample demonstrates how to lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. * - * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json + * @summary lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json */ async function availabilitySetListAvailableSizesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.availabilitySets.listAvailableSizes( - resourceGroupName, - availabilitySetName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * This sample demonstrates how to lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. * - * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json + * @summary lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json */ async function availabilitySetListAvailableSizesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.availabilitySets.listAvailableSizes( - resourceGroupName, - availabilitySetName, - )) { + for await (const item of client.availabilitySets.listAvailableSizes("rgcompute", "aa")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsListBySubscriptionSample.ts index 2b511063e7cc..412777308976 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsListBySubscriptionSample.ts @@ -1,33 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - AvailabilitySetsListBySubscriptionOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all availability sets in a subscription. + * This sample demonstrates how to lists all availability sets in a subscription. * - * @summary Lists all availability sets in a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json + * @summary lists all availability sets in a subscription. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListBySubscription.json */ async function listAvailabilitySetsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const expand = "virtualMachines\\$ref"; - const options: AvailabilitySetsListBySubscriptionOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.availabilitySets.listBySubscription( - options, - )) { + for await (const item of client.availabilitySets.listBySubscription({ + expand: "virtualMachines\\$ref", + })) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsListSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsListSample.ts index dc42b0b89f8e..d274bda01735 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsListSample.ts @@ -3,45 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all availability sets in a resource group. + * This sample demonstrates how to lists all availability sets in a resource group. * - * @summary Lists all availability sets in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json + * @summary lists all availability sets in a resource group. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json */ async function availabilitySetListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.availabilitySets.list(resourceGroupName)) { + for await (const item of client.availabilitySets.list("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all availability sets in a resource group. + * This sample demonstrates how to lists all availability sets in a resource group. * - * @summary Lists all availability sets in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json + * @summary lists all availability sets in a resource group. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json */ async function availabilitySetListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.availabilitySets.list(resourceGroupName)) { + for await (const item of client.availabilitySets.list("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts index f1b2cac41bf2..650c6e7e09d1 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts @@ -1,40 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - MigrateToVirtualMachineScaleSetInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. + * This sample demonstrates how to start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. * - * @summary Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json + * @summary start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json */ async function availabilitySetStartMigrationToVirtualMachineScaleSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: MigrateToVirtualMachineScaleSetInput = { - virtualMachineScaleSetFlexible: { - id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.startMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); + await client.availabilitySets.startMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + { + virtualMachineScaleSetFlexible: { + id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", + }, + }, + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsUpdateSample.ts index d1b38fe81f96..f3d5f1824835 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsUpdateSample.ts @@ -1,70 +1,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - AvailabilitySetUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update an availability set. + * This sample demonstrates how to update an availability set. * - * @summary Update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json + * @summary update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json */ async function availabilitySetUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaa"; - const parameters: AvailabilitySetUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update("rgcompute", "aaaaaaaaaaaaaaaaaaa", { platformFaultDomainCount: 2, platformUpdateDomainCount: 20, - proximityPlacementGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, - tags: { key2574: "aaaaaaaa" }, virtualMachines: [ { id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", }, ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.update( - resourceGroupName, - availabilitySetName, - parameters, - ); + proximityPlacementGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + sku: { name: "DSv3-Type1", tier: "aaa", capacity: 7 }, + tags: { key2574: "aaaaaaaa" }, + }); console.log(result); } /** - * This sample demonstrates how to Update an availability set. + * This sample demonstrates how to update an availability set. * - * @summary Update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json + * @summary update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json */ async function availabilitySetUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: AvailabilitySetUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.update( - resourceGroupName, - availabilitySetName, - parameters, - ); + const result = await client.availabilitySets.update("rgcompute", "aaaaaaaaaaaaaaaaaaaa", {}); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples-dev/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts index d685ac2e7c4d..2df666994f93 100644 --- a/sdk/compute/arm-compute/samples-dev/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts @@ -1,40 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - MigrateToVirtualMachineScaleSetInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. + * This sample demonstrates how to validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. * - * @summary Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json + * @summary validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json */ async function availabilitySetValidateMigrationToVirtualMachineScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: MigrateToVirtualMachineScaleSetInput = { - virtualMachineScaleSetFlexible: { - id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.validateMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); + await client.availabilitySets.validateMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + { + virtualMachineScaleSetFlexible: { + id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", + }, + }, + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsCreateOrUpdateSample.ts index f52fa73aa4c8..44277ea253ff 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsCreateOrUpdateSample.ts @@ -1,105 +1,85 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationGroup} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json */ async function createOrUpdateABlockCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const parameters: CapacityReservationGroup = { - location: "westus", - reservationType: "Block", - tags: { department: "finance" }, - zones: ["1", "2"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, + "myResourceGroup", + "blockCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + reservationType: "Block", + }, ); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json */ async function createOrUpdateACapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const parameters: CapacityReservationGroup = { - location: "westus", - sharingProfile: { - subscriptionIds: [ - { id: "/subscriptions/{subscription-id1}" }, - { id: "/subscriptions/{subscription-id2}" }, - ], - }, - tags: { department: "finance" }, - zones: ["1", "2"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, + "myResourceGroup", + "myCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + sharingProfile: { + subscriptionIds: [ + { id: "/subscriptions/{subscription-id1}" }, + { id: "/subscriptions/{subscription-id2}" }, + ], + }, + }, ); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservationGroup_CreateOrUpdate.json + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservationGroup_CreateOrUpdate.json */ async function createOrUpdateATargetedCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const parameters: CapacityReservationGroup = { - location: "westus", - reservationType: "Targeted", - sharingProfile: { - subscriptionIds: [ - { id: "/subscriptions/{subscription-id1}" }, - { id: "/subscriptions/{subscription-id2}" }, - ], - }, - tags: { department: "finance" }, - zones: ["1", "2"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, + "myResourceGroup", + "targetedCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + sharingProfile: { + subscriptionIds: [ + { id: "/subscriptions/{subscription-id1}" }, + { id: "/subscriptions/{subscription-id2}" }, + ], + }, + reservationType: "Targeted", + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsDeleteSample.ts index 75403d223e20..ed5d07ffccea 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsDeleteSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json + * @summary the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json */ async function capacityReservationGroupDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "a"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.delete( - resourceGroupName, - capacityReservationGroupName, - ); - console.log(result); + await client.capacityReservationGroups.delete("rgcompute", "a"); } /** - * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json + * @summary the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json */ async function capacityReservationGroupDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.delete( - resourceGroupName, - capacityReservationGroupName, - ); - console.log(result); + await client.capacityReservationGroups.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsGetSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsGetSample.ts index aa3ed9c8e957..4c5610fea708 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsGetSample.ts @@ -1,82 +1,59 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationGroupsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_Get.json + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_Get.json */ async function getABlockCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const expand = "instanceView"; - const options: CapacityReservationGroupsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, + "myResourceGroup", + "blockCapacityReservationGroup", + { expand: "instanceView" }, ); console.log(result); } /** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Get.json */ async function getACapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const expand = "instanceView"; - const options: CapacityReservationGroupsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, + "myResourceGroup", + "myCapacityReservationGroup", + { expand: "instanceView" }, ); console.log(result); } /** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservationGroup_Get.json + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservationGroup_Get.json */ async function getATargetedCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const expand = "instanceView"; - const options: CapacityReservationGroupsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, + "myResourceGroup", + "targetedCapacityReservationGroup", + { expand: "instanceView" }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListByResourceGroupSample.ts index d841978eee8f..daa2b9cb66d2 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListByResourceGroupSample.ts @@ -1,38 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationGroupsListByResourceGroupOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json + * @summary lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json */ async function listCapacityReservationGroupsInResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const expand = "virtualMachines/$ref"; - const options: CapacityReservationGroupsListByResourceGroupOptionalParams = { - expand, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listByResourceGroup( - resourceGroupName, - options, - )) { + for await (const item of client.capacityReservationGroups.listByResourceGroup("myResourceGroup", { + expand: "virtualMachines/$ref", + })) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListBySubscriptionSample.ts index f962373e680d..d285be3b9159 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsListBySubscriptionSample.ts @@ -1,59 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationGroupsListBySubscriptionOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json + * @summary lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json */ async function listCapacityReservationGroupsInSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const expand = "virtualMachines/$ref"; - const options: CapacityReservationGroupsListBySubscriptionOptionalParams = { - expand, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listBySubscription( - options, - )) { + for await (const item of client.capacityReservationGroups.listBySubscription({ + expand: "virtualMachines/$ref", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json + * @summary lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json */ async function listCapacityReservationGroupsWithResourceIdsOnlyInSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceIdsOnly = "All"; - const options: CapacityReservationGroupsListBySubscriptionOptionalParams = { - resourceIdsOnly, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listBySubscription( - options, - )) { + for await (const item of client.capacityReservationGroups.listBySubscription({ + resourceIdsOnly: "All", + })) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsUpdateSample.ts index c7f7779430c6..306052f2bec6 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationGroupsUpdateSample.ts @@ -1,59 +1,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationGroupUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * This sample demonstrates how to the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. * - * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json + * @summary the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json */ async function capacityReservationGroupUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; - const parameters: CapacityReservationGroupUpdate = { - instanceView: {}, - tags: { key5355: "aaa" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.update( - resourceGroupName, - capacityReservationGroupName, - parameters, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + { tags: { key5355: "aaa" } }, ); console.log(result); } /** - * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * This sample demonstrates how to the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. * - * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json + * @summary the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json */ async function capacityReservationGroupUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; - const parameters: CapacityReservationGroupUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservationGroups.update( - resourceGroupName, - capacityReservationGroupName, - parameters, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + {}, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsCreateOrUpdateSample.ts index 1a298b25c165..8fae63edb0eb 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsCreateOrUpdateSample.ts @@ -1,101 +1,78 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservation} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json */ async function createOrUpdateABlockCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const capacityReservationName = "blockCapacityReservation"; - const parameters: CapacityReservation = { - location: "westus", - scheduleProfile: { end: "2025-08-02", start: "2025-08-01" }, - sku: { name: "Standard_ND96isr_H100_v5", capacity: 1 }, - tags: { department: "HR" }, - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "blockCapacityReservationGroup", + "blockCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_ND96isr_H100_v5", capacity: 1 }, + scheduleProfile: { start: "2025-08-01", end: "2025-08-02" }, + zones: ["1"], + }, ); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json */ async function createOrUpdateACapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const capacityReservationName = "myCapacityReservation"; - const parameters: CapacityReservation = { - location: "westus", - sku: { name: "Standard_DS1_v2", capacity: 4 }, - tags: { department: "HR" }, - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_DS1_v2", capacity: 4 }, + zones: ["1"], + }, ); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_CreateOrUpdate.json + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_CreateOrUpdate.json */ async function createOrUpdateATargetedCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const capacityReservationName = "targetedCapacityReservation"; - const parameters: CapacityReservation = { - location: "westus", - sku: { name: "Standard_DS1_v2", capacity: 4 }, - tags: { department: "HR" }, - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "targetedCapacityReservationGroup", + "targetedCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_DS1_v2", capacity: 4 }, + zones: ["1"], + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsDeleteSample.ts index 7ac41575efa6..d1e38ea45317 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsDeleteSample.ts @@ -3,52 +3,35 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * This sample demonstrates how to the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. * - * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json + * @summary the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json */ async function capacityReservationDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaa"; - const capacityReservationName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginDeleteAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, + await client.capacityReservations.delete( + "rgcompute", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); - console.log(result); } /** - * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * This sample demonstrates how to the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. * - * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json + * @summary the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json */ async function capacityReservationDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaa"; - const capacityReservationName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginDeleteAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - ); - console.log(result); + await client.capacityReservations.delete("rgcompute", "aaa", "aaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsGetSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsGetSample.ts index f77389ae8400..85acb674e3d7 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsGetSample.ts @@ -1,88 +1,62 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_Get.json + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_Get.json */ async function getABlockCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const capacityReservationName = "blockCapacityReservation"; - const expand = "instanceView"; - const options: CapacityReservationsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, + "myResourceGroup", + "blockCapacityReservationGroup", + "blockCapacityReservation", + { expand: "instanceView" }, ); console.log(result); } /** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Get.json + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Get.json */ async function getACapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const capacityReservationName = "myCapacityReservation"; - const expand = "instanceView"; - const options: CapacityReservationsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + { expand: "instanceView" }, ); console.log(result); } /** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_Get.json + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_Get.json */ async function getATargetedCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const capacityReservationName = "targetedCapacityReservation"; - const expand = "instanceView"; - const options: CapacityReservationsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, + "myResourceGroup", + "targetedCapacityReservationGroup", + "targetedCapacityReservation", + { expand: "instanceView" }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsListByCapacityReservationGroupSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsListByCapacityReservationGroupSample.ts index 402628ae8abb..2ba4604a1abd 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationsListByCapacityReservationGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsListByCapacityReservationGroupSample.ts @@ -3,77 +3,70 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json */ async function listBlockCapacityReservationsInReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "blockCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json */ async function listCapacityReservationsInReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "myCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_ListByReservationGroup.json */ async function listCapacityReservationsInTargetedReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "targetedCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/capacityReservationsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/capacityReservationsUpdateSample.ts index e0d003865b4a..6d3aa0112425 100644 --- a/sdk/compute/arm-compute/samples-dev/capacityReservationsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/capacityReservationsUpdateSample.ts @@ -1,75 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update a capacity reservation. + * This sample demonstrates how to the operation to update a capacity reservation. * - * @summary The operation to update a capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json + * @summary the operation to update a capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json */ async function capacityReservationUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaa"; - const capacityReservationName = "aaaaaaaaaaaaaaaaaaa"; - const parameters: CapacityReservationUpdate = { - instanceView: { - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - utilizationInfo: {}, - }, - sku: { name: "Standard_DS1_v2", capacity: 7, tier: "aaa" }, - tags: { key4974: "aaaaaaaaaaaaaaaa" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, + const result = await client.capacityReservations.update( + "rgcompute", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + { + sku: { name: "Standard_DS1_v2", tier: "aaa", capacity: 7 }, + tags: { key4974: "aaaaaaaaaaaaaaaa" }, + }, ); console.log(result); } /** - * This sample demonstrates how to The operation to update a capacity reservation. + * This sample demonstrates how to the operation to update a capacity reservation. * - * @summary The operation to update a capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json + * @summary the operation to update a capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json */ async function capacityReservationUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const capacityReservationName = "aaa"; - const parameters: CapacityReservationUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, + const result = await client.capacityReservations.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaa", + {}, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSFamilySample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSFamilySample.ts deleted file mode 100644 index 378226bb01b1..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSFamilySample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. - * - * @summary Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamily_Get.json - */ -async function getCloudServiceOSFamily(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const osFamilyName = "3"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceOperatingSystems.getOSFamily( - location, - osFamilyName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceOSFamily(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSVersionSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSVersionSample.ts deleted file mode 100644 index 61587b927621..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsGetOSVersionSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. - * - * @summary Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_Get.json - */ -async function getCloudServiceOSVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const osVersionName = "WA-GUEST-OS-3.90_202010-02"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceOperatingSystems.getOSVersion( - location, - osVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceOSVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSFamiliesSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSFamiliesSample.ts deleted file mode 100644 index 98c1f88f8cc3..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSFamiliesSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * - * @summary Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamilies_List.json - */ -async function listCloudServiceOSFamiliesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceOperatingSystems.listOSFamilies( - location, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServiceOSFamiliesInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSVersionsSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSVersionsSample.ts deleted file mode 100644 index 2002cd5f2993..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceOperatingSystemsListOSVersionsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * - * @summary Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_List.json - */ -async function listCloudServiceOSVersionsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceOperatingSystems.listOSVersions( - location, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServiceOSVersionsInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesDeleteSample.ts deleted file mode 100644 index 7ca8d19e9601..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a role instance from a cloud service. - * - * @summary Deletes a role instance from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete.json - */ -async function deleteCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginDeleteAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetInstanceViewSample.ts deleted file mode 100644 index 29f24619790a..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetInstanceViewSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about the run-time state of a role instance in a cloud service. - * - * @summary Retrieves information about the run-time state of a role instance in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_InstanceView.json - */ -async function getInstanceViewOfCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.getInstanceView( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getInstanceViewOfCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts deleted file mode 100644 index 445389f91c0d..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a remote desktop file for a role instance in a cloud service. - * - * @summary Gets a remote desktop file for a role instance in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json - */ -async function getCloudServiceRole(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcloudService"; - const cloudServiceName = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.getRemoteDesktopFile( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceRole(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetSample.ts deleted file mode 100644 index d270920b7ed0..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a role instance from a cloud service. - * - * @summary Gets a role instance from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get.json - */ -async function getCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.get( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesListSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesListSample.ts deleted file mode 100644 index 918c4432697e..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * - * @summary Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRolesInstance_List.json - */ -async function listRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceRoleInstances.list( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRebuildSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRebuildSample.ts deleted file mode 100644 index 5c9d7c9c9af1..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRebuildSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. - * - * @summary The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild.json - */ -async function rebuildCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginRebuildAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await rebuildCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesReimageSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesReimageSample.ts deleted file mode 100644 index 0bd54930c717..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesReimageSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * - * @summary The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage.json - */ -async function reimageCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginReimageAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await reimageCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRestartSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRestartSample.ts deleted file mode 100644 index 76e681aa4ae6..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRoleInstancesRestartSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. - * - * @summary The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart.json - */ -async function restartCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginRestartAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await restartCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRolesGetSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRolesGetSample.ts deleted file mode 100644 index d5b0ef87d0f3..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRolesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a role from a cloud service. - * - * @summary Gets a role from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_Get.json - */ -async function getCloudServiceRole(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleName = "{role-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoles.get( - roleName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceRole(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServiceRolesListSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServiceRolesListSample.ts deleted file mode 100644 index 99f72ff3dd71..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServiceRolesListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. - * - * @summary Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_List.json - */ -async function listRolesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceRoles.list( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listRolesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesCreateOrUpdateSample.ts deleted file mode 100644 index 7fc8e0a05215..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesCreateOrUpdateSample.ts +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CloudService, - CloudServicesCreateOrUpdateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole.json - */ -async function createNewCloudServiceWithMultipleRoles(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - { - name: "ContosoBackend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole_WithZones.json - */ -async function createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - { - name: "ContosoBackend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - zones: ["1"], - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRole.json - */ -async function createNewCloudServiceWithSingleRole(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "myLoadBalancer", - properties: { - frontendIpConfigurations: [ - { - name: "myfe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json - */ -async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - osProfile: { - secrets: [ - { - sourceVault: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}", - }, - vaultCertificates: [ - { - certificateUrl: - "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}", - isBootstrapCertificate: true, - }, - ], - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndRDP.json - */ -async function createNewCloudServiceWithSingleRoleAndRdpExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - extensionProfile: { - extensions: [ - { - name: "RDPExtension", - properties: { - type: "RDP", - autoUpgradeMinorVersion: false, - protectedSettings: - "{password}", - publisher: "Microsoft.Windows.Azure.Extensions", - settings: - "UserAzure10/22/2021 15:05:45", - typeHandlerVersion: "1.2", - }, - }, - ], - }, - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await createNewCloudServiceWithMultipleRoles(); - await createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(); - await createNewCloudServiceWithSingleRole(); - await createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(); - await createNewCloudServiceWithSingleRoleAndRdpExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteInstancesSample.ts deleted file mode 100644 index 7e289a8b33fd..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteInstancesSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesDeleteInstancesOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes role instances in a cloud service. - * - * @summary Deletes role instances in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json - */ -async function deleteCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesDeleteInstancesOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginDeleteInstancesAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await deleteCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteSample.ts deleted file mode 100644 index 8abc4febbed5..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a cloud service. - * - * @summary Deletes a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Delete.json - */ -async function deleteCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginDeleteAndWait( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesGetInstanceViewSample.ts deleted file mode 100644 index 0985609302bb..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesGetInstanceViewSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the status of a cloud service. - * - * @summary Gets the status of a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_InstanceViewWithMultiRole.json - */ -async function getCloudServiceInstanceViewWithMultipleRoles(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.getInstanceView( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceInstanceViewWithMultipleRoles(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesGetSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesGetSample.ts deleted file mode 100644 index 87e01b983e78..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Display information about a cloud service. - * - * @summary Display information about a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_WithMultiRoleAndRDP.json - */ -async function getCloudServiceWithMultipleRolesAndRdpExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.get( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceWithMultipleRolesAndRdpExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesListAllSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesListAllSample.ts deleted file mode 100644 index c2e6e49929cd..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesListAllSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * - * @summary Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_BySubscription.json - */ -async function listCloudServicesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServices.listAll()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServicesInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesListSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesListSample.ts deleted file mode 100644 index c01427141653..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesListSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * - * @summary Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_ByResourceGroup.json - */ -async function listCloudServicesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServices.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServicesInAResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesPowerOffSample.ts deleted file mode 100644 index 92203d3f2dd5..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesPowerOffSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. - * - * @summary Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_PowerOff.json - */ -async function stopOrPowerOffCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginPowerOffAndWait( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await stopOrPowerOffCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesRebuildSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesRebuildSample.ts deleted file mode 100644 index 0b72f916d574..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesRebuildSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesRebuildOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. - * - * @summary Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json - */ -async function rebuildCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesRebuildOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginRebuildAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await rebuildCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesReimageSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesReimageSample.ts deleted file mode 100644 index c4a492f145f5..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesReimageSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * - * @summary Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json - */ -async function reimageCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesReimageOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginReimageAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await reimageCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesRestartSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesRestartSample.ts deleted file mode 100644 index 40f42c29bfb6..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesRestartSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesRestartOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restarts one or more role instances in a cloud service. - * - * @summary Restarts one or more role instances in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json - */ -async function restartCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesRestartOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginRestartAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await restartCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesStartSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesStartSample.ts deleted file mode 100644 index 72be38e693e7..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesStartSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Starts the cloud service. - * - * @summary Starts the cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Start.json - */ -async function startCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginStartAndWait( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await startCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainGetUpdateDomainSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainGetUpdateDomainSample.ts deleted file mode 100644 index 31bce4ea995a..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainGetUpdateDomainSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * - * @summary Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Get.json - */ -async function getCloudServiceUpdateDomain(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const updateDomain = 1; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServicesUpdateDomain.getUpdateDomain( - resourceGroupName, - cloudServiceName, - updateDomain, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceUpdateDomain(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainListUpdateDomainsSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainListUpdateDomainsSample.ts deleted file mode 100644 index 7782df0e3ae8..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainListUpdateDomainsSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all update domains in a cloud service. - * - * @summary Gets a list of all update domains in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_List.json - */ -async function listUpdateDomainsInCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServicesUpdateDomain.listUpdateDomains( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listUpdateDomainsInCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainWalkUpdateDomainSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainWalkUpdateDomainSample.ts deleted file mode 100644 index fa0d3c81a7d1..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateDomainWalkUpdateDomainSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates the role instances in the specified update domain. - * - * @summary Updates the role instances in the specified update domain. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Update.json - */ -async function updateCloudServiceToSpecifiedDomain(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const updateDomain = 1; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.cloudServicesUpdateDomain.beginWalkUpdateDomainAndWait( - resourceGroupName, - cloudServiceName, - updateDomain, - ); - console.log(result); -} - -async function main(): Promise { - await updateCloudServiceToSpecifiedDomain(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateSample.ts deleted file mode 100644 index 52c53284a225..000000000000 --- a/sdk/compute/arm-compute/samples-dev/cloudServicesUpdateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CloudServiceUpdate, - CloudServicesUpdateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a cloud service. - * - * @summary Update a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Update_ToIncludeTags.json - */ -async function updateExistingCloudServiceToAddTags(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudServiceUpdate = { tags: { documentation: "RestAPI" } }; - const options: CloudServicesUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await updateExistingCloudServiceToAddTags(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleriesGetSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleriesGetSample.ts index 94c05338ac5a..367e1043bc8a 100644 --- a/sdk/compute/arm-compute/samples-dev/communityGalleriesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/communityGalleriesGetSample.ts @@ -3,25 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a community gallery by gallery public name. + * This sample demonstrates how to get a community gallery by gallery public name. * - * @summary Get a community gallery by gallery public name. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json + * @summary get a community gallery by gallery public name. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGallery_Get.json */ async function getACommunityGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.communityGalleries.get( - location, - publicGalleryName, - ); + const result = await client.communityGalleries.get("myLocation", "publicGalleryName"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsGetSample.ts index b597153791cf..ab1c75c68ef3 100644 --- a/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsGetSample.ts @@ -3,28 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a community gallery image version. + * This sample demonstrates how to get a community gallery image version. * - * @summary Get a community gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json + * @summary get a community gallery image version. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_Get.json */ async function getACommunityGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "myGalleryImageVersionName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.communityGalleryImageVersions.get( - location, - publicGalleryName, - galleryImageName, - galleryImageVersionName, + "myLocation", + "publicGalleryName", + "myGalleryImageName", + "myGalleryImageVersionName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsListSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsListSample.ts index da3a76c8f459..38ff4c1257de 100644 --- a/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/communityGalleryImageVersionsListSample.ts @@ -3,30 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List community gallery image versions inside an image. + * This sample demonstrates how to list community gallery image versions inside an image. * - * @summary List community gallery image versions inside an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json + * @summary list community gallery image versions inside an image. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_List.json */ async function listCommunityGalleryImageVersions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.communityGalleryImageVersions.list( - location, - publicGalleryName, - galleryImageName, + "myLocation", + "publicGalleryName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleryImagesGetSample.ts index 3f7231694610..b7532338cd91 100644 --- a/sdk/compute/arm-compute/samples-dev/communityGalleryImagesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/communityGalleryImagesGetSample.ts @@ -3,26 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a community gallery image. + * This sample demonstrates how to get a community gallery image. * - * @summary Get a community gallery image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json + * @summary get a community gallery image. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_Get.json */ async function getACommunityGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.communityGalleryImages.get( - location, - publicGalleryName, - galleryImageName, + "myLocation", + "publicGalleryName", + "myGalleryImageName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/communityGalleryImagesListSample.ts b/sdk/compute/arm-compute/samples-dev/communityGalleryImagesListSample.ts index 7ad2f95f0774..a9b7fa9253da 100644 --- a/sdk/compute/arm-compute/samples-dev/communityGalleryImagesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/communityGalleryImagesListSample.ts @@ -3,28 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List community gallery images inside a gallery. + * This sample demonstrates how to list community gallery images inside a gallery. * - * @summary List community gallery images inside a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json + * @summary list community gallery images inside a gallery. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_List.json */ async function listCommunityGalleryImages(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.communityGalleryImages.list( - location, - publicGalleryName, - )) { + for await (const item of client.communityGalleryImages.list("myLocation", "publicGalleryName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsCreateOrUpdateSample.ts index e6cf03483493..10fffab32115 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsCreateOrUpdateSample.ts @@ -1,76 +1,61 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - DedicatedHostGroup} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * This sample demonstrates how to create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) * - * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json + * @summary create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json */ -async function createOrUpdateADedicatedHostGroupWithUltraSsdSupport(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const parameters: DedicatedHostGroup = { - additionalCapabilities: { ultraSSDEnabled: true }, - location: "westus", - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { department: "finance" }, - zones: ["1"], - }; +async function createOrUpdateADedicatedHostGroup(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.dedicatedHostGroups.createOrUpdate( - resourceGroupName, - hostGroupName, - parameters, + "myResourceGroup", + "myDedicatedHostGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1"], + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + }, ); console.log(result); } /** - * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * This sample demonstrates how to create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) * - * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json + * @summary create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json */ -async function createOrUpdateADedicatedHostGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const parameters: DedicatedHostGroup = { - location: "westus", - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { department: "finance" }, - zones: ["1"], - }; +async function createOrUpdateADedicatedHostGroupWithUltraSSDSupport(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.dedicatedHostGroups.createOrUpdate( - resourceGroupName, - hostGroupName, - parameters, + "myResourceGroup", + "myDedicatedHostGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1"], + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + additionalCapabilities: { ultraSSDEnabled: true }, + }, ); console.log(result); } async function main(): Promise { - await createOrUpdateADedicatedHostGroupWithUltraSsdSupport(); await createOrUpdateADedicatedHostGroup(); + await createOrUpdateADedicatedHostGroupWithUltraSSDSupport(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsDeleteSample.ts index 42db101ece26..99e77dca602a 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsDeleteSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a dedicated host group. + * This sample demonstrates how to delete a dedicated host group. * - * @summary Delete a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json + * @summary delete a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json */ async function dedicatedHostGroupDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "a"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.delete( - resourceGroupName, - hostGroupName, - ); - console.log(result); + await client.dedicatedHostGroups.delete("rgcompute", "a"); } /** - * This sample demonstrates how to Delete a dedicated host group. + * This sample demonstrates how to delete a dedicated host group. * - * @summary Delete a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json + * @summary delete a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json */ async function dedicatedHostGroupDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.delete( - resourceGroupName, - hostGroupName, - ); - console.log(result); + await client.dedicatedHostGroups.delete("rgcompute", "aaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsGetSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsGetSample.ts index bc135d813ea0..86bdaf885256 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsGetSample.ts @@ -3,53 +3,38 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a dedicated host group. + * This sample demonstrates how to retrieves information about a dedicated host group. * - * @summary Retrieves information about a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + * @summary retrieves information about a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get.json */ async function createADedicatedHostGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.get( - resourceGroupName, - hostGroupName, - ); + const result = await client.dedicatedHostGroups.get("myResourceGroup", "myDedicatedHostGroup"); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a dedicated host group. + * This sample demonstrates how to retrieves information about a dedicated host group. * - * @summary Retrieves information about a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + * @summary retrieves information about a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json */ -async function createAnUltraSsdEnabledDedicatedHostGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; +async function createAnUltraSSDEnabledDedicatedHostGroup(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.get( - resourceGroupName, - hostGroupName, - ); + const result = await client.dedicatedHostGroups.get("myResourceGroup", "myDedicatedHostGroup"); console.log(result); } async function main(): Promise { await createADedicatedHostGroup(); - await createAnUltraSsdEnabledDedicatedHostGroup(); + await createAnUltraSSDEnabledDedicatedHostGroup(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListByResourceGroupSample.ts index 880caf3bdcbb..c60e3cee17ba 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListByResourceGroupSample.ts @@ -3,49 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json + * @summary lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json */ async function dedicatedHostGroupListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHostGroups.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.dedicatedHostGroups.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json + * @summary lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json */ async function dedicatedHostGroupListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHostGroups.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.dedicatedHostGroups.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListBySubscriptionSample.ts index 94f53dc3d365..d4dcf899a5a5 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsListBySubscriptionSample.ts @@ -3,41 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json + * @summary lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json */ async function dedicatedHostGroupListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHostGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json + * @summary lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json */ async function dedicatedHostGroupListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHostGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsUpdateSample.ts index 5305714eb444..a0774a2e9d9d 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostGroupsUpdateSample.ts @@ -1,80 +1,39 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - DedicatedHostGroupUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update an dedicated host group. + * This sample demonstrates how to update an dedicated host group. * - * @summary Update an dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json + * @summary update an dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json */ async function dedicatedHostGroupUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; - const parameters: DedicatedHostGroupUpdate = { - instanceView: { - hosts: [ - { - availableCapacity: { - allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], - }, - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - ], - }, + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update("rgcompute", "aaaa", { platformFaultDomainCount: 3, supportAutomaticPlacement: true, - tags: { key9921: "aaaaaaaaaa" }, zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.update( - resourceGroupName, - hostGroupName, - parameters, - ); + tags: { key9921: "aaaaaaaaaa" }, + }); console.log(result); } /** - * This sample demonstrates how to Update an dedicated host group. + * This sample demonstrates how to update an dedicated host group. * - * @summary Update an dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json + * @summary update an dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json */ async function dedicatedHostGroupUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaa"; - const parameters: DedicatedHostGroupUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.update( - resourceGroupName, - hostGroupName, - parameters, - ); + const result = await client.dedicatedHostGroups.update("rgcompute", "aaaaaaaaaaa", {}); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsCreateOrUpdateSample.ts index c0ecc86e58b2..94a71231ced2 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsCreateOrUpdateSample.ts @@ -1,37 +1,29 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { DedicatedHost} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a dedicated host . + * This sample demonstrates how to create or update a dedicated host . * - * @summary Create or update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json + * @summary create or update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json */ async function createOrUpdateADedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myDedicatedHost"; - const parameters: DedicatedHost = { - location: "westus", - platformFaultDomain: 1, - sku: { name: "DSv3-Type1" }, - tags: { department: "HR" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginCreateOrUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, + const result = await client.dedicatedHosts.createOrUpdate( + "myResourceGroup", + "myDedicatedHostGroup", + "myDedicatedHost", + { + location: "westus", + tags: { department: "HR" }, + platformFaultDomain: 1, + sku: { name: "DSv3-Type1" }, + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsDeleteSample.ts index a5f96d594b60..c8f9a48f0db9 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsDeleteSample.ts @@ -3,52 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a dedicated host. + * This sample demonstrates how to delete a dedicated host. * - * @summary Delete a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json + * @summary delete a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json */ async function dedicatedHostDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaa"; - const hostName = "aaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginDeleteAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.delete("rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa"); } /** - * This sample demonstrates how to Delete a dedicated host. + * This sample demonstrates how to delete a dedicated host. * - * @summary Delete a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json + * @summary delete a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json */ async function dedicatedHostDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaaaaaa"; - const hostName = "aaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginDeleteAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.delete("rgcompute", "aaaaaaaaaaaaaaa", "aaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsGetSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsGetSample.ts index b9949ffddbc7..3bd12f478161 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsGetSample.ts @@ -1,36 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - DedicatedHostsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a dedicated host. + * This sample demonstrates how to retrieves information about a dedicated host. * - * @summary Retrieves information about a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + * @summary retrieves information about a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Get.json */ async function getADedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; - const expand = "instanceView"; - const options: DedicatedHostsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.dedicatedHosts.get( - resourceGroupName, - hostGroupName, - hostName, - options, + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", + { expand: "instanceView" }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsListAvailableSizesSample.ts index 870289e37b52..673bb080601a 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsListAvailableSizesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsListAvailableSizesSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. + * This sample demonstrates how to lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. * - * @summary Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json + * @summary lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json */ async function getAvailableDedicatedHostSizes(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHosts.listAvailableSizes( - resourceGroupName, - hostGroupName, - hostName, + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsListByHostGroupSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsListByHostGroupSample.ts index 506164d4279d..5563cc444ce9 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsListByHostGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsListByHostGroupSample.ts @@ -3,53 +3,43 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * This sample demonstrates how to lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. * - * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json + * @summary lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json */ async function dedicatedHostListByHostGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHosts.listByHostGroup( - resourceGroupName, - hostGroupName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * This sample demonstrates how to lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. * - * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json + * @summary lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json */ async function dedicatedHostListByHostGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHosts.listByHostGroup( - resourceGroupName, - hostGroupName, - )) { + for await (const item of client.dedicatedHosts.listByHostGroup("rgcompute", "aaaa")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsRedeploySample.ts index 5e16adb854cb..05744c1aac57 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsRedeploySample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsRedeploySample.ts @@ -3,29 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * This sample demonstrates how to redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. * - * @summary Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json + * @summary redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Redeploy.json */ async function redeployDedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginRedeployAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.redeploy("myResourceGroup", "myDedicatedHostGroup", "myHost"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsRestartSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsRestartSample.ts index 30d98d5c8513..bacefa902824 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsRestartSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsRestartSample.ts @@ -3,29 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * This sample demonstrates how to restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. * - * @summary Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json + * @summary restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Restart.json */ async function restartDedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginRestartAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.restart("myResourceGroup", "myDedicatedHostGroup", "myHost"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/dedicatedHostsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/dedicatedHostsUpdateSample.ts index 901afc72aa42..9cab34deb1be 100644 --- a/sdk/compute/arm-compute/samples-dev/dedicatedHostsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/dedicatedHostsUpdateSample.ts @@ -1,104 +1,67 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - DedicatedHostUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a dedicated host . + * This sample demonstrates how to update a dedicated host . * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json */ async function dedicatedHostUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaa"; - const parameters: DedicatedHostUpdate = { - autoReplaceOnFailure: true, - instanceView: { - availableCapacity: { - allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], - }, - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - licenseType: "Windows_Server_Hybrid", - platformFaultDomain: 1, - tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, + const result = await client.dedicatedHosts.update( + "rgcompute", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { + platformFaultDomain: 1, + autoReplaceOnFailure: true, + licenseType: "Windows_Server_Hybrid", + tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + }, ); console.log(result); } /** - * This sample demonstrates how to Update a dedicated host . + * This sample demonstrates how to update a dedicated host . * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json */ async function dedicatedHostUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: DedicatedHostUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, + const result = await client.dedicatedHosts.update( + "rgcompute", + "aa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + {}, ); console.log(result); } /** - * This sample demonstrates how to Update a dedicated host . + * This sample demonstrates how to update a dedicated host . * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_Resize.json */ async function dedicatedHostUpdateResize(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaa"; - const parameters: DedicatedHostUpdate = { sku: { name: "DSv3-Type1" } }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, + const result = await client.dedicatedHosts.update( + "rgcompute", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { sku: { name: "DSv3-Type1" } }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesCreateOrUpdateSample.ts index 2bb4701d761c..051b2a078cff 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesCreateOrUpdateSample.ts @@ -1,31 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { DiskAccess} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Creates or updates a disk access resource + * This sample demonstrates how to creates or updates a disk access resource * - * @summary Creates or updates a disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Create.json + * @summary creates or updates a disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Create.json */ async function createADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const diskAccess: DiskAccess = { location: "West US" }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginCreateOrUpdateAndWait( - resourceGroupName, - diskAccessName, - diskAccess, - ); + const result = await client.diskAccesses.createOrUpdate("myResourceGroup", "myDiskAccess", { + location: "West US", + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteAPrivateEndpointConnectionSample.ts index 3c8af417e035..9b5a2021a588 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteAPrivateEndpointConnectionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteAPrivateEndpointConnectionSample.ts @@ -3,30 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes a private endpoint connection under a disk access resource. + * This sample demonstrates how to deletes a private endpoint connection under a disk access resource. * - * @summary Deletes a private endpoint connection under a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json + * @summary deletes a private endpoint connection under a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json */ async function deleteAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskAccesses.beginDeleteAPrivateEndpointConnectionAndWait( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - ); - console.log(result); + await client.diskAccesses.deleteAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteSample.ts index d2c663c0ffd8..682b1325bffc 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesDeleteSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes a disk access resource. + * This sample demonstrates how to deletes a disk access resource. * - * @summary Deletes a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Delete.json + * @summary deletes a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Delete.json */ async function deleteADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginDeleteAndWait( - resourceGroupName, - diskAccessName, - ); - console.log(result); + await client.diskAccesses.delete("myResourceGroup", "myDiskAccess"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesGetAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesGetAPrivateEndpointConnectionSample.ts index b167c750bd48..f02e5c6c673d 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesGetAPrivateEndpointConnectionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesGetAPrivateEndpointConnectionSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets information about a private endpoint connection under a disk access resource. + * This sample demonstrates how to gets information about a private endpoint connection under a disk access resource. * - * @summary Gets information about a private endpoint connection under a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + * @summary gets information about a private endpoint connection under a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json */ async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.diskAccesses.getAPrivateEndpointConnection( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesGetPrivateLinkResourcesSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesGetPrivateLinkResourcesSample.ts index 8e4820c286e2..a224a7d318df 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesGetPrivateLinkResourcesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesGetPrivateLinkResourcesSample.ts @@ -3,25 +3,20 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the private link resources possible under disk access resource + * This sample demonstrates how to gets the private link resources possible under disk access resource * - * @summary Gets the private link resources possible under disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json + * @summary gets the private link resources possible under disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json */ async function listAllPossiblePrivateLinkResourcesUnderDiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.diskAccesses.getPrivateLinkResources( - resourceGroupName, - diskAccessName, + "myResourceGroup", + "myDiskAccess", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesGetSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesGetSample.ts index c92904182a37..711fa7646ac8 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesGetSample.ts @@ -3,53 +3,38 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets information about a disk access resource. + * This sample demonstrates how to gets information about a disk access resource. * - * @summary Gets information about a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + * @summary gets information about a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get.json */ -async function getInformationAboutADiskAccessResourceWithPrivateEndpoints(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; +async function getInformationAboutADiskAccessResource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.get( - resourceGroupName, - diskAccessName, - ); + const result = await client.diskAccesses.get("myResourceGroup", "myDiskAccess"); console.log(result); } /** - * This sample demonstrates how to Gets information about a disk access resource. + * This sample demonstrates how to gets information about a disk access resource. * - * @summary Gets information about a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get.json + * @summary gets information about a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json */ -async function getInformationAboutADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; +async function getInformationAboutADiskAccessResourceWithPrivateEndpoints(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.get( - resourceGroupName, - diskAccessName, - ); + const result = await client.diskAccesses.get("myResourceGroup", "myDiskAccess"); console.log(result); } async function main(): Promise { - await getInformationAboutADiskAccessResourceWithPrivateEndpoints(); await getInformationAboutADiskAccessResource(); + await getInformationAboutADiskAccessResourceWithPrivateEndpoints(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesListByResourceGroupSample.ts index 7be4c467ccd5..8cfc3e8bc08d 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk access resources under a resource group. + * This sample demonstrates how to lists all the disk access resources under a resource group. * - * @summary Lists all the disk access resources under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json + * @summary lists all the disk access resources under a resource group. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListByResourceGroup.json */ async function listAllDiskAccessResourcesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.diskAccesses.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.diskAccesses.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesListPrivateEndpointConnectionsSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesListPrivateEndpointConnectionsSample.ts index 80bc72757860..eb9823dbc4c7 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesListPrivateEndpointConnectionsSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesListPrivateEndpointConnectionsSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List information about private endpoint connections under a disk access resource + * This sample demonstrates how to list information about private endpoint connections under a disk access resource * - * @summary List information about private endpoint connections under a disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json + * @summary list information about private endpoint connections under a disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json */ async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskAccesses.listPrivateEndpointConnections( - resourceGroupName, - diskAccessName, + "myResourceGroup", + "myDiskAccess", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesListSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesListSample.ts index 7f49b691f7b6..69e67fe77817 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk access resources under a subscription. + * This sample demonstrates how to lists all the disk access resources under a subscription. * - * @summary Lists all the disk access resources under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json + * @summary lists all the disk access resources under a subscription. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListBySubscription.json */ async function listAllDiskAccessResourcesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskAccesses.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateAPrivateEndpointConnectionSample.ts index c5dc1ecf14d6..9ad23e306a06 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateAPrivateEndpointConnectionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateAPrivateEndpointConnectionSample.ts @@ -1,42 +1,30 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - PrivateEndpointConnection} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * This sample demonstrates how to approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. * - * @summary Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + * @summary approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json */ async function approveAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; - const privateEndpointConnection: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approving myPrivateEndpointConnection", - status: "Approved", - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskAccesses.beginUpdateAPrivateEndpointConnectionAndWait( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - privateEndpointConnection, - ); + const result = await client.diskAccesses.updateAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + { + privateLinkServiceConnectionState: { + status: "Approved", + description: "Approving myPrivateEndpointConnection", + }, + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateSample.ts index 9d4214e60291..206a27e7cbbe 100644 --- a/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskAccessesUpdateSample.ts @@ -1,33 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { DiskAccessUpdate} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Updates (patches) a disk access resource. + * This sample demonstrates how to updates (patches) a disk access resource. * - * @summary Updates (patches) a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Update.json + * @summary updates (patches) a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Update.json */ async function updateADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const diskAccess: DiskAccessUpdate = { - tags: { department: "Development", project: "PrivateEndpoints" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginUpdateAndWait( - resourceGroupName, - diskAccessName, - diskAccess, - ); + const result = await client.diskAccesses.update("myResourceGroup", "myDiskAccess", { + tags: { department: "Development", project: "PrivateEndpoints" }, + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsCreateOrUpdateSample.ts index 1aa5b0f4eded..5accad7a9349 100644 --- a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsCreateOrUpdateSample.ts @@ -1,116 +1,94 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { DiskEncryptionSet} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Creates or updates a disk encryption set + * This sample demonstrates how to creates or updates a disk encryption set * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create.json */ -async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSet = { - activeKey: { - keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - location: "West US", - }; +async function createADiskEncryptionSet(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { type: "SystemAssigned" }, + activeKey: { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + }, ); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk encryption set + * This sample demonstrates how to creates or updates a disk encryption set * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json */ -async function createADiskEncryptionSetWithKeyVaultFromADifferentTenant(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSet = { - activeKey: { - keyUrl: - "https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - federatedClientId: "00000000-0000-0000-0000-000000000000", - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MicrosoftManagedIdentity/userAssignedIdentities/{identityName}": - {}, - }, - }, - location: "West US", - }; +async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { type: "SystemAssigned" }, + activeKey: { keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}" }, + encryptionType: "EncryptionAtRestWithCustomerKey", + }, ); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk encryption set + * This sample demonstrates how to creates or updates a disk encryption set * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json */ -async function createADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSet = { - activeKey: { - keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", - }, - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - location: "West US", - }; +async function createADiskEncryptionSetWithKeyVaultFromADifferentTenant(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": + {}, + }, + }, + activeKey: { keyUrl: "https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}" }, + encryptionType: "EncryptionAtRestWithCustomerKey", + federatedClientId: "00000000-0000-0000-0000-000000000000", + }, ); console.log(result); } async function main(): Promise { + await createADiskEncryptionSet(); await createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(); await createADiskEncryptionSetWithKeyVaultFromADifferentTenant(); - await createADiskEncryptionSet(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsDeleteSample.ts index 799370e15ed7..a990b53c6fa6 100644 --- a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsDeleteSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes a disk encryption set. + * This sample demonstrates how to deletes a disk encryption set. * - * @summary Deletes a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json + * @summary deletes a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json */ async function deleteADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginDeleteAndWait( - resourceGroupName, - diskEncryptionSetName, - ); - console.log(result); + await client.diskEncryptionSets.delete("myResourceGroup", "myDiskEncryptionSet"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsGetSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsGetSample.ts index 1f53b82fab57..92fb656013f4 100644 --- a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsGetSample.ts @@ -3,53 +3,38 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets information about a disk encryption set. + * This sample demonstrates how to gets information about a disk encryption set. * - * @summary Gets information about a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + * @summary gets information about a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get.json */ -async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; +async function getInformationAboutADiskEncryptionSet(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.get( - resourceGroupName, - diskEncryptionSetName, - ); + const result = await client.diskEncryptionSets.get("myResourceGroup", "myDiskEncryptionSet"); console.log(result); } /** - * This sample demonstrates how to Gets information about a disk encryption set. + * This sample demonstrates how to gets information about a disk encryption set. * - * @summary Gets information about a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + * @summary gets information about a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json */ -async function getInformationAboutADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; +async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.get( - resourceGroupName, - diskEncryptionSetName, - ); + const result = await client.diskEncryptionSets.get("myResourceGroup", "myDiskEncryptionSet"); console.log(result); } async function main(): Promise { - await getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(); await getInformationAboutADiskEncryptionSet(); + await getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListAssociatedResourcesSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListAssociatedResourcesSample.ts index 3684449edd67..02138f2ff04e 100644 --- a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListAssociatedResourcesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListAssociatedResourcesSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all resources that are encrypted with this disk encryption set. + * This sample demonstrates how to lists all resources that are encrypted with this disk encryption set. * - * @summary Lists all resources that are encrypted with this disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json + * @summary lists all resources that are encrypted with this disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json */ async function listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskEncryptionSets.listAssociatedResources( - resourceGroupName, - diskEncryptionSetName, + "myResourceGroup", + "myDiskEncryptionSet", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListByResourceGroupSample.ts index 1342eca575d3..638cb156fd75 100644 --- a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk encryption sets under a resource group. + * This sample demonstrates how to lists all the disk encryption sets under a resource group. * - * @summary Lists all the disk encryption sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json + * @summary lists all the disk encryption sets under a resource group. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json */ async function listAllDiskEncryptionSetsInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.diskEncryptionSets.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.diskEncryptionSets.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListSample.ts index 026902eec273..ffb21524f887 100644 --- a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk encryption sets under a subscription. + * This sample demonstrates how to lists all the disk encryption sets under a subscription. * - * @summary Lists all the disk encryption sets under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json + * @summary lists all the disk encryption sets under a subscription. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json */ async function listAllDiskEncryptionSetsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskEncryptionSets.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsUpdateSample.ts index 3b3fec5c97b6..2453efa69472 100644 --- a/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskEncryptionSetsUpdateSample.ts @@ -1,113 +1,78 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - DiskEncryptionSetUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Updates (patches) a disk encryption set. + * This sample demonstrates how to updates (patches) a disk encryption set. * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update.json */ -async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSetUpdate = { +async function updateADiskEncryptionSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { activeKey: { - keyUrl: - "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", }, encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - rotationToLatestKeyVersionEnabled: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); + tags: { department: "Development", project: "Encryption" }, + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk encryption set. + * This sample demonstrates how to updates (patches) a disk encryption set. * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json */ -async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSetUpdate = { +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + identity: { type: "SystemAssigned" }, activeKey: { - keyUrl: - "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", }, encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, rotationToLatestKeyVersionEnabled: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk encryption set. + * This sample demonstrates how to updates (patches) a disk encryption set. * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json */ -async function updateADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSetUpdate = { +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + identity: { type: "SystemAssigned" }, activeKey: { - keyUrl: - "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", - }, + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", }, encryptionType: "EncryptionAtRestWithCustomerKey", - tags: { department: "Development", project: "Encryption" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); + rotationToLatestKeyVersionEnabled: true, + }); console.log(result); } async function main(): Promise { + await updateADiskEncryptionSet(); await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(); await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(); - await updateADiskEncryptionSet(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointGetSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointGetSample.ts index 1496c06aa8bf..92c369c47830 100644 --- a/sdk/compute/arm-compute/samples-dev/diskRestorePointGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointGetSample.ts @@ -3,56 +3,41 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get disk restorePoint resource + * This sample demonstrates how to get disk restorePoint resource * - * @summary Get disk restorePoint resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + * @summary get disk restorePoint resource + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get.json */ async function getAnIncrementalDiskRestorePointResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.get( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, + const result = await client.diskRestorePoint.get( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", ); console.log(result); } /** - * This sample demonstrates how to Get disk restorePoint resource + * This sample demonstrates how to get disk restorePoint resource * - * @summary Get disk restorePoint resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + * @summary get disk restorePoint resource + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json */ async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.get( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, + const result = await client.diskRestorePoint.get( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointGrantAccessSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointGrantAccessSample.ts index 7a346da0f0e2..dc7321c3d02e 100644 --- a/sdk/compute/arm-compute/samples-dev/diskRestorePointGrantAccessSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointGrantAccessSample.ts @@ -1,41 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { GrantAccessData} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Grants access to a diskRestorePoint. + * This sample demonstrates how to grants access to a diskRestorePoint. * - * @summary Grants access to a diskRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json + * @summary grants access to a diskRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json */ async function grantsAccessToADiskRestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const grantAccessData: GrantAccessData = { - access: "Read", - durationInSeconds: 300, - fileFormat: "VHDX", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskRestorePointOperations.beginGrantAccessAndWait( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - grantAccessData, - ); + const result = await client.diskRestorePoint.grantAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + { access: "Read", durationInSeconds: 300, fileFormat: "VHDX" }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointListByRestorePointSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointListByRestorePointSample.ts index 4d30dca40096..5cbb1df3e862 100644 --- a/sdk/compute/arm-compute/samples-dev/diskRestorePointListByRestorePointSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointListByRestorePointSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists diskRestorePoints under a vmRestorePoint. + * This sample demonstrates how to lists diskRestorePoints under a vmRestorePoint. * - * @summary Lists diskRestorePoints under a vmRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json + * @summary lists diskRestorePoints under a vmRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json */ async function getAnIncrementalDiskRestorePointResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.diskRestorePointOperations.listByRestorePoint( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, + for await (const item of client.diskRestorePoint.listByRestorePoint( + "myResourceGroup", + "rpc", + "vmrp", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/diskRestorePointRevokeAccessSample.ts b/sdk/compute/arm-compute/samples-dev/diskRestorePointRevokeAccessSample.ts index 3233ea4bd1de..8a9445e1e29e 100644 --- a/sdk/compute/arm-compute/samples-dev/diskRestorePointRevokeAccessSample.ts +++ b/sdk/compute/arm-compute/samples-dev/diskRestorePointRevokeAccessSample.ts @@ -3,33 +3,23 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Revokes access to a diskRestorePoint. + * This sample demonstrates how to revokes access to a diskRestorePoint. * - * @summary Revokes access to a diskRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json + * @summary revokes access to a diskRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json */ async function revokesAccessToADiskRestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskRestorePointOperations.beginRevokeAccessAndWait( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - ); - console.log(result); + await client.diskRestorePoint.revokeAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/disksCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/disksCreateOrUpdateSample.ts index 4126f7899ffd..3de6a69eb4dd 100644 --- a/sdk/compute/arm-compute/samples-dev/disksCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksCreateOrUpdateSample.ts @@ -1,355 +1,173 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Disk} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json */ -async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - securityProfile: { - secureVMDiskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey", - }, - }; +async function createAManagedDiskWithAvailabilityPolicy(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDiskAccess.json - */ -async function createAManagedDiskAndAssociateWithDiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskAccessId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", - diskSizeGB: 200, + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { location: "West US", - networkAccessPolicy: "AllowPrivate", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json - */ -async function createAManagedDiskAndAssociateWithDiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { creationData: { createOption: "Empty" }, - diskSizeGB: 200, - encryption: { - diskEncryptionSetId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + diskSizeGB: 1024, + availabilityPolicy: { actionOnDiskDelay: "AutomaticReattach" }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByCopyingASnapshot.json */ async function createAManagedDiskByCopyingASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", creationData: { createOption: "Copy", sourceResourceId: "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json */ async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", creationData: { createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", storageAccountId: "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json */ async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", creationData: { createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromImportSecure.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json */ -async function createAManagedDiskFromImportSecureCreateOption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "ImportSecure", - securityDataUri: - "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - osType: "Windows", - securityProfile: { - securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - }, - }; +async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromImportSecure_WithVMMetadata.json - */ -async function createAManagedDiskFromImportSecureCreateOptionWithMetadataUriForConfidentialVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "ImportSecure", - securityDataUri: - "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", - securityMetadataUri: - "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { location: "West US", osType: "Windows", securityProfile: { - securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey", + secureVMDiskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", + }, + }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_Empty.json */ -async function createAManagedDiskFromUploadPreparedSecureCreateOption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "UploadPreparedSecure", - uploadSizeBytes: 10737418752, - }, - location: "West US", - osType: "Windows", - securityProfile: { securityType: "TrustedLaunch" }, - }; +async function createAnEmptyManagedDisk(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAPlatformImage.json */ async function createAManagedDiskFromAPlatformImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", creationData: { createOption: "FromImage", imageReference: { id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", }, }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json */ async function createAManagedDiskFromAnAzureComputeGalleryCommunityImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", creationData: { createOption: "FromImage", galleryImageReference: { @@ -357,32 +175,23 @@ async function createAManagedDiskFromAnAzureComputeGalleryCommunityImage(): Prom "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0", }, }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json */ async function createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", creationData: { createOption: "FromImage", galleryImageReference: { @@ -390,480 +199,412 @@ async function createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(): P "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0", }, }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json */ async function createAManagedDiskFromAnAzureComputeGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", creationData: { createOption: "FromImage", galleryImageReference: { id: "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0", }, }, - location: "West US", - osType: "Windows", - }; + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json + */ +async function createAManagedDiskFromElasticSanVolumeSnapshot(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "CopyFromSanSnapshot", + elasticSanResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", + }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnExistingManagedDisk.json */ async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk2"; - const disk: Disk = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk2", { + location: "West US", creationData: { createOption: "Copy", sourceResourceId: "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromImportSecure.json */ -async function createAManagedDiskFromElasticSanVolumeSnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "CopyFromSanSnapshot", - elasticSanResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", - }, - location: "West US", - }; +async function createAManagedDiskFromImportSecureCreateOption(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" }, + creationData: { + createOption: "ImportSecure", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromImportSecure_WithVMMetadata.json */ -async function createAManagedDiskWithAvailabilityPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - availabilityPolicy: { actionOnDiskDelay: "AutomaticReattach" }, - creationData: { createOption: "Empty" }, - diskSizeGB: 1024, - location: "West US", - }; +async function createAManagedDiskFromImportSecureCreateOptionWithMetadataURIForConfidentialVM(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" }, + creationData: { + createOption: "ImportSecure", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + securityMetadataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd", + }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromUploadPreparedSecure.json */ -async function createAManagedDiskWithDataAccessAuthMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - dataAccessAuthMode: "AzureActiveDirectory", - diskSizeGB: 200, - location: "West US", - }; +async function createAManagedDiskFromUploadPreparedSecureCreateOption(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + creationData: { createOption: "UploadPreparedSecure", uploadSizeBytes: 10737418752 }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_InExtendedLocation.json */ -async function createAManagedDiskWithOptimizedForFrequentAttach(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - optimizedForFrequentAttach: true, - }; +async function createAnEmptyManagedDiskInExtendedLocation(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + extendedLocation: { type: "EdgeZone", name: "{edge-zone-id}" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_PerformancePlus.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_PerformancePlus.json */ async function createAManagedDiskWithPerformancePlus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Upload", performancePlus: true }, - location: "West US", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Upload", performancePlus: true }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_UploadDisk.json */ -async function createAManagedDiskWithPremiumV2AccountType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myPremiumV2Disk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskIopsReadWrite: 125, - diskMBpsReadWrite: 3000, - diskSizeGB: 200, - location: "West US", - sku: { name: "PremiumV2_LRS" }, - }; +async function createAManagedUploadDisk(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDataAccessAuthMode.json */ -async function createAManagedDiskWithSecurityProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}", - }, - }, - location: "North Central US", - osType: "Windows", - securityProfile: { securityType: "TrustedLaunch" }, - }; +async function createAManagedDiskWithDataAccessAuthMode(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + dataAccessAuthMode: "AzureActiveDirectory", + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDiskAccess.json */ -async function createAManagedDiskWithSsdZrsAccountType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - sku: { name: "Premium_ZRS" }, - }; +async function createAManagedDiskAndAssociateWithDiskAccessResource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + networkAccessPolicy: "AllowPrivate", + diskAccessId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDiskEncryptionSet.json */ -async function createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myUltraReadOnlyDisk"; - const disk: Disk = { - creationData: { createOption: "Empty", logicalSectorSize: 4096 }, - diskIopsReadWrite: 125, - diskMBpsReadWrite: 3000, - diskSizeGB: 200, - encryption: { type: "EncryptionAtRestWithPlatformKey" }, - location: "West US", - sku: { name: "UltraSSD_LRS" }, - }; +async function createAManagedDiskAndAssociateWithDiskEncryptionSet(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + encryption: { + diskEncryptionSetId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_UploadDisk.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithLogicalSectorSize.json */ -async function createAManagedUploadDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, - location: "West US", - }; +async function createAnUltraManagedDiskWithLogicalSectorSize512E(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + sku: { name: "UltraSSD_LRS" }, + creationData: { createOption: "Empty", logicalSectorSize: 512 }, + diskSizeGB: 200, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_InExtendedLocation.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json */ -async function createAnEmptyManagedDiskInExtendedLocation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { +async function createAManagedDiskWithOptimizedForFrequentAttach(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", creationData: { createOption: "Empty" }, diskSizeGB: 200, - extendedLocation: { name: "{edge-zone-id}", type: "EdgeZone" }, - location: "West US", - }; + optimizedForFrequentAttach: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + */ +async function createAManagedDiskWithPremiumV2AccountType(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myPremiumV2Disk", { + location: "West US", + sku: { name: "PremiumV2_LRS" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + diskIopsReadWrite: 125, + diskMBpsReadWrite: 3000, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_Empty.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithSSDZRSAccountType.json */ -async function createAnEmptyManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { +async function createAManagedDiskWithSsdZrsAccountType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + sku: { name: "Premium_ZRS" }, creationData: { createOption: "Empty" }, diskSizeGB: 200, - location: "West US", - }; + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithSecurityProfile.json + */ +async function createAManagedDiskWithSecurityProfile(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "North Central US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}", + }, + }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a disk. + * This sample demonstrates how to creates or updates a disk. * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json */ -async function createAnUltraManagedDiskWithLogicalSectorSize512E(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty", logicalSectorSize: 512 }, - diskSizeGB: 200, - location: "West US", - sku: { name: "UltraSSD_LRS" }, - }; +async function createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.createOrUpdate("myResourceGroup", "myUltraReadOnlyDisk", { + location: "West US", + sku: { name: "UltraSSD_LRS" }, + creationData: { createOption: "Empty", logicalSectorSize: 4096 }, + diskSizeGB: 200, + diskIopsReadWrite: 125, + diskMBpsReadWrite: 3000, + encryption: { type: "EncryptionAtRestWithPlatformKey" }, + }); console.log(result); } async function main(): Promise { - await createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(); - await createAManagedDiskAndAssociateWithDiskAccessResource(); - await createAManagedDiskAndAssociateWithDiskEncryptionSet(); + await createAManagedDiskWithAvailabilityPolicy(); await createAManagedDiskByCopyingASnapshot(); await createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(); await createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(); - await createAManagedDiskFromImportSecureCreateOption(); - await createAManagedDiskFromImportSecureCreateOptionWithMetadataUriForConfidentialVM(); - await createAManagedDiskFromUploadPreparedSecureCreateOption(); + await createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(); + await createAnEmptyManagedDisk(); await createAManagedDiskFromAPlatformImage(); await createAManagedDiskFromAnAzureComputeGalleryCommunityImage(); await createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(); await createAManagedDiskFromAnAzureComputeGalleryImage(); - await createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(); await createAManagedDiskFromElasticSanVolumeSnapshot(); - await createAManagedDiskWithAvailabilityPolicy(); + await createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(); + await createAManagedDiskFromImportSecureCreateOption(); + await createAManagedDiskFromImportSecureCreateOptionWithMetadataURIForConfidentialVM(); + await createAManagedDiskFromUploadPreparedSecureCreateOption(); + await createAnEmptyManagedDiskInExtendedLocation(); + await createAManagedDiskWithPerformancePlus(); + await createAManagedUploadDisk(); await createAManagedDiskWithDataAccessAuthMode(); + await createAManagedDiskAndAssociateWithDiskAccessResource(); + await createAManagedDiskAndAssociateWithDiskEncryptionSet(); + await createAnUltraManagedDiskWithLogicalSectorSize512E(); await createAManagedDiskWithOptimizedForFrequentAttach(); - await createAManagedDiskWithPerformancePlus(); await createAManagedDiskWithPremiumV2AccountType(); - await createAManagedDiskWithSecurityProfile(); await createAManagedDiskWithSsdZrsAccountType(); + await createAManagedDiskWithSecurityProfile(); await createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(); - await createAManagedUploadDisk(); - await createAnEmptyManagedDiskInExtendedLocation(); - await createAnEmptyManagedDisk(); - await createAnUltraManagedDiskWithLogicalSectorSize512E(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/disksDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/disksDeleteSample.ts index 4b63ce565aad..a393adfd138d 100644 --- a/sdk/compute/arm-compute/samples-dev/disksDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksDeleteSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes a disk. + * This sample demonstrates how to deletes a disk. * - * @summary Deletes a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Delete.json + * @summary deletes a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Delete.json */ async function deleteAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginDeleteAndWait( - resourceGroupName, - diskName, - ); - console.log(result); + await client.disks.delete("myResourceGroup", "myDisk"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/disksGetSample.ts b/sdk/compute/arm-compute/samples-dev/disksGetSample.ts index 3ccd35b0827b..078b5afed49d 100644 --- a/sdk/compute/arm-compute/samples-dev/disksGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksGetSample.ts @@ -3,23 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets information about a disk. + * This sample demonstrates how to gets information about a disk. * - * @summary Gets information about a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Get.json + * @summary gets information about a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Get.json */ async function getInformationAboutAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myManagedDisk"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.get(resourceGroupName, diskName); + const result = await client.disks.get("myResourceGroup", "myManagedDisk"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/disksGrantAccessSample.ts b/sdk/compute/arm-compute/samples-dev/disksGrantAccessSample.ts index 9b87e456f201..33aa6fa22d00 100644 --- a/sdk/compute/arm-compute/samples-dev/disksGrantAccessSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksGrantAccessSample.ts @@ -1,89 +1,60 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { GrantAccessData} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Grants access to a disk. + * This sample demonstrates how to grants access to a disk. * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess.json + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess.json */ async function getASasOnAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData: GrantAccessData = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { access: "Read", durationInSeconds: 300, fileFormat: "VHD", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); + }); console.log(result); } /** - * This sample demonstrates how to Grants access to a disk. + * This sample demonstrates how to grants access to a disk. * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json */ async function getSasOnManagedDiskAndVMGuestState(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData: GrantAccessData = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { access: "Read", durationInSeconds: 300, getSecureVMGuestStateSAS: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); + }); console.log(result); } /** - * This sample demonstrates how to Grants access to a disk. + * This sample demonstrates how to grants access to a disk. * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestStateAndVMMetadata.json + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess_WithVMGuestStateAndVMMetadata.json */ async function getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData: GrantAccessData = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { access: "Read", durationInSeconds: 300, getSecureVMGuestStateSAS: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/disksListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/disksListByResourceGroupSample.ts index c0cedb81c6a9..413af66b8bd8 100644 --- a/sdk/compute/arm-compute/samples-dev/disksListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disks under a resource group. + * This sample demonstrates how to lists all the disks under a resource group. * - * @summary Lists all the disks under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListByResourceGroup.json + * @summary lists all the disks under a resource group. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_ListByResourceGroup.json */ async function listAllManagedDisksInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.disks.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.disks.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/disksListSample.ts b/sdk/compute/arm-compute/samples-dev/disksListSample.ts index 6fc48a5100c5..204f6704804e 100644 --- a/sdk/compute/arm-compute/samples-dev/disksListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disks under a subscription. + * This sample demonstrates how to lists all the disks under a subscription. * - * @summary Lists all the disks under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListBySubscription.json + * @summary lists all the disks under a subscription. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_ListBySubscription.json */ async function listAllManagedDisksInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.disks.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/disksRevokeAccessSample.ts b/sdk/compute/arm-compute/samples-dev/disksRevokeAccessSample.ts index 219db5be7857..deb852441cc9 100644 --- a/sdk/compute/arm-compute/samples-dev/disksRevokeAccessSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksRevokeAccessSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Revokes access to a disk. + * This sample demonstrates how to revokes access to a disk. * - * @summary Revokes access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_EndGetAccess.json + * @summary revokes access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_EndGetAccess.json */ async function revokeAccessToAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginRevokeAccessAndWait( - resourceGroupName, - diskName, - ); - console.log(result); + await client.disks.revokeAccess("myResourceGroup", "myDisk"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/disksUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/disksUpdateSample.ts index 2559fabf8793..035db7263a0d 100644 --- a/sdk/compute/arm-compute/samples-dev/disksUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/disksUpdateSample.ts @@ -1,263 +1,182 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { DiskUpdate} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json */ async function createOrUpdateABurstingEnabledManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { burstingEnabled: true, diskSizeGB: 1024 }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { + diskSizeGB: 1024, + burstingEnabled: true, + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddAcceleratedNetworking.json */ async function updateAManagedDiskToAddAcceleratedNetworking(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { - supportedCapabilities: { acceleratedNetwork: false }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { acceleratedNetwork: false }, + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddDiskControllerTypes.json */ -async function updateAManagedDiskToAddArchitecture(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { supportedCapabilities: { architecture: "Arm64" } }; +async function updateAManagedDiskWithDiskControllerTypes(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { diskControllerTypes: "SCSI" }, + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddPurchasePlan.json */ async function updateAManagedDiskToAddPurchasePlan(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { purchasePlan: { name: "myPurchasePlanName", + publisher: "myPurchasePlanPublisher", product: "myPurchasePlanProduct", promotionCode: "myPurchasePlanPromotionCode", - publisher: "myPurchasePlanPublisher", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddSupportsHibernation.json */ async function updateAManagedDiskToAddSupportsHibernation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { supportsHibernation: true }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportsHibernation: true, + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_ChangeTier.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_ChangeTier.json */ async function updateAManagedDiskToChangeTier(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { tier: "P30" }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { tier: "P30" }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_DisableBursting.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_DisableBursting.json */ async function updateAManagedDiskToDisableBursting(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { burstingEnabled: false }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { burstingEnabled: false }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json */ async function updateAManagedDiskToDisableOptimizedForFrequentAttach(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { optimizedForFrequentAttach: false }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { + optimizedForFrequentAttach: false, + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_RemoveDiskAccess.json */ -async function updateAManagedDiskWithDiskControllerTypes(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { - supportedCapabilities: { diskControllerTypes: "SCSI" }, - }; +async function updateManagedDiskToRemoveDiskAccessResourceAssociation(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { + networkAccessPolicy: "AllowAll", + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a disk. + * This sample demonstrates how to updates (patches) a disk. * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_ToAddArchitecture.json */ -async function updateManagedDiskToRemoveDiskAccessResourceAssociation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { networkAccessPolicy: "AllowAll" }; +async function updateAManagedDiskToAddArchitecture(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { architecture: "Arm64" }, + }); console.log(result); } async function main(): Promise { await createOrUpdateABurstingEnabledManagedDisk(); await updateAManagedDiskToAddAcceleratedNetworking(); - await updateAManagedDiskToAddArchitecture(); + await updateAManagedDiskWithDiskControllerTypes(); await updateAManagedDiskToAddPurchasePlan(); await updateAManagedDiskToAddSupportsHibernation(); await updateAManagedDiskToChangeTier(); await updateAManagedDiskToDisableBursting(); await updateAManagedDiskToDisableOptimizedForFrequentAttach(); - await updateAManagedDiskWithDiskControllerTypes(); await updateManagedDiskToRemoveDiskAccessResourceAssociation(); + await updateAManagedDiskToAddArchitecture(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesCreateOrUpdateSample.ts index 5f40d2296f2f..1cfb618f1b7d 100644 --- a/sdk/compute/arm-compute/samples-dev/galleriesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleriesCreateOrUpdateSample.ts @@ -1,165 +1,118 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Gallery} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a Shared Image Gallery. + * This sample demonstrates how to create or update a Shared Image Gallery. * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Create.json + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Create.json */ async function createACommunityGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { location: "West US", + description: "This is the gallery description.", sharingProfile: { + permissions: "Community", communityGalleryInfo: { + publisherUri: "uri", + publisherContact: "pir@microsoft.com", eula: "eula", publicNamePrefix: "PirPublic", - publisherContact: "pir@microsoft.com", - publisherUri: "uri", }, - permissions: "Community", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update a Shared Image Gallery. + * This sample demonstrates how to create or update a Shared Image Gallery. * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_WithSharingProfile.json + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create.json */ -async function createOrUpdateASimpleGalleryWithSharingProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - location: "West US", - sharingProfile: { permissions: "Groups" }, - }; +async function createOrUpdateASimpleGallery(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + }); console.log(result); } /** - * This sample demonstrates how to Create or update a Shared Image Gallery. + * This sample demonstrates how to create or update a Shared Image Gallery. * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_SoftDeletionEnabled.json + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_SoftDeletionEnabled.json */ async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - location: "West US", - softDeletePolicy: { isSoftDeleteEnabled: true }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + softDeletePolicy: { isSoftDeleteEnabled: true }, + }); console.log(result); } /** - * This sample demonstrates how to Create or update a Shared Image Gallery. + * This sample demonstrates how to create or update a Shared Image Gallery. * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_WithManagedIdentity.json + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_WithManagedIdentity.json */ async function createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", identity: { type: "SystemAssigned, UserAssigned", userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/myIdentity": + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}, }, }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); + description: "This is the gallery description.", + }); console.log(result); } /** - * This sample demonstrates how to Create or update a Shared Image Gallery. + * This sample demonstrates how to create or update a Shared Image Gallery. * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create.json + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_WithSharingProfile.json */ -async function createOrUpdateASimpleGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - location: "West US", - }; +async function createOrUpdateASimpleGalleryWithSharingProfile(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + sharingProfile: { permissions: "Groups" }, + }); console.log(result); } async function main(): Promise { await createACommunityGallery(); - await createOrUpdateASimpleGalleryWithSharingProfile(); + await createOrUpdateASimpleGallery(); await createOrUpdateASimpleGalleryWithSoftDeletionEnabled(); await createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); - await createOrUpdateASimpleGallery(); + await createOrUpdateASimpleGalleryWithSharingProfile(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesDeleteSample.ts index befc53fd2567..3a8b231d36c2 100644 --- a/sdk/compute/arm-compute/samples-dev/galleriesDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleriesDeleteSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a Shared Image Gallery. + * This sample demonstrates how to delete a Shared Image Gallery. * - * @summary Delete a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Delete.json + * @summary delete a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Delete.json */ async function deleteAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginDeleteAndWait( - resourceGroupName, - galleryName, - ); - console.log(result); + await client.galleries.delete("myResourceGroup", "myGalleryName"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleriesGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesGetSample.ts index 83c003e167d1..1fe787589f40 100644 --- a/sdk/compute/arm-compute/samples-dev/galleriesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleriesGetSample.ts @@ -1,122 +1,89 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleriesGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * This sample demonstrates how to retrieves information about a Shared Image Gallery. * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Get.json + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Get.json */ async function getACommunityGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * This sample demonstrates how to retrieves information about a Shared Image Gallery. * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get.json */ -async function getAGalleryWithExpandSharingProfileGroups(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const expand = "SharingProfile/Groups"; - const options: GalleriesGetOptionalParams = { expand }; +async function getAGallery(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get( - resourceGroupName, - galleryName, - options, - ); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * This sample demonstrates how to retrieves information about a Shared Image Gallery. * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json */ -async function getAGalleryWithSelectPermissions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const select = "Permissions"; - const options: GalleriesGetOptionalParams = { select }; +async function getAGalleryWithExpandSharingProfileGroups(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get( - resourceGroupName, - galleryName, - options, - ); + const result = await client.galleries.get("myResourceGroup", "myGalleryName", { + expand: "SharingProfile/Groups", + }); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * This sample demonstrates how to retrieves information about a Shared Image Gallery. * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithManagedIdentity.json + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithManagedIdentity.json */ async function getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. + * This sample demonstrates how to retrieves information about a Shared Image Gallery. * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get.json + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithSelectPermissions.json */ -async function getAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; +async function getAGalleryWithSelectPermissions(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); + const result = await client.galleries.get("myResourceGroup", "myGalleryName", { + select: "Permissions", + }); console.log(result); } async function main(): Promise { await getACommunityGallery(); + await getAGallery(); await getAGalleryWithExpandSharingProfileGroups(); - await getAGalleryWithSelectPermissions(); await getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); - await getAGallery(); + await getAGalleryWithSelectPermissions(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleriesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesListByResourceGroupSample.ts index bf216f1aac1c..4b0ab078b5bc 100644 --- a/sdk/compute/arm-compute/samples-dev/galleriesListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleriesListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List galleries under a resource group. + * This sample demonstrates how to list galleries under a resource group. * - * @summary List galleries under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json + * @summary list galleries under a resource group. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListByResourceGroup.json */ async function listGalleriesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.galleries.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.galleries.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleriesListSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesListSample.ts index 3dc92135078a..03de1c6bdad9 100644 --- a/sdk/compute/arm-compute/samples-dev/galleriesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleriesListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List galleries under a subscription. + * This sample demonstrates how to list galleries under a subscription. * - * @summary List galleries under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListBySubscription.json + * @summary list galleries under a subscription. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListBySubscription.json */ async function listGalleriesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleries.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleriesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleriesUpdateSample.ts index 52bc18cad7af..3028fca96d89 100644 --- a/sdk/compute/arm-compute/samples-dev/galleriesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleriesUpdateSample.ts @@ -1,33 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { GalleryUpdate} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a Shared Image Gallery. + * This sample demonstrates how to update a Shared Image Gallery. * - * @summary Update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Update.json + * @summary update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Update.json */ async function updateASimpleGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: GalleryUpdate = { - description: "This is the gallery description.", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); + const result = await client.galleries.update("myResourceGroup", "myGalleryName", { + description: "This is the gallery description.", + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsCreateOrUpdateSample.ts index 1b383b447d8d..47a662f4311a 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsCreateOrUpdateSample.ts @@ -1,80 +1,67 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryApplicationVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery Application Version. + * This sample demonstrates how to create or update a gallery Application Version. * - * @summary Create or update a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json + * @summary create or update a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Create.json */ async function createOrUpdateASimpleGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const galleryApplicationVersion: GalleryApplicationVersion = { - location: "West US", - publishingProfile: { - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { + location: "West US", + publishingProfile: { + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", }, - ], - endOfLifeDate: new Date("2019-07-01T07:00:00Z"), - manageActions: { - install: - 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', - remove: "del C:\\package ", - }, - replicaCount: 1, - source: { - mediaLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 1, - storageAccountType: "Standard_LRS", + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', + remove: "del C:\\package ", }, - ], + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 1, + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryApplicationVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - ); + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsDeleteSample.ts index 53484e0a15a1..786489da8630 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsDeleteSample.ts @@ -3,31 +3,23 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery Application Version. + * This sample demonstrates how to delete a gallery Application Version. * - * @summary Delete a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json + * @summary delete a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Delete.json */ async function deleteAGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, + await client.galleryApplicationVersions.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsGetSample.ts index 0696ac743ebd..9e4d22e4145d 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsGetSample.ts @@ -1,70 +1,51 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryApplicationVersionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a gallery Application Version. + * This sample demonstrates how to retrieves information about a gallery Application Version. * - * @summary Retrieves information about a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json + * @summary retrieves information about a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get.json */ -async function getAGalleryApplicationVersionWithReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const expand = "ReplicationStatus"; - const options: GalleryApplicationVersionsGetOptionalParams = { expand }; +async function getAGalleryApplicationVersion(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryApplicationVersions.get( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - options, + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", ); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a gallery Application Version. + * This sample demonstrates how to retrieves information about a gallery Application Version. * - * @summary Retrieves information about a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get.json + * @summary retrieves information about a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json */ -async function getAGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; +async function getAGalleryApplicationVersionWithReplicationStatus(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryApplicationVersions.get( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { expand: "ReplicationStatus" }, ); console.log(result); } async function main(): Promise { - await getAGalleryApplicationVersionWithReplicationStatus(); await getAGalleryApplicationVersion(); + await getAGalleryApplicationVersionWithReplicationStatus(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsListByGalleryApplicationSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsListByGalleryApplicationSample.ts index 639b1a3b8a19..84559e2cdb8f 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsListByGalleryApplicationSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsListByGalleryApplicationSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Application Versions in a gallery Application Definition. + * This sample demonstrates how to list gallery Application Versions in a gallery Application Definition. * - * @summary List gallery Application Versions in a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json + * @summary list gallery Application Versions in a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json */ async function listGalleryApplicationVersionsInAGalleryApplicationDefinition(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryApplicationVersions.listByGalleryApplication( - resourceGroupName, - galleryName, - galleryApplicationName, + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsUpdateSample.ts index 7323a54fdabf..3eac329dbc5d 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationVersionsUpdateSample.ts @@ -1,61 +1,49 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryApplicationVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery Application Version. + * This sample demonstrates how to update a gallery Application Version. * - * @summary Update a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json + * @summary update a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Update.json */ async function updateASimpleGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const galleryApplicationVersion: GalleryApplicationVersionUpdate = { - publishingProfile: { - endOfLifeDate: new Date("2019-07-01T07:00:00Z"), - manageActions: { - install: - 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', - remove: "del C:\\package ", - }, - replicaCount: 1, - source: { - mediaLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 1, - storageAccountType: "Standard_LRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, + const result = await client.galleryApplicationVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { + publishingProfile: { + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", + }, + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', + remove: "del C:\\package ", + }, + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 1, + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsCreateOrUpdateSample.ts index cba7f75175e3..d38e1089b60d 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsCreateOrUpdateSample.ts @@ -1,58 +1,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryApplication} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery Application Definition. + * This sample demonstrates how to create or update a gallery Application Definition. * - * @summary Create or update a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Create.json + * @summary create or update a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Create.json */ async function createOrUpdateASimpleGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplication: GalleryApplication = { - description: "This is the gallery application description.", - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - eula: "This is the gallery application EULA.", - location: "West US", - privacyStatementUri: "myPrivacyStatementUri}", - releaseNoteUri: "myReleaseNoteUri", - supportedOSType: "Windows", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, + const result = await client.galleryApplications.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + { + location: "West US", + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsDeleteSample.ts index 617bda01ee43..0a108cde8a32 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsDeleteSample.ts @@ -3,29 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery Application. + * This sample demonstrates how to delete a gallery Application. * - * @summary Delete a gallery Application. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Delete.json + * @summary delete a gallery Application. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Delete.json */ async function deleteAGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, + await client.galleryApplications.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsGetSample.ts index 184a7438c5fe..ffa741dd41b6 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsGetSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a gallery Application Definition. + * This sample demonstrates how to retrieves information about a gallery Application Definition. * - * @summary Retrieves information about a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Get.json + * @summary retrieves information about a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Get.json */ async function getAGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryApplications.get( - resourceGroupName, - galleryName, - galleryApplicationName, + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsListByGallerySample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsListByGallerySample.ts index af317182ba80..b183a2f9de36 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationsListByGallerySample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsListByGallerySample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Application Definitions in a gallery. + * This sample demonstrates how to list gallery Application Definitions in a gallery. * - * @summary List gallery Application Definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json + * @summary list gallery Application Definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_ListByGallery.json */ async function listGalleryApplicationsInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryApplications.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryApplicationsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryApplicationsUpdateSample.ts index e5ef687ffac1..a1f98aefa2e0 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryApplicationsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryApplicationsUpdateSample.ts @@ -1,57 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryApplicationUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery Application Definition. + * This sample demonstrates how to update a gallery Application Definition. * - * @summary Update a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Update.json + * @summary update a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Update.json */ async function updateASimpleGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplication: GalleryApplicationUpdate = { - description: "This is the gallery application description.", - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - eula: "This is the gallery application EULA.", - privacyStatementUri: "myPrivacyStatementUri}", - releaseNoteUri: "myReleaseNoteUri", - supportedOSType: "Windows", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, + const result = await client.galleryApplications.update( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsCreateOrUpdateSample.ts index c8c67e48758b..3bd34d26f618 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsCreateOrUpdateSample.ts @@ -1,914 +1,830 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryImageVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create.json */ -async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { +async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 2, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - virtualMachineId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithAdditionalReplicaSets.json */ -async function createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { +async function createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + additionalReplicaSets: [ + { storageAccountType: "PreviumV2_LRS", regionalReplicaCount: 1 }, + ], + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - communityGalleryImageId: - "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}", }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json */ -async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { +async function createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", + ], + }, + storageProfile: { + source: { + communityGalleryImageId: + "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}", }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - replicationMode: "Shallow", - targetRegions: [ - { name: "West US", excludeFromLatest: false, regionalReplicaCount: 1 }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json */ async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}", }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}", + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, }, }, - }; + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [{ name: "West US", regionalReplicaCount: 1, excludeFromLatest: false }], + replicationMode: "Shallow", + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json */ async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, + ], + }, + storageProfile: { + osDiskImage: { source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", }, + hostCaching: "ReadOnly", }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", - }, + dataDiskImages: [ + { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, }, }, - }; + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithStorageAccountStrategy.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { name: "West US" }, + { name: "East US" }, + { name: "East US 2", storageAccountType: "Premium_LRS" }, + ], + storageAccountStrategy: "PreferStandard_ZRS", + }, + storageProfile: { + source: { + virtualMachineId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", + }, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json */ -async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { +async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", - lun: 1, + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - securityProfile: { - uefiSettings: { - additionalSignatures: { - db: [{ type: "x509", value: [""] }], - dbx: [{ type: "x509", value: [""] }], - kek: [{ type: "sha256", value: [""] }], - }, - signatureTemplateNames: ["MicrosoftUefiCertificateAuthorityTemplate"], - }, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, }, - }, - ], - osDiskImage: { - hostCaching: "ReadOnly", + ], + }, + storageProfile: { source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", }, }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVHD.json */ async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", - lun: 1, + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1, + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + osDiskImage: { source: { storageAccountId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", }, + hostCaching: "ReadOnly", }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, + dataDiskImages: [ + { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithAdditionalReplicaSets.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json */ -async function createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - additionalReplicaSets: [ - { regionalReplicaCount: 1, storageAccountType: "PreviumV2_LRS" }, - ], - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1, + }, + ], }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, + ], + }, + storageProfile: { + osDiskImage: { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + hostCaching: "ReadOnly", }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + dataDiskImages: [ + { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + securityProfile: { + uefiSettings: { + signatureTemplateNames: ["MicrosoftUefiCertificateAuthorityTemplate"], + additionalSignatures: { + kek: [{ type: "sha256", value: [""] }], + db: [{ type: "x509", value: [""] }], + dbx: [{ type: "x509", value: [""] }], }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, ); console.log(result); } /** - * This sample demonstrates how to Create or update a gallery image version. + * This sample demonstrates how to create or update a gallery image version. * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithStorageAccountStrategy.json + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json */ -async function createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - storageAccountStrategy: "PreferStandard_ZRS", - targetRegions: [ - { name: "West US" }, - { name: "East US" }, - { name: "East US 2", storageAccountType: "Premium_LRS" }, - ], - }, - storageProfile: { - source: { - virtualMachineId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", - }, - }, - }; +async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json - */ -async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 2, + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { diskEncryptionSetId: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], }, + excludeFromLatest: false, }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", + ], + }, + storageProfile: { + source: { + virtualMachineId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, ); console.log(result); } async function main(): Promise { - await createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(); await createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(); + await createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(); + await createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(); await createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(); + await createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(); await createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(); - await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(); - await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(); - await createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(); await createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(); await createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(); + await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(); + await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(); + await createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsDeleteSample.ts index d6f918fb29ec..d6fa05d770bb 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsDeleteSample.ts @@ -3,31 +3,23 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery image version. + * This sample demonstrates how to delete a gallery image version. * - * @summary Delete a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json + * @summary delete a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Delete.json */ async function deleteAGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, + await client.galleryImageVersions.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsGetSample.ts index f75b8ba77ed1..f3b68f6a3255 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsGetSample.ts @@ -1,180 +1,133 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryImageVersionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a gallery image version. + * This sample demonstrates how to retrieves information about a gallery image version. * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get.json */ -async function getAGalleryImageVersionWithReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ReplicationStatus"; - const options: GalleryImageVersionsGetOptionalParams = { expand }; +async function getAGalleryImageVersion(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", ); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a gallery image version. + * This sample demonstrates how to retrieves information about a gallery image version. * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json */ -async function getAGalleryImageVersionWithSnapshotsAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; +async function getAGalleryImageVersionWithReplicationStatus(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ReplicationStatus" }, ); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a gallery image version. + * This sample demonstrates how to retrieves information about a gallery image version. * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json */ -async function getAGalleryImageVersionWithValidationProfileAndReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ValidationProfile,ReplicationStatus"; - const options: GalleryImageVersionsGetOptionalParams = { expand }; +async function getAGalleryImageVersionWithSnapshotsAsASource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", ); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a gallery image version. + * This sample demonstrates how to retrieves information about a gallery image version. * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfile.json + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithValidationProfile.json */ async function getAGalleryImageVersionWithValidationProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ValidationProfile"; - const options: GalleryImageVersionsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ValidationProfile" }, ); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a gallery image version. + * This sample demonstrates how to retrieves information about a gallery image version. * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json */ -async function getAGalleryImageVersionWithVhdAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; +async function getAGalleryImageVersionWithValidationProfileAndReplicationStatus(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ValidationProfile,ReplicationStatus" }, ); console.log(result); } /** - * This sample demonstrates how to Retrieves information about a gallery image version. + * This sample demonstrates how to retrieves information about a gallery image version. * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get.json + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json */ -async function getAGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; +async function getAGalleryImageVersionWithVhdAsASource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", ); console.log(result); } async function main(): Promise { + await getAGalleryImageVersion(); await getAGalleryImageVersionWithReplicationStatus(); await getAGalleryImageVersionWithSnapshotsAsASource(); - await getAGalleryImageVersionWithValidationProfileAndReplicationStatus(); await getAGalleryImageVersionWithValidationProfile(); + await getAGalleryImageVersionWithValidationProfileAndReplicationStatus(); await getAGalleryImageVersionWithVhdAsASource(); - await getAGalleryImageVersion(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsListByGalleryImageSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsListByGalleryImageSample.ts index 55e8aad7bad5..63183dd7f404 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsListByGalleryImageSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsListByGalleryImageSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery image versions in a gallery image definition. + * This sample demonstrates how to list gallery image versions in a gallery image definition. * - * @summary List gallery image versions in a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json + * @summary list gallery image versions in a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_ListByGalleryImage.json */ async function listGalleryImageVersionsInAGalleryImageDefinition(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryImageVersions.listByGalleryImage( - resourceGroupName, - galleryName, - galleryImageName, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsUpdateSample.ts index 5b8af71d2b16..61a7438c4a9c 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImageVersionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImageVersionsUpdateSample.ts @@ -1,129 +1,92 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryImageVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery image version. + * This sample demonstrates how to update a gallery image version. * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update.json */ -async function restoreASoftDeletedGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersionUpdate = { - restore: true, - storageProfile: {}, - }; +async function updateASimpleGalleryImageVersionManagedImageAsSource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { name: "East US", regionalReplicaCount: 2, storageAccountType: "Standard_ZRS" }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Update a gallery image version. + * This sample demonstrates how to update a gallery image version. * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update.json + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json */ -async function updateASimpleGalleryImageVersionManagedImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersionUpdate = { - publishingProfile: { - targetRegions: [ - { name: "West US", regionalReplicaCount: 1 }, - { - name: "East US", - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; +async function restoreASoftDeletedGalleryImageVersion(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { restore: true, storageProfile: {} }, ); console.log(result); } /** - * This sample demonstrates how to Update a gallery image version. + * This sample demonstrates how to update a gallery image version. * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json */ async function updateASimpleGalleryImageVersionWithoutSourceId(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersionUpdate = { - publishingProfile: { - targetRegions: [ - { name: "West US", regionalReplicaCount: 1 }, - { - name: "East US", - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - storageProfile: {}, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { name: "East US", regionalReplicaCount: 2, storageAccountType: "Standard_ZRS" }, + ], + }, + storageProfile: {}, + }, ); console.log(result); } async function main(): Promise { - await restoreASoftDeletedGalleryImageVersion(); await updateASimpleGalleryImageVersionManagedImageAsSource(); + await restoreASoftDeletedGalleryImageVersion(); await updateASimpleGalleryImageVersionWithoutSourceId(); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesCreateOrUpdateSample.ts index 67d87853f57f..75e30c816347 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImagesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesCreateOrUpdateSample.ts @@ -1,42 +1,30 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { GalleryImage} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery image definition. + * This sample demonstrates how to create or update a gallery image definition. * - * @summary Create or update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Create.json + * @summary create or update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Create.json */ async function createOrUpdateASimpleGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage: GalleryImage = { - hyperVGeneration: "V1", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - location: "West US", - osState: "Generalized", - osType: "Windows", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, + const result = await client.galleryImages.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + location: "West US", + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V1", + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesDeleteSample.ts index 34147910e471..1f9692513637 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImagesDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesDeleteSample.ts @@ -3,29 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery image. + * This sample demonstrates how to delete a gallery image. * - * @summary Delete a gallery image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Delete.json + * @summary delete a gallery image. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Delete.json */ async function deleteAGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryImageName, - ); - console.log(result); + await client.galleryImages.delete("myResourceGroup", "myGalleryName", "myGalleryImageName"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesGetSample.ts index e3c197c584f8..77898a83a496 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImagesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesGetSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a gallery image definition. + * This sample demonstrates how to retrieves information about a gallery image definition. * - * @summary Retrieves information about a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Get.json + * @summary retrieves information about a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Get.json */ async function getAGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImages.get( - resourceGroupName, - galleryName, - galleryImageName, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesListByGallerySample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesListByGallerySample.ts index 9b43313fa3e6..53770633e0a9 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImagesListByGallerySample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesListByGallerySample.ts @@ -3,29 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery image definitions in a gallery. + * This sample demonstrates how to list gallery image definitions in a gallery. * - * @summary List gallery image definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json + * @summary list gallery image definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_ListByGallery.json */ async function listGalleryImagesInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.galleryImages.listByGallery( - resourceGroupName, - galleryName, - )) { + for await (const item of client.galleryImages.listByGallery("myResourceGroup", "myGalleryName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryImagesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryImagesUpdateSample.ts index 8ad9a0c4ff13..4e9b051b5172 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryImagesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryImagesUpdateSample.ts @@ -1,93 +1,62 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryImageUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery image definition. + * This sample demonstrates how to update a gallery image definition. * - * @summary Update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_UpdateFeatures.json + * @summary update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Update.json */ -async function updateAGalleryImageFeature(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage: GalleryImageUpdate = { - allowUpdateImage: true, - features: [ - { - name: "SecurityType", - startsAtVersion: "2.0.0", - value: "TrustedLaunch", - }, - ], - hyperVGeneration: "V2", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - osState: "Generalized", - osType: "Windows", - }; +async function updateASimpleGalleryImage(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, + const result = await client.galleryImages.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V1", + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, ); console.log(result); } /** - * This sample demonstrates how to Update a gallery image definition. + * This sample demonstrates how to update a gallery image definition. * - * @summary Update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Update.json + * @summary update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_UpdateFeatures.json */ -async function updateASimpleGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage: GalleryImageUpdate = { - hyperVGeneration: "V1", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - osState: "Generalized", - osType: "Windows", - }; +async function updateAGalleryImageFeature(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, + const result = await client.galleryImages.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V2", + allowUpdateImage: true, + features: [{ name: "SecurityType", value: "TrustedLaunch", startsAtVersion: "2.0.0" }], + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, ); console.log(result); } async function main(): Promise { - await updateAGalleryImageFeature(); await updateASimpleGalleryImage(); + await updateAGalleryImageFeature(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts index 4387be7ea26e..31d834c8da9f 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts @@ -1,66 +1,48 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryInVMAccessControlProfileVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery inVMAccessControlProfile version. + * This sample demonstrates how to create or update a gallery inVMAccessControlProfile version. * - * @summary Create or update a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json + * @summary create or update a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json */ async function createOrUpdateAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion = + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", { - defaultAccess: "Allow", - excludeFromLatest: false, location: "West US", mode: "Audit", + defaultAccess: "Allow", rules: { + privileges: [ + { name: "GoalState", path: "/machine", queryParameters: { comp: "goalstate" } }, + ], + roles: [{ name: "Provisioning", privileges: ["GoalState"] }], identities: [ { name: "WinPA", - exePath: "C:\\Windows\\System32\\cscript.exe", + userName: "SYSTEM", groupName: "Administrators", + exePath: "C:\\Windows\\System32\\cscript.exe", processName: "cscript", - userName: "SYSTEM", - }, - ], - privileges: [ - { - name: "GoalState", - path: "/machine", - queryParameters: { comp: "goalstate" }, }, ], - roleAssignments: [{ identities: ["WinPA"], role: "Provisioning" }], - roles: [{ name: "Provisioning", privileges: ["GoalState"] }], + roleAssignments: [{ role: "Provisioning", identities: ["WinPA"] }], }, targetLocations: [{ name: "West US" }, { name: "South Central US" }], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfileVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - ); + excludeFromLatest: false, + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsDeleteSample.ts index 5f43a5e435ef..4e4dcfcacbdc 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsDeleteSample.ts @@ -3,32 +3,23 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery inVMAccessControlProfile version. + * This sample demonstrates how to delete a gallery inVMAccessControlProfile version. * - * @summary Delete a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json + * @summary delete a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json */ async function deleteAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfileVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - ); - console.log(result); + await client.galleryInVMAccessControlProfileVersions.delete( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsGetSample.ts index 553c579d3815..375c5c0bbdd3 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsGetSample.ts @@ -3,29 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a gallery inVMAccessControlProfile version. + * This sample demonstrates how to retrieves information about a gallery inVMAccessControlProfile version. * - * @summary Retrieves information about a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json + * @summary retrieves information about a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json */ async function getAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryInVMAccessControlProfileVersions.get( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts rename to sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts index f4018263e6dd..aa2d019ce1d9 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts @@ -3,36 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * This sample demonstrates how to list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile * - * @summary List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json + * @summary list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json */ -async function listGalleryInVMAccessControlProfileVersionsInAGalleryInVmaccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; +async function listGalleryInVMAccessControlProfileVersionsInAGalleryInVMAccessControlProfile(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryInVMAccessControlProfileVersions.listByGalleryInVMAccessControlProfile( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", )) { resArray.push(item); } + console.log(resArray); } async function main(): Promise { - await listGalleryInVMAccessControlProfileVersionsInAGalleryInVmaccessControlProfile(); + await listGalleryInVMAccessControlProfileVersionsInAGalleryInVMAccessControlProfile(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsUpdateSample.ts index d4c24d638631..faaf59cdce57 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsUpdateSample.ts @@ -1,49 +1,31 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryInVMAccessControlProfileVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery inVMAccessControlProfile version. + * This sample demonstrates how to update a gallery inVMAccessControlProfile version. * - * @summary Update a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json + * @summary update a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json */ async function updateAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate = + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.update( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", { + mode: "Audit", defaultAccess: "Allow", + targetLocations: [{ name: "West US" }, { name: "South Central US" }, { name: "East US" }], excludeFromLatest: false, - mode: "Audit", - targetLocations: [ - { name: "West US" }, - { name: "South Central US" }, - { name: "East US" }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfileVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - ); + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts index 662c42165e35..848475a94b75 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts @@ -1,40 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryInVMAccessControlProfile} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery inVMAccessControlProfile. + * This sample demonstrates how to create or update a gallery inVMAccessControlProfile. * - * @summary Create or update a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json + * @summary create or update a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json */ async function createOrUpdateAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile = { - location: "West US", - properties: { applicableHostEndpoint: "WireServer", osType: "Linux" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfiles.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - ); + const result = await client.galleryInVMAccessControlProfiles.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + { location: "West US", properties: { osType: "Linux", applicableHostEndpoint: "WireServer" } }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesDeleteSample.ts index 6b8f565f63e4..4b0573ebac86 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesDeleteSample.ts @@ -3,30 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery inVMAccessControlProfile. + * This sample demonstrates how to delete a gallery inVMAccessControlProfile. * - * @summary Delete a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json + * @summary delete a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json */ async function deleteAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfiles.beginDeleteAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - ); - console.log(result); + await client.galleryInVMAccessControlProfiles.delete( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesGetSample.ts index 9aa8c274d836..15577e6ba5b9 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesGetSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a gallery inVMAccessControlProfile. + * This sample demonstrates how to retrieves information about a gallery inVMAccessControlProfile. * - * @summary Retrieves information about a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json + * @summary retrieves information about a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json */ async function getAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryInVMAccessControlProfiles.get( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesListByGallerySample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesListByGallerySample.ts index a43a9aa34043..3a3c62b5ca77 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesListByGallerySample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesListByGallerySample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery inVMAccessControlProfiles in a gallery. + * This sample demonstrates how to list gallery inVMAccessControlProfiles in a gallery. * - * @summary List gallery inVMAccessControlProfiles in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json + * @summary list gallery inVMAccessControlProfiles in a gallery. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json */ async function listGalleryInVMAccessControlProfilesInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryInVMAccessControlProfiles.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesUpdateSample.ts index daa804c66bf4..94b19177bd93 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfilesUpdateSample.ts @@ -1,38 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryInVMAccessControlProfileUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery inVMAccessControlProfile. + * This sample demonstrates how to update a gallery inVMAccessControlProfile. * - * @summary Update a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json + * @summary update a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json */ async function updateAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate = - { properties: { applicableHostEndpoint: "WireServer", osType: "Linux" } }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfiles.beginUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - ); + const result = await client.galleryInVMAccessControlProfiles.update( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + { properties: { osType: "Linux", applicableHostEndpoint: "WireServer" } }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsCreateOrUpdateSample.ts index fe6e8b61efb1..50ac949cf226 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsCreateOrUpdateSample.ts @@ -1,107 +1,90 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryScriptVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery Script Version. + * This sample demonstrates how to create or update a gallery Script Version. * - * @summary Create or update a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Create.json + * @summary create or update a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Create.json */ async function createOrUpdateASimpleGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const galleryScriptVersion: GalleryScriptVersion = { - location: "West US", - properties: { - publishingProfile: { - endOfLifeDate: new Date("2027-07-01T07:00:00Z"), - replicaCount: 2, - source: { - parameters: [ - { - name: "location", - type: "String", - defaultValue: "westus", - required: true, - }, - { - name: "myGalleryScriptParameter1", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: true, - }, - { - name: "myGalleryScriptParameter2", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: false, - }, - { - name: "numberOfUnits", - type: "Int", - description: "description of the parameter", - defaultValue: "3", - maxValue: "5", - minValue: "1", - required: true, - }, - { - name: "weightOfUnit", - type: "Double", - description: "description of the parameter", - defaultValue: "0.6", - maxValue: "2", - minValue: "0.1", - required: true, - }, + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + { + location: "West US", + properties: { + publishingProfile: { + source: { + scriptLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", + parameters: [ + { name: "location", required: true, defaultValue: "westus", type: "String" }, + { + name: "myGalleryScriptParameter1", + required: true, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "myGalleryScriptParameter2", + required: false, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "numberOfUnits", + required: true, + type: "Int", + defaultValue: "3", + description: "description of the parameter", + minValue: "1", + maxValue: "5", + }, + { + name: "weightOfUnit", + required: true, + type: "Double", + defaultValue: "0.6", + description: "description of the parameter", + minValue: "0.1", + maxValue: "2", + }, + { + name: "typeOfProduct", + required: false, + type: "Enum", + defaultValue: "Fruit", + description: "description of the parameter", + enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], + }, + ], + }, + targetRegions: [ { - name: "typeOfProduct", - type: "Enum", - description: "description of the parameter", - defaultValue: "Fruit", - enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], - required: false, + name: "West US", + regionalReplicaCount: 2, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, }, ], - scriptLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", + replicaCount: 2, + endOfLifeDate: new Date("2027-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_LRS", - }, - ], + safetyProfile: { allowDeletionOfReplicatedLocations: false }, }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsDeleteSample.ts index 15763088adcf..f55d96f9a25f 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsDeleteSample.ts @@ -3,31 +3,23 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery Script Version. + * This sample demonstrates how to delete a gallery Script Version. * - * @summary Delete a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Delete.json + * @summary delete a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Delete.json */ async function deleteAGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, + await client.galleryScriptVersions.delete( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsGetSample.ts index 6ecfb16bbace..44b3cb3d78b9 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsGetSample.ts @@ -3,61 +3,48 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Custom ArmResourceRead operation template with CloudError as Error + * This sample demonstrates how to custom ArmResourceRead operation template with CloudError as Error * - * @summary Custom ArmResourceRead operation template with CloudError as Error - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json + * @summary custom ArmResourceRead operation template with CloudError as Error + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get.json */ -async function getAGalleryScriptVersionWithReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; +async function getAGalleryScriptVersion(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryScriptVersions.get( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", ); console.log(result); } /** - * This sample demonstrates how to Custom ArmResourceRead operation template with CloudError as Error + * This sample demonstrates how to custom ArmResourceRead operation template with CloudError as Error * - * @summary Custom ArmResourceRead operation template with CloudError as Error - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get.json + * @summary custom ArmResourceRead operation template with CloudError as Error + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json */ -async function getAGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; +async function getAGalleryScriptVersionWithReplicationStatus(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryScriptVersions.get( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", ); console.log(result); } async function main(): Promise { - await getAGalleryScriptVersionWithReplicationStatus(); await getAGalleryScriptVersion(); + await getAGalleryScriptVersionWithReplicationStatus(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsListByGalleryScriptSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsListByGalleryScriptSample.ts index 9082a43e1554..4847f78976c0 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsListByGalleryScriptSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsListByGalleryScriptSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Script Versions in a gallery Script Definition. + * This sample demonstrates how to list gallery Script Versions in a gallery Script Definition. * - * @summary List gallery Script Versions in a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json + * @summary list gallery Script Versions in a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json */ async function listGalleryScriptVersionsInAGalleryScriptDefinition(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryScriptVersions.listByGalleryScript( - resourceGroupName, - galleryName, - galleryScriptName, + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsUpdateSample.ts index 2edbdc805f93..675e15d93e7f 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptVersionsUpdateSample.ts @@ -1,104 +1,87 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryScriptVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery Script Version. + * This sample demonstrates how to update a gallery Script Version. * - * @summary Update a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Update.json + * @summary update a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Update.json */ async function updateASimpleGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const galleryScriptVersion: GalleryScriptVersionUpdate = { - publishingProfile: { - endOfLifeDate: new Date("2027-07-01T07:00:00Z"), - replicaCount: 2, - source: { - parameters: [ - { - name: "location", - type: "String", - defaultValue: "westus", - required: true, - }, - { - name: "myGalleryScriptParameter1", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: true, - }, - { - name: "myGalleryScriptParameter2", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: false, - }, - { - name: "numberOfUnits", - type: "Int", - description: "description of the parameter", - defaultValue: "3", - maxValue: "5", - minValue: "1", - required: true, - }, - { - name: "weightOfUnit", - type: "Double", - description: "description of the parameter", - defaultValue: "0.6", - maxValue: "2", - minValue: "0.1", - required: true, - }, + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.update( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + { + publishingProfile: { + source: { + scriptLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", + parameters: [ + { name: "location", required: true, defaultValue: "westus", type: "String" }, + { + name: "myGalleryScriptParameter1", + required: true, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "myGalleryScriptParameter2", + required: false, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "numberOfUnits", + required: true, + type: "Int", + defaultValue: "3", + description: "description of the parameter", + minValue: "1", + maxValue: "5", + }, + { + name: "weightOfUnit", + required: true, + type: "Double", + defaultValue: "0.6", + description: "description of the parameter", + minValue: "0.1", + maxValue: "2", + }, + { + name: "typeOfProduct", + required: false, + type: "Enum", + defaultValue: "Fruit", + description: "description of the parameter", + enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], + }, + ], + }, + targetRegions: [ { - name: "typeOfProduct", - type: "Enum", - description: "description of the parameter", - defaultValue: "Fruit", - enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], - required: false, + name: "West US", + regionalReplicaCount: 2, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, }, ], - scriptLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", + replicaCount: 2, + endOfLifeDate: new Date("2027-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_LRS", - }, - ], + safetyProfile: { allowDeletionOfReplicatedLocations: false }, }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptsCreateOrUpdateSample.ts index 1e5cf8896053..3cdc7da00c73 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptsCreateOrUpdateSample.ts @@ -1,41 +1,33 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { GalleryScript} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts + * This sample demonstrates how to create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts * - * @summary Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Create.json + * @summary create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Create.json */ async function createOrUpdateASimpleGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScript: GalleryScript = { - location: "West US", - properties: { - description: "This is the gallery script description.", - eula: "This is the gallery script EULA.", - privacyStatementUri: "{myPrivacyStatementUri}", - releaseNoteUri: "{myReleaseNoteUri}", - supportedOSType: "Windows", - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, + const result = await client.galleryScripts.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + { + location: "West US", + properties: { + description: "This is the gallery script description.", + eula: "This is the gallery script EULA.", + privacyStatementUri: "{myPrivacyStatementUri}", + releaseNoteUri: "{myReleaseNoteUri}", + supportedOSType: "Windows", + }, + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptsDeleteSample.ts index 08eedb573942..215d81625e2f 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptsDeleteSample.ts @@ -3,29 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a gallery Script Definition. + * This sample demonstrates how to delete a gallery Script Definition. * - * @summary Delete a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Delete.json + * @summary delete a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Delete.json */ async function deleteAGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - ); - console.log(result); + await client.galleryScripts.delete("myResourceGroup", "myGalleryName", "myGalleryScriptName"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptsGetSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptsGetSample.ts index 5ca63f38f39e..7f58e5463498 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptsGetSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a gallery script definition. + * This sample demonstrates how to retrieves information about a gallery script definition. * - * @summary Retrieves information about a gallery script definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Get.json + * @summary retrieves information about a gallery script definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Get.json */ async function getAGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryScripts.get( - resourceGroupName, - galleryName, - galleryScriptName, + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptsListByGallerySample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptsListByGallerySample.ts index 925269fbd468..5962273b727c 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptsListByGallerySample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptsListByGallerySample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Script Definitions in a gallery. + * This sample demonstrates how to list gallery Script Definitions in a gallery. * - * @summary List gallery Script Definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_ListByGallery.json + * @summary list gallery Script Definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_ListByGallery.json */ async function listGalleryScriptsInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryScripts.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/galleryScriptsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/galleryScriptsUpdateSample.ts index 8e3d12b8f914..b7dea1e09716 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryScriptsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/galleryScriptsUpdateSample.ts @@ -1,41 +1,30 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryScriptUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a gallery Script Definition. + * This sample demonstrates how to update a gallery Script Definition. * - * @summary Update a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Update.json + * @summary update a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Update.json */ async function updateASimpleGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScript: GalleryScriptUpdate = { - description: "This is the gallery script description.", - eula: "This is the gallery script EULA.", - privacyStatementUri: "{myPrivacyStatementUri}", - releaseNoteUri: "{myReleaseNoteUri}", - supportedOSType: "Windows", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, + const result = await client.galleryScripts.update( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + { + description: "This is the gallery script description.", + eula: "This is the gallery script EULA.", + privacyStatementUri: "{myPrivacyStatementUri}", + releaseNoteUri: "{myReleaseNoteUri}", + supportedOSType: "Windows", + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/gallerySharingProfileUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/gallerySharingProfileUpdateSample.ts index 3f725dbc1177..d7c7de35a948 100644 --- a/sdk/compute/arm-compute/samples-dev/gallerySharingProfileUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/gallerySharingProfileUpdateSample.ts @@ -1,96 +1,68 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { SharingUpdate} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update sharing profile of a gallery. + * This sample demonstrates how to update sharing profile of a gallery. * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_AddToSharingProfile.json */ async function addSharingIdToTheSharingProfileOfAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate: SharingUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "Add", groups: [ { type: "Subscriptions", - ids: [ - "34a4ab42-0d72-47d9-bd1a-aed207386dac", - "380fd389-260b-41aa-bad9-0a83108c370b", - ], + ids: ["34a4ab42-0d72-47d9-bd1a-aed207386dac", "380fd389-260b-41aa-bad9-0a83108c370b"], }, { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] }, ], - operationType: "Add", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); + }); console.log(result); } /** - * This sample demonstrates how to Update sharing profile of a gallery. + * This sample demonstrates how to update sharing profile of a gallery. * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ResetSharingProfile.json + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_EnableCommunityGallery.json */ -async function resetSharingProfileOfAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate: SharingUpdate = { operationType: "Reset" }; +async function shareAGalleryToCommunity(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "EnableCommunity", + }); console.log(result); } /** - * This sample demonstrates how to Update sharing profile of a gallery. + * This sample demonstrates how to update sharing profile of a gallery. * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_EnableCommunityGallery.json + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ResetSharingProfile.json */ -async function shareAGalleryToCommunity(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate: SharingUpdate = { operationType: "EnableCommunity" }; +async function resetSharingProfileOfAGallery(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "Reset", + }); console.log(result); } async function main(): Promise { await addSharingIdToTheSharingProfileOfAGallery(); - await resetSharingProfileOfAGallery(); await shareAGalleryToCommunity(); + await resetSharingProfileOfAGallery(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/imagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/imagesCreateOrUpdateSample.ts index 5cf4e62b14ca..0ef678618fe4 100644 --- a/sdk/compute/arm-compute/samples-dev/imagesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/imagesCreateOrUpdateSample.ts @@ -1,309 +1,236 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Image} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlob.json */ -async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { - location: "West US", - storageProfile: { - osDisk: { - blobUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - osState: "Generalized", - osType: "Linux", - }, - }, - }; +async function createAVirtualMachineImageFromABlob(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an image. - * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlob.json - */ -async function createAVirtualMachineImageFromABlob(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { - blobUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - osState: "Generalized", osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json */ -async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { +async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", diskEncryptionSet: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", }, osState: "Generalized", - osType: "Linux", - snapshot: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAManagedDisk.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAManagedDisk.json */ async function createAVirtualMachineImageFromAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", managedDisk: { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", }, osState: "Generalized", - osType: "Linux", }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json */ -async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { +async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, diskEncryptionSet: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", }, - managedDisk: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", - }, osState: "Generalized", - osType: "Linux", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromASnapshot.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromASnapshot.json */ async function createAVirtualMachineImageFromASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { - osState: "Generalized", osType: "Linux", snapshot: { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", }, + osState: "Generalized", }, zoneResilient: false, }, - }; + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update an image. + * + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { + location: "West US", + storageProfile: { + osDisk: { + osType: "Linux", + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + osState: "Generalized", + }, + }, + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAVM.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAVM.json */ async function createAVirtualMachineImageFromAnExistingVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", sourceVirtualMachine: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromABlobIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromABlob(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + }, dataDisks: [ { - blobUri: - "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", lun: 1, + blobUri: "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", }, ], - osDisk: { - blobUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - osState: "Generalized", - osType: "Linux", - }, zoneResilient: false, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + osState: "Generalized", + }, dataDisks: [ { lun: 1, @@ -312,41 +239,32 @@ async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() }, }, ], - osDisk: { - managedDisk: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", - }, - osState: "Generalized", - osType: "Linux", - }, zoneResilient: false, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + osState: "Generalized", + }, dataDisks: [ { lun: 1, @@ -355,33 +273,19 @@ async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot(): P }, }, ], - osDisk: { - osState: "Generalized", - osType: "Linux", - snapshot: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } async function main(): Promise { - await createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromABlob(); - await createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(); + await createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromAManagedDisk(); - await createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(); + await createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromASnapshot(); + await createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromAnExistingVirtualMachine(); await createAVirtualMachineImageThatIncludesADataDiskFromABlob(); await createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk(); diff --git a/sdk/compute/arm-compute/samples-dev/imagesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/imagesDeleteSample.ts index 179dfe8d792b..512cb2d5dc7f 100644 --- a/sdk/compute/arm-compute/samples-dev/imagesDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/imagesDeleteSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes an Image. + * This sample demonstrates how to deletes an Image. * - * @summary Deletes an Image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json + * @summary deletes an Image. + * x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MaximumSet_Gen.json */ async function imageDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait( - resourceGroupName, - imageName, - ); - console.log(result); + await client.images.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa"); } /** - * This sample demonstrates how to Deletes an Image. + * This sample demonstrates how to deletes an Image. * - * @summary Deletes an Image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json + * @summary deletes an Image. + * x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MinimumSet_Gen.json */ async function imageDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait( - resourceGroupName, - imageName, - ); - console.log(result); + await client.images.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/imagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/imagesGetSample.ts index d4769b7bcc49..8892b2a6b773 100644 --- a/sdk/compute/arm-compute/samples-dev/imagesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/imagesGetSample.ts @@ -3,23 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets an image. + * This sample demonstrates how to gets an image. * - * @summary Gets an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Get.json + * @summary gets an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Get.json */ async function getInformationAboutAVirtualMachineImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.get(resourceGroupName, imageName); + const result = await client.images.get("myResourceGroup", "myImage"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/imagesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/imagesListByResourceGroupSample.ts index 98f529bc7f4b..3d7ff46e2ce8 100644 --- a/sdk/compute/arm-compute/samples-dev/imagesListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/imagesListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * This sample demonstrates how to gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. * - * @summary Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListByResourceGroup.json + * @summary gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: 2025-11-01/imageExamples/Image_ListByResourceGroup.json */ async function listAllVirtualMachineImagesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.images.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.images.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/imagesListSample.ts b/sdk/compute/arm-compute/samples-dev/imagesListSample.ts index 799678baa056..ee0a87098217 100644 --- a/sdk/compute/arm-compute/samples-dev/imagesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/imagesListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * This sample demonstrates how to gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. * - * @summary Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListBySubscription.json + * @summary gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: 2025-11-01/imageExamples/Image_ListBySubscription.json */ async function listAllVirtualMachineImagesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.images.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/imagesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/imagesUpdateSample.ts index e44f50b61d5d..7e064bc818ac 100644 --- a/sdk/compute/arm-compute/samples-dev/imagesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/imagesUpdateSample.ts @@ -1,37 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { ImageUpdate} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update an image. + * This sample demonstrates how to update an image. * - * @summary Update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Update.json + * @summary update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Update.json */ async function updatesTagsOfAnImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: ImageUpdate = { - hyperVGeneration: "V1", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.update("myResourceGroup", "myImage", { sourceVirtualMachine: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, + hyperVGeneration: "V1", tags: { department: "HR" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/logAnalyticsExportRequestRateByIntervalSample.ts b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportRequestRateByIntervalSample.ts index d54adee46487..cc2db2d8de03 100644 --- a/sdk/compute/arm-compute/samples-dev/logAnalyticsExportRequestRateByIntervalSample.ts +++ b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportRequestRateByIntervalSample.ts @@ -1,38 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - RequestRateByIntervalInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * This sample demonstrates how to export logs that show Api requests made by this subscription in the given time window to show throttling activities. * - * @summary Export logs that show Api requests made by this subscription in the given time window to show throttling activities. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json + * @summary export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json */ async function exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus"; - const parameters: RequestRateByIntervalInput = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.exportRequestRateByInterval("westus", { + intervalLength: "FiveMins", blobContainerSasUri: "https://somesasuri", fromTime: new Date("2018-01-21T01:54:06.862601Z"), - groupByResourceName: true, - intervalLength: "FiveMins", toTime: new Date("2018-01-23T01:54:06.862601Z"), - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.logAnalytics.beginExportRequestRateByIntervalAndWait( - location, - parameters, - ); + groupByResourceName: true, + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/logAnalyticsExportThrottledRequestsSample.ts b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportThrottledRequestsSample.ts index e56693a50bf6..3195d61c82fb 100644 --- a/sdk/compute/arm-compute/samples-dev/logAnalyticsExportThrottledRequestsSample.ts +++ b/sdk/compute/arm-compute/samples-dev/logAnalyticsExportThrottledRequestsSample.ts @@ -1,39 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ThrottledRequestsInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Export logs that show total throttled Api requests for this subscription in the given time window. + * This sample demonstrates how to export logs that show total throttled Api requests for this subscription in the given time window. * - * @summary Export logs that show total throttled Api requests for this subscription in the given time window. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json + * @summary export logs that show total throttled Api requests for this subscription in the given time window. + * x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_ThrottledRequests.json */ async function exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus"; - const parameters: ThrottledRequestsInput = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.exportThrottledRequests("westus", { blobContainerSasUri: "https://somesasuri", fromTime: new Date("2018-01-21T01:54:06.862601Z"), - groupByClientApplicationId: false, + toTime: new Date("2018-01-23T01:54:06.862601Z"), groupByOperationName: true, groupByResourceName: false, + groupByClientApplicationId: false, groupByUserAgent: false, - toTime: new Date("2018-01-23T01:54:06.862601Z"), - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.logAnalytics.beginExportThrottledRequestsAndWait( - location, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/operationsListSample.ts b/sdk/compute/arm-compute/samples-dev/operationsListSample.ts index 97d841b9ecdc..61ecfd81c77e 100644 --- a/sdk/compute/arm-compute/samples-dev/operationsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/operationsListSample.ts @@ -3,43 +3,38 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json */ async function operationsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); + const client = new ComputeManagementClient(credential); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to List the operations for the provider + * This sample demonstrates how to list the operations for the provider * - * @summary List the operations for the provider - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json + * @summary list the operations for the provider + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json */ async function operationsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); + const client = new ComputeManagementClient(credential); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsCreateOrUpdateSample.ts index f2b3d05fdacd..89a3d7b1eb31 100644 --- a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsCreateOrUpdateSample.ts @@ -1,38 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ProximityPlacementGroup} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a proximity placement group. + * This sample demonstrates how to create or update a proximity placement group. * - * @summary Create or update a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json + * @summary create or update a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json */ async function createOrUpdateAProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const parameters: ProximityPlacementGroup = { - intent: { vmSizes: ["Basic_A0", "Basic_A2"] }, - location: "westus", - proximityPlacementGroupType: "Standard", - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.proximityPlacementGroups.createOrUpdate( - resourceGroupName, - proximityPlacementGroupName, - parameters, + "myResourceGroup", + "myProximityPlacementGroup", + { + location: "westus", + zones: ["1"], + proximityPlacementGroupType: "Standard", + intent: { vmSizes: ["Basic_A0", "Basic_A2"] }, + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsDeleteSample.ts index e61d7a349413..6085245aedc8 100644 --- a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsDeleteSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete a proximity placement group. + * This sample demonstrates how to delete a proximity placement group. * - * @summary Delete a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json + * @summary delete a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json */ async function deleteAProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.delete( - resourceGroupName, - proximityPlacementGroupName, - ); - console.log(result); + await client.proximityPlacementGroups.delete("myResourceGroup", "myProximityPlacementGroup"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsGetSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsGetSample.ts index 8ae8098691b4..5cfe879d6138 100644 --- a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsGetSample.ts @@ -3,25 +3,20 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about a proximity placement group . + * This sample demonstrates how to retrieves information about a proximity placement group . * - * @summary Retrieves information about a proximity placement group . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + * @summary retrieves information about a proximity placement group . + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json */ async function getProximityPlacementGroups(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.proximityPlacementGroups.get( - resourceGroupName, - proximityPlacementGroupName, + "myResourceGroup", + "myProximityPlacementGroup", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListByResourceGroupSample.ts index a60002ac9c15..7e06fdd00e15 100644 --- a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all proximity placement groups in a resource group. + * This sample demonstrates how to lists all proximity placement groups in a resource group. * - * @summary Lists all proximity placement groups in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json + * @summary lists all proximity placement groups in a resource group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json */ async function listProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.proximityPlacementGroups.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.proximityPlacementGroups.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListBySubscriptionSample.ts index ab3016fb54d1..2c91347b9769 100644 --- a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsListBySubscriptionSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all proximity placement groups in a subscription. + * This sample demonstrates how to lists all proximity placement groups in a subscription. * - * @summary Lists all proximity placement groups in a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json + * @summary lists all proximity placement groups in a subscription. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json */ async function listProximityPlacementGroups(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.proximityPlacementGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsUpdateSample.ts index b5d25959b887..ca1254d6f13a 100644 --- a/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/proximityPlacementGroupsUpdateSample.ts @@ -1,35 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ProximityPlacementGroupUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a proximity placement group. + * This sample demonstrates how to update a proximity placement group. * - * @summary Update a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json + * @summary update a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json */ async function updateAProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const parameters: ProximityPlacementGroupUpdate = { - tags: { additionalProp1: "string" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.proximityPlacementGroups.update( - resourceGroupName, - proximityPlacementGroupName, - parameters, + "myResourceGroup", + "myProximityPlacementGroup", + { tags: { additionalProp1: "string" } }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/resourceSkusListSample.ts b/sdk/compute/arm-compute/samples-dev/resourceSkusListSample.ts index c3a4a7f9ac81..d50f1ff67bcd 100644 --- a/sdk/compute/arm-compute/samples-dev/resourceSkusListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/resourceSkusListSample.ts @@ -1,76 +1,67 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ResourceSkusListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkus.json */ -async function listsAllAvailableResourceSkUs(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; +async function listsAllAvailableResourceSKUs(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.resourceSkus.list()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkusForARegion.json */ -async function listsAllAvailableResourceSkUsForTheSpecifiedRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const filter = "location eq 'westus'"; - const options: ResourceSkusListOptionalParams = { filter }; +async function listsAllAvailableResourceSKUsForTheSpecifiedRegion(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.resourceSkus.list(options)) { + for await (const item of client.resourceSkus.list({ filter: "location eq 'westus'" })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkusWithExtendedLocations.json */ -async function listsAllAvailableResourceSkUsWithExtendedLocationInformation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const includeExtendedLocations = "true"; - const options: ResourceSkusListOptionalParams = { includeExtendedLocations }; +async function listsAllAvailableResourceSKUsWithExtendedLocationInformation(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.resourceSkus.list(options)) { + for await (const item of client.resourceSkus.list({ includeExtendedLocations: "true" })) { resArray.push(item); } + console.log(resArray); } async function main(): Promise { - await listsAllAvailableResourceSkUs(); - await listsAllAvailableResourceSkUsForTheSpecifiedRegion(); - await listsAllAvailableResourceSkUsWithExtendedLocationInformation(); + await listsAllAvailableResourceSKUs(); + await listsAllAvailableResourceSKUsForTheSpecifiedRegion(); + await listsAllAvailableResourceSKUsWithExtendedLocationInformation(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsCreateOrUpdateSample.ts index 1ca0c46af733..fb2cad2fa340 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsCreateOrUpdateSample.ts @@ -1,76 +1,53 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - RestorePointCollection} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * This sample demonstrates how to the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. * - * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json + * @summary the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate.json */ -async function createOrUpdateARestorePointCollectionForCrossRegionCopy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const parameters: RestorePointCollection = { +async function createOrUpdateARestorePointCollection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate("myResourceGroup", "myRpc", { location: "norwayeast", source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, + instantAccess: true, tags: { myTag1: "tagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.createOrUpdate( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * This sample demonstrates how to the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. * - * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json + * @summary the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json */ -async function createOrUpdateARestorePointCollection(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const parameters: RestorePointCollection = { - instantAccess: true, +async function createOrUpdateARestorePointCollectionForCrossRegionCopy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate("myResourceGroup", "myRpc", { location: "norwayeast", source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName", }, tags: { myTag1: "tagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.createOrUpdate( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + }); console.log(result); } async function main(): Promise { - await createOrUpdateARestorePointCollectionForCrossRegionCopy(); await createOrUpdateARestorePointCollection(); + await createOrUpdateARestorePointCollectionForCrossRegionCopy(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsDeleteSample.ts index c2f3c1f7faee..1bc75dfdcf74 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsDeleteSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * This sample demonstrates how to the operation to delete the restore point collection. This operation will also delete all the contained restore points. * - * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json + * @summary the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json */ async function restorePointCollectionDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); + await client.restorePointCollections.delete("rgcompute", "aaaaaaaaaaaaaaaaa"); } /** - * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. + * This sample demonstrates how to the operation to delete the restore point collection. This operation will also delete all the contained restore points. * - * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json + * @summary the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json */ async function restorePointCollectionDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); + await client.restorePointCollections.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsGetSample.ts index 705c22494d50..99cf39f38926 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsGetSample.ts @@ -3,47 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get the restore point collection. + * This sample demonstrates how to the operation to get the restore point collection. * - * @summary The operation to get the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get.json + * @summary the operation to get the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get.json */ async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.get( - resourceGroupName, - restorePointCollectionName, - ); + const result = await client.restorePointCollections.get("myResourceGroup", "myRpc"); console.log(result); } /** - * This sample demonstrates how to The operation to get the restore point collection. + * This sample demonstrates how to the operation to get the restore point collection. * - * @summary The operation to get the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + * @summary the operation to get the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json */ async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.get( - resourceGroupName, - restorePointCollectionName, - ); + const result = await client.restorePointCollections.get("myResourceGroup", "rpcName"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListAllSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListAllSample.ts index 667e112e5019..03e2f06a92a9 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListAllSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListAllSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * This sample demonstrates how to gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. * - * @summary Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json + * @summary gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListBySubscription.json */ async function getsTheListOfRestorePointCollectionsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.restorePointCollections.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListSample.ts index b80209a25cb0..2bbd8dbce675 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsListSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of restore point collections in a resource group. + * This sample demonstrates how to gets the list of restore point collections in a resource group. * - * @summary Gets the list of restore point collections in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json + * @summary gets the list of restore point collections in a resource group. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListByResourceGroup.json */ async function getsTheListOfRestorePointCollectionsInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.restorePointCollections.list( - resourceGroupName, - )) { + for await (const item of client.restorePointCollections.list("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsUpdateSample.ts index 832862a0c49d..4cd6b93e08f8 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointCollectionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointCollectionsUpdateSample.ts @@ -1,63 +1,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - RestorePointCollectionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update the restore point collection. + * This sample demonstrates how to the operation to update the restore point collection. * - * @summary The operation to update the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json + * @summary the operation to update the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json */ async function restorePointCollectionUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: RestorePointCollectionUpdate = { - instantAccess: true, + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update("rgcompute", "aaaaaaaaaaaaaaaaaaaa", { source: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, + instantAccess: true, tags: { key8536: "aaaaaaaaaaaaaaaaaaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.update( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to update the restore point collection. + * This sample demonstrates how to the operation to update the restore point collection. * - * @summary The operation to update the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json + * @summary the operation to update the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json */ async function restorePointCollectionUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaa"; - const parameters: RestorePointCollectionUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.update( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + const result = await client.restorePointCollections.update("rgcompute", "aaaaaaaaaaaaaaaaaa", {}); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/restorePointsCreateSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointsCreateSample.ts index 9f24e748cd79..9c4dc90a7f49 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointsCreateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointsCreateSample.ts @@ -1,69 +1,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { RestorePoint} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * This sample demonstrates how to the operation to create the restore point. Updating properties of an existing restore point is not allowed * - * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + * @summary the operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Copy_BetweenRegions.json */ async function copyARestorePointToADifferentRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const parameters: RestorePoint = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.create("myResourceGroup", "rpcName", "rpName", { sourceRestorePoint: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginCreateAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed + * This sample demonstrates how to the operation to create the restore point. Updating properties of an existing restore point is not allowed * - * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Create.json + * @summary the operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Create.json */ async function createARestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const parameters: RestorePoint = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.create("myResourceGroup", "rpcName", "rpName", { excludeDisks: [ { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", }, ], instantAccessDurationMinutes: 120, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginCreateAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/restorePointsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointsDeleteSample.ts index 26086cc25a4a..dda1662ee81c 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointsDeleteSample.ts @@ -3,52 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete the restore point. + * This sample demonstrates how to the operation to delete the restore point. * - * @summary The operation to delete the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json + * @summary the operation to delete the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json */ async function restorePointDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaaaa"; - const restorePointName = "a"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); + await client.restorePoints.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", "a"); } /** - * This sample demonstrates how to The operation to delete the restore point. + * This sample demonstrates how to the operation to delete the restore point. * - * @summary The operation to delete the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json + * @summary the operation to delete the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json */ async function restorePointDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; - const restorePointName = "aaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); + await client.restorePoints.delete("rgcompute", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/restorePointsGetSample.ts b/sdk/compute/arm-compute/samples-dev/restorePointsGetSample.ts index 83eb4e410802..419dd5f36bb2 100644 --- a/sdk/compute/arm-compute/samples-dev/restorePointsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/restorePointsGetSample.ts @@ -3,51 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get the restore point. + * This sample demonstrates how to the operation to get the restore point. * - * @summary The operation to get the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get.json + * @summary the operation to get the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get.json */ async function getARestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.get( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); + const result = await client.restorePoints.get("myResourceGroup", "rpcName", "rpName"); console.log(result); } /** - * This sample demonstrates how to The operation to get the restore point. + * This sample demonstrates how to the operation to get the restore point. * - * @summary The operation to get the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + * @summary the operation to get the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get_WithInstanceView.json */ async function getRestorePointWithInstanceView(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.get( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); + const result = await client.restorePoints.get("myResourceGroup", "rpcName", "rpName"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleriesGetSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleriesGetSample.ts index 789df82e9e52..e794b6089f9c 100644 --- a/sdk/compute/arm-compute/samples-dev/sharedGalleriesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleriesGetSample.ts @@ -3,22 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a shared gallery by subscription id or tenant id. + * This sample demonstrates how to get a shared gallery by subscription id or tenant id. * - * @summary Get a shared gallery by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json + * @summary get a shared gallery by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_Get.json */ async function getASharedGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sharedGalleries.get(location, galleryUniqueName); + const result = await client.sharedGalleries.get("myLocation", "galleryUniqueName"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleriesListSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleriesListSample.ts index 1a20930131a7..200c3beae57e 100644 --- a/sdk/compute/arm-compute/samples-dev/sharedGalleriesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleriesListSample.ts @@ -3,24 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List shared galleries by subscription id or tenant id. + * This sample demonstrates how to list shared galleries by subscription id or tenant id. * - * @summary List shared galleries by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_List.json + * @summary list shared galleries by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_List.json */ async function listSharedGalleries(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sharedGalleries.list(location)) { + for await (const item of client.sharedGalleries.list("myLocation")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsGetSample.ts index 53a2e5c47557..08a8adebd643 100644 --- a/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsGetSample.ts @@ -3,28 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a shared gallery image version by subscription id or tenant id. + * This sample demonstrates how to get a shared gallery image version by subscription id or tenant id. * - * @summary Get a shared gallery image version by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json + * @summary get a shared gallery image version by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersion_Get.json */ async function getASharedGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "myGalleryImageVersionName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.sharedGalleryImageVersions.get( - location, - galleryUniqueName, - galleryImageName, - galleryImageVersionName, + "myLocation", + "galleryUniqueName", + "myGalleryImageName", + "myGalleryImageVersionName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsListSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsListSample.ts index 7e8862314e10..d378489eed4e 100644 --- a/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImageVersionsListSample.ts @@ -3,30 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List shared gallery image versions by subscription id or tenant id. + * This sample demonstrates how to list shared gallery image versions by subscription id or tenant id. * - * @summary List shared gallery image versions by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json + * @summary list shared gallery image versions by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersions_List.json */ async function listSharedGalleryImageVersions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sharedGalleryImageVersions.list( - location, - galleryUniqueName, - galleryImageName, + "myLocation", + "galleryUniqueName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesGetSample.ts index 30c6dc6984bc..c37772e633cd 100644 --- a/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesGetSample.ts @@ -3,26 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a shared gallery image by subscription id or tenant id. + * This sample demonstrates how to get a shared gallery image by subscription id or tenant id. * - * @summary Get a shared gallery image by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json + * @summary get a shared gallery image by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImage_Get.json */ async function getASharedGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.sharedGalleryImages.get( - location, - galleryUniqueName, - galleryImageName, + "myLocation", + "galleryUniqueName", + "myGalleryImageName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesListSample.ts b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesListSample.ts index a541bdefb774..e3e4a3b084cd 100644 --- a/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sharedGalleryImagesListSample.ts @@ -3,28 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List shared gallery images by subscription id or tenant id. + * This sample demonstrates how to list shared gallery images by subscription id or tenant id. * - * @summary List shared gallery images by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json + * @summary list shared gallery images by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImages_List.json */ async function listSharedGalleryImages(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sharedGalleryImages.list( - location, - galleryUniqueName, - )) { + for await (const item of client.sharedGalleryImages.list("myLocation", "galleryUniqueName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsCreateOrUpdateSample.ts index a9664e245231..6628fa6227d8 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsCreateOrUpdateSample.ts @@ -1,232 +1,165 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Snapshot} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Creates or updates a snapshot. + * This sample demonstrates how to creates or updates a snapshot. * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json */ async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot1"; - const snapshot: Snapshot = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot1", { + location: "West US", creationData: { createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", storageAccountId: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a snapshot. + * This sample demonstrates how to creates or updates a snapshot. * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json */ async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot1"; - const snapshot: Snapshot = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot1", { + location: "West US", creationData: { createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", }, - location: "West US", - }; + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + provisionedBandwidthCopySpeed: "Enhanced", + }, + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a snapshot. + * This sample demonstrates how to creates or updates a snapshot. * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json */ async function createASnapshotFromAnElasticSanVolumeSnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot: Snapshot = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot", { + location: "West US", creationData: { createOption: "CopyFromSanSnapshot", elasticSanResourceId: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a snapshot. + * This sample demonstrates how to creates or updates a snapshot. * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", creationData: { - createOption: "CopyStart", - provisionedBandwidthCopySpeed: "Enhanced", + createOption: "Copy", sourceResourceId: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a snapshot. + * This sample demonstrates how to creates or updates a snapshot. * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json */ async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { - creationData: { - createOption: "CopyStart", - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", - }, - location: "West US", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json - */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", creationData: { - createOption: "Copy", + createOption: "CopyStart", sourceResourceId: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + }); console.log(result); } /** - * This sample demonstrates how to Creates or updates a snapshot. + * This sample demonstrates how to creates or updates a snapshot. * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_InstantAccessSnapshot.json + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_InstantAccessSnapshot.json */ async function createASnapshotWhichCanBeInstantlyAccessable(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", creationData: { createOption: "Copy", - instantAccessDurationMinutes: 120, sourceResourceId: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", + instantAccessDurationMinutes: 120, }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + }); console.log(result); } async function main(): Promise { await createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(); await createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(); - await createASnapshotFromAnElasticSanVolumeSnapshot(); await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(); - await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(); + await createASnapshotFromAnElasticSanVolumeSnapshot(); await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(); + await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(); await createASnapshotWhichCanBeInstantlyAccessable(); } diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsDeleteSample.ts index 59712e136a82..98146c4f58f0 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsDeleteSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes a snapshot. + * This sample demonstrates how to deletes a snapshot. * - * @summary Deletes a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Delete.json + * @summary deletes a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Delete.json */ async function deleteASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginDeleteAndWait( - resourceGroupName, - snapshotName, - ); - console.log(result); + await client.snapshots.delete("myResourceGroup", "mySnapshot"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsGetSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsGetSample.ts index becd274d52f9..8db4942c1152 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsGetSample.ts @@ -3,41 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets information about a snapshot. + * This sample demonstrates how to gets information about a snapshot. * - * @summary Gets information about a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Get.json + * @summary gets information about a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Get.json */ async function getInformationAboutASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.get(resourceGroupName, snapshotName); + const result = await client.snapshots.get("myResourceGroup", "mySnapshot"); console.log(result); } /** - * This sample demonstrates how to Gets information about a snapshot. + * This sample demonstrates how to gets information about a snapshot. * - * @summary Gets information about a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + * @summary gets information about a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_GetIncrementalSnapshot.json */ async function getInformationAboutAnIncrementalSnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "myIncrementalSnapshot"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.get(resourceGroupName, snapshotName); + const result = await client.snapshots.get("myResourceGroup", "myIncrementalSnapshot"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsGrantAccessSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsGrantAccessSample.ts index a49992431343..bb09e23f8feb 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsGrantAccessSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsGrantAccessSample.ts @@ -1,35 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { GrantAccessData} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Grants access to a snapshot. + * This sample demonstrates how to grants access to a snapshot. * - * @summary Grants access to a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json + * @summary grants access to a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_BeginGetAccess.json */ async function getASasOnASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const grantAccessData: GrantAccessData = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.grantAccess("myResourceGroup", "mySnapshot", { access: "Read", durationInSeconds: 300, fileFormat: "VHDX", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginGrantAccessAndWait( - resourceGroupName, - snapshotName, - grantAccessData, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsListByResourceGroupSample.ts index a3ce53a14398..fa5e58aa9ea3 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists snapshots under a resource group. + * This sample demonstrates how to lists snapshots under a resource group. * - * @summary Lists snapshots under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json + * @summary lists snapshots under a resource group. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListByResourceGroup.json */ async function listAllSnapshotsInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.snapshots.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.snapshots.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsListSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsListSample.ts index cc3045417253..e4cbb34ad0b8 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists snapshots under a subscription. + * This sample demonstrates how to lists snapshots under a subscription. * - * @summary Lists snapshots under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListBySubscription.json + * @summary lists snapshots under a subscription. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListBySubscription.json */ async function listAllSnapshotsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.snapshots.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsRevokeAccessSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsRevokeAccessSample.ts index 8142776cd2dc..e0686a8fc206 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsRevokeAccessSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsRevokeAccessSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Revokes access to a snapshot. + * This sample demonstrates how to revokes access to a snapshot. * - * @summary Revokes access to a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_EndGetAccess.json + * @summary revokes access to a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_EndGetAccess.json */ async function revokeAccessToASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginRevokeAccessAndWait( - resourceGroupName, - snapshotName, - ); - console.log(result); + await client.snapshots.revokeAccess("myResourceGroup", "mySnapshot"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/snapshotsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/snapshotsUpdateSample.ts index 563a6b933685..acd0aa1987a2 100644 --- a/sdk/compute/arm-compute/samples-dev/snapshotsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/snapshotsUpdateSample.ts @@ -1,67 +1,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { SnapshotUpdate} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Updates (patches) a snapshot. + * This sample demonstrates how to updates (patches) a snapshot. * - * @summary Updates (patches) a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json + * @summary updates (patches) a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update.json */ -async function updateASnapshotWithAcceleratedNetworking(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot: SnapshotUpdate = { - diskSizeGB: 20, - supportedCapabilities: { acceleratedNetwork: false }, - tags: { department: "Development", project: "UpdateSnapshots" }, - }; +async function updateASnapshot(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + const result = await client.snapshots.update("myResourceGroup", "mySnapshot", { + diskSizeGB: 20, + tags: { department: "Development", project: "UpdateSnapshots" }, + }); console.log(result); } /** - * This sample demonstrates how to Updates (patches) a snapshot. + * This sample demonstrates how to updates (patches) a snapshot. * - * @summary Updates (patches) a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update.json + * @summary updates (patches) a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json */ -async function updateASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot: SnapshotUpdate = { - diskSizeGB: 20, - tags: { department: "Development", project: "UpdateSnapshots" }, - }; +async function updateASnapshotWithAcceleratedNetworking(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); + const result = await client.snapshots.update("myResourceGroup", "mySnapshot", { + diskSizeGB: 20, + supportedCapabilities: { acceleratedNetwork: false }, + tags: { department: "Development", project: "UpdateSnapshots" }, + }); console.log(result); } async function main(): Promise { - await updateASnapshotWithAcceleratedNetworking(); await updateASnapshot(); + await updateASnapshotWithAcceleratedNetworking(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/softDeletedResourceListByArtifactNameSample.ts b/sdk/compute/arm-compute/samples-dev/softDeletedResourceListByArtifactNameSample.ts index b3b0c7fe3f26..899bf414ef2d 100644 --- a/sdk/compute/arm-compute/samples-dev/softDeletedResourceListByArtifactNameSample.ts +++ b/sdk/compute/arm-compute/samples-dev/softDeletedResourceListByArtifactNameSample.ts @@ -3,33 +3,27 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. + * This sample demonstrates how to list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. * - * @summary List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json + * @summary list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. + * x-ms-original-file: 2025-03-03/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json */ async function listSoftDeletedResourcesOfAnArtifactInTheGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const artifactType = "images"; - const artifactName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.softDeletedResource.listByArtifactName( - resourceGroupName, - galleryName, - artifactType, - artifactName, + "myResourceGroup", + "myGalleryName", + "images", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysCreateSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysCreateSample.ts index df9df4b1feda..17f68c4d706f 100644 --- a/sdk/compute/arm-compute/samples-dev/sshPublicKeysCreateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysCreateSample.ts @@ -1,42 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - SshPublicKeyResource} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Creates a new SSH public key resource. + * This sample demonstrates how to creates a new SSH public key resource. * - * @summary Creates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json + * @summary creates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Create.json */ -async function createANewSshPublicKeyResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters: SshPublicKeyResource = { - location: "westus", - publicKey: "{ssh-rsa public key}", - }; +async function createANewSSHPublicKeyResource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.create( - resourceGroupName, - sshPublicKeyName, - parameters, - ); + const result = await client.sshPublicKeys.create("myResourceGroup", "mySshPublicKeyName", { + location: "westus", + publicKey: "{ssh-rsa public key}", + }); console.log(result); } async function main(): Promise { - await createANewSshPublicKeyResource(); + await createANewSSHPublicKeyResource(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysDeleteSample.ts index 6161bdc2fc98..96ff342d1dc2 100644 --- a/sdk/compute/arm-compute/samples-dev/sshPublicKeysDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysDeleteSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Delete an SSH public key. + * This sample demonstrates how to delete an SSH public key. * - * @summary Delete an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json + * @summary delete an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json */ async function sshPublicKeyDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.delete( - resourceGroupName, - sshPublicKeyName, - ); - console.log(result); + await client.sshPublicKeys.delete("rgcompute", "aaaaaaaaaa"); } /** - * This sample demonstrates how to Delete an SSH public key. + * This sample demonstrates how to delete an SSH public key. * - * @summary Delete an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json + * @summary delete an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json */ async function sshPublicKeyDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.delete( - resourceGroupName, - sshPublicKeyName, - ); - console.log(result); + await client.sshPublicKeys.delete("rgcompute", "aaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysGenerateKeyPairSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGenerateKeyPairSample.ts index 055866c9ae7d..35c68a058c69 100644 --- a/sdk/compute/arm-compute/samples-dev/sshPublicKeysGenerateKeyPairSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGenerateKeyPairSample.ts @@ -1,92 +1,66 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - SshGenerateKeyPairInputParameters, - SshPublicKeysGenerateKeyPairOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json */ -async function generateAnSshKeyPairWithEd25519Encryption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters: SshGenerateKeyPairInputParameters = { - encryptionType: "Ed25519", - }; - const options: SshPublicKeysGenerateKeyPairOptionalParams = { parameters }; +async function generateAnSSHKeyPair(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, - options, + "myResourceGroup", + "mySshPublicKeyName", ); console.log(result); } /** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json */ -async function generateAnSshKeyPairWithRsaEncryption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters: SshGenerateKeyPairInputParameters = { - encryptionType: "RSA", - }; - const options: SshPublicKeysGenerateKeyPairOptionalParams = { parameters }; +async function generateAnSSHKeyPairWithEd25519Encryption(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, - options, + "myResourceGroup", + "mySshPublicKeyName", + { parameters: { encryptionType: "Ed25519" } }, ); console.log(result); } /** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json */ -async function generateAnSshKeyPair(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; +async function generateAnSSHKeyPairWithRSAEncryption(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, + "myResourceGroup", + "mySshPublicKeyName", + { parameters: { encryptionType: "RSA" } }, ); console.log(result); } async function main(): Promise { - await generateAnSshKeyPairWithEd25519Encryption(); - await generateAnSshKeyPairWithRsaEncryption(); - await generateAnSshKeyPair(); + await generateAnSSHKeyPair(); + await generateAnSSHKeyPairWithEd25519Encryption(); + await generateAnSSHKeyPairWithRSAEncryption(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysGetSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGetSample.ts index 7520228ff502..b46dd5694d56 100644 --- a/sdk/compute/arm-compute/samples-dev/sshPublicKeysGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysGetSample.ts @@ -3,26 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about an SSH public key. + * This sample demonstrates how to retrieves information about an SSH public key. * - * @summary Retrieves information about an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + * @summary retrieves information about an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Get.json */ async function getAnSshPublicKey(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.get( - resourceGroupName, - sshPublicKeyName, - ); + const result = await client.sshPublicKeys.get("myResourceGroup", "mySshPublicKeyName"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListByResourceGroupSample.ts index ffdb0bb51658..a82a9e04966f 100644 --- a/sdk/compute/arm-compute/samples-dev/sshPublicKeysListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListByResourceGroupSample.ts @@ -3,49 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json + * @summary lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json */ async function sshPublicKeyListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sshPublicKeys.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.sshPublicKeys.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json + * @summary lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json */ async function sshPublicKeyListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sshPublicKeys.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.sshPublicKeys.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListBySubscriptionSample.ts index 92906743fe8a..c6c198ecc3e5 100644 --- a/sdk/compute/arm-compute/samples-dev/sshPublicKeysListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysListBySubscriptionSample.ts @@ -3,41 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json + * @summary lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json */ async function sshPublicKeyListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sshPublicKeys.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json + * @summary lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json */ async function sshPublicKeyListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sshPublicKeys.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/sshPublicKeysUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/sshPublicKeysUpdateSample.ts index 30422492e7d5..e14ec29b69e8 100644 --- a/sdk/compute/arm-compute/samples-dev/sshPublicKeysUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/sshPublicKeysUpdateSample.ts @@ -1,60 +1,37 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - SshPublicKeyUpdateResource} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Updates a new SSH public key resource. + * This sample demonstrates how to updates a new SSH public key resource. * - * @summary Updates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json + * @summary updates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json */ async function sshPublicKeyUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaaa"; - const parameters: SshPublicKeyUpdateResource = { - publicKey: "{ssh-rsa public key}", - tags: { key2854: "a" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.update( - resourceGroupName, - sshPublicKeyName, - parameters, - ); + const result = await client.sshPublicKeys.update("rgcompute", "aaaaaaaaaaaa", { + publicKey: "{ssh-rsa public key}", + tags: { key2854: "a" }, + }); console.log(result); } /** - * This sample demonstrates how to Updates a new SSH public key resource. + * This sample demonstrates how to updates a new SSH public key resource. * - * @summary Updates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json + * @summary updates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json */ async function sshPublicKeyUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaa"; - const parameters: SshPublicKeyUpdateResource = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.update( - resourceGroupName, - sshPublicKeyName, - parameters, - ); + const result = await client.sshPublicKeys.update("rgcompute", "aaaaaaaaaaa", {}); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/usageListSample.ts b/sdk/compute/arm-compute/samples-dev/usageListSample.ts index 6f30c97319bb..d6847a04c839 100644 --- a/sdk/compute/arm-compute/samples-dev/usageListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/usageListSample.ts @@ -3,43 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * This sample demonstrates how to gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. * - * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json + * @summary gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json */ async function usageListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "4_."; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.usageOperations.list(location)) { + for await (const item of client.usage.list("4_.")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * This sample demonstrates how to gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. * - * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json + * @summary gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json */ async function usageListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "_--"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.usageOperations.list(location)) { + for await (const item of client.usage.list("_--")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesGetSample.ts index cdfaa7668ef2..c7ae1bcb5637 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesGetSample.ts @@ -3,52 +3,41 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a virtual machine extension image. + * This sample demonstrates how to gets a virtual machine extension image. * - * @summary Gets a virtual machine extension image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + * @summary gets a virtual machine extension image. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json */ async function virtualMachineExtensionImageGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaaaaaaaaaaaaaaaa"; - const version = "aaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineExtensionImages.get( - location, - publisherName, - typeParam, - version, + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a virtual machine extension image. + * This sample demonstrates how to gets a virtual machine extension image. * - * @summary Gets a virtual machine extension image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + * @summary gets a virtual machine extension image. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json */ async function virtualMachineExtensionImageGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aa"; - const version = "aaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineExtensionImages.get( - location, - publisherName, - typeParam, - version, + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aa", + "aaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListTypesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListTypesSample.ts index 7bc4a6457127..7c6854c51ad9 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListTypesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListTypesSample.ts @@ -3,45 +3,35 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine extension image types. + * This sample demonstrates how to gets a list of virtual machine extension image types. * - * @summary Gets a list of virtual machine extension image types. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json + * @summary gets a list of virtual machine extension image types. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json */ async function virtualMachineExtensionImageListTypesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineExtensionImages.listTypes( - location, - publisherName, + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine extension image types. + * This sample demonstrates how to gets a list of virtual machine extension image types. * - * @summary Gets a list of virtual machine extension image types. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json + * @summary gets a list of virtual machine extension image types. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json */ async function virtualMachineExtensionImageListTypesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listTypes( - location, - publisherName, - ); + const result = await client.virtualMachineExtensionImages.listTypes("aaaa", "aa"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListVersionsSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListVersionsSample.ts index 7e21e94e5269..1685a76224c7 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListVersionsSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionImagesListVersionsSample.ts @@ -1,63 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineExtensionImagesListVersionsOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * This sample demonstrates how to gets a list of virtual machine extension image versions. * - * @summary Gets a list of virtual machine extension image versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json + * @summary gets a list of virtual machine extension image versions. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json */ async function virtualMachineExtensionImageListVersionsMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaaaaaaaaaaaaaaaa"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 22; - const orderby = "a"; - const options: VirtualMachineExtensionImagesListVersionsOptionalParams = { - filter, - top, - orderby, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineExtensionImages.listVersions( - location, - publisherName, - typeParam, - options, + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + { filter: "aaaaaaaaaaaaaaaaaaaaaaaaa", top: 22, orderby: "a" }, ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine extension image versions. + * This sample demonstrates how to gets a list of virtual machine extension image versions. * - * @summary Gets a list of virtual machine extension image versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json + * @summary gets a list of virtual machine extension image versions. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json */ async function virtualMachineExtensionImageListVersionsMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineExtensionImages.listVersions( - location, - publisherName, - typeParam, + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsCreateOrUpdateSample.ts index 38d283552cd6..9cb7f274e1af 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsCreateOrUpdateSample.ts @@ -1,98 +1,79 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineExtension} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update the extension. + * This sample demonstrates how to the operation to create or update the extension. * - * @summary The operation to create or update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json + * @summary the operation to create or update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json */ async function virtualMachineExtensionCreateOrUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaaaaaaaa"; - const extensionParameters: VirtualMachineExtension = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "a", - instanceView: { - name: "aaaaaaaaaaaaaaaaa", - type: "aaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - substatuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - }, - location: "westus", - protectedSettings: {}, - publisher: "extPublisher", - settings: {}, - suppressFailures: true, - tags: { key9183: "aa" }, - typeHandlerVersion: "1.2", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineExtensions.createOrUpdate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", + { + location: "westus", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + suppressFailures: true, + settings: {}, + forceUpdateTag: "a", + enableAutomaticUpgrade: true, + protectedSettings: {}, + instanceView: { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + level: "Info", + displayStatus: "aaaaaa", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + level: "Info", + displayStatus: "aaaaaa", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + }, + tags: { key9183: "aa" }, + }, + ); console.log(result); } /** - * This sample demonstrates how to The operation to create or update the extension. + * This sample demonstrates how to the operation to create or update the extension. * - * @summary The operation to create or update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json + * @summary the operation to create or update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json */ async function virtualMachineExtensionCreateOrUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineExtension = { location: "westus" }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineExtensions.createOrUpdate( + "rgcompute", + "myVM", + "myVMExtension", + { location: "westus" }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsDeleteSample.ts index 304e7b25dcd3..a6798b90c2a3 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsDeleteSample.ts @@ -3,52 +3,35 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete the extension. + * This sample demonstrates how to the operation to delete the extension. * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json */ async function virtualMachineExtensionDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginDeleteAndWait( - resourceGroupName, - vmName, - vmExtensionName, + await client.virtualMachineExtensions.delete( + "rgcompute", + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); - console.log(result); } /** - * This sample demonstrates how to The operation to delete the extension. + * This sample demonstrates how to the operation to delete the extension. * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json */ async function virtualMachineExtensionDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginDeleteAndWait( - resourceGroupName, - vmName, - vmExtensionName, - ); - console.log(result); + await client.virtualMachineExtensions.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsGetSample.ts index 084ab374b52c..23c99b55ca2f 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsGetSample.ts @@ -1,60 +1,39 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineExtensionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get the extension. + * This sample demonstrates how to the operation to get the extension. * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json */ async function virtualMachineExtensionGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaa"; - const expand = "aaaaaa"; - const options: VirtualMachineExtensionsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineExtensions.get( - resourceGroupName, - vmName, - vmExtensionName, - options, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", + { expand: "aaaaaa" }, ); console.log(result); } /** - * This sample demonstrates how to The operation to get the extension. + * This sample demonstrates how to the operation to get the extension. * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json */ async function virtualMachineExtensionGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.get( - resourceGroupName, - vmName, - vmExtensionName, - ); + const result = await client.virtualMachineExtensions.get("rgcompute", "myVM", "myVMExtension"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsListSample.ts index 1226dc1c7957..0f95e29c7db8 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsListSample.ts @@ -1,55 +1,38 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineExtensionsListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * This sample demonstrates how to the operation to get all extensions of a Virtual Machine. * - * @summary The operation to get all extensions of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json + * @summary the operation to get all extensions of a Virtual Machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json */ async function virtualMachineExtensionListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaa"; - const options: VirtualMachineExtensionsListOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.list( - resourceGroupName, - vmName, - options, - ); + const result = await client.virtualMachineExtensions.list("rgcompute", "aaaaaaaaaaaaa", { + expand: "aaaaaaaaaaaaaaaaa", + }); console.log(result); } /** - * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. + * This sample demonstrates how to the operation to get all extensions of a Virtual Machine. * - * @summary The operation to get all extensions of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json + * @summary the operation to get all extensions of a Virtual Machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json */ async function virtualMachineExtensionListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineExtensions.list( - resourceGroupName, - vmName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsUpdateSample.ts index a5f9ccfb566b..f0e8236c103f 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineExtensionsUpdateSample.ts @@ -1,49 +1,38 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineExtensionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update the extension. + * This sample demonstrates how to the operation to update the extension. * - * @summary The operation to update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json + * @summary the operation to update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Update.json */ async function updateVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineExtensionUpdate = { - type: "extType", - autoUpgradeMinorVersion: true, - protectedSettingsFromKeyVault: { - secretUrl: - "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", - sourceVault: { - id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", - }, - }, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - suppressFailures: true, - typeHandlerVersion: "1.2", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, + const result = await client.virtualMachineExtensions.update( + "myResourceGroup", + "myVM", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + type: "extType", + typeHandlerVersion: "1.2", + suppressFailures: true, + settings: { UserName: "xyz@microsoft.com" }, + protectedSettingsFromKeyVault: { + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", + }, + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + }, + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneGetSample.ts index 235e2baa00e8..da43530c8b9f 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneGetSample.ts @@ -3,60 +3,45 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * This sample demonstrates how to gets a virtual machine image in an edge zone. * - * @summary Gets a virtual machine image in an edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + * @summary gets a virtual machine image in an edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.get( - location, - edgeZone, - publisherName, - offer, - skus, - version, + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a virtual machine image in an edge zone. + * This sample demonstrates how to gets a virtual machine image in an edge zone. * - * @summary Gets a virtual machine image in an edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + * @summary gets a virtual machine image in an edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaa"; - const version = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.get( - location, - edgeZone, - publisherName, - offer, - skus, - version, + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListOffersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListOffersSample.ts index 2215b6a03943..bd15c6ec5241 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListOffersSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListOffersSample.ts @@ -3,48 +3,39 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location, edge zone and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListOffersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listOffers( - location, - edgeZone, - publisherName, + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location, edge zone and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListOffersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listOffers( - location, - edgeZone, - publisherName, + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListPublishersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListPublishersSample.ts index 6b2dafb9e780..11eb256b2cc6 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListPublishersSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListPublishersSample.ts @@ -3,44 +3,37 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location and edge zone. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListPublishersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listPublishers( - location, - edgeZone, + "aaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location and edge zone. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListPublishersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listPublishers( - location, - edgeZone, + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSample.ts index aa37e6826706..0701902b93e4 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSample.ts @@ -1,71 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineImagesEdgeZoneListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. * - * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 12; - const orderby = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const options: VirtualMachineImagesEdgeZoneListOptionalParams = { - expand, - top, - orderby, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.list( - location, - edgeZone, - publisherName, - offer, - skus, - options, + "aaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaaaaaaaaaaaaaaaaaaa", top: 12, orderby: "aaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, ); console.log(result); } /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. * - * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.list( - location, - edgeZone, - publisherName, - offer, - skus, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSkusSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSkusSample.ts index 79f8d1ab43d5..346fbcaa4f22 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSkusSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesEdgeZoneListSkusSample.ts @@ -3,52 +3,41 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. * - * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + * @summary gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaa"; - const edgeZone = "aaaaa"; - const publisherName = "aaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listSkus( - location, - edgeZone, - publisherName, - offer, + "aaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaa", + "aaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. * - * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + * @summary gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaa"; - const offer = "aaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listSkus( - location, - edgeZone, - publisherName, - offer, + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaa", + "aaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesGetSample.ts index 85a2e94ba05d..ed975a2eac27 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesGetSample.ts @@ -3,56 +3,43 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a virtual machine image. + * This sample demonstrates how to gets a virtual machine image. * - * @summary Gets a virtual machine image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json + * @summary gets a virtual machine image. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json */ async function virtualMachineImageGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaa"; - const publisherName = "aaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.get( - location, - publisherName, - offer, - skus, - version, + "aaaaaa", + "aaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a virtual machine image. + * This sample demonstrates how to gets a virtual machine image. * - * @summary Gets a virtual machine image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json + * @summary gets a virtual machine image. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json */ async function virtualMachineImageGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaa"; - const offer = "aa"; - const skus = "aaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.get( - location, - publisherName, - offer, - skus, - version, + "aaaaaaaaaaaa", + "aaaaaaaaaaa", + "aa", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListByEdgeZoneSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListByEdgeZoneSample.ts index d064f3a60091..4f356aed678d 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListByEdgeZoneSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListByEdgeZoneSample.ts @@ -3,47 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified edge zone + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified edge zone * - * @summary Gets a list of all virtual machine image versions for the specified edge zone - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified edge zone + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; - const location = "WestUS"; - const edgeZone = "microsoftlosangeles1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listByEdgeZone( - location, - edgeZone, - ); + const result = await client.virtualMachineImages.listByEdgeZone("WestUS", "microsoftlosangeles1"); console.log(result); } /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified edge zone + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified edge zone * - * @summary Gets a list of all virtual machine image versions for the specified edge zone - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified edge zone + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; - const location = "WestUS"; - const edgeZone = "microsoftlosangeles1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listByEdgeZone( - location, - edgeZone, - ); + const result = await client.virtualMachineImages.listByEdgeZone("WestUS", "microsoftlosangeles1"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListOffersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListOffersSample.ts index 4670f2c0aba7..c620bfa9ce7d 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListOffersSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListOffersSample.ts @@ -3,44 +3,34 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json */ async function virtualMachineImageListOffersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaa"; - const publisherName = "aaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listOffers( - location, - publisherName, - ); + const result = await client.virtualMachineImages.listOffers("aaaaaaa", "aaaaaaaa"); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json */ async function virtualMachineImageListOffersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.listOffers( - location, - publisherName, + "aaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListPublishersSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListPublishersSample.ts index d262074cfa43..5431649588fc 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListPublishersSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListPublishersSample.ts @@ -3,37 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json */ async function virtualMachineImageListPublishersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listPublishers(location); + const result = await client.virtualMachineImages.listPublishers("aaaaa"); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json */ async function virtualMachineImageListPublishersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listPublishers(location); + const result = await client.virtualMachineImages.listPublishers("aaaaaaaaaaaaaaaaaaaaaaaaaaa"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSample.ts index 9773eddd83dd..0f3f744fa331 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSample.ts @@ -1,67 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineImagesListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. * - * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json */ async function virtualMachineImageListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaa"; - const publisherName = "aaaaaa"; - const offer = "aaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 18; - const orderby = "aa"; - const options: VirtualMachineImagesListOptionalParams = { - expand, - top, - orderby, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.list( - location, - publisherName, - offer, - skus, - options, + "aaaaaaaaaaaaaaa", + "aaaaaa", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaaaaaaaaaaaaaaaaaaa", top: 18, orderby: "aa" }, ); console.log(result); } /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. * - * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json */ async function virtualMachineImageListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaa"; - const publisherName = "aaaaaaaaaaa"; - const offer = "aaaaaaaaaa"; - const skus = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.list( - location, - publisherName, - offer, - skus, + "aaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSkusSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSkusSample.ts index 497f89d40fa0..da2b5072fea4 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSkusSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListSkusSample.ts @@ -3,49 +3,36 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, publisher, and offer. * - * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json + * @summary gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json */ async function virtualMachineImageListSkusMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.listSkus( - location, - publisherName, - offer, + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, publisher, and offer. * - * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json + * @summary gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json */ async function virtualMachineImageListSkusMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aaaaaaaaaaaaa"; - const offer = "aaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listSkus( - location, - publisherName, - offer, - ); + const result = await client.virtualMachineImages.listSkus("aaaa", "aaaaaaaaaaaaa", "aaaaaaa"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListWithPropertiesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListWithPropertiesSample.ts index 4a0d7fdb1338..e84876329150 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListWithPropertiesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineImagesListWithPropertiesSample.ts @@ -1,69 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineImagesListWithPropertiesOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to + * This sample demonstrates how to execute listWithProperties * - * @summary - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json + * @summary execute listWithProperties + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json */ async function virtualMachineImagesListWithPropertiesMaximumSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; - const publisherName = "MicrosoftWindowsServer"; - const offer = "WindowsServer"; - const skus = "2022-datacenter-azure-edition"; - const expand = "Properties"; - const top = 4; - const orderby = "aa"; - const options: VirtualMachineImagesListWithPropertiesOptionalParams = { - top, - orderby, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.listWithProperties( - location, - publisherName, - offer, - skus, - expand, - options, + "eastus", + "MicrosoftWindowsServer", + "WindowsServer", + "2022-datacenter-azure-edition", + "Properties", + { top: 4, orderby: "aa" }, ); console.log(result); } /** - * This sample demonstrates how to + * This sample demonstrates how to execute listWithProperties * - * @summary - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MinimumSet_Gen.json + * @summary execute listWithProperties + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MinimumSet_Gen.json */ async function virtualMachineImagesListWithPropertiesMinimumSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; - const publisherName = "MicrosoftWindowsServer"; - const offer = "WindowsServer"; - const skus = "2022-datacenter-azure-edition"; - const expand = "Properties"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImages.listWithProperties( - location, - publisherName, - offer, - skus, - expand, + "eastus", + "MicrosoftWindowsServer", + "WindowsServer", + "2022-datacenter-azure-edition", + "Properties", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsCreateOrUpdateSample.ts index 9dccf43e4a21..c81398dc32cd 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsCreateOrUpdateSample.ts @@ -1,59 +1,43 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineRunCommand} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update the run command. + * This sample demonstrates how to the operation to create or update the run command. * - * @summary The operation to create or update the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json + * @summary the operation to create or update the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json */ async function createOrUpdateARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommand = { - asyncExecution: false, - errorBlobUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", - location: "West US", - outputBlobManagedIdentity: { - clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a", - }, - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - scriptUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", - }, - timeoutInSeconds: 3600, - treatFailureAsDeploymentFailure: false, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineRunCommands.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - runCommandName, - runCommand, - ); + const result = await client.virtualMachineRunCommands.createOrUpdate( + "myResourceGroup", + "myVM", + "myRunCommand", + { + location: "West US", + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", + }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + treatFailureAsDeploymentFailure: false, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", + outputBlobManagedIdentity: { clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a" }, + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsDeleteSample.ts index 64ad7ef7d5a4..409473082043 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsDeleteSample.ts @@ -3,29 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete the run command. + * This sample demonstrates how to the operation to delete the run command. * - * @summary The operation to delete the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json + * @summary the operation to delete the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Delete.json */ async function deleteARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.beginDeleteAndWait( - resourceGroupName, - vmName, - runCommandName, - ); - console.log(result); + await client.virtualMachineRunCommands.delete("myResourceGroup", "myVM", "myRunCommand"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetByVirtualMachineSample.ts index b5ac330bd502..439090449382 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetByVirtualMachineSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetByVirtualMachineSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get the run command. + * This sample demonstrates how to the operation to get the run command. * - * @summary The operation to get the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + * @summary the operation to get the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Get.json */ async function getARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineRunCommands.getByVirtualMachine( - resourceGroupName, - vmName, - runCommandName, + "myResourceGroup", + "myVM", + "myRunCommand", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetSample.ts index ecac737eae71..3eac5fd1207f 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsGetSample.ts @@ -3,26 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets specific run command for a subscription in a location. + * This sample demonstrates how to gets specific run command for a subscription in a location. * - * @summary Gets specific run command for a subscription in a location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_Get.json + * @summary gets specific run command for a subscription in a location. + * x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_Get.json */ async function virtualMachineRunCommandGet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; - const location = "SoutheastAsia"; - const commandId = "RunPowerShellScript"; const credential = new DefaultAzureCredential(); + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.get( - location, - commandId, - ); + const result = await client.virtualMachineRunCommands.get("SoutheastAsia", "RunPowerShellScript"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListByVirtualMachineSample.ts index 924092984760..3f10928052a7 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListByVirtualMachineSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListByVirtualMachineSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get all run commands of a Virtual Machine. + * This sample demonstrates how to the operation to get all run commands of a Virtual Machine. * - * @summary The operation to get all run commands of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json + * @summary the operation to get all run commands of a Virtual Machine. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_List.json */ async function listRunCommandsInAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineRunCommands.listByVirtualMachine( - resourceGroupName, - vmName, + "myResourceGroup", + "myVM", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListSample.ts index df5c7b6267fc..f3264c7e3256 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available run commands for a subscription in a location. + * This sample demonstrates how to lists all available run commands for a subscription in a location. * - * @summary Lists all available run commands for a subscription in a location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_List.json + * @summary lists all available run commands for a subscription in a location. + * x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_List.json */ async function virtualMachineRunCommandList(): Promise { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "subid"; - const location = "SoutheastAsia"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineRunCommands.list(location)) { + for await (const item of client.virtualMachineRunCommands.list("SoutheastAsia")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsUpdateSample.ts index 6bdc91e388f2..15aca2100e13 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineRunCommandsUpdateSample.ts @@ -1,54 +1,38 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineRunCommandUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update the run command. + * This sample demonstrates how to the operation to update the run command. * - * @summary The operation to update the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json + * @summary the operation to update the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Update.json */ async function updateARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommandUpdate = { - asyncExecution: false, - errorBlobManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - errorBlobUri: - "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - script: "Write-Host Hello World! ; Remove-Item C:\test\testFile.txt", - }, - timeoutInSeconds: 3600, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.beginUpdateAndWait( - resourceGroupName, - vmName, - runCommandName, - runCommand, + const result = await client.virtualMachineRunCommands.update( + "myResourceGroup", + "myVM", + "myRunCommand", + { + source: { script: "Write-Host Hello World! ; Remove-Item C:\test\testFile.txt" }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", + errorBlobManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts index db59e789042b..03c1b5794e6b 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts @@ -1,75 +1,56 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetExtension} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update an extension. + * This sample demonstrates how to the operation to create or update an extension. * - * @summary The operation to create or update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json + * @summary the operation to create or update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json */ async function virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaa"; - const extensionParameters: VirtualMachineScaleSetExtension = { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineScaleSetExtensions.createOrUpdate( + "rgcompute", + "aaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { + name: "{extension-name}", + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, + }, + ); console.log(result); } /** - * This sample demonstrates how to The operation to create or update an extension. + * This sample demonstrates how to the operation to create or update an extension. * - * @summary The operation to create or update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json + * @summary the operation to create or update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json */ async function virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaa"; - const extensionParameters: VirtualMachineScaleSetExtension = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineScaleSetExtensions.createOrUpdate( + "rgcompute", + "aaaaaaaaaaa", + "aaaaaaaaaaa", + {}, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsDeleteSample.ts index fe41a95ed743..f92a3d7100a1 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsDeleteSample.ts @@ -3,54 +3,39 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete the extension. + * This sample demonstrates how to the operation to delete the extension. * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json */ async function virtualMachineScaleSetExtensionDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); + await client.virtualMachineScaleSetExtensions.delete( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + ); } /** - * This sample demonstrates how to The operation to delete the extension. + * This sample demonstrates how to the operation to delete the extension. * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json */ async function virtualMachineScaleSetExtensionDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); + await client.virtualMachineScaleSetExtensions.delete( + "rgcompute", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsGetSample.ts index c6f431946a46..430e3e429c30 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsGetSample.ts @@ -1,59 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetExtensionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get the extension. + * This sample demonstrates how to the operation to get the extension. * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json */ async function virtualMachineScaleSetExtensionGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaa"; - const options: VirtualMachineScaleSetExtensionsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetExtensions.get( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - options, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaa" }, ); console.log(result); } /** - * This sample demonstrates how to The operation to get the extension. + * This sample demonstrates how to the operation to get the extension. * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json */ async function virtualMachineScaleSetExtensionGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "a"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetExtensions.get( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, + "rgcompute", + "a", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsListSample.ts index 7a6bf6922e5a..05acad53e80e 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsListSample.ts @@ -3,53 +3,46 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * This sample demonstrates how to gets a list of all extensions in a VM scale set. * - * @summary Gets a list of all extensions in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json + * @summary gets a list of all extensions in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json */ async function virtualMachineScaleSetExtensionListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSetExtensions.list( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of all extensions in a VM scale set. + * This sample demonstrates how to gets a list of all extensions in a VM scale set. * - * @summary Gets a list of all extensions in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json + * @summary gets a list of all extensions in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json */ async function virtualMachineScaleSetExtensionListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSetExtensions.list( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsUpdateSample.ts index 7615e783e33f..26f721d1571d 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetExtensionsUpdateSample.ts @@ -1,74 +1,55 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetExtensionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update an extension. + * This sample demonstrates how to the operation to update an extension. * - * @summary The operation to update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json + * @summary the operation to update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json */ async function virtualMachineScaleSetExtensionUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaa"; - const extensionParameters: VirtualMachineScaleSetExtensionUpdate = { - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineScaleSetExtensions.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + { + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, + }, + ); console.log(result); } /** - * This sample demonstrates how to The operation to update an extension. + * This sample demonstrates how to the operation to update an extension. * - * @summary The operation to update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json + * @summary the operation to update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json */ async function virtualMachineScaleSetExtensionUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aa"; - const extensionParameters: VirtualMachineScaleSetExtensionUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineScaleSetExtensions.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aa", + {}, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts new file mode 100644 index 000000000000..5424d0ec1d6c --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine scale set lifecycle hook event. + * + * @summary gets a virtual machine scale set lifecycle hook event. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Get.json + */ +async function getAVirtualMachineScaleSetLifecycleHookEvent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2167b012-c9f9-4b04-83b2-0ff304e7d51d"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetLifeCycleHookEvents.get( + "RG01", + "VMSS01", + "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717", + ); + console.log(result); +} + +async function main(): Promise { + await getAVirtualMachineScaleSetLifecycleHookEvent(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsListSample.ts new file mode 100644 index 000000000000..f4dd95ad032b --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsListSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. + * + * @summary gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_List.json + */ +async function getsAListOfAllLifecycleHookEventsInAVirtualMachineScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetLifeCycleHookEvents.list( + "RG01", + "VMSS01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getsAListOfAllLifecycleHookEventsInAVirtualMachineScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts new file mode 100644 index 000000000000..e28475ed4a85 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a virtual machine scale set lifecycle hook event. + * + * @summary the operation to update a virtual machine scale set lifecycle hook event. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Update.json + */ +async function theOperationToUpdateTheVirtualMachineScaleSetLifecycleHookEvent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2167b012-c9f9-4b04-83b2-0ff304e7d51d"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetLifeCycleHookEvents.update( + "RG01", + "VMSS01", + "445c0a08-cfc5-4ef6-bb89-fe77c5178628", + { + waitUntil: "2025-05-08T11:17:55.6844555+00:00", + targetResources: [ + { + resource: { + id: "/subscriptions/2167b012-c9f9-4b04-83b2-0ff304e7d51d/resourceGroups/RG01/providers/Microsoft.Compute/virtualMachineScaleSets/VMSS01/virtualMachines/2", + }, + actionState: "Approved", + }, + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await theOperationToUpdateTheVirtualMachineScaleSetLifecycleHookEvent(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesCancelSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesCancelSample.ts index e1c15c515cfd..a431069b146c 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesCancelSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesCancelSample.ts @@ -3,50 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * This sample demonstrates how to cancels the current virtual machine scale set rolling upgrade. * - * @summary Cancels the current virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json + * @summary cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.cancel("rgcompute", "aaaaa"); } /** - * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. + * This sample demonstrates how to cancels the current virtual machine scale set rolling upgrade. * - * @summary Cancels the current virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json + * @summary cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.cancel("rgcompute", "aaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts index 054fe8e2afeb..c580aae05d69 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts @@ -3,46 +3,37 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * This sample demonstrates how to gets the status of the latest virtual machine scale set rolling upgrade. * - * @summary Gets the status of the latest virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json + * @summary gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. + * This sample demonstrates how to gets the status of the latest virtual machine scale set rolling upgrade. * - * @summary Gets the status of the latest virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json + * @summary gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts index 10afd3e3bb9e..3e6df87c19fe 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts @@ -3,28 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. * - * @summary Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json + * @summary starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json */ async function startAnExtensionRollingUpgrade(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginStartExtensionUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startExtensionUpgrade( + "myResourceGroup", + "{vmss-name}", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts index 3cf2cfb25d92..52c7a4e34cb1 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts @@ -3,50 +3,34 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. * - * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json + * @summary starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeStartOSUpgradeMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startOSUpgrade("rgcompute", "aaaa"); } /** - * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. * - * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json + * @summary starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeStartOSUpgradeMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startOSUpgrade( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts index 84fc59130382..7bf95d868456 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts @@ -1,45 +1,32 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMExtension} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update the VMSS VM extension. + * This sample demonstrates how to the operation to create or update the VMSS VM extension. * - * @summary The operation to create or update the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json + * @summary the operation to create or update the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json */ async function createVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineScaleSetVMExtension = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - typeHandlerVersion: "1.2", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineScaleSetVMExtensions.createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + settings: { UserName: "xyz@microsoft.com" }, + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsDeleteSample.ts index 5ba88f22ed01..ac4dec5b0c72 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsDeleteSample.ts @@ -3,32 +3,23 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete the VMSS VM extension. + * This sample demonstrates how to the operation to delete the VMSS VM extension. * - * @summary The operation to delete the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json + * @summary the operation to delete the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json */ async function deleteVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - ); - console.log(result); + await client.virtualMachineScaleSetVMExtensions.delete( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsGetSample.ts index 1cdea8c026f5..3b3777db30de 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsGetSample.ts @@ -3,29 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get the VMSS VM extension. + * This sample demonstrates how to the operation to get the VMSS VM extension. * - * @summary The operation to get the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + * @summary the operation to get the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json */ async function getVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMExtensions.get( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsListSample.ts index cc712079385e..12f8fbdf2ff3 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsListSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get all extensions of an instance in Virtual Machine Scaleset. + * This sample demonstrates how to the operation to get all extensions of an instance in Virtual Machine Scaleset. * - * @summary The operation to get all extensions of an instance in Virtual Machine Scaleset. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json + * @summary the operation to get all extensions of an instance in Virtual Machine Scaleset. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json */ async function listExtensionsInVmssInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMExtensions.list( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myvmScaleSet", + "0", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsUpdateSample.ts index 599c25ae77b8..036039462fd7 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMExtensionsUpdateSample.ts @@ -1,45 +1,32 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMExtensionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update the VMSS VM extension. + * This sample demonstrates how to the operation to update the VMSS VM extension. * - * @summary The operation to update the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json + * @summary the operation to update the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json */ async function updateVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineScaleSetVMExtensionUpdate = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - typeHandlerVersion: "1.2", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - ); + const result = await client.virtualMachineScaleSetVMExtensions.update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + settings: { UserName: "xyz@microsoft.com" }, + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts index 551766cf3bed..5619d70ff7af 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts @@ -1,65 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineRunCommand} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update the VMSS VM run command. + * This sample demonstrates how to the operation to create or update the VMSS VM run command. * - * @summary The operation to create or update the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json + * @summary the operation to create or update the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json */ async function createVirtualMachineScaleSetVMRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommand = { - asyncExecution: false, - errorBlobManagedIdentity: {}, - errorBlobUri: - "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", - location: "West US", - outputBlobManagedIdentity: { - clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a", - }, - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - scriptUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", - scriptUriManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - }, - timeoutInSeconds: 3600, - treatFailureAsDeploymentFailure: true, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMRunCommands.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - ); + const result = await client.virtualMachineScaleSetVMRunCommands.createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + { + location: "West US", + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", + scriptUriManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + treatFailureAsDeploymentFailure: true, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", + outputBlobManagedIdentity: { clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a" }, + errorBlobManagedIdentity: {}, + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsDeleteSample.ts index 34ab7f009e36..6afd9e799ec9 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsDeleteSample.ts @@ -3,32 +3,23 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete the VMSS VM run command. + * This sample demonstrates how to the operation to delete the VMSS VM run command. * - * @summary The operation to delete the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json + * @summary the operation to delete the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json */ async function deleteVirtualMachineScaleSetVMRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMRunCommands.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - ); - console.log(result); + await client.virtualMachineScaleSetVMRunCommands.delete( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsGetSample.ts index e40b807342a9..71ba5d0fd7b2 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsGetSample.ts @@ -3,29 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get the VMSS VM run command. + * This sample demonstrates how to the operation to get the VMSS VM run command. * - * @summary The operation to get the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + * @summary the operation to get the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json */ async function getVirtualMachineScaleSetVMRunCommands(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMRunCommands.get( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsListSample.ts index 0d7bfbe85f3e..e10328c88859 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsListSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get all run commands of an instance in Virtual Machine Scaleset. + * This sample demonstrates how to the operation to get all run commands of an instance in Virtual Machine Scaleset. * - * @summary The operation to get all run commands of an instance in Virtual Machine Scaleset. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json + * @summary the operation to get all run commands of an instance in Virtual Machine Scaleset. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json */ async function listRunCommandsInVmssInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSetVMRunCommands.list( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myvmScaleSet", + "0", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsUpdateSample.ts index 81e1e3fc52c4..007b620a4b87 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMRunCommandsUpdateSample.ts @@ -1,47 +1,31 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineRunCommandUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update the VMSS VM run command. + * This sample demonstrates how to the operation to update the VMSS VM run command. * - * @summary The operation to update the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json + * @summary the operation to update the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json */ async function updateVirtualMachineScaleSetVMRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommandUpdate = { - source: { - scriptUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", - scriptUriManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMRunCommands.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - ); + const result = await client.virtualMachineScaleSetVMRunCommands.update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + { + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", + scriptUriManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + }, + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts deleted file mode 100644 index df4d1a8016ad..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * - * @summary Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json - */ -async function virtualMachineScaleSetVMApproveRollingUpgrade(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "vmssToApproveRollingUpgradeOn"; - const instanceId = "0123"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginApproveRollingUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMApproveRollingUpgrade(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts deleted file mode 100644 index 2068ee82d214..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - AttachDetachDataDisksRequest} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Attach and detach data disks to/from a virtual machine in a VM scale set. - * - * @summary Attach and detach data disks to/from a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "azure-vmscaleset"; - const instanceId = "0"; - const parameters: AttachDetachDataDisksRequest = { - dataDisksToAttach: [ - { - caching: "ReadOnly", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - lun: 1, - writeAcceleratorEnabled: true, - }, - { - caching: "ReadWrite", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", - lun: 2, - writeAcceleratorEnabled: false, - }, - ], - dataDisksToDetach: [ - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Attach and detach data disks to/from a virtual machine in a VM scale set. - * - * @summary Attach and detach data disks to/from a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "azure-vmscaleset"; - const instanceId = "0"; - const parameters: AttachDetachDataDisksRequest = { - dataDisksToAttach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - }, - ], - dataDisksToDetach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(); - await virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeleteSample.ts deleted file mode 100644 index 200631187f41..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeleteSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsDeleteOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a virtual machine from a VM scale set. - * - * @summary Deletes a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json - */ -async function forceDeleteAVirtualMachineFromAVMScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const forceDeletion = true; - const options: VirtualMachineScaleSetVMsDeleteOptionalParams = { - forceDeletion, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -async function main(): Promise { - await forceDeleteAVirtualMachineFromAVMScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetSample.ts deleted file mode 100644 index f83f5881b45b..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json - */ -async function getVMScaleSetVMWithResiliencyView(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "1"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json - */ -async function getVMScaleSetVMWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json - */ -async function getVMScaleSetVMWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await getVMScaleSetVMWithResiliencyView(); - await getVMScaleSetVMWithUserData(); - await getVMScaleSetVMWithVMSizeProperties(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSListSample.ts deleted file mode 100644 index 640cbe4104f9..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSListSample.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json - */ -async function listVmssVMSWithResilientVmdeletionStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "resourceGroupname"; - const virtualMachineScaleSetName = "vmssName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; - const filter = "aaaaaaaaaaaaaa"; - const select = "aaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaa"; - const options: VirtualMachineScaleSetVMsListOptionalParams = { - filter, - select, - expand, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const virtualMachineScaleSetName = "aaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listVmssVMSWithResilientVmdeletionStatus(); - await virtualMachineScaleSetVMListMaximumSetGen(); - await virtualMachineScaleSetVMListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPerformMaintenanceSample.ts deleted file mode 100644 index 1ac295022346..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPerformMaintenanceSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. - * - * @summary Performs maintenance on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. - * - * @summary Performs maintenance on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaa"; - const instanceId = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(); - await virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPowerOffSample.ts deleted file mode 100644 index 31f5608124e1..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSPowerOffSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsPowerOffOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMPowerOffMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; - const instanceId = "aaaaaaaaa"; - const skipShutdown = true; - const options: VirtualMachineScaleSetVMsPowerOffOptionalParams = { - skipShutdown, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMPowerOffMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMPowerOffMaximumSetGen(); - await virtualMachineScaleSetVMPowerOffMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRedeploySample.ts deleted file mode 100644 index e7415fade4ce..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRedeploySample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMRedeployMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMRedeployMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMRedeployMaximumSetGen(); - await virtualMachineScaleSetVMRedeployMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageAllSample.ts deleted file mode 100644 index cdddec94e7f3..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageAllSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * - * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * - * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMReimageAllMaximumSetGen(); - await virtualMachineScaleSetVMReimageAllMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageSample.ts deleted file mode 100644 index a7ff01d6ea70..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSReimageSample.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMReimageParameters, - VirtualMachineScaleSetVMsReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmScaleSetVMReimageInput: VirtualMachineScaleSetVMReimageParameters = { - forceUpdateOSDiskForEphemeral: true, - tempDisk: true, - }; - const options: VirtualMachineScaleSetVMsReimageOptionalParams = { - vmScaleSetVMReimageInput, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaa"; - const instanceId = "aaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMReimageMaximumSetGen(); - await virtualMachineScaleSetVMReimageMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRestartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRestartSample.ts deleted file mode 100644 index 6774a670b7d4..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRestartSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restarts a virtual machine in a VM scale set. - * - * @summary Restarts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMRestartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aa"; - const instanceId = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restarts a virtual machine in a VM scale set. - * - * @summary Restarts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMRestartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const instanceId = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMRestartMaximumSetGen(); - await virtualMachineScaleSetVMRestartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts deleted file mode 100644 index 3ce461aefb82..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @summary The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json - */ -async function retrieveBootDiagnosticsDataOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const sasUriExpirationTimeInMinutes = 60; - const options: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams = - { sasUriExpirationTimeInMinutes }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -async function main(): Promise { - await retrieveBootDiagnosticsDataOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRunCommandSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRunCommandSample.ts deleted file mode 100644 index cafc7fc8ae39..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSRunCommandSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { RunCommandInput} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Run command on a virtual machine in a VM scale set. - * - * @summary Run command on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json - */ -async function virtualMachineScaleSetVMSRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const instanceId = "0"; - const parameters: RunCommandInput = { - commandId: "RunPowerShellScript", - script: ["Write-Host Hello World!"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRunCommandAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMSRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSSimulateEvictionSample.ts deleted file mode 100644 index 8928e642e4a6..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSSimulateEvictionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @summary The operation to simulate the eviction of spot virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json - */ -async function simulateEvictionAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmScaleSetName = "VmScaleSetName"; - const instanceId = "InstanceId"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.simulateEviction( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await simulateEvictionAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSStartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSStartSample.ts deleted file mode 100644 index 7ee09432ff3e..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSStartSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Starts a virtual machine in a VM scale set. - * - * @summary Starts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMStartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Starts a virtual machine in a VM scale set. - * - * @summary Starts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMStartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMStartMaximumSetGen(); - await virtualMachineScaleSetVMStartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSUpdateSample.ts deleted file mode 100644 index 34bf94737d8f..000000000000 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSUpdateSample.ts +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVM} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a virtual machine of a VM scale set. - * - * @summary Updates a virtual machine of a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetVM = { - additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, - availabilitySet: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - diagnosticsProfile: { - bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" }, - }, - hardwareProfile: { - vmSize: "Basic_A0", - vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 }, - }, - instanceView: { - bootDiagnostics: { - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - }, - disks: [ - { - name: "aaaaaaaaaaa", - encryptionSettings: [ - { - diskEncryptionKey: { - secretUrl: "aaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - enabled: true, - keyEncryptionKey: { - keyUrl: "aaaaaaaaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - }, - ], - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - ], - maintenanceRedeployStatus: { - isCustomerInitiatedMaintenanceAllowed: true, - lastOperationMessage: "aaaaaa", - lastOperationResultCode: "None", - maintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), - maintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), - preMaintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), - preMaintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), - }, - placementGroupId: "aaa", - platformFaultDomain: 14, - platformUpdateDomain: 23, - rdpThumbPrint: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - vmAgent: { - extensionHandlers: [ - { - type: "aaaaaaaaaaaaa", - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - typeHandlerVersion: "aaaaa", - }, - ], - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - vmAgentVersion: "aaaaaaaaaaaaaaaaaaaaaaa", - }, - vmHealth: { - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - }, - extensions: [ - { - name: "aaaaaaaaaaaaaaaaa", - type: "aaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - substatuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - }, - ], - }, - licenseType: "aaaaaaaaaa", - location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "aaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { dnsServers: ["aaaaaa"] }, - dscpConfiguration: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - enableAcceleratedNetworking: true, - enableFpga: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "aa", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - applicationSecurityGroups: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 2, - ipTags: [ - { - ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", - tag: "aaaaaaaaaaaaaaaaaaaa", - }, - ], - publicIPAddressVersion: "IPv4", - publicIPAllocationMethod: "Dynamic", - publicIPPrefix: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "Basic", tier: "Regional" }, - }, - subnet: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - ], - networkSecurityGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - primary: true, - }, - ], - networkInterfaces: [ - { - deleteOption: "Delete", - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", - primary: true, - }, - ], - }, - networkProfileConfiguration: { - networkInterfaceConfigurations: [ - { - name: "vmsstestnetconfig5415", - deleteOption: "Delete", - dnsSettings: { dnsServers: [] }, - enableAcceleratedNetworking: true, - enableFpga: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "vmsstestnetconfig9693", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - applicationSecurityGroups: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerInboundNatPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "aaaaaaaaaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 18, - ipTags: [ - { ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, - ], - publicIPAddressVersion: "IPv4", - publicIPPrefix: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "Basic", tier: "Regional" }, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503", - }, - }, - ], - networkSecurityGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "aaaaaaaaaaaaaaaa", - adminUsername: "Foo12", - allowExtensionOperations: true, - computerName: "test000000", - customData: "aaaa", - linuxConfiguration: { - disablePasswordAuthentication: true, - patchSettings: { - assessmentMode: "ImageDefault", - patchMode: "ImageDefault", - }, - provisionVMAgent: true, - ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] }, - }, - requireGuestProvisionSignal: true, - secrets: [], - windowsConfiguration: { - additionalUnattendContent: [ - { - componentName: "Microsoft-Windows-Shell-Setup", - content: "aaaaaaaaaaaaaaaaaaaa", - passName: "OobeSystem", - settingName: "AutoLogon", - }, - ], - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "ImageDefault", - enableHotpatching: true, - patchMode: "Manual", - }, - provisionVMAgent: true, - timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - winRM: { - listeners: [ - { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }, - ], - }, - }, - }, - plan: { - name: "aaaaaaaaaa", - product: "aaaaaaaaaaaaaaaaaaaa", - promotionCode: "aaaaaaaaaaaaaaaaaaaa", - publisher: "aaaaaaaaaaaaaaaaaaaaaa", - }, - protectionPolicy: { - protectFromScaleIn: true, - protectFromScaleSetActions: true, - }, - securityProfile: { - encryptionAtHost: true, - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - sku: { name: "Classic", capacity: 29, tier: "aaaaaaaaaaaaaa" }, - storageProfile: { - dataDisks: [ - { - name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - caching: "None", - createOption: "Empty", - deleteOption: "Delete", - detachOption: "ForceDetach", - diskSizeGB: 128, - image: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - lun: 1, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - storageAccountType: "Standard_LRS", - }, - toBeDetached: true, - vhd: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - writeAcceleratorEnabled: true, - }, - ], - imageReference: { - id: "a", - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", - sku: "2012-R2-Datacenter", - version: "4.127.20180315", - }, - osDisk: { - name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", - caching: "None", - createOption: "FromImage", - deleteOption: "Delete", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - diskSizeGB: 127, - encryptionSettings: { - diskEncryptionKey: { - secretUrl: "aaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - enabled: true, - keyEncryptionKey: { - keyUrl: "aaaaaaaaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - }, - image: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", - storageAccountType: "Standard_LRS", - }, - osType: "Windows", - vhd: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - writeAcceleratorEnabled: true, - }, - }, - tags: {}, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a virtual machine of a VM scale set. - * - * @summary Updates a virtual machine of a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetVM = { location: "westus" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMUpdateMaximumSetGen(); - await virtualMachineScaleSetVMUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts new file mode 100644 index 000000000000..d22e09b421a6 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. + * + * @summary approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json + */ +async function virtualMachineScaleSetVMApproveRollingUpgrade(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.approveRollingUpgrade( + "rgcompute", + "vmssToApproveRollingUpgradeOn", + "0123", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMApproveRollingUpgrade(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts new file mode 100644 index 000000000000..56a85252d2c6 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to attach and detach data disks to/from a virtual machine in a VM scale set. + * + * @summary attach and detach data disks to/from a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.attachDetachDataDisks( + "rgcompute", + "azure-vmscaleset", + "0", + { + dataDisksToAttach: [ + { + lun: 1, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadOnly", + writeAcceleratorEnabled: true, + }, + { + lun: 2, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadWrite", + writeAcceleratorEnabled: false, + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + detachOption: "ForceDetach", + }, + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", + detachOption: "ForceDetach", + }, + ], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to attach and detach data disks to/from a virtual machine in a VM scale set. + * + * @summary attach and detach data disks to/from a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.attachDetachDataDisks( + "rgcompute", + "azure-vmscaleset", + "0", + { + dataDisksToAttach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + }, + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(); + await virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsDeallocateSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts rename to sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsDeallocateSample.ts index 2cc4a74f8c3a..7dedd4f85ada 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsDeallocateSample.ts @@ -3,52 +3,39 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * This sample demonstrates how to deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * - * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json + * @summary deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json */ async function virtualMachineScaleSetVMDeallocateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, + await client.virtualMachineScaleSetVMs.deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", ); - console.log(result); } /** - * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * This sample demonstrates how to deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * - * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json + * @summary deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json */ async function virtualMachineScaleSetVMDeallocateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, + await client.virtualMachineScaleSetVMs.deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaa", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsDeleteSample.ts new file mode 100644 index 000000000000..570655857462 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a virtual machine from a VM scale set. + * + * @summary deletes a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json + */ +async function forceDeleteAVirtualMachineFromAVMScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.delete("myResourceGroup", "myvmScaleSet", "0", { + forceDeletion: true, + }); +} + +async function main(): Promise { + await forceDeleteAVirtualMachineFromAVMScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsGetInstanceViewSample.ts similarity index 52% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts rename to sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsGetInstanceViewSample.ts index 12eaf3f15226..bb4e47046a79 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsGetInstanceViewSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the status of a virtual machine from a VM scale set. + * This sample demonstrates how to gets the status of a virtual machine from a VM scale set. * - * @summary Gets the status of a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + * @summary gets the status of a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json */ async function getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMs.getInstanceView( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsGetSample.ts new file mode 100644 index 000000000000..c712137c5bf1 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsGetSample.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json + */ +async function getVMScaleSetVMWithResiliencyView(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "1"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + */ +async function getVMScaleSetVMWithUserData(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "0"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + */ +async function getVMScaleSetVMWithVMSizeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "0"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVirtualMachineResourceId.json + */ +async function getVMScaleSetFlexVMWithVirtualMachineResourceId(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + "myResourceGroup", + "{vmss-flex-name}", + "{vmss-flex-vm-name}", + ); + console.log(result); +} + +async function main(): Promise { + await getVMScaleSetVMWithResiliencyView(); + await getVMScaleSetVMWithUserData(); + await getVMScaleSetVMWithVMSizeProperties(); + await getVMScaleSetFlexVMWithVirtualMachineResourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsListSample.ts new file mode 100644 index 000000000000..bd7d2aa57c92 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsListSample.ts @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + { filter: "aaaaaaaaaaaaaa", select: "aaaaaaaaaaaaaaaaaaaaa", expand: "aaaaaaaaaaaaa" }, + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("rgcompute", "aaaaaaaaaaaaaa")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json + */ +async function listVmssVMsWithResilientVMDeletionStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("resourceGroupname", "vmssName")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithVirtualMachineResourceId.json + */ +async function listVmssVMsWithVirtualMachineResourceId(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("resourceGroupname", "vmssName")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await virtualMachineScaleSetVMListMaximumSetGen(); + await virtualMachineScaleSetVMListMinimumSetGen(); + await listVmssVMsWithResilientVMDeletionStatus(); + await listVmssVMsWithVirtualMachineResourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPerformMaintenanceSample.ts new file mode 100644 index 000000000000..6814857454e7 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPerformMaintenanceSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to performs maintenance on a virtual machine in a VM scale set. + * + * @summary performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.performMaintenance( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to performs maintenance on a virtual machine in a VM scale set. + * + * @summary performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.performMaintenance("rgcompute", "aaaaaaaaaa", "aaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(); + await virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPowerOffSample.ts new file mode 100644 index 000000000000..83e7bdb82233 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsPowerOffSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMPowerOffMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.powerOff("rgcompute", "aaaaaa", "aaaaaaaaa", { + skipShutdown: true, + }); +} + +/** + * This sample demonstrates how to power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMPowerOffMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.powerOff( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMPowerOffMaximumSetGen(); + await virtualMachineScaleSetVMPowerOffMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRedeploySample.ts new file mode 100644 index 000000000000..66aeb5af14e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRedeploySample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMRedeployMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.redeploy( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMRedeployMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.redeploy( + "rgcompute", + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMRedeployMaximumSetGen(); + await virtualMachineScaleSetVMRedeployMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageAllSample.ts new file mode 100644 index 000000000000..506b9bffc3ae --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageAllSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageAllMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageAllMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMReimageAllMaximumSetGen(); + await virtualMachineScaleSetVMReimageAllMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageSample.ts new file mode 100644 index 000000000000..8320d64408af --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsReimageSample.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimage( + "rgcompute", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { vmScaleSetVMReimageInput: { forceUpdateOSDiskForEphemeral: true, tempDisk: true } }, + ); +} + +/** + * This sample demonstrates how to reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimage("rgcompute", "aaaaaaa", "aaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetVMReimageMaximumSetGen(); + await virtualMachineScaleSetVMReimageMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRestartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRestartSample.ts new file mode 100644 index 000000000000..846855cc21a5 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRestartSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to restarts a virtual machine in a VM scale set. + * + * @summary restarts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMRestartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.restart("rgcompute", "aa", "aaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to restarts a virtual machine in a VM scale set. + * + * @summary restarts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMRestartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.restart("rgcompute", "aaaaaaaaaaaa", "aaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetVMRestartMaximumSetGen(); + await virtualMachineScaleSetVMRestartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts new file mode 100644 index 000000000000..9681c7dd8c94 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @summary the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( + "ResourceGroup", + "myvmScaleSet", + "0", + { sasUriExpirationTimeInMinutes: 60 }, + ); + console.log(result); +} + +async function main(): Promise { + await retrieveBootDiagnosticsDataOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRunCommandSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRunCommandSample.ts new file mode 100644 index 000000000000..cdc8da745c91 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsRunCommandSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to run command on a virtual machine in a VM scale set. + * + * @summary run command on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json + */ +async function virtualMachineScaleSetVMsRunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.runCommand( + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", + { commandId: "RunPowerShellScript", script: ["Write-Host Hello World!"] }, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetVMsRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsSimulateEvictionSample.ts new file mode 100644 index 000000000000..c14e0793a232 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsSimulateEvictionSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @summary the operation to simulate the eviction of spot virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json + */ +async function simulateEvictionAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.simulateEviction( + "ResourceGroup", + "VmScaleSetName", + "InstanceId", + ); +} + +async function main(): Promise { + await simulateEvictionAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsStartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsStartSample.ts new file mode 100644 index 000000000000..720e07f33e97 --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsStartSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to starts a virtual machine in a VM scale set. + * + * @summary starts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMStartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.start("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to starts a virtual machine in a VM scale set. + * + * @summary starts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMStartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.start( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMStartMaximumSetGen(); + await virtualMachineScaleSetVMStartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsUpdateSample.ts new file mode 100644 index 000000000000..9f5264af5caf --- /dev/null +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMsUpdateSample.ts @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a virtual machine of a VM scale set. + * + * @summary updates a virtual machine of a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.update( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { + location: "westus", + tags: {}, + networkProfileConfiguration: { + networkInterfaceConfigurations: [ + { + name: "vmsstestnetconfig5415", + primary: true, + enableAcceleratedNetworking: true, + dnsSettings: { dnsServers: [] }, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "vmsstestnetconfig9693", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503", + }, + privateIPAddressVersion: "IPv4", + primary: true, + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaa", + idleTimeoutInMinutes: 18, + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + ipTags: [{ ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }], + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + publicIPAddressVersion: "IPv4", + deleteOption: "Delete", + sku: { name: "Basic", tier: "Regional" }, + }, + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + }, + ], + enableFpga: true, + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + deleteOption: "Delete", + }, + ], + }, + hardwareProfile: { + vmSize: "Basic_A0", + vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 }, + }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2012-R2-Datacenter", + version: "4.127.20180315", + sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", + id: "a", + }, + osDisk: { + osType: "Windows", + name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + createOption: "FromImage", + caching: "None", + managedDisk: { + storageAccountType: "Standard_LRS", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskSizeGB: 127, + encryptionSettings: { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + enabled: true, + }, + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + deleteOption: "Delete", + }, + dataDisks: [ + { + lun: 1, + name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + createOption: "Empty", + caching: "None", + managedDisk: { + storageAccountType: "Standard_LRS", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskSizeGB: 128, + toBeDetached: true, + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + detachOption: "ForceDetach", + deleteOption: "Delete", + }, + ], + }, + osProfile: { + computerName: "test000000", + adminUsername: "Foo12", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + additionalUnattendContent: [ + { + passName: "OobeSystem", + componentName: "Microsoft-Windows-Shell-Setup", + settingName: "AutoLogon", + content: "aaaaaaaaaaaaaaaaaaaa", + }, + ], + patchSettings: { + patchMode: "Manual", + enableHotpatching: true, + assessmentMode: "ImageDefault", + }, + winRM: { listeners: [{ protocol: "Http", certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa" }] }, + }, + secrets: [], + allowExtensionOperations: true, + requireGuestProvisionSignal: true, + adminPassword: "aaaaaaaaaaaaaaaa", + customData: "aaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] }, + provisionVMAgent: true, + patchSettings: { patchMode: "ImageDefault", assessmentMode: "ImageDefault" }, + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", + primary: true, + deleteOption: "Delete", + }, + ], + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaaaaa", + primary: true, + deleteOption: "Delete", + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + dnsSettings: { dnsServers: ["aaaaaa"] }, + ipConfigurations: [ + { + name: "aa", + subnet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + primary: true, + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + idleTimeoutInMinutes: 2, + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + ipTags: [{ ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaa" }], + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + publicIPAddressVersion: "IPv4", + publicIPAllocationMethod: "Dynamic", + sku: { name: "Basic", tier: "Regional" }, + }, + privateIPAddressVersion: "IPv4", + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + }, + ], + dscpConfiguration: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + ], + }, + diagnosticsProfile: { bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" } }, + additionalCapabilities: { ultraSSDEnabled: true, hibernationEnabled: true }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + encryptionAtHost: true, + securityType: "TrustedLaunch", + }, + availabilitySet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + licenseType: "aaaaaaaaaa", + protectionPolicy: { protectFromScaleIn: true, protectFromScaleSetActions: true }, + plan: { + name: "aaaaaaaaaa", + publisher: "aaaaaaaaaaaaaaaaaaaaaa", + product: "aaaaaaaaaaaaaaaaaaaa", + promotionCode: "aaaaaaaaaaaaaaaaaaaa", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to updates a virtual machine of a VM scale set. + * + * @summary updates a virtual machine of a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + { location: "westus" }, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetVMUpdateMaximumSetGen(); + await virtualMachineScaleSetVMUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsApproveRollingUpgradeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsApproveRollingUpgradeSample.ts index 830c01cff7ee..00be678a0904 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsApproveRollingUpgradeSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsApproveRollingUpgradeSample.ts @@ -1,42 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. + * This sample demonstrates how to approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. * - * @summary Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json + * @summary approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json */ async function virtualMachineScaleSetApproveRollingUpgrade(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "vmssToApproveRollingUpgradeOn"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["0", "1", "2"], - }; - const options: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams = { - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginApproveRollingUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.approveRollingUpgrade( + "rgcompute", + "vmssToApproveRollingUpgradeOn", + { vmInstanceIDs: { instanceIds: ["0", "1", "2"] } }, + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts index 6d38d182aa3f..5f1ab34e9743 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts @@ -1,62 +1,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VMScaleSetConvertToSinglePlacementGroupInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * This sample demonstrates how to converts SinglePlacementGroup property to false for a existing virtual machine scale set. * - * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + * @summary converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json */ async function virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: VMScaleSetConvertToSinglePlacementGroupInput = { - activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.convertToSinglePlacementGroup( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); + await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + ); } /** - * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * This sample demonstrates how to converts SinglePlacementGroup property to false for a existing virtual machine scale set. * - * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + * @summary converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json */ async function virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const parameters: VMScaleSetConvertToSinglePlacementGroupInput = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.convertToSinglePlacementGroup( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); + await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + "rgcompute", + "aaaaaaaaaaaaa", + {}, + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsCreateOrUpdateSample.ts index 7150b25e58c6..5eb9c35824de 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsCreateOrUpdateSample.ts @@ -1,3969 +1,3913 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSet} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json */ -async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithEphemeralOsDisksUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAndFullCachingEnabled.json */ -async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - protectedSettingsFromKeyVault: { - secretUrl: - "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", - sourceVault: { - id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", - }, +async function createAScaleSetWithEphemeralOsDisksUsingPlacementPropertyAndEnableFullCachingSetToTrue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { + option: "Local", + placement: "ResourceDisk", + enableFullCaching: true, }, - publisher: "{extension-Publisher}", - settings: {}, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json */ -async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", - }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json */ -async function createAPlatformImageScaleSetWithUnmanagedOSDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + osDisk: { + caching: "ReadWrite", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + createOption: "FromImage", + name: "osDisk", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - vhdContainers: [ - "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer", + ], + }, ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json */ async function createAScaleSetFromACustomImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json */ async function createAScaleSetFromAGeneralizedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json */ async function createAScaleSetFromASpecializedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json */ async function createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{nicConfig1-name}", - disableTcpStateTracking: true, - enableAcceleratedNetworking: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{nicConfig1-name}", + primary: true, + enableIPForwarding: true, + disableTcpStateTracking: true, + enableAcceleratedNetworking: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - { - name: "{nicConfig2-name}", - disableTcpStateTracking: false, - enableAcceleratedNetworking: false, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{nicConfig2-name}", - primary: true, - privateIPAddressVersion: "IPv4", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", + ], + }, + { + name: "{nicConfig2-name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + disableTcpStateTracking: false, + ipConfigurations: [ + { + name: "{nicConfig2-name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", + }, + privateIPAddressVersion: "IPv4", }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json */ -async function createAScaleSetWithApplicationProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - applicationProfile: { - galleryApplications: [ - { - configurationReference: - "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", - enableAutomaticUpgrade: false, - order: 1, - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", - tags: "myTag1", - treatFailureAsDeploymentFailure: true, - }, - { - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithFpgaNetworkInterfaces(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + { + name: "{fpgaNic-Name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + enableFpga: true, + ipConfigurations: [ + { + name: "{fpgaNic-Name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}", + }, + privateIPAddressVersion: "IPv4", + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticZoneRebalancingPolicy.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json */ -async function createAScaleSetWithAutomaticZoneRebalancingEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { - automaticZoneRebalancingPolicy: { - enabled: true, - rebalanceBehavior: "CreateBeforeDelete", - rebalanceStrategy: "Recreate", - }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{nicConfig1-name}", + tags: { nicTag: "tag" }, + primary: true, + enableIPForwarding: true, + disableTcpStateTracking: true, + enableAcceleratedNetworking: true, + auxiliaryMode: "AcceleratedConnections", + auxiliarySku: "A1", + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + { + name: "{nicConfig2-name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + disableTcpStateTracking: false, + ipConfigurations: [ + { + name: "{nicConfig2-name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", + }, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "publicip", + tags: { pipTag: "tag" }, + idleTimeoutInMinutes: 10, + dnsSettings: { + domainNameLabel: "vmsstestlabel01", + domainNameLabelScope: "NoReuse", + }, + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json */ -async function createAScaleSetWithDiskControllerType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - hardwareProfile: { - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, +async function createAPlatformImageScaleSetWithUnmanagedOsDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + name: "osDisk", + vhdContainers: [ + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer", ], - primary: true, }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - diskControllerType: "NVMe", - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json */ -async function createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { +async function createAScaleSetWithAMarketplaceImagePlan(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { caching: "ReadWrite", - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - ], - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], }, - storageAccountType: "Standard_LRS", - }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json */ -async function createAScaleSetWithFpgaNetworkInterfaces(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - { - name: "{fpgaNic-Name}", - enableAcceleratedNetworking: false, - enableFpga: true, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{fpgaNic-Name}", - primary: true, - privateIPAddressVersion: "IPv4", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", +async function createAScaleSetWithApplicationProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + applicationProfile: { + galleryApplications: [ + { + tags: "myTag1", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + treatFailureAsDeploymentFailure: true, + enableAutomaticUpgrade: false, + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json */ -async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithAutomaticRepairsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { encryptionAtHost: true }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", + ], + }, + ], }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxInstancePercentPerZonePolicy.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticZoneRebalancingPolicy.json */ -async function createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { - zoneAllocationPolicy: { - maxInstancePercentPerZonePolicy: { enabled: true, value: 50 }, - }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithAutomaticZoneRebalancingEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", + ], + }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + automaticZoneRebalancingPolicy: { + enabled: true, + rebalanceStrategy: "Recreate", + rebalanceBehavior: "CreateBeforeDelete", }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json */ -async function createAScaleSetWithNetworkInterfacesWithPublicIPAddressDnsSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{nicConfig1-name}", - auxiliaryMode: "AcceleratedConnections", - auxiliarySku: "A1", - disableTcpStateTracking: true, - enableAcceleratedNetworking: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - tags: { nicTag: "tag" }, - }, - { - name: "{nicConfig2-name}", - disableTcpStateTracking: false, - enableAcceleratedNetworking: false, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{nicConfig2-name}", - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "publicip", - dnsSettings: { - domainNameLabel: "vmsstestlabel01", - domainNameLabelScope: "NoReuse", +async function createAScaleSetWithAnAzureApplicationGateway(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", }, - idleTimeoutInMinutes: 10, - tags: { pipTag: "tag" }, }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json */ -async function createAScaleSetWithOSImageScheduledEventsEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithAnAzureLoadBalancer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + publicIPAddressConfiguration: { + name: "{vmss-name}", + publicIPAddressVersion: "IPv4", + }, + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - scheduledEventsProfile: { - osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json */ -async function createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - proxyAgentSettings: { - addProxyAgentExtension: true, - enabled: true, - imds: { - inVMAccessControlProfileReferenceId: - "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", +async function createAScaleSetWithBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", }, - wireServer: { - inVMAccessControlProfileReferenceId: - "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }, - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-jammy", - publisher: "Canonical", - sku: "22_04-lts-gen2", - version: "latest", + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json */ -async function createAScaleSetWithResilientVMCreationEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { resilientVMCreationPolicy: { enabled: true } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createOrUpdateAScaleSetWithCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", + ], + }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + capacityReservation: { + capacityReservationGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json */ -async function createAScaleSetWithResilientVMDeletionEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { resilientVMDeletionPolicy: { enabled: true } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithEphemeralOsDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json */ -async function createAScaleSetWithSecurityPostureReference(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "eastus2euap", - overprovision: true, - sku: { name: "Standard_A1", capacity: 3, tier: "Standard" }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "Automatic", - }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithDiskControllerType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, + }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + diskControllerType: "NVMe", + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + hardwareProfile: { vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityPostureReference: { - id: "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2022-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", + ], + }, + ], }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json */ -async function createAScaleSetWithSecurityTypeAsConfidentialVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DC2as_v5", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + createOption: "FromImage", + }, + dataDisks: [ + { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", }, }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2019-datacenter-cvm", - publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + }, + ], }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, - storageAccountType: "StandardSSD_LRS", - }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json */ -async function createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTpmSecurityEncryptionType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DC2es_v5", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, +async function createAScaleSetWithEmptyDataDisksOnEachVm(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + diskSizeGB: 512, }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2022-datacenter-cvm", - publisher: "UbuntuServer", - sku: "linux-cvm", - version: "17763.2183.2109130127", + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "NonPersistedTPM" }, - storageAccountType: "StandardSSD_LRS", - }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json */ -async function createAScaleSetWithServiceArtifactReference(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "eastus2euap", - overprovision: true, - sku: { name: "Standard_A1", capacity: 3, tier: "Standard" }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "Automatic", - }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { encryptionAtHost: true }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - serviceArtifactReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName", + ], + }, + ], + }, }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2022-Datacenter", - version: "latest", + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + */ +async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + suppressFailures: true, + }, + ], }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + */ +async function createAScaleSetWithExtensionTimeBudget(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + }, + ], + extensionsTimeBudget: "PT1H20M", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExternalHealthPolicy.json */ -async function createAScaleSetWithUefiSettingsOfSecureBootAndVTpm(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithExternalHealthPolicyEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "windowsserver-gen2preview-preview", - publisher: "MicrosoftWindowsServer", - sku: "windows10-tvm", - version: "18363.592.2001092016", + ], + }, + ], }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, + externalHealthPolicy: { enabled: true, expiryDuration: "PT10M", gracePeriod: "PT4H" }, }, - }; + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithHighSpeedInterconnectPlacement.json + */ +async function createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_D1_v2" }, + location: "westus", + orchestrationMode: "Flexible", + highSpeedInterconnectPlacement: "None", + platformFaultDomainCount: 1, + virtualMachineProfile: { + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-focal", + sku: "20_04-lts-gen2", + version: "latest", + }, + osDisk: { + createOption: "FromImage", + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + enableAcceleratedNetworking: false, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + primary: true, + applicationGatewayBackendAddressPools: [], + loadBalancerBackendAddressPools: [], + publicIPAddressConfiguration: { name: "{vmss-name}", idleTimeoutInMinutes: 15 }, + }, + ], + }, + ], + networkApiVersion: "2020-11-01", + }, + }, + }, + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithLifecycleHooksProfile.json */ -async function createAScaleSetWithAMarketplaceImagePlan(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ +async function createAVirtualMachineScaleSetWithLifecycleHooksProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 4, name: "Standard_D1_v2" }, + location: "westus", + lifecycleHooksProfile: { + lifecycleHooks: [ { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, + type: "UpgradeAutoOSRollingBatchStarting", + waitDuration: "PT20M", + defaultAction: "Approve", }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json */ -async function createAScaleSetWithAnAzureApplicationGateway(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}", +async function createAScaleSetWithManagedBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", }, - ], - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxInstancePercentPerZonePolicy.json */ -async function createAScaleSetWithAnAzureLoadBalancer(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}", - }, - ], - loadBalancerInboundNatPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}", - }, - ], - publicIPAddressConfiguration: { +async function createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { name: "{vmss-name}", - publicIPAddressVersion: "IPv4", - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + zoneAllocationPolicy: { maxInstancePercentPerZonePolicy: { enabled: true, value: 50 } }, + }, }, - }; + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxZoneCount.json + */ +async function createAZonesAutoScaleSetWithMaxZoneCount(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { zoneAllocationPolicy: { maxZoneCount: 2 } }, + placement: { zonePlacementPolicy: "Auto" }, + }, + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json */ -async function createAScaleSetWithAutomaticRepairsEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithOSImageScheduledEventsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", + ], + }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + scheduledEventsProfile: { + osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOperationRecoverySettings.json */ -async function createAScaleSetWithBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithOperationRecoverySettingsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", + ], + }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + operationRecoverySettings: { + restartRecoveryPolicy: { enabled: true }, + startRecoveryPolicy: { enabled: true }, + reimageRecoveryPolicy: { enabled: true }, }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json */ -async function createAScaleSetWithEmptyDataDisksOnEachVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithPasswordAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - diskSizeGB: 512, - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPlacement.json */ -async function createAScaleSetWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithPlacementPolicyAuto(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + placement: { zonePlacementPolicy: "Auto", includeZones: ["1", "3"] }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json */ -async function createAScaleSetWithEphemeralOSDisksUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithPremiumStorage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json */ -async function createAScaleSetWithEphemeralOSDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithPriorityMixPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A8m_v2" }, + location: "westus", + orchestrationMode: "Flexible", + platformFaultDomainCount: 1, + priorityMixPolicy: { baseRegularPriorityCount: 10, regularPriorityPercentageAboveBase: 50 }, + virtualMachineProfile: { + priority: "Spot", + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-focal", + sku: "20_04-lts-gen2", + version: "latest", + }, + osDisk: { + createOption: "FromImage", + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + osProfile: { computerNamePrefix: "{vmss-name}", adminUsername: "{your-username}" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + enableAcceleratedNetworking: false, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + primary: true, + applicationGatewayBackendAddressPools: [], + loadBalancerBackendAddressPools: [], + publicIPAddressConfiguration: { name: "{vmss-name}", idleTimeoutInMinutes: 15 }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], + networkApiVersion: "2020-11-01", }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json */ -async function createAScaleSetWithExtensionTimeBudget(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensionsTimeBudget: "PT1H20M", - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - publisher: "{extension-Publisher}", - settings: {}, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + protectedSettingsFromKeyVault: { + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", }, + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", + }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json */ -async function createAScaleSetWithManagedBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { bootDiagnostics: { enabled: true } }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, +async function createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2s_v3" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-jammy", + sku: "22_04-lts-gen2", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { + proxyAgentSettings: { + enabled: true, + addProxyAgentExtension: true, + wireServer: { + inVMAccessControlProfileReferenceId: + "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", + }, + imds: { + inVMAccessControlProfileReferenceId: + "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", + }, }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + osProfile: { computerNamePrefix: "{vmss-name}", adminUsername: "{your-username}" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json */ -async function createAScaleSetWithPasswordAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithResilientVMCreationEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { resilientVMCreationPolicy: { enabled: true } }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPlacement.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json */ -async function createAScaleSetWithPlacementPolicyAuto(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - placement: { includeZones: ["1", "3"], zonePlacementPolicy: "Auto" }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithResilientVMDeletionEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { resilientVMDeletionPolicy: { enabled: true } }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json */ -async function createAScaleSetWithPremiumStorage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithScaleInPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + scaleInPolicy: { rules: ["OldestVM"], prioritizeUnhealthyVMs: true, forceDeletion: true }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json */ -async function createAScaleSetWithPriorityMixPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - orchestrationMode: "Flexible", - platformFaultDomainCount: 1, - priorityMixPolicy: { - baseRegularPriorityCount: 10, - regularPriorityPercentageAboveBase: 50, - }, - sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, - virtualMachineProfile: { - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableAcceleratedNetworking: false, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [], - loadBalancerBackendAddressPools: [], - primary: true, - publicIPAddressConfiguration: { +async function createAScaleSetWithSecurityPostureReference(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_A1" }, + location: "eastus2euap", + overprovision: true, + virtualMachineProfile: { + securityPostureReference: { + id: "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", + }, + storageProfile: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { caching: "ReadWrite", createOption: "FromImage", name: "osDisk" }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { name: "{vmss-name}", - idleTimeoutInMinutes: 15, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { + mode: "Automatic", + automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, + }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json */ -async function createAScaleSetWithScaleInPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - scaleInPolicy: { - forceDeletion: true, - prioritizeUnhealthyVMs: true, - rules: ["OldestVM"], - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithSecurityTypeAsConfidentialVM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DC2as_v5" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, + }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + location: "westus", }, - }; + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DC2es_v5" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "linux-cvm", + publisher: "UbuntuServer", + version: "17763.2183.2109130127", + offer: "2022-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "NonPersistedTPM" }, + }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json */ -async function createAScaleSetWithSkuProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - orchestrationMode: "Flexible", - priorityMixPolicy: { - baseRegularPriorityCount: 4, - regularPriorityPercentageAboveBase: 50, - }, - singlePlacementGroup: false, - sku: { name: "Mix", capacity: 10 }, - skuProfile: { - allocationStrategy: "CapacityOptimized", - vmSizes: [ - { name: "Standard_D8s_v5" }, - { name: "Standard_E16s_v5" }, - { name: "Standard_D2s_v5" }, - ], - }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithServiceArtifactReference(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_A1" }, + location: "eastus2euap", + overprovision: true, + virtualMachineProfile: { + serviceArtifactReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName", + }, + storageProfile: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { caching: "ReadWrite", createOption: "FromImage", name: "osDisk" }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { + mode: "Automatic", + automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, + }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile_Prioritized.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json */ -async function createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - orchestrationMode: "Flexible", - priorityMixPolicy: { - baseRegularPriorityCount: 4, - regularPriorityPercentageAboveBase: 50, - }, - singlePlacementGroup: false, - sku: { name: "Mix", capacity: 10 }, - skuProfile: { - allocationStrategy: "Prioritized", - vmSizes: [ - { name: "Standard_D8s_v5", rank: 0 }, - { name: "Standard_E16s_v5", rank: 1 }, - { name: "Standard_D2s_v5", rank: 2 }, - ], - }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithSkuProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { capacity: 10, name: "Mix" }, + location: "westus", + singlePlacementGroup: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + orchestrationMode: "Flexible", + priorityMixPolicy: { baseRegularPriorityCount: 4, regularPriorityPercentageAboveBase: 50 }, + skuProfile: { + vmSizes: [ + { name: "Standard_D8s_v5" }, + { name: "Standard_E16s_v5" }, + { name: "Standard_D2s_v5" }, + ], + allocationStrategy: "CapacityOptimized", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile_Prioritized.json */ -async function createAScaleSetWithSpotRestorePolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, - spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { capacity: 10, name: "Mix" }, + location: "westus", + singlePlacementGroup: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + orchestrationMode: "Flexible", + priorityMixPolicy: { baseRegularPriorityCount: 4, regularPriorityPercentageAboveBase: 50 }, + skuProfile: { + vmSizes: [ + { name: "Standard_D8s_v5", rank: 0 }, + { name: "Standard_E16s_v5", rank: 1 }, + { name: "Standard_D2s_v5", rank: 2 }, + ], + allocationStrategy: "Prioritized", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json */ -async function createAScaleSetWithSshAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithSpotRestorePolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A8m_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - linuxConfiguration: { - disablePasswordAuthentication: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, }, + upgradePolicy: { mode: "Manual" }, + spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json */ -async function createAScaleSetWithTerminateScheduledEventsEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithSshAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", }, - }, - ], - primary: true, + ], + }, + disablePasswordAuthentication: true, }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - scheduledEventsProfile: { - terminateNotificationProfile: { - enable: true, - notBeforeTimeout: "PT5M", - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithStorageFaultDomainAlignment.json */ -async function createAScaleSetWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetContainingDisksWithStorageFaultDomainAlignment(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + storageFaultDomainAlignment: "BestEffortAligned", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { eventGridAndResourceGraph: { enable: true } }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + }, + zonalPlatformFaultDomainAlignMode: "Aligned", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json */ -async function createAScaleSetWithVirtualMachinesInDifferentZones(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "centralus", - overprovision: true, - sku: { name: "Standard_A1_v2", capacity: 2, tier: "Standard" }, - upgradePolicy: { mode: "Automatic" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithTerminateScheduledEventsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", + ], + }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - diskSizeGB: 512, - managedDisk: { storageAccountType: "Standard_LRS" }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT5M" }, }, }, + upgradePolicy: { mode: "Manual" }, }, - zones: ["1", "3"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json */ -async function createAScaleSetWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - hardwareProfile: { - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithUefiSettingsOfSecureBootAndVTPM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2s_v3" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows10-tvm", + publisher: "MicrosoftWindowsServer", + version: "18363.592.2001092016", + offer: "windowsserver-gen2preview-preview", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + upgradePolicy: { mode: "Manual" }, + location: "westus", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json */ -async function createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { enable: true }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithUserData(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, }, - zonalPlatformFaultDomainAlignMode: "Aligned", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithHighSpeedInterconnectPlacement.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json */ -async function createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - highSpeedInterconnectPlacement: "None", - location: "westus", - orchestrationMode: "Flexible", - platformFaultDomainCount: 1, - sku: { name: "Standard_D1_v2", capacity: 2, tier: "Standard" }, - virtualMachineProfile: { - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableAcceleratedNetworking: false, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [], - loadBalancerBackendAddressPools: [], - primary: true, - publicIPAddressConfiguration: { +async function createAScaleSetWithVmSizeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + hardwareProfile: { vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { name: "{vmss-name}", - idleTimeoutInMinutes: 15, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxZoneCount.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json */ -async function createAZonesAutoScaleSetWithMaxZoneCount(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - placement: { zonePlacementPolicy: "Auto" }, - resiliencyPolicy: { zoneAllocationPolicy: { maxZoneCount: 2 } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, +async function createAScaleSetWithVirtualMachinesInDifferentZones(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A1_v2" }, + location: "centralus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + diskSizeGB: 512, }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Automatic" }, + zones: ["1", "3"], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } /** - * This sample demonstrates how to Create or update a VM scale set. + * This sample demonstrates how to create or update a VM scale set. * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json */ -async function createOrUpdateAScaleSetWithCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - capacityReservation: { - capacityReservationGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", - }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", +async function createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + ], + }, + ], }, }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { eventGridAndResourceGraph: { enable: true } }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + }, + zonalPlatformFaultDomainAlignMode: "Aligned", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + ); console.log(result); } async function main(): Promise { - await createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(); - await createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(); - await createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage(); - await createAPlatformImageScaleSetWithUnmanagedOSDisks(); + await createAScaleSetWithEphemeralOsDisksUsingPlacementProperty(); + await createAScaleSetWithEphemeralOsDisksUsingPlacementPropertyAndEnableFullCachingSetToTrue(); + await createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(); + await createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage(); await createAScaleSetFromACustomImage(); await createAScaleSetFromAGeneralizedSharedImage(); await createAScaleSetFromASpecializedSharedImage(); await createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(); - await createAScaleSetWithApplicationProfile(); - await createAScaleSetWithAutomaticZoneRebalancingEnabled(); - await createAScaleSetWithDiskControllerType(); - await createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk(); await createAScaleSetWithFpgaNetworkInterfaces(); - await createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(); - await createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(); - await createAScaleSetWithNetworkInterfacesWithPublicIPAddressDnsSettings(); - await createAScaleSetWithOSImageScheduledEventsEnabled(); - await createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(); - await createAScaleSetWithResilientVMCreationEnabled(); - await createAScaleSetWithResilientVMDeletionEnabled(); - await createAScaleSetWithSecurityPostureReference(); - await createAScaleSetWithSecurityTypeAsConfidentialVM(); - await createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTpmSecurityEncryptionType(); - await createAScaleSetWithServiceArtifactReference(); - await createAScaleSetWithUefiSettingsOfSecureBootAndVTpm(); + await createAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings(); + await createAPlatformImageScaleSetWithUnmanagedOsDisks(); await createAScaleSetWithAMarketplaceImagePlan(); + await createAScaleSetWithApplicationProfile(); + await createAScaleSetWithAutomaticRepairsEnabled(); + await createAScaleSetWithAutomaticZoneRebalancingEnabled(); await createAScaleSetWithAnAzureApplicationGateway(); await createAScaleSetWithAnAzureLoadBalancer(); - await createAScaleSetWithAutomaticRepairsEnabled(); await createAScaleSetWithBootDiagnostics(); - await createAScaleSetWithEmptyDataDisksOnEachVM(); - await createAScaleSetWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(); - await createAScaleSetWithEphemeralOSDisksUsingPlacementProperty(); - await createAScaleSetWithEphemeralOSDisks(); + await createOrUpdateAScaleSetWithCapacityReservation(); + await createAScaleSetWithEphemeralOsDisks(); + await createAScaleSetWithDiskControllerType(); + await createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk(); + await createAScaleSetWithEmptyDataDisksOnEachVm(); + await createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(); + await createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(); await createAScaleSetWithExtensionTimeBudget(); + await createAScaleSetWithExternalHealthPolicyEnabled(); + await createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(); + await createAVirtualMachineScaleSetWithLifecycleHooksProfile(); await createAScaleSetWithManagedBootDiagnostics(); + await createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(); + await createAZonesAutoScaleSetWithMaxZoneCount(); + await createAScaleSetWithOSImageScheduledEventsEnabled(); + await createAScaleSetWithOperationRecoverySettingsEnabled(); await createAScaleSetWithPasswordAuthentication(); await createAScaleSetWithPlacementPolicyAuto(); await createAScaleSetWithPremiumStorage(); await createAScaleSetWithPriorityMixPolicy(); + await createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(); + await createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(); + await createAScaleSetWithResilientVMCreationEnabled(); + await createAScaleSetWithResilientVMDeletionEnabled(); await createAScaleSetWithScaleInPolicy(); + await createAScaleSetWithSecurityPostureReference(); + await createAScaleSetWithSecurityTypeAsConfidentialVM(); + await createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType(); + await createAScaleSetWithServiceArtifactReference(); await createAScaleSetWithSkuProfile(); await createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(); await createAScaleSetWithSpotRestorePolicy(); await createAScaleSetWithSshAuthentication(); + await createAScaleSetContainingDisksWithStorageFaultDomainAlignment(); await createAScaleSetWithTerminateScheduledEventsEnabled(); + await createAScaleSetWithUefiSettingsOfSecureBootAndVTPM(); await createAScaleSetWithUserData(); + await createAScaleSetWithVmSizeProperties(); await createAScaleSetWithVirtualMachinesInDifferentZones(); - await createAScaleSetWithVMSizeProperties(); await createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(); - await createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(); - await createAZonesAutoScaleSetWithMaxZoneCount(); - await createOrUpdateAScaleSetWithCapacityReservation(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeallocateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeallocateSample.ts index bba73d0f65d0..09b4cf551306 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeallocateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeallocateSample.ts @@ -1,64 +1,36 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsDeallocateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * This sample demonstrates how to deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * - * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json + * @summary deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json */ async function virtualMachineScaleSetDeallocateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const hibernate = true; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsDeallocateOptionalParams = { - hibernate, - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + hibernate: true, + }); } /** - * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * This sample demonstrates how to deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * - * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json + * @summary deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json */ async function virtualMachineScaleSetDeallocateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteInstancesSample.ts index 817cdb825210..8cf6a7e6666b 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteInstancesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteInstancesSample.ts @@ -1,70 +1,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceRequiredIDs, - VirtualMachineScaleSetsDeleteInstancesOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * This sample demonstrates how to deletes virtual machines in a VM scale set. * - * @summary Deletes virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json + * @summary deletes virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json */ async function virtualMachineScaleSetDeleteInstancesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; - const forceDeletion = true; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsDeleteInstancesOptionalParams = { - forceDeletion, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.deleteInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + { instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] }, + { forceDeletion: true }, + ); } /** - * This sample demonstrates how to Deletes virtual machines in a VM scale set. + * This sample demonstrates how to deletes virtual machines in a VM scale set. * - * @summary Deletes virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json + * @summary deletes virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json */ async function virtualMachineScaleSetDeleteInstancesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); + await client.virtualMachineScaleSets.deleteInstances("rgcompute", "aaaaaaaaaaaaaaa", { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteSample.ts index bb392b95d386..64362f98fc58 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsDeleteSample.ts @@ -1,38 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetsDeleteOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deletes a VM scale set. + * This sample demonstrates how to deletes a VM scale set. * - * @summary Deletes a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json + * @summary deletes a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json */ async function forceDeleteAVMScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const forceDeletion = true; - const options: VirtualMachineScaleSetsDeleteOptionalParams = { - forceDeletion, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.delete("myResourceGroup", "myvmScaleSet", { + forceDeletion: true, + }); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts index 5b1aa7692184..45bc83c9a159 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts @@ -3,52 +3,41 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * This sample demonstrates how to manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. * - * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + * @summary manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json */ async function virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const platformUpdateDomain = 30; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName, - vmScaleSetName, - platformUpdateDomain, + "rgcompute", + "aaaaaaaaaaaaaaaa", + 30, ); console.log(result); } /** - * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * This sample demonstrates how to manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. * - * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + * @summary manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json */ async function virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const platformUpdateDomain = 9; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName, - vmScaleSetName, - platformUpdateDomain, + "rgcompute", + "aaaaaaaaaaaa", + 9, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetInstanceViewSample.ts index 7f9b09267e9d..fee43e879654 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetInstanceViewSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetInstanceViewSample.ts @@ -3,46 +3,37 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the status of a VM scale set instance. + * This sample demonstrates how to gets the status of a VM scale set instance. * - * @summary Gets the status of a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json + * @summary gets the status of a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json */ async function virtualMachineScaleSetGetInstanceViewMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.getInstanceView( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets the status of a VM scale set instance. + * This sample demonstrates how to gets the status of a VM scale set instance. * - * @summary Gets the status of a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json + * @summary gets the status of a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json */ async function virtualMachineScaleSetGetInstanceViewMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.getInstanceView( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts index ab574f0f83a5..26d568d0e431 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts @@ -3,53 +3,46 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * This sample demonstrates how to gets list of OS upgrades on a VM scale set instance. * - * @summary Gets list of OS upgrades on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json + * @summary gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json */ async function virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listOSUpgradeHistory( - resourceGroupName, - vmScaleSetName, + for await (const item of client.virtualMachineScaleSets.getOSUpgradeHistory( + "rgcompute", + "aaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. + * This sample demonstrates how to gets list of OS upgrades on a VM scale set instance. * - * @summary Gets list of OS upgrades on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json + * @summary gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json */ async function virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listOSUpgradeHistory( - resourceGroupName, - vmScaleSetName, + for await (const item of client.virtualMachineScaleSets.getOSUpgradeHistory( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetSample.ts index 1dda419720ed..01d6f2cb752c 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsGetSample.ts @@ -1,108 +1,83 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Display information about a virtual machine scale set. + * This sample demonstrates how to display information about a virtual machine scale set. * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json */ -async function getVMScaleSetVMWithDiskControllerType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const expand = "userData"; - const options: VirtualMachineScaleSetsGetOptionalParams = { expand }; +async function getAVirtualMachineScaleSet(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - options, + "myResourceGroup", + "myVirtualMachineScaleSet", ); console.log(result); } /** - * This sample demonstrates how to Display information about a virtual machine scale set. + * This sample demonstrates how to display information about a virtual machine scale set. * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json */ -async function getAVirtualMachineScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; +async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, + "myResourceGroup", + "myVirtualMachineScaleSet", ); console.log(result); } /** - * This sample demonstrates how to Display information about a virtual machine scale set. + * This sample demonstrates how to display information about a virtual machine scale set. * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json */ -async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; +async function getVMScaleSetVMWithDiskControllerType(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, + "myResourceGroup", + "myVirtualMachineScaleSet", + { expand: "userData" }, ); console.log(result); } /** - * This sample demonstrates how to Display information about a virtual machine scale set. + * This sample demonstrates how to display information about a virtual machine scale set. * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json */ async function getAVirtualMachineScaleSetWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const expand = "userData"; - const options: VirtualMachineScaleSetsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - options, + "myResourceGroup", + "myVirtualMachineScaleSet", + { expand: "userData" }, ); console.log(result); } async function main(): Promise { - await getVMScaleSetVMWithDiskControllerType(); await getAVirtualMachineScaleSet(); await getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(); + await getVMScaleSetVMWithDiskControllerType(); await getAVirtualMachineScaleSetWithUserData(); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListAllSample.ts index 78538262b1f2..191bbe22cd29 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListAllSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListAllSample.ts @@ -3,41 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * This sample demonstrates how to gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. * - * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json + * @summary gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json */ async function virtualMachineScaleSetListAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listAll()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * This sample demonstrates how to gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. * - * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json + * @summary gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json */ async function virtualMachineScaleSetListAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListByLocationSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListByLocationSample.ts index 4430dc36048b..72cf07163dfc 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListByLocationSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListByLocationSample.ts @@ -3,26 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets all the VM scale sets under the specified subscription for the specified location. + * This sample demonstrates how to gets all the VM scale sets under the specified subscription for the specified location. * - * @summary Gets all the VM scale sets under the specified subscription for the specified location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json + * @summary gets all the VM scale sets under the specified subscription for the specified location. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json */ async function listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listByLocation( - location, - )) { + for await (const item of client.virtualMachineScaleSets.listByLocation("eastus")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSample.ts index 186f55722315..c013b752d578 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSample.ts @@ -3,49 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * This sample demonstrates how to gets a list of all VM scale sets under a resource group. * - * @summary Gets a list of all VM scale sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json + * @summary gets a list of all VM scale sets under a resource group. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json */ async function virtualMachineScaleSetListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.list( - resourceGroupName, - )) { + for await (const item of client.virtualMachineScaleSets.list("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. + * This sample demonstrates how to gets a list of all VM scale sets under a resource group. * - * @summary Gets a list of all VM scale sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json + * @summary gets a list of all VM scale sets under a resource group. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json */ async function virtualMachineScaleSetListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.list( - resourceGroupName, - )) { + for await (const item of client.virtualMachineScaleSets.list("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSkusSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSkusSample.ts index ffbe678d54ad..a1c4b30262f0 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSkusSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsListSkusSample.ts @@ -3,53 +3,43 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * This sample demonstrates how to gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. * - * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json + * @summary gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json */ async function virtualMachineScaleSetListSkusMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listSkus( - resourceGroupName, - vmScaleSetName, - )) { + for await (const item of client.virtualMachineScaleSets.listSkus("rgcompute", "aaaaaa")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * This sample demonstrates how to gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. * - * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json + * @summary gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json */ async function virtualMachineScaleSetListSkusMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listSkus( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPerformMaintenanceSample.ts index 373bf68cf268..878b4d4f5ecb 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPerformMaintenanceSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPerformMaintenanceSample.ts @@ -1,64 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsPerformMaintenanceOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * This sample demonstrates how to perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * - * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json + * @summary perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json */ async function virtualMachineScaleSetPerformMaintenanceMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsPerformMaintenanceOptionalParams = { - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.performMaintenance("rgcompute", "aaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); } /** - * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * This sample demonstrates how to perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * - * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json + * @summary perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json */ async function virtualMachineScaleSetPerformMaintenanceMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.performMaintenance("rgcompute", "aa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPowerOffSample.ts index b0e4cc205c5d..58fc48f865a5 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPowerOffSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsPowerOffSample.ts @@ -1,64 +1,36 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsPowerOffOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * This sample demonstrates how to power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. * - * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json + * @summary power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json */ async function virtualMachineScaleSetPowerOffMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; - const skipShutdown = true; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsPowerOffOptionalParams = { - skipShutdown, - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + skipShutdown: true, + }); } /** - * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * This sample demonstrates how to power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. * - * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json + * @summary power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json */ async function virtualMachineScaleSetPowerOffMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "a"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.powerOff("rgcompute", "a"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReapplySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReapplySample.ts index edec0b8b7f0b..7820fa887a82 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReapplySample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReapplySample.ts @@ -3,52 +3,37 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * This sample demonstrates how to reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances * - * @summary Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json + * @summary reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json */ async function virtualMachineScaleSetsReapplyMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "b4f1213b-cacc-4816-8bfb-f30f90643de8"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || - "VirtualMachineScaleSetReapplyTestRG"; - const vmScaleSetName = "VMSSReapply-Test-ScaleSet"; const credential = new DefaultAzureCredential(); + const subscriptionId = "b4f1213b-cacc-4816-8bfb-f30f90643de8"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReapplyAndWait( - resourceGroupName, - vmScaleSetName, + await client.virtualMachineScaleSets.reapply( + "VirtualMachineScaleSetReapplyTestRG", + "VMSSReapply-Test-ScaleSet", ); - console.log(result); } /** - * This sample demonstrates how to Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * This sample demonstrates how to reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances * - * @summary Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json + * @summary reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json */ async function virtualMachineScaleSetsReapplyMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "b4f1213b-cacc-4816-8bfb-f30f90643de8"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || - "VirtualMachineScaleSetReapplyTestRG"; - const vmScaleSetName = "VMSSReapply-Test-ScaleSet"; const credential = new DefaultAzureCredential(); + const subscriptionId = "b4f1213b-cacc-4816-8bfb-f30f90643de8"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReapplyAndWait( - resourceGroupName, - vmScaleSetName, + await client.virtualMachineScaleSets.reapply( + "VirtualMachineScaleSetReapplyTestRG", + "VMSSReapply-Test-ScaleSet", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRedeploySample.ts index 9e778e36284f..2196954e2344 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRedeploySample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRedeploySample.ts @@ -1,62 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsRedeployOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * This sample demonstrates how to shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. * - * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json + * @summary shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json */ async function virtualMachineScaleSetRedeployMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsRedeployOptionalParams = { - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); } /** - * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * This sample demonstrates how to shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. * - * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json + * @summary shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json */ async function virtualMachineScaleSetRedeployMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageAllSample.ts index 4c3af6f3696a..c79a8c8a1051 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageAllSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageAllSample.ts @@ -1,62 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsReimageAllOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * This sample demonstrates how to reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. * - * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json + * @summary reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json */ async function virtualMachineScaleSetReimageAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsReimageAllOptionalParams = { - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.reimageAll("rgcompute", "aaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); } /** - * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * This sample demonstrates how to reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. * - * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json + * @summary reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json */ async function virtualMachineScaleSetReimageAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageSample.ts index 791d8d9717f3..c1502d063c59 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsReimageSample.ts @@ -1,64 +1,39 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetReimageParameters, - VirtualMachineScaleSetsReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * This sample demonstrates how to reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. * - * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json + * @summary reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json */ async function virtualMachineScaleSetReimageMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmScaleSetReimageInput: VirtualMachineScaleSetReimageParameters = { - forceUpdateOSDiskForEphemeral: true, - instanceIds: ["aaaaaaaaaa"], - tempDisk: true, - }; - const options: VirtualMachineScaleSetsReimageOptionalParams = { - vmScaleSetReimageInput, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmScaleSetReimageInput: { + instanceIds: ["aaaaaaaaaa"], + forceUpdateOSDiskForEphemeral: true, + tempDisk: true, + }, + }); } /** - * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * This sample demonstrates how to reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. * - * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json + * @summary reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json */ async function virtualMachineScaleSetReimageMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRestartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRestartSample.ts index 4d788912d3a4..77a4ae3944d8 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRestartSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsRestartSample.ts @@ -1,62 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsRestartOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * This sample demonstrates how to restarts one or more virtual machines in a VM scale set. * - * @summary Restarts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json + * @summary restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json */ async function virtualMachineScaleSetRestartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsRestartOptionalParams = { - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.restart("rgcompute", "aaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); } /** - * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. + * This sample demonstrates how to restarts one or more virtual machines in a VM scale set. * - * @summary Restarts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json + * @summary restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json */ async function virtualMachineScaleSetRestartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.restart("rgcompute", "aaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsScaleOutSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsScaleOutSample.ts index 966ee7a2014d..ea3ae217aaee 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsScaleOutSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsScaleOutSample.ts @@ -1,38 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VMScaleSetScaleOutInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Scales out one or more virtual machines in a VM scale set. + * This sample demonstrates how to scales out one or more virtual machines in a VM scale set. * - * @summary Scales out one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json + * @summary scales out one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json */ async function virtualMachineScaleSetScaleOut(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VMScaleSetScaleOutInput = { - capacity: 5, - properties: { zone: "1" }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginScaleOutAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); + await client.virtualMachineScaleSets.scaleOut("myResourceGroup", "{vmss-name}", { + capacity: 5, + properties: { zone: "1" }, + }); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts index 8f36df299447..cb675521fef4 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts @@ -1,71 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - OrchestrationServiceStateInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Changes ServiceState property for a given service + * This sample demonstrates how to changes ServiceState property for a given service * - * @summary Changes ServiceState property for a given service - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json + * @summary changes ServiceState property for a given service + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json */ -async function virtualMachineScaleSetOrchestrationServiceStateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const parameters: OrchestrationServiceStateInput = { - action: "Resume", - serviceName: "AutomaticRepairs", - }; +async function virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); + await client.virtualMachineScaleSets.setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaa", + { serviceName: "AutomaticRepairs", action: "Resume" }, + ); } /** - * This sample demonstrates how to Changes ServiceState property for a given service + * This sample demonstrates how to changes ServiceState property for a given service * - * @summary Changes ServiceState property for a given service - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json + * @summary changes ServiceState property for a given service + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json */ -async function virtualMachineScaleSetOrchestrationServiceStateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: OrchestrationServiceStateInput = { - action: "Resume", - serviceName: "AutomaticRepairs", - }; +async function virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); + await client.virtualMachineScaleSets.setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + { serviceName: "AutomaticRepairs", action: "Resume" }, + ); } async function main(): Promise { - await virtualMachineScaleSetOrchestrationServiceStateMaximumSetGen(); - await virtualMachineScaleSetOrchestrationServiceStateMinimumSetGen(); + await virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen(); + await virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsStartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsStartSample.ts index 01e61006fa04..4b6287563043 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsStartSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsStartSample.ts @@ -1,60 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsStartOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * This sample demonstrates how to starts one or more virtual machines in a VM scale set. * - * @summary Starts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json + * @summary starts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json */ async function virtualMachineScaleSetStartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsStartOptionalParams = { vmInstanceIDs }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.start("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); } /** - * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. + * This sample demonstrates how to starts one or more virtual machines in a VM scale set. * - * @summary Starts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json + * @summary starts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json */ async function virtualMachineScaleSetStartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.start("rgcompute", "aaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateInstancesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateInstancesSample.ts index 86737d4bbaca..7d8de504d8a5 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateInstancesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateInstancesSample.ts @@ -1,64 +1,39 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceRequiredIDs} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * This sample demonstrates how to upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * - * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json + * @summary upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json */ async function virtualMachineScaleSetUpdateInstancesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); + await client.virtualMachineScaleSets.updateInstances("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }); } /** - * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * This sample demonstrates how to upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * - * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json + * @summary upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json */ async function virtualMachineScaleSetUpdateInstancesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); + await client.virtualMachineScaleSets.updateInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] }, + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateSample.ts index 161e3586c779..83617c1280b4 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetsUpdateSample.ts @@ -1,110 +1,162 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a VM scale set. + * This sample demonstrates how to update a VM scale set. * - * @summary Update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json + * @summary update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json */ async function virtualMachineScaleSetUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetUpdate = { - additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, - automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, - doNotRunExtensionsOnOverprovisionedVMs: true, - identity: { - type: "SystemAssigned", - userAssignedIdentities: { key3951: {} }, - }, - overprovision: true, + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.update("rgcompute", "aaaaaaaaaaaaa", { + sku: { name: "DSv3-Type1", tier: "aaa", capacity: 7 }, plan: { - name: "windows2016", + publisher: "microsoft-ads", product: "windows-data-science-vm", + name: "windows2016", promotionCode: "aaaaaaaaaa", - publisher: "microsoft-ads", }, - proximityPlacementGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, - singlePlacementGroup: true, - sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, - tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, upgradePolicy: { - automaticOSUpgradePolicy: { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - osRollingUpgradeDeferral: true, - }, mode: "Manual", rollingUpgradePolicy: { - enableCrossZoneUpgrade: true, maxBatchInstancePercent: 49, - maxSurge: true, maxUnhealthyInstancePercent: 81, maxUnhealthyUpgradedInstancePercent: 98, pauseTimeBetweenBatches: "aaaaaaaaaaaaaaa", + enableCrossZoneUpgrade: true, prioritizeUnhealthyInstances: true, rollbackFailedInstancesOnPolicyBreach: true, + maxSurge: true, + }, + automaticOSUpgradePolicy: { + enableAutomaticOSUpgrade: true, + disableAutomaticRollback: true, + osRollingUpgradeDeferral: true, }, }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + enableHotpatching: true, + assessmentMode: "ImageDefault", + automaticByPlatformSettings: { rebootSetting: "Never" }, + }, + timeZone: "aaaaaaaaaaaaaaaa", + additionalUnattendContent: [ + { + passName: "OobeSystem", + componentName: "Microsoft-Windows-Shell-Setup", + settingName: "AutoLogon", + content: "aaaaaaaaaaaaaaaaaaaa", + }, + ], + winRM: { listeners: [{ protocol: "Http", certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa" }] }, }, + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + provisionVMAgent: true, + patchSettings: { patchMode: "ImageDefault", assessmentMode: "ImageDefault" }, + }, + secrets: [ + { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + vaultCertificates: [ + { certificateUrl: "aaaaaaa", certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + ], + }, + ], }, - extensionProfile: { - extensionsTimeBudget: "PT1H20M", - extensions: [ + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + sharedGalleryImageId: "aaaaaa", + id: "aaaaaaaaaaaaaaaaaaa", + }, + osDisk: { + caching: "ReadWrite", + writeAcceleratorEnabled: true, + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + diskSizeGB: 6, + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + vhdContainers: ["aa"], + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + }, + dataDisks: [ { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", + diskSizeGB: 1023, + createOption: "Empty", + lun: 26, + name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + caching: "None", + writeAcceleratorEnabled: true, + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskIopsReadWrite: 28, + diskMBpsReadWrite: 15, }, ], }, - licenseType: "aaaaaaaaaaaa", networkProfile: { healthProbe: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", }, - networkApiVersion: "2020-11-01", networkInterfaceConfigurations: [ { name: "aaaaaaaa", - deleteOption: "Delete", - dnsSettings: { dnsServers: [] }, + primary: true, enableAcceleratedNetworking: true, enableFpga: true, - enableIPForwarding: true, + networkSecurityGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + dnsSettings: { dnsServers: [] }, ipConfigurations: [ { name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + primary: true, + publicIPAddressConfiguration: { + name: "a", + idleTimeoutInMinutes: 3, + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + deleteOption: "Delete", + }, + privateIPAddressVersion: "IPv4", applicationGatewayBackendAddressPools: [ { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", @@ -125,168 +177,76 @@ async function virtualMachineScaleSetUpdateMaximumSetGen(): Promise { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", }, ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "a", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 3, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", - }, - }, - ], - networkSecurityGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - primary: true, - }, - ], - }, - osProfile: { - customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - linuxConfiguration: { - disablePasswordAuthentication: true, - patchSettings: { - assessmentMode: "ImageDefault", - patchMode: "ImageDefault", - }, - provisionVMAgent: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, - }, - secrets: [ - { - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - vaultCertificates: [ - { - certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa", - certificateUrl: "aaaaaaa", }, ], + enableIPForwarding: true, + deleteOption: "Delete", }, ], - windowsConfiguration: { - additionalUnattendContent: [ - { - componentName: "Microsoft-Windows-Shell-Setup", - content: "aaaaaaaaaaaaaaaaaaaa", - passName: "OobeSystem", - settingName: "AutoLogon", - }, - ], - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "ImageDefault", - automaticByPlatformSettings: { rebootSetting: "Never" }, - enableHotpatching: true, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - timeZone: "aaaaaaaaaaaaaaaa", - winRM: { - listeners: [ - { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }, - ], - }, - }, - }, - scheduledEventsProfile: { - terminateNotificationProfile: { - enable: true, - notBeforeTimeout: "PT10M", - }, + networkApiVersion: "2020-11-01", }, securityProfile: { encryptionAtHost: true, - securityType: "TrustedLaunch", uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", }, - storageProfile: { - dataDisks: [ + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + extensionProfile: { + extensions: [ { - name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - caching: "None", - createOption: "Empty", - diskIopsReadWrite: 28, - diskMBpsReadWrite: 15, - diskSizeGB: 1023, - lun: 26, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - storageAccountType: "Standard_LRS", - }, - writeAcceleratorEnabled: true, + name: "{extension-name}", + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, }, ], - imageReference: { - id: "aaaaaaaaaaaaaaaaaaa", - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sharedGalleryImageId: "aaaaaa", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - diskSizeGB: 6, - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - storageAccountType: "Standard_LRS", - }, - vhdContainers: ["aa"], - writeAcceleratorEnabled: true, - }, + extensionsTimeBudget: "PT1H20M", + }, + licenseType: "aaaaaaaaaaaa", + billingProfile: { maxPrice: -1 }, + scheduledEventsProfile: { + terminateNotificationProfile: { notBeforeTimeout: "PT10M", enable: true }, }, userData: "aaaaaaaaaaaaa", }, + overprovision: true, + doNotRunExtensionsOnOverprovisionedVMs: true, + singlePlacementGroup: true, + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + scaleInPolicy: { rules: ["OldestVM"], forceDeletion: true }, + proximityPlacementGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + identity: { type: "SystemAssigned", userAssignedIdentities: { key3951: {} } }, zones: ["1", "2", "3"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, + }); console.log(result); } /** - * This sample demonstrates how to Update a VM scale set. + * This sample demonstrates how to update a VM scale set. * - * @summary Update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json + * @summary update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json */ async function virtualMachineScaleSetUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + const result = await client.virtualMachineScaleSets.update("rgcompute", "aaaaaaaaaaaaaa", {}); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineSizesListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachineSizesListSample.ts index 234d7aa658c0..8c449e1fb926 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineSizesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachineSizesListSample.ts @@ -3,43 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * This sample demonstrates how to this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) * - * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json + * @summary this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json */ async function virtualMachineSizesListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "-e"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineSizes.list(location)) { + for await (const item of client.virtualMachineSizes.list("-e")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * This sample demonstrates how to this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) * - * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json + * @summary this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json */ async function virtualMachineSizesListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "._.."; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineSizes.list(location)) { + for await (const item of client.virtualMachineSizes.list("._..")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesAssessPatchesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesAssessPatchesSample.ts index 5939d6a3d3c6..8b31d0c0354c 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesAssessPatchesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesAssessPatchesSample.ts @@ -3,26 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Assess patches on the VM. + * This sample demonstrates how to assess patches on the VM. * - * @summary Assess patches on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json + * @summary assess patches on the VM. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AssessPatches.json */ async function assessPatchStateOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const vmName = "myVMName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAssessPatchesAndWait( - resourceGroupName, - vmName, - ); + const result = await client.virtualMachines.assessPatches("myResourceGroupName", "myVMName"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesAttachDetachDataDisksSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesAttachDetachDataDisksSample.ts index c93d13174bbe..765ca192a360 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesAttachDetachDataDisksSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesAttachDetachDataDisksSample.ts @@ -1,87 +1,75 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - AttachDetachDataDisksRequest} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Attach and detach data disks to/from the virtual machine. + * This sample demonstrates how to attach and detach data disks to/from the virtual machine. * - * @summary Attach and detach data disks to/from the virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json + * @summary attach and detach data disks to/from the virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json */ async function virtualMachineAttachDetachDataDisksMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: AttachDetachDataDisksRequest = { - dataDisksToAttach: [ - { - caching: "ReadOnly", - deleteOption: "Delete", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - lun: 1, - writeAcceleratorEnabled: true, - }, - { - caching: "ReadWrite", - deleteOption: "Detach", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", - lun: 2, - writeAcceleratorEnabled: false, - }, - ], - dataDisksToDetach: [ - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", - }, - ], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmName, - parameters, + const result = await client.virtualMachines.attachDetachDataDisks( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + { + dataDisksToAttach: [ + { + lun: 1, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadOnly", + deleteOption: "Delete", + writeAcceleratorEnabled: true, + }, + { + lun: 2, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadWrite", + deleteOption: "Detach", + writeAcceleratorEnabled: false, + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + detachOption: "ForceDetach", + }, + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", + detachOption: "ForceDetach", + }, + ], + }, ); console.log(result); } /** - * This sample demonstrates how to Attach and detach data disks to/from the virtual machine. + * This sample demonstrates how to attach and detach data disks to/from the virtual machine. * - * @summary Attach and detach data disks to/from the virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json + * @summary attach and detach data disks to/from the virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json */ async function virtualMachineAttachDetachDataDisksMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "azure-vm"; - const parameters: AttachDetachDataDisksRequest = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.attachDetachDataDisks("rgcompute", "azure-vm", { dataDisksToAttach: [ { diskId: @@ -94,14 +82,7 @@ async function virtualMachineAttachDetachDataDisksMinimumSetGen(): Promise "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", }, ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesCaptureSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesCaptureSample.ts index 4c95a02dd37c..5fe0cbea96a3 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesCaptureSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesCaptureSample.ts @@ -1,65 +1,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineCaptureParameters} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * This sample demonstrates how to captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. * - * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json + * @summary captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json */ async function virtualMachineCaptureMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: VirtualMachineCaptureParameters = { - destinationContainerName: "aaaaaaa", - overwriteVhds: true, - vhdPrefix: "aaaaaaaaa", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCaptureAndWait( - resourceGroupName, - vmName, - parameters, - ); + const result = await client.virtualMachines.capture("rgcompute", "aaaaaaaaaaaaaaaaaaaa", { + vhdPrefix: "aaaaaaaaa", + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + }); console.log(result); } /** - * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * This sample demonstrates how to captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. * - * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json + * @summary captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json */ async function virtualMachineCaptureMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const parameters: VirtualMachineCaptureParameters = { - destinationContainerName: "aaaaaaa", - overwriteVhds: true, - vhdPrefix: "aaaaaaaaa", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCaptureAndWait( - resourceGroupName, - vmName, - parameters, - ); + const result = await client.virtualMachines.capture("rgcompute", "aaaaaaaaaaaaa", { + vhdPrefix: "aaaaaaaaa", + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesConvertToManagedDisksSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesConvertToManagedDisksSample.ts index cf911a08b875..ef06fcecb65b 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesConvertToManagedDisksSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesConvertToManagedDisksSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * This sample demonstrates how to converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. * - * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json + * @summary converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json */ async function virtualMachineConvertToManagedDisksMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.convertToManagedDisks("rgcompute", "aaaaaaa"); } /** - * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * This sample demonstrates how to converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. * - * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json + * @summary converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json */ async function virtualMachineConvertToManagedDisksMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.convertToManagedDisks("rgcompute", "aaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesCreateOrUpdateSample.ts index aeac45784a6c..23120fffb9ce 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesCreateOrUpdateSample.ts @@ -1,26 +1,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { VirtualMachine} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json */ -async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createACustomImageVmFromAnUnmanagedGeneralizedOsImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + osDisk: { + name: "myVMosdisk", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + osType: "Windows", + createOption: "FromImage", + caching: "ReadWrite", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -29,55 +44,40 @@ async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault(): Pr }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { assessmentMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json + */ +async function createAVMFromACommunityGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + communityGalleryImageId: + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json - */ -async function createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -86,62 +86,80 @@ async function createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndA }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { - assessmentMode: "AutomaticByPlatform", - automaticByPlatformSettings: { - bypassPlatformSafetyChecksOnUserSchedule: true, - rebootSetting: "Never", - }, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json + */ +async function createAVmFromACustomImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json */ -async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createAVmFromAGeneralizedSharedImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -150,55 +168,76 @@ async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault(): Promise }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { patchMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json + */ +async function createAVMFromASharedGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + sharedGalleryImageId: + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json */ -async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createAVmFromASpecializedSharedImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, networkProfile: { networkInterfaces: [ { @@ -207,58 +246,37 @@ async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAu }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { - assessmentMode: "AutomaticByPlatform", - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + */ +async function createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json - */ -async function createAVMFromACommunityGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -268,48 +286,45 @@ async function createAVMFromACommunityGalleryImage(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", + }, + virtualMachineScaleSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}", }, + platformFaultDomain: 1, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json + */ +async function createAVmInAnAvailabilitySet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - communityGalleryImageId: - "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json - */ -async function createAVMFromASharedGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -319,129 +334,60 @@ async function createAVMFromASharedGalleryImage(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - sharedGalleryImageId: - "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, + availabilitySet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json */ -async function createAVMWithDiskControllerType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - hardwareProfile: { vmSize: "Standard_D4_v3" }, +async function createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { - diskControllerType: "NVMe", imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "U29tZSBDdXN0b20gRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithFips1403Enabled.json - */ -async function createAVMWithFips1403Enabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - additionalCapabilities: { enableFips1403Encryption: true }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + assessmentMode: "AutomaticByPlatform", + automaticByPlatformSettings: { + rebootSetting: "Never", + bypassPlatformSafetyChecksOnUserSchedule: true, + }, + }, }, }, - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "eastus2euap", networkProfile: { networkInterfaces: [ { @@ -450,59 +396,46 @@ async function createAVMWithFips1403Enabled(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json - */ -async function createAVMWithHibernationEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - additionalCapabilities: { hibernationEnabled: true }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { assessmentMode: "ImageDefault" }, }, }, - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "eastus2euap", networkProfile: { networkInterfaces: [ { @@ -511,51 +444,43 @@ async function createAVMWithHibernationEnabled(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + */ +async function createALinuxVmWithAPatchSettingPatchModeOfImageDefault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json - */ -async function createAVMWithProxyAgentSettingsOfEnabledAndMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { provisionVMAgent: true, patchSettings: { patchMode: "ImageDefault" } }, + }, networkProfile: { networkInterfaces: [ { @@ -564,58 +489,46 @@ async function createAVMWithProxyAgentSettingsOfEnabledAndMode(): Promise }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - proxyAgentSettings: { - enabled: true, - imds: { mode: "Audit" }, - wireServer: { mode: "Audit" }, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json - */ -async function createAVMWithUefiSettingsOfSecureBootAndVTpm(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { patchMode: "AutomaticByPlatform", assessmentMode: "AutomaticByPlatform" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -624,62 +537,62 @@ async function createAVMWithUefiSettingsOfSecureBootAndVTpm(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "windowsserver-gen2preview-preview", - publisher: "MicrosoftWindowsServer", - sku: "windows10-tvm", - version: "18363.592.2001092016", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json */ -async function createAVMWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAPlatformImageVmWithUnmanagedOsAndDataDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + createOption: "FromImage", + name: "myVMosdisk", }, + dataDisks: [ + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd", + }, + }, + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 1, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd", + }, + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -688,62 +601,54 @@ async function createAVMWithUserData(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json - */ -async function createAVMWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + assessmentMode: "AutomaticByPlatform", + automaticByPlatformSettings: { + rebootSetting: "Never", + bypassPlatformSafetyChecksOnUserSchedule: false, + }, + }, }, }, - hardwareProfile: { - vmSize: "Standard_D4_v3", - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -752,52 +657,47 @@ async function createAVMWithVMSizeProperties(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "U29tZSBDdXN0b20gRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPlacement.json - */ -async function createAVMWithAutomaticZonePlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus2", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { assessmentMode: "ImageDefault" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -806,263 +706,145 @@ async function createAVMWithAutomaticZonePlacement(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - placement: { includeZones: ["1", "3"], zonePlacementPolicy: "Any" }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json - */ -async function createAVMWithEncryptionIdentity(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/myIdentity": - {}, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByOS" }, }, }, - location: "westus", networkProfile: { networkInterfaces: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", primary: true, }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - encryptionIdentity: { - userAssignedIdentityResourceId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity", - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", + sku: "2016-Datacenter", publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json - */ -async function createAVMWithNetworkInterfaceConfiguration(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{nic-config-name}", - deleteOption: "Delete", - ipConfigurations: [ - { - name: "{ip-config-name}", - primary: true, - publicIPAddressConfiguration: { - name: "{publicIP-config-name}", - deleteOption: "Detach", - publicIPAllocationMethod: "Static", - sku: { name: "Basic", tier: "Global" }, - tags: { pipTag: "tag" }, - }, - }, - ], - primary: true, - tags: { nicTag: "tag" }, - }, - ], - }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByPlatform", enableHotpatching: true }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json */ -async function createAVMWithNetworkInterfaceConfigurationWithPublicIPAddressDnsSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAWindowsVmWithAPatchSettingPatchModeOfManual(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{nic-config-name}", - deleteOption: "Delete", - ipConfigurations: [ - { - name: "{ip-config-name}", - primary: true, - publicIPAddressConfiguration: { - name: "{publicIP-config-name}", - deleteOption: "Detach", - dnsSettings: { - domainNameLabel: "aaaaa", - domainNameLabelScope: "TenantReuse", - }, - publicIPAllocationMethod: "Static", - sku: { name: "Basic", tier: "Global" }, - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json - */ -async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DC2as_v5" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "Manual" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -1071,63 +853,47 @@ async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(): }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "2019-datacenter-cvm", + sku: "2016-Datacenter", publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", + version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { - securityProfile: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - securityEncryptionType: "DiskWithVMGuestState", - }, - storageAccountType: "StandardSSD_LRS", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json - */ -async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurityEncryptionType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DC2es_v5" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByPlatform", assessmentMode: "AutomaticByPlatform" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -1136,118 +902,44 @@ async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurit }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2022-datacenter-cvm", - publisher: "UbuntuServer", - sku: "linux-cvm", - version: "17763.2183.2109130127", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "NonPersistedTPM" }, - storageAccountType: "StandardSSD_LRS", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json */ -async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DC2as_v5" }, +async function createAVmWithEphemeralOsDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "2019-datacenter-cvm", - publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, - storageAccountType: "StandardSSD_LRS", - }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json - */ -async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1256,114 +948,44 @@ async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault(): }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { assessmentMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskAndFullCachingEnabled.json */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVmWithEphemeralOsDiskAndEnableFullCachingSetToTrue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { patchMode: "AutomaticByOS" }, - provisionVMAgent: true, - }, - }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "TempDisk", enableFullCaching: true }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1372,63 +994,44 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAn }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "AutomaticByPlatform", - automaticByPlatformSettings: { - bypassPlatformSafetyChecksOnUserSchedule: false, - rebootSetting: "Never", - }, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ +async function createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1437,59 +1040,44 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAn }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - enableHotpatching: true, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + */ +async function createAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfManual(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1498,56 +1086,44 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfManual(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json - */ -async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1556,59 +1132,43 @@ async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToA }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "AutomaticByPlatform", - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json + */ +async function createAVmWithAMarketplaceImagePlan(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json - */ -async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1617,124 +1177,60 @@ async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage(): Promise< }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - storageProfile: { - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", - }, - osType: "Windows", - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json */ -async function createAPlatformImageVMWithUnmanagedOSAndDataDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, +async function createAVmWithApplicationProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { - dataDisks: [ - { - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd", - }, - }, - { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd", - }, - }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "{image_sku}", + publisher: "{image_publisher}", version: "latest", + offer: "{image_offer}", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json - */ -async function createAVMFromACustomImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + applicationProfile: { + galleryApplications: [ + { + tags: "myTag1", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + treatFailureAsDeploymentFailure: false, + enableAutomaticUpgrade: false, + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1743,48 +1239,37 @@ async function createAVMFromACustomImage(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + */ +async function createAVmWithBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json - */ -async function createAVMFromAGeneralizedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1794,47 +1279,58 @@ async function createAVMFromAGeneralizedSharedImage(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json */ -async function createAVMFromASpecializedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createOrUpdateAVMWithCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + capacityReservation: { + capacityReservationGroup: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1843,43 +1339,68 @@ async function createAVMFromASpecializedSharedImage(): Promise { }, ], }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json + */ +async function createAVmWithDataDisksUsingCopyAndRestoreOptions(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, storageProfile: { imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { + diskSizeGB: 1023, + createOption: "Copy", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}", + }, + lun: 0, + }, + { + diskSizeGB: 1023, + createOption: "Copy", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}", + }, + lun: 1, + }, + { + diskSizeGB: 1023, + createOption: "Restore", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}", + }, + lun: 2, + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json - */ -async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1888,58 +1409,46 @@ async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFau }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + */ +async function createAVMWithDiskControllerType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D4_v3" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, - platformFaultDomain: 1, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + diskControllerType: "NVMe", }, - virtualMachineScaleSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json - */ -async function createAVMInAnAvailabilitySet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - availabilitySet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}", - }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1949,68 +1458,82 @@ async function createAVMInAnAvailabilitySet(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + userData: "U29tZSBDdXN0b20gRGF0YQ==", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json */ -async function createAVMWithApplicationProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - applicationProfile: { - galleryApplications: [ +async function createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + name: "myVMosdisk", + createOption: "FromImage", + }, + dataDisks: [ { - configurationReference: - "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", - enableAutomaticUpgrade: false, - order: 1, - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", - tags: "myTag1", - treatFailureAsDeploymentFailure: false, + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, }, { - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + caching: "ReadWrite", + managedDisk: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + diskSizeGB: 1023, + createOption: "Attach", + lun: 1, }, ], }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2019,51 +1542,92 @@ async function createAVMWithApplicationProfile(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + */ +async function createAVmWithEmptyDataDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, storageProfile: { imageReference: { - offer: "{image_offer}", - publisher: "{image_publisher}", - sku: "{image_sku}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json */ -async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVmWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2072,80 +1636,94 @@ async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk(): }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json + */ +async function createAVMWithEncryptionIdentity(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": + {}, + }, + }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + encryptionIdentity: { + userAssignedIdentityResourceId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity", + }, }, storageProfile: { - dataDisks: [ - { - caching: "ReadWrite", - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - { - caching: "ReadWrite", - createOption: "Attach", - diskSizeGB: 1023, - lun: 1, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", - storageAccountType: "Standard_LRS", - }, - }, - ], imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, createOption: "FromImage", - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json */ -async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVmWithAnExtensionsTimeBudget(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, networkProfile: { networkInterfaces: [ { @@ -2155,63 +1733,49 @@ async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty(): Promi ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - securityProfile: { encryptionAtHost: true }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + extensionsTimeBudget: "PT30M", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithFips1403Enabled.json */ -async function createAVMWithScheduledEventsProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVMWithFips1403Enabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "eastus2euap", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + additionalCapabilities: { enableFips1403Encryption: true }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2221,65 +1785,48 @@ async function createAVMWithScheduledEventsProfile(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - scheduledEventsProfile: { - osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, - terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT10M" }, }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json + */ +async function createAVMWithHibernationEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "eastus2euap", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + additionalCapabilities: { hibernationEnabled: true }, storageProfile: { imageReference: { - offer: "WindowsServer", publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + offer: "WindowsServer", + sku: "2019-Datacenter", version: "latest", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json - */ -async function createAVMWithAMarketplaceImagePlan(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2289,63 +1836,47 @@ async function createAVMWithAMarketplaceImagePlan(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json */ -async function createAVMWithAnExtensionsTimeBudget(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVmWithManagedBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - extensionsTimeBudget: "PT30M", - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2355,110 +1886,166 @@ async function createAVMWithAnExtensionsTimeBudget(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json + */ +async function createAVMWithNetworkInterfaceConfiguration(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "{nic-config-name}", + tags: { nicTag: "tag" }, + primary: true, + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + tags: { pipTag: "tag" }, + sku: { name: "Basic", tier: "Global" }, + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + }, + }, + ], + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json */ -async function createAVMWithBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { - networkInterfaces: [ + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + name: "{nic-config-name}", primary: true, + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + sku: { name: "Basic", tier: "Global" }, + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + dnsSettings: { domainNameLabel: "aaaaa", domainNameLabelScope: "TenantReuse" }, + }, + }, + ], }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json + */ +async function createAVmWithPasswordAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json - */ -async function createAVMWithDataDisksUsingCopyAndRestoreOptions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2467,77 +2054,135 @@ async function createAVMWithDataDisksUsingCopyAndRestoreOptions(): Promise }, ], }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPlacement.json + */ +async function createAVMWithAutomaticZonePlacement(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus2", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - dataDisks: [ - { - createOption: "Copy", - diskSizeGB: 1023, - lun: 0, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}", - }, - }, - { - createOption: "Copy", - diskSizeGB: 1023, - lun: 1, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}", - }, - }, + networkProfile: { + networkInterfaces: [ { - createOption: "Restore", - diskSizeGB: 1023, - lun: 2, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}", - }, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, ], + }, + placement: { zonePlacementPolicy: "Any", includeZones: ["1", "3"] }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + */ +async function createAVmWithPremiumStorage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json */ -async function createAVMWithEmptyDataDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, +async function createAVMWithProxyAgentSettingsOfEnabledAndMode(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + proxyAgentSettings: { enabled: true, wireServer: { mode: "Audit" }, imds: { mode: "Audit" } }, + }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2546,55 +2191,45 @@ async function createAVMWithEmptyDataDisks(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + */ +async function createAVmWithScheduledEventsProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json - */ -async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2604,56 +2239,63 @@ async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacement ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + scheduledEventsProfile: { + terminateNotificationProfile: { notBeforeTimeout: "PT10M", enable: true }, + osImageNotificationProfile: { notBeforeTimeout: "PT15M", enable: true }, + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json */ -async function createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + storageProfile: { + imageReference: { + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, + }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2662,57 +2304,105 @@ async function createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementP }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { + securityEncryptionType: "DiskWithVMGuestState", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + }, createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json */ -async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_DC2es_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + storageProfile: { + imageReference: { + sku: "linux-cvm", + publisher: "UbuntuServer", + version: "17763.2183.2109130127", + offer: "2022-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "NonPersistedTPM" }, + }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2721,57 +2411,53 @@ async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacem }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json + */ +async function createAVmWithSshAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", + sku: "{image_sku}", + publisher: "{image_publisher}", version: "latest", + offer: "{image_offer}", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json - */ -async function createAVMWithEphemeralOSDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + }, + }, networkProfile: { networkInterfaces: [ { @@ -2780,58 +2466,46 @@ async function createAVMWithEphemeralOSDisk(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json + */ +async function createAVMWithUefiSettingsOfSecureBootAndVTPM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", + sku: "windows10-tvm", + publisher: "MicrosoftWindowsServer", + version: "18363.592.2001092016", + offer: "windowsserver-gen2preview-preview", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, createOption: "FromImage", - diffDiskSettings: { option: "Local" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json - */ -async function createAVMWithManagedBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { bootDiagnostics: { enabled: true } }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2840,51 +2514,37 @@ async function createAVMWithManagedBootDiagnostics(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + */ +async function createAVMWithUserData(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json - */ -async function createAVMWithPasswordAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2894,103 +2554,51 @@ async function createAVMWithPasswordAuthentication(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json */ -async function createAVMWithPremiumStorage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVMWithVMSizeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + hardwareProfile: { + vmSize: "Standard_D4_v3", + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json - */ -async function createAVMWithSshAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -3002,64 +2610,61 @@ async function createAVMWithSshAuthentication(): Promise { osProfile: { adminUsername: "{your-username}", computerName: "myVM", - linuxConfiguration: { - disablePasswordAuthentication: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, + adminPassword: "{your-password}", + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, + userData: "U29tZSBDdXN0b20gRGF0YQ==", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithZoneMovementEnabled.json + */ +async function createAVmWithResiliencyProfileAndZoneMovementEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "{image_offer}", - publisher: "{image_publisher}", - sku: "{image_sku}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_ZRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, + dataDisks: [ + { + diskSizeGB: 128, + lun: 0, + createOption: "Empty", + managedDisk: { storageAccountType: "Premium_ZRS" }, + name: "myVMdatadisk1", + caching: "ReadWrite", + }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json - */ -async function createOrUpdateAVMWithCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - capacityReservation: { - capacityReservationGroup: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", - }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -3068,93 +2673,65 @@ async function createOrUpdateAVMWithCapacityReservation(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + resiliencyProfile: { zoneMovement: { isEnabled: true } }, + }); console.log(result); } async function main(): Promise { - await createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault(); - await createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); - await createALinuxVMWithAPatchSettingPatchModeOfImageDefault(); - await createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createACustomImageVmFromAnUnmanagedGeneralizedOsImage(); await createAVMFromACommunityGalleryImage(); + await createAVmFromACustomImage(); + await createAVmFromAGeneralizedSharedImage(); await createAVMFromASharedGalleryImage(); + await createAVmFromASpecializedSharedImage(); + await createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(); + await createAVmInAnAvailabilitySet(); + await createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); + await createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault(); + await createALinuxVmWithAPatchSettingPatchModeOfImageDefault(); + await createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createAPlatformImageVmWithUnmanagedOsAndDataDisks(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); + await createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(); + await createAWindowsVmWithAPatchSettingPatchModeOfManual(); + await createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createAVmWithEphemeralOsDisk(); + await createAVmWithEphemeralOsDiskAndEnableFullCachingSetToTrue(); + await createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty(); + await createAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(); + await createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty(); + await createAVmWithAMarketplaceImagePlan(); + await createAVmWithApplicationProfile(); + await createAVmWithBootDiagnostics(); + await createOrUpdateAVMWithCapacityReservation(); + await createAVmWithDataDisksUsingCopyAndRestoreOptions(); await createAVMWithDiskControllerType(); + await createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk(); + await createAVmWithEmptyDataDisks(); + await createAVmWithHostEncryptionUsingEncryptionAtHostProperty(); + await createAVMWithEncryptionIdentity(); + await createAVmWithAnExtensionsTimeBudget(); await createAVMWithFips1403Enabled(); await createAVMWithHibernationEnabled(); + await createAVmWithManagedBootDiagnostics(); + await createAVMWithNetworkInterfaceConfiguration(); + await createAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings(); + await createAVmWithPasswordAuthentication(); + await createAVMWithAutomaticZonePlacement(); + await createAVmWithPremiumStorage(); await createAVMWithProxyAgentSettingsOfEnabledAndMode(); - await createAVMWithUefiSettingsOfSecureBootAndVTpm(); + await createAVmWithScheduledEventsProfile(); + await createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(); + await createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(); + await createAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType(); + await createAVmWithSshAuthentication(); + await createAVMWithUefiSettingsOfSecureBootAndVTPM(); await createAVMWithUserData(); await createAVMWithVMSizeProperties(); - await createAVMWithAutomaticZonePlacement(); - await createAVMWithEncryptionIdentity(); - await createAVMWithNetworkInterfaceConfiguration(); - await createAVMWithNetworkInterfaceConfigurationWithPublicIPAddressDnsSettings(); - await createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(); - await createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurityEncryptionType(); - await createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(); - await createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(); - await createAWindowsVMWithAPatchSettingPatchModeOfManual(); - await createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); - await createACustomImageVMFromAnUnmanagedGeneralizedOSImage(); - await createAPlatformImageVMWithUnmanagedOSAndDataDisks(); - await createAVMFromACustomImage(); - await createAVMFromAGeneralizedSharedImage(); - await createAVMFromASpecializedSharedImage(); - await createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(); - await createAVMInAnAvailabilitySet(); - await createAVMWithApplicationProfile(); - await createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk(); - await createAVMWithHostEncryptionUsingEncryptionAtHostProperty(); - await createAVMWithScheduledEventsProfile(); - await createAVMWithAMarketplaceImagePlan(); - await createAVMWithAnExtensionsTimeBudget(); - await createAVMWithBootDiagnostics(); - await createAVMWithDataDisksUsingCopyAndRestoreOptions(); - await createAVMWithEmptyDataDisks(); - await createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDisk(); - await createAVMWithManagedBootDiagnostics(); - await createAVMWithPasswordAuthentication(); - await createAVMWithPremiumStorage(); - await createAVMWithSshAuthentication(); - await createOrUpdateAVMWithCapacityReservation(); + await createAVmWithResiliencyProfileAndZoneMovementEnabled(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesDeallocateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeallocateSample.ts index b8920abaa215..c4c0eefc43d7 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesDeallocateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeallocateSample.ts @@ -1,62 +1,54 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesDeallocateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. * - * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json */ -async function virtualMachineDeallocateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaa"; - const hibernate = true; - const options: VirtualMachinesDeallocateOptionalParams = { hibernate }; +async function virtualMachineDeallocateMinimumSetGen(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeallocateAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa"); } /** - * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. * - * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_WithForceDeallocate.json */ -async function virtualMachineDeallocateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaa"; +async function virtualMachineDeallocateWithForceDeallocate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa", { + forceDeallocate: true, + }); +} + +/** + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_WithHibernation.json + */ +async function virtualMachineDeallocateWithHibernation(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeallocateAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa", { hibernate: true }); } async function main(): Promise { - await virtualMachineDeallocateMaximumSetGen(); await virtualMachineDeallocateMinimumSetGen(); + await virtualMachineDeallocateWithForceDeallocate(); + await virtualMachineDeallocateWithHibernation(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesDeleteSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeleteSample.ts index 4eb12ed26b32..faf16965a3ff 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesDeleteSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesDeleteSample.ts @@ -1,36 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesDeleteOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete a virtual machine. + * This sample demonstrates how to the operation to delete a virtual machine. * - * @summary The operation to delete a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json + * @summary the operation to delete a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Delete_Force.json */ async function forceDeleteAVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const forceDeletion = true; - const options: VirtualMachinesDeleteOptionalParams = { forceDeletion }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeleteAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.delete("myResourceGroup", "myVM", { forceDeletion: true }); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesGeneralizeSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesGeneralizeSample.ts index dde40f48b392..c5a34d8f8dba 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesGeneralizeSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesGeneralizeSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * This sample demonstrates how to sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). * - * @summary Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json + * @summary sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Generalize.json */ async function generalizeAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.generalize( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.generalize("myResourceGroup", "myVMName"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesGetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesGetSample.ts index 8a0858ebbbce..210b638e1a9c 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesGetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesGetSample.ts @@ -1,95 +1,66 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get.json + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get.json */ async function getAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const expand = "userData"; - const options: VirtualMachinesGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get( - resourceGroupName, - vmName, - options, - ); + const result = await client.virtualMachines.get("myResourceGroup", "myVM", { + expand: "userData", + }); console.log(result); } /** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json */ async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName); + const result = await client.virtualMachines.get("myResourceGroup", "myVM"); console.log(result); } /** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json */ async function getAVirtualMachineWithDiskControllerTypeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const expand = "userData"; - const options: VirtualMachinesGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get( - resourceGroupName, - vmName, - options, - ); + const result = await client.virtualMachines.get("myResourceGroup", "myVM", { + expand: "userData", + }); console.log(result); } /** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json */ async function getAVirtualMachineWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName); + const result = await client.virtualMachines.get("myResourceGroup", "myVM"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesInstallPatchesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstallPatchesSample.ts index 5d35ab28f294..3264e73056e2 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesInstallPatchesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstallPatchesSample.ts @@ -1,43 +1,29 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineInstallPatchesParameters} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Installs patches on the VM. + * This sample demonstrates how to installs patches on the VM. * - * @summary Installs patches on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json + * @summary installs patches on the VM. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_InstallPatches.json */ async function installPatchStateOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const vmName = "myVMName"; - const installPatchesInput: VirtualMachineInstallPatchesParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.installPatches("myResourceGroupName", "myVMName", { maximumDuration: "PT4H", rebootSetting: "IfRequired", windowsParameters: { classificationsToInclude: ["Critical", "Security"], maxPatchPublishDate: new Date("2020-11-19T02:36:43.0539904+00:00"), - patchNameMasksToExclude: ["*Windows*"], patchNameMasksToInclude: ["*SQL*"], + patchNameMasksToExclude: ["*Windows*"], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginInstallPatchesAndWait( - resourceGroupName, - vmName, - installPatchesInput, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesInstanceViewSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstanceViewSample.ts index 2347f6f251ef..636b76e17bed 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesInstanceViewSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesInstanceViewSample.ts @@ -3,47 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * This sample demonstrates how to retrieves information about the run-time state of a virtual machine. * - * @summary Retrieves information about the run-time state of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json + * @summary retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceView.json */ async function getVirtualMachineInstanceView(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.instanceView( - resourceGroupName, - vmName, - ); + const result = await client.virtualMachines.instanceView("myResourceGroup", "myVM"); console.log(result); } /** - * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. + * This sample demonstrates how to retrieves information about the run-time state of a virtual machine. * - * @summary Retrieves information about the run-time state of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + * @summary retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json */ async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.instanceView( - resourceGroupName, - vmName, - ); + const result = await client.virtualMachines.instanceView("myResourceGroup", "myVM"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListAllSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAllSample.ts index d8415de3454b..66075f0df628 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesListAllSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAllSample.ts @@ -1,50 +1,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesListAllOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json + * @summary lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json */ async function virtualMachineListAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const statusOnly = "aaaaaa"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const options: VirtualMachinesListAllOptionalParams = { statusOnly, filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.listAll(options)) { + for await (const item of client.virtualMachines.listAll({ + statusOnly: "aaaaaa", + filter: "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json + * @summary lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json */ async function virtualMachineListAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachines.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAvailableSizesSample.ts index 08a255c9850f..5d0b25e8708a 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesListAvailableSizesSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListAvailableSizesSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * This sample demonstrates how to lists all available virtual machine sizes to which the specified virtual machine can be resized. * - * @summary Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json + * @summary lists all available virtual machine sizes to which the specified virtual machine can be resized. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json */ async function listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVmName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachines.listAvailableSizes( - resourceGroupName, - vmName, + "myResourceGroup", + "myVmName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListByLocationSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListByLocationSample.ts index 2398a205a915..4dd92fddfb65 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesListByLocationSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListByLocationSample.ts @@ -3,24 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets all the virtual machines under the specified subscription for the specified location. + * This sample demonstrates how to gets all the virtual machines under the specified subscription for the specified location. * - * @summary Gets all the virtual machines under the specified subscription for the specified location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json + * @summary gets all the virtual machines under the specified subscription for the specified location. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json */ async function listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const location = "eastus"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.listByLocation(location)) { + for await (const item of client.virtualMachines.listByLocation("eastus")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesListSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesListSample.ts index b50c9197a8b7..9f6d054dea56 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesListSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesListSample.ts @@ -1,56 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json + * @summary lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json */ async function virtualMachineListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaa"; - const options: VirtualMachinesListOptionalParams = { filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.list( - resourceGroupName, - options, - )) { + for await (const item of client.virtualMachines.list("rgcompute", { + filter: "aaaaaaaaaaaaaaaaaaaaaaa", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json + * @summary lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json */ async function virtualMachineListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.list(resourceGroupName)) { + for await (const item of client.virtualMachines.list("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesMigrateToVMScaleSetSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesMigrateToVMScaleSetSample.ts index 640d2060393b..2f6f2a4a0bdc 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesMigrateToVMScaleSetSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesMigrateToVMScaleSetSample.ts @@ -1,42 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - MigrateVMToVirtualMachineScaleSetInput, - VirtualMachinesMigrateToVMScaleSetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. + * This sample demonstrates how to migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. * - * @summary Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json + * @summary migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json */ async function migrateAVirtualMachineToFlexibleVirtualMachineScaleSer(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters: MigrateVMToVirtualMachineScaleSetInput = { - targetFaultDomain: 0, - targetVMSize: "Standard_D1_v2", - }; - const options: VirtualMachinesMigrateToVMScaleSetOptionalParams = { - parameters, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginMigrateToVMScaleSetAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.migrateToVMScaleSet("myResourceGroup", "myVMName", { + parameters: { targetFaultDomain: 0, targetVMSize: "Standard_D1_v2" }, + }); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesPerformMaintenanceSample.ts index 074c07636d0c..0298097b2279 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesPerformMaintenanceSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesPerformMaintenanceSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * This sample demonstrates how to the operation to perform maintenance on a virtual machine. * - * @summary The operation to perform maintenance on a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json + * @summary the operation to perform maintenance on a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json */ async function virtualMachinePerformMaintenanceMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPerformMaintenanceAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.performMaintenance("rgcompute", "aaaaaaa"); } /** - * This sample demonstrates how to The operation to perform maintenance on a virtual machine. + * This sample demonstrates how to the operation to perform maintenance on a virtual machine. * - * @summary The operation to perform maintenance on a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json + * @summary the operation to perform maintenance on a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json */ async function virtualMachinePerformMaintenanceMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPerformMaintenanceAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.performMaintenance("rgcompute", "aaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesPowerOffSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesPowerOffSample.ts index ff011118df49..60f5f28d479a 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesPowerOffSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesPowerOffSample.ts @@ -1,57 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesPowerOffOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * This sample demonstrates how to the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. * - * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json + * @summary the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json */ async function virtualMachinePowerOffMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skipShutdown = true; - const options: VirtualMachinesPowerOffOptionalParams = { skipShutdown }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPowerOffAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", { + skipShutdown: true, + }); } /** - * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * This sample demonstrates how to the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. * - * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json + * @summary the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json */ async function virtualMachinePowerOffMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPowerOffAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesReapplySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesReapplySample.ts index 96282070d624..abfc156ef4bf 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesReapplySample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesReapplySample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to reapply a virtual machine's state. + * This sample demonstrates how to the operation to reapply a virtual machine's state. * - * @summary The operation to reapply a virtual machine's state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json + * @summary the operation to reapply a virtual machine's state. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reapply.json */ async function reapplyTheStateOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReapplyAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.reapply("ResourceGroup", "VMName"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRedeploySample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRedeploySample.ts index e6228fcf3644..e177fb2aeca6 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesRedeploySample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRedeploySample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * This sample demonstrates how to shuts down the virtual machine, moves it to a new node, and powers it back on. * - * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json + * @summary shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json */ async function virtualMachineRedeployMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "a"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRedeployAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.redeploy("rgcompute", "a"); } /** - * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. + * This sample demonstrates how to shuts down the virtual machine, moves it to a new node, and powers it back on. * - * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json + * @summary shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json */ async function virtualMachineRedeployMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRedeployAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.redeploy("rgcompute", "aaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesReimageSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesReimageSample.ts index 7d99dff1329e..57b40a66ab9e 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesReimageSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesReimageSample.ts @@ -1,73 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineReimageParameters, - VirtualMachinesReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * This sample demonstrates how to reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. * - * @summary Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json + * @summary reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage.json */ -async function reimageANonEphemeralVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters: VirtualMachineReimageParameters = { - exactVersion: "aaaaaa", - osProfile: { - adminPassword: "{your-password}", - customData: "{your-custom-data}", - }, - tempDisk: true, - }; - const options: VirtualMachinesReimageOptionalParams = { parameters }; +async function reimageAVirtualMachine(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReimageAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.reimage("myResourceGroup", "myVMName", { + parameters: { tempDisk: true }, + }); } /** - * This sample demonstrates how to Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * This sample demonstrates how to reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. * - * @summary Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json + * @summary reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json */ -async function reimageAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters: VirtualMachineReimageParameters = { tempDisk: true }; - const options: VirtualMachinesReimageOptionalParams = { parameters }; +async function reimageANonEphemeralVirtualMachine(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReimageAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.reimage("myResourceGroup", "myVMName", { + parameters: { + tempDisk: true, + exactVersion: "aaaaaa", + osProfile: { adminPassword: "{your-password}", customData: "{your-custom-data}" }, + }, + }); } async function main(): Promise { - await reimageANonEphemeralVirtualMachine(); await reimageAVirtualMachine(); + await reimageANonEphemeralVirtualMachine(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRestartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRestartSample.ts index f5b6e20a5389..d0d0afc904f6 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesRestartSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRestartSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to restart a virtual machine. + * This sample demonstrates how to the operation to restart a virtual machine. * - * @summary The operation to restart a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json + * @summary the operation to restart a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json */ async function virtualMachineRestartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRestartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.restart("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); } /** - * This sample demonstrates how to The operation to restart a virtual machine. + * This sample demonstrates how to the operation to restart a virtual machine. * - * @summary The operation to restart a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json + * @summary the operation to restart a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json */ async function virtualMachineRestartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRestartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.restart("rgcompute", "aaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRetrieveBootDiagnosticsDataSample.ts index 1dafdd404144..0c1d694543d7 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesRetrieveBootDiagnosticsDataSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRetrieveBootDiagnosticsDataSample.ts @@ -1,36 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * This sample demonstrates how to the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. * - * @summary The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json + * @summary the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json */ async function retrieveBootDiagnosticsDataOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; - const sasUriExpirationTimeInMinutes = 60; - const options: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams = { - sasUriExpirationTimeInMinutes, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachines.retrieveBootDiagnosticsData( - resourceGroupName, - vmName, - options, + "ResourceGroup", + "VMName", + { sasUriExpirationTimeInMinutes: 60 }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesRunCommandSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesRunCommandSample.ts index a67f40e7b0c1..82e5a9cf0cf2 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesRunCommandSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesRunCommandSample.ts @@ -1,32 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { RunCommandInput} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Run command on the VM. + * This sample demonstrates how to run command on the VM. * - * @summary Run command on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand.json + * @summary run command on the VM. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand.json */ async function virtualMachineRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "crptestar98131"; - const vmName = "vm3036"; - const parameters: RunCommandInput = { commandId: "RunPowerShellScript" }; const credential = new DefaultAzureCredential(); + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRunCommandAndWait( - resourceGroupName, - vmName, - parameters, - ); + const result = await client.virtualMachines.runCommand("crptestar98131", "vm3036", { + commandId: "RunPowerShellScript", + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesSimulateEvictionSample.ts index 5f379d1f3e43..e9f2a60849c7 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesSimulateEvictionSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesSimulateEvictionSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine. + * This sample demonstrates how to the operation to simulate the eviction of spot virtual machine. * - * @summary The operation to simulate the eviction of spot virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json + * @summary the operation to simulate the eviction of spot virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_SimulateEviction.json */ async function simulateEvictionAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.simulateEviction( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.simulateEviction("ResourceGroup", "VMName"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesStartSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesStartSample.ts index 1ded6434779f..1136e35404ee 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesStartSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesStartSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to start a virtual machine. + * This sample demonstrates how to the operation to start a virtual machine. * - * @summary The operation to start a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json + * @summary the operation to start a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json */ async function virtualMachineStartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginStartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.start("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); } /** - * This sample demonstrates how to The operation to start a virtual machine. + * This sample demonstrates how to the operation to start a virtual machine. * - * @summary The operation to start a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json + * @summary the operation to start a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json */ async function virtualMachineStartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginStartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.start("rgcompute", "aaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachinesUpdateSample.ts b/sdk/compute/arm-compute/samples-dev/virtualMachinesUpdateSample.ts index e2ea5081ca3a..a563647d7aab 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachinesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples-dev/virtualMachinesUpdateSample.ts @@ -1,139 +1,106 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update a virtual machine. + * This sample demonstrates how to the operation to update a virtual machine. * - * @summary The operation to update a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json + * @summary the operation to update a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json */ async function updateAVMByDetachingDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachineUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.update("myResourceGroup", "myVM", { hardwareProfile: { vmSize: "Standard_D2_v2" }, - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0, toBeDetached: true }, - { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - toBeDetached: false, - }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0, toBeDetached: true }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1, toBeDetached: false }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to update a virtual machine. + * This sample demonstrates how to the operation to update a virtual machine. * - * @summary The operation to update a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json + * @summary the operation to update a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json */ async function updateAVMByForceDetachingDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachineUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.update("myResourceGroup", "myVM", { hardwareProfile: { vmSize: "Standard_D2_v2" }, - networkProfile: { - networkInterfaces: [ + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + dataDisks: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + toBeDetached: true, + detachOption: "ForceDetach", }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1, toBeDetached: false }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - dataDisks: [ - { - createOption: "Empty", - detachOption: "ForceDetach", - diskSizeGB: 1023, - lun: 0, - toBeDetached: true, - }, + networkProfile: { + networkInterfaces: [ { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - toBeDetached: false, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js deleted file mode 100644 index 2869fe585f1b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Cancel the migration operation on an Availability Set. - * - * @summary Cancel the migration operation on an Availability Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json - */ -async function availabilitySetCancelMigrationToVirtualMachineScaleSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.cancelMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - ); - console.log(result); -} - -async function main() { - await availabilitySetCancelMigrationToVirtualMachineScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js deleted file mode 100644 index 24a8de5ea6ac..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. - * - * @summary Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json - */ -async function availabilitySetConvertToVirtualMachineScaleSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters = { - virtualMachineScaleSetName: "{vmss-name}", - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.beginConvertToVirtualMachineScaleSetAndWait( - resourceGroupName, - availabilitySetName, - options, - ); - console.log(result); -} - -async function main() { - await availabilitySetConvertToVirtualMachineScaleSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCreateOrUpdateSample.js deleted file mode 100644 index 9fd8b0e8cc8b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCreateOrUpdateSample.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update an availability set. - * - * @summary Create or update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json - */ -async function createAnAvailabilitySetWithScheduledEventPolicy() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const availabilitySetName = "myAvailabilitySet"; - const parameters = { - location: "westus", - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.createOrUpdate( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an availability set. - * - * @summary Create or update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create.json - */ -async function createAnAvailabilitySet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const availabilitySetName = "myAvailabilitySet"; - const parameters = { - location: "westus", - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.createOrUpdate( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main() { - await createAnAvailabilitySetWithScheduledEventPolicy(); - await createAnAvailabilitySet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsDeleteSample.js deleted file mode 100644 index fbc4199f516b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsDeleteSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete an availability set. - * - * @summary Delete an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json - */ -async function availabilitySetDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.delete(resourceGroupName, availabilitySetName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an availability set. - * - * @summary Delete an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json - */ -async function availabilitySetDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.delete(resourceGroupName, availabilitySetName); - console.log(result); -} - -async function main() { - await availabilitySetDeleteMaximumSetGen(); - await availabilitySetDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsGetSample.js deleted file mode 100644 index f299e744f67a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsGetSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about an availability set. - * - * @summary Retrieves information about an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json - */ -async function availabilitySetGetMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.get(resourceGroupName, availabilitySetName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about an availability set. - * - * @summary Retrieves information about an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json - */ -async function availabilitySetGetMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.get(resourceGroupName, availabilitySetName); - console.log(result); -} - -async function main() { - await availabilitySetGetMaximumSetGen(); - await availabilitySetGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListSample.js deleted file mode 100644 index bf10409038be..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListSample.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Lists all availability sets in a resource group. - * - * @summary Lists all availability sets in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json - */ -async function availabilitySetListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.availabilitySets.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all availability sets in a resource group. - * - * @summary Lists all availability sets in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json - */ -async function availabilitySetListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.availabilitySets.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await availabilitySetListMaximumSetGen(); - await availabilitySetListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js deleted file mode 100644 index c2a9567961ba..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. - * - * @summary Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json - */ -async function availabilitySetStartMigrationToVirtualMachineScaleSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters = { - virtualMachineScaleSetFlexible: { - id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.startMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main() { - await availabilitySetStartMigrationToVirtualMachineScaleSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsUpdateSample.js deleted file mode 100644 index 58cfa3edc047..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsUpdateSample.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update an availability set. - * - * @summary Update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json - */ -async function availabilitySetUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaa"; - const parameters = { - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - proximityPlacementGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, - tags: { key2574: "aaaaaaaa" }, - virtualMachines: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.update( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an availability set. - * - * @summary Update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json - */ -async function availabilitySetUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.update( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main() { - await availabilitySetUpdateMaximumSetGen(); - await availabilitySetUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js deleted file mode 100644 index 88c38dc5569a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. - * - * @summary Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json - */ -async function availabilitySetValidateMigrationToVirtualMachineScaleSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters = { - virtualMachineScaleSetFlexible: { - id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.validateMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main() { - await availabilitySetValidateMigrationToVirtualMachineScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsCreateOrUpdateSample.js deleted file mode 100644 index 4fd441d28720..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json - */ -async function createOrUpdateABlockCapacityReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const parameters = { - location: "westus", - reservationType: "Block", - tags: { department: "finance" }, - zones: ["1", "2"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json - */ -async function createOrUpdateACapacityReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const parameters = { - location: "westus", - sharingProfile: { - subscriptionIds: [ - { id: "/subscriptions/{subscription-id1}" }, - { id: "/subscriptions/{subscription-id2}" }, - ], - }, - tags: { department: "finance" }, - zones: ["1", "2"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservationGroup_CreateOrUpdate.json - */ -async function createOrUpdateATargetedCapacityReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const parameters = { - location: "westus", - reservationType: "Targeted", - sharingProfile: { - subscriptionIds: [ - { id: "/subscriptions/{subscription-id1}" }, - { id: "/subscriptions/{subscription-id2}" }, - ], - }, - tags: { department: "finance" }, - zones: ["1", "2"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await createOrUpdateABlockCapacityReservationGroup(); - await createOrUpdateACapacityReservationGroup(); - await createOrUpdateATargetedCapacityReservationGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsGetSample.js deleted file mode 100644 index 48f259e4b55f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsGetSample.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. - * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_Get.json - */ -async function getABlockCapacityReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const expand = "instanceView"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. - * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json - */ -async function getACapacityReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const expand = "instanceView"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. - * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservationGroup_Get.json - */ -async function getATargetedCapacityReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const expand = "instanceView"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, - ); - console.log(result); -} - -async function main() { - await getABlockCapacityReservationGroup(); - await getACapacityReservationGroup(); - await getATargetedCapacityReservationGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsUpdateSample.js deleted file mode 100644 index 1f3d4a924210..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsUpdateSample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * - * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json - */ -async function capacityReservationGroupUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; - const parameters = { - instanceView: {}, - tags: { key5355: "aaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.update( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * - * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json - */ -async function capacityReservationGroupUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.update( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await capacityReservationGroupUpdateMaximumSetGen(); - await capacityReservationGroupUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsCreateOrUpdateSample.js deleted file mode 100644 index 4fe5ae27cd84..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsCreateOrUpdateSample.js +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json - */ -async function createOrUpdateABlockCapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const capacityReservationName = "blockCapacityReservation"; - const parameters = { - location: "westus", - scheduleProfile: { end: "2025-08-02", start: "2025-08-01" }, - sku: { name: "Standard_ND96isr_H100_v5", capacity: 1 }, - tags: { department: "HR" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json - */ -async function createOrUpdateACapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const capacityReservationName = "myCapacityReservation"; - const parameters = { - location: "westus", - sku: { name: "Standard_DS1_v2", capacity: 4 }, - tags: { department: "HR" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_CreateOrUpdate.json - */ -async function createOrUpdateATargetedCapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const capacityReservationName = "targetedCapacityReservation"; - const parameters = { - location: "westus", - sku: { name: "Standard_DS1_v2", capacity: 4 }, - tags: { department: "HR" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -async function main() { - await createOrUpdateABlockCapacityReservation(); - await createOrUpdateACapacityReservation(); - await createOrUpdateATargetedCapacityReservation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsGetSample.js deleted file mode 100644 index ef614b4ae6d2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsGetSample.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. - * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_Get.json - */ -async function getABlockCapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const capacityReservationName = "blockCapacityReservation"; - const expand = "instanceView"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. - * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Get.json - */ -async function getACapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const capacityReservationName = "myCapacityReservation"; - const expand = "instanceView"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. - * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_Get.json - */ -async function getATargetedCapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const capacityReservationName = "targetedCapacityReservation"; - const expand = "instanceView"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - ); - console.log(result); -} - -async function main() { - await getABlockCapacityReservation(); - await getACapacityReservation(); - await getATargetedCapacityReservation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsUpdateSample.js deleted file mode 100644 index 992e61300006..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsUpdateSample.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update a capacity reservation. - * - * @summary The operation to update a capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json - */ -async function capacityReservationUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaa"; - const capacityReservationName = "aaaaaaaaaaaaaaaaaaa"; - const parameters = { - instanceView: { - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - utilizationInfo: {}, - }, - sku: { name: "Standard_DS1_v2", capacity: 7, tier: "aaa" }, - tags: { key4974: "aaaaaaaaaaaaaaaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update a capacity reservation. - * - * @summary The operation to update a capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json - */ -async function capacityReservationUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const capacityReservationName = "aaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -async function main() { - await capacityReservationUpdateMaximumSetGen(); - await capacityReservationUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js deleted file mode 100644 index 974ca7f742e3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. - * - * @summary Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamily_Get.json - */ -async function getCloudServiceOSFamily() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const osFamilyName = "3"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceOperatingSystems.getOSFamily(location, osFamilyName); - console.log(result); -} - -async function main() { - await getCloudServiceOSFamily(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js deleted file mode 100644 index 6bfcf659d100..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. - * - * @summary Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_Get.json - */ -async function getCloudServiceOSVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const osVersionName = "WA-GUEST-OS-3.90_202010-02"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceOperatingSystems.getOSVersion(location, osVersionName); - console.log(result); -} - -async function main() { - await getCloudServiceOSVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js deleted file mode 100644 index 36bc2f4de54f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * - * @summary Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamilies_List.json - */ -async function listCloudServiceOSFamiliesInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceOperatingSystems.listOSFamilies(location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listCloudServiceOSFamiliesInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js deleted file mode 100644 index 3b38221cf0ee..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * - * @summary Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_List.json - */ -async function listCloudServiceOSVersionsInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceOperatingSystems.listOSVersions(location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listCloudServiceOSVersionsInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesDeleteSample.js deleted file mode 100644 index fcb14688ec58..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a role instance from a cloud service. - * - * @summary Deletes a role instance from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete.json - */ -async function deleteCloudServiceRoleInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginDeleteAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await deleteCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js deleted file mode 100644 index c1a8e16cb49f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about the run-time state of a role instance in a cloud service. - * - * @summary Retrieves information about the run-time state of a role instance in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_InstanceView.json - */ -async function getInstanceViewOfCloudServiceRoleInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.getInstanceView( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await getInstanceViewOfCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetRemoteDesktopFileSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetRemoteDesktopFileSample.js deleted file mode 100644 index f32a7d186c82..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetRemoteDesktopFileSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a remote desktop file for a role instance in a cloud service. - * - * @summary Gets a remote desktop file for a role instance in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json - */ -async function getCloudServiceRole() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcloudService"; - const cloudServiceName = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.getRemoteDesktopFile( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await getCloudServiceRole(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetSample.js deleted file mode 100644 index 0316b32c755b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a role instance from a cloud service. - * - * @summary Gets a role instance from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get.json - */ -async function getCloudServiceRoleInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.get( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await getCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesListSample.js deleted file mode 100644 index 60f7d90ca2c0..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesListSample.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * - * @summary Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRolesInstance_List.json - */ -async function listRoleInstancesInACloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceRoleInstances.list( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRebuildSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRebuildSample.js deleted file mode 100644 index cc2038c6b7d6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRebuildSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. - * - * @summary The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild.json - */ -async function rebuildCloudServiceRoleInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginRebuildAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await rebuildCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesReimageSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesReimageSample.js deleted file mode 100644 index cfa3d26b4b32..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesReimageSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * - * @summary The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage.json - */ -async function reimageCloudServiceRoleInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginReimageAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await reimageCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRestartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRestartSample.js deleted file mode 100644 index dd0a97cbb582..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRestartSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. - * - * @summary The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart.json - */ -async function restartCloudServiceRoleInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginRestartAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await restartCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesGetSample.js deleted file mode 100644 index a3c30e0627ec..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a role from a cloud service. - * - * @summary Gets a role from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_Get.json - */ -async function getCloudServiceRole() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleName = "{role-name}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoles.get(roleName, resourceGroupName, cloudServiceName); - console.log(result); -} - -async function main() { - await getCloudServiceRole(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesListSample.js deleted file mode 100644 index ab11a9da84eb..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. - * - * @summary Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_List.json - */ -async function listRolesInACloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceRoles.list(resourceGroupName, cloudServiceName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listRolesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesCreateOrUpdateSample.js deleted file mode 100644 index 4715b71ca183..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesCreateOrUpdateSample.js +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole.json - */ -async function createNewCloudServiceWithMultipleRoles() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - { - name: "ContosoBackend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole_WithZones.json - */ -async function createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - { - name: "ContosoBackend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - zones: ["1"], - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRole.json - */ -async function createNewCloudServiceWithSingleRole() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "myLoadBalancer", - properties: { - frontendIpConfigurations: [ - { - name: "myfe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json - */ -async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - osProfile: { - secrets: [ - { - sourceVault: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}", - }, - vaultCertificates: [ - { - certificateUrl: - "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}", - isBootstrapCertificate: true, - }, - ], - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndRDP.json - */ -async function createNewCloudServiceWithSingleRoleAndRdpExtension() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - extensionProfile: { - extensions: [ - { - name: "RDPExtension", - properties: { - type: "RDP", - autoUpgradeMinorVersion: false, - protectedSettings: "{password}", - publisher: "Microsoft.Windows.Azure.Extensions", - settings: - "UserAzure10/22/2021 15:05:45", - typeHandlerVersion: "1.2", - }, - }, - ], - }, - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main() { - await createNewCloudServiceWithMultipleRoles(); - await createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(); - await createNewCloudServiceWithSingleRole(); - await createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(); - await createNewCloudServiceWithSingleRoleAndRdpExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteInstancesSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteInstancesSample.js deleted file mode 100644 index 22a601c807f4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteInstancesSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes role instances in a cloud service. - * - * @summary Deletes role instances in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json - */ -async function deleteCloudServiceRoleInstancesInACloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginDeleteInstancesAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main() { - await deleteCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteSample.js deleted file mode 100644 index 8e9a16b41012..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a cloud service. - * - * @summary Deletes a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Delete.json - */ -async function deleteCloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginDeleteAndWait(resourceGroupName, cloudServiceName); - console.log(result); -} - -async function main() { - await deleteCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetInstanceViewSample.js deleted file mode 100644 index 7859eba70adc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetInstanceViewSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the status of a cloud service. - * - * @summary Gets the status of a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_InstanceViewWithMultiRole.json - */ -async function getCloudServiceInstanceViewWithMultipleRoles() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.getInstanceView(resourceGroupName, cloudServiceName); - console.log(result); -} - -async function main() { - await getCloudServiceInstanceViewWithMultipleRoles(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetSample.js deleted file mode 100644 index ff7fce77db96..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Display information about a cloud service. - * - * @summary Display information about a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_WithMultiRoleAndRDP.json - */ -async function getCloudServiceWithMultipleRolesAndRdpExtension() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.get(resourceGroupName, cloudServiceName); - console.log(result); -} - -async function main() { - await getCloudServiceWithMultipleRolesAndRdpExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListAllSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListAllSample.js deleted file mode 100644 index e0292e58cb20..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListAllSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * - * @summary Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_BySubscription.json - */ -async function listCloudServicesInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServices.listAll()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listCloudServicesInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListSample.js deleted file mode 100644 index 5c3fe8fa9a6e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListSample.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * - * @summary Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_ByResourceGroup.json - */ -async function listCloudServicesInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServices.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listCloudServicesInAResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesPowerOffSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesPowerOffSample.js deleted file mode 100644 index f4a0f2a7f8b3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesPowerOffSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. - * - * @summary Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_PowerOff.json - */ -async function stopOrPowerOffCloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginPowerOffAndWait( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main() { - await stopOrPowerOffCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRebuildSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRebuildSample.js deleted file mode 100644 index 528bca04077c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRebuildSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. - * - * @summary Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json - */ -async function rebuildCloudServiceRoleInstancesInACloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginRebuildAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main() { - await rebuildCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesReimageSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesReimageSample.js deleted file mode 100644 index 2e3821b30977..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesReimageSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * - * @summary Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json - */ -async function reimageCloudServiceRoleInstancesInACloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginReimageAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main() { - await reimageCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRestartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRestartSample.js deleted file mode 100644 index 422371be103c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRestartSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Restarts one or more role instances in a cloud service. - * - * @summary Restarts one or more role instances in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json - */ -async function restartCloudServiceRoleInstancesInACloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginRestartAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main() { - await restartCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesStartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesStartSample.js deleted file mode 100644 index b3411adbd677..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesStartSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Starts the cloud service. - * - * @summary Starts the cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Start.json - */ -async function startCloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginStartAndWait(resourceGroupName, cloudServiceName); - console.log(result); -} - -async function main() { - await startCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js deleted file mode 100644 index 988a979d6f68..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * - * @summary Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Get.json - */ -async function getCloudServiceUpdateDomain() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const updateDomain = 1; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServicesUpdateDomain.getUpdateDomain( - resourceGroupName, - cloudServiceName, - updateDomain, - ); - console.log(result); -} - -async function main() { - await getCloudServiceUpdateDomain(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js deleted file mode 100644 index d62a2b2f7a78..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all update domains in a cloud service. - * - * @summary Gets a list of all update domains in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_List.json - */ -async function listUpdateDomainsInCloudService() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServicesUpdateDomain.listUpdateDomains( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listUpdateDomainsInCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js deleted file mode 100644 index dc7e97a47be9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Updates the role instances in the specified update domain. - * - * @summary Updates the role instances in the specified update domain. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Update.json - */ -async function updateCloudServiceToSpecifiedDomain() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const updateDomain = 1; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServicesUpdateDomain.beginWalkUpdateDomainAndWait( - resourceGroupName, - cloudServiceName, - updateDomain, - ); - console.log(result); -} - -async function main() { - await updateCloudServiceToSpecifiedDomain(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateSample.js deleted file mode 100644 index 8bcc68e452a7..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateSample.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a cloud service. - * - * @summary Update a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Update_ToIncludeTags.json - */ -async function updateExistingCloudServiceToAddTags() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters = { tags: { documentation: "RestAPI" } }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main() { - await updateExistingCloudServiceToAddTags(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleriesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/communityGalleriesGetSample.js deleted file mode 100644 index 50092db08427..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleriesGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a community gallery by gallery public name. - * - * @summary Get a community gallery by gallery public name. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json - */ -async function getACommunityGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.communityGalleries.get(location, publicGalleryName); - console.log(result); -} - -async function main() { - await getACommunityGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsGetSample.js deleted file mode 100644 index 07a8f3e86c09..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a community gallery image version. - * - * @summary Get a community gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json - */ -async function getACommunityGalleryImageVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "myGalleryImageVersionName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.communityGalleryImageVersions.get( - location, - publicGalleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main() { - await getACommunityGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesGetSample.js deleted file mode 100644 index 491e0a77c7fe..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a community gallery image. - * - * @summary Get a community gallery image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json - */ -async function getACommunityGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.communityGalleryImages.get( - location, - publicGalleryName, - galleryImageName, - ); - console.log(result); -} - -async function main() { - await getACommunityGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsCreateOrUpdateSample.js deleted file mode 100644 index f1285fc5b829..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * - * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json - */ -async function createOrUpdateADedicatedHostGroupWithUltraSsdSupport() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const parameters = { - additionalCapabilities: { ultraSSDEnabled: true }, - location: "westus", - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { department: "finance" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.createOrUpdate( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * - * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json - */ -async function createOrUpdateADedicatedHostGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const parameters = { - location: "westus", - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { department: "finance" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.createOrUpdate( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await createOrUpdateADedicatedHostGroupWithUltraSsdSupport(); - await createOrUpdateADedicatedHostGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsDeleteSample.js deleted file mode 100644 index 41ed3174fcc8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsDeleteSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a dedicated host group. - * - * @summary Delete a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json - */ -async function dedicatedHostGroupDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.delete(resourceGroupName, hostGroupName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a dedicated host group. - * - * @summary Delete a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json - */ -async function dedicatedHostGroupDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.delete(resourceGroupName, hostGroupName); - console.log(result); -} - -async function main() { - await dedicatedHostGroupDeleteMaximumSetGen(); - await dedicatedHostGroupDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsGetSample.js deleted file mode 100644 index 954f9646faf4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsGetSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a dedicated host group. - * - * @summary Retrieves information about a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json - */ -async function createADedicatedHostGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.get(resourceGroupName, hostGroupName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a dedicated host group. - * - * @summary Retrieves information about a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json - */ -async function createAnUltraSsdEnabledDedicatedHostGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.get(resourceGroupName, hostGroupName); - console.log(result); -} - -async function main() { - await createADedicatedHostGroup(); - await createAnUltraSsdEnabledDedicatedHostGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsUpdateSample.js deleted file mode 100644 index 7326f045dbfd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsUpdateSample.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update an dedicated host group. - * - * @summary Update an dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json - */ -async function dedicatedHostGroupUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; - const parameters = { - instanceView: { - hosts: [ - { - availableCapacity: { - allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], - }, - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - ], - }, - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { key9921: "aaaaaaaaaa" }, - zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.update( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an dedicated host group. - * - * @summary Update an dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json - */ -async function dedicatedHostGroupUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.update( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await dedicatedHostGroupUpdateMaximumSetGen(); - await dedicatedHostGroupUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsCreateOrUpdateSample.js deleted file mode 100644 index 09b09b86a99a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsCreateOrUpdateSample.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a dedicated host . - * - * @summary Create or update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json - */ -async function createOrUpdateADedicatedHost() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myDedicatedHost"; - const parameters = { - location: "westus", - platformFaultDomain: 1, - sku: { name: "DSv3-Type1" }, - tags: { department: "HR" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginCreateOrUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -async function main() { - await createOrUpdateADedicatedHost(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsDeleteSample.js deleted file mode 100644 index ad26a92979a3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsDeleteSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a dedicated host. - * - * @summary Delete a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json - */ -async function dedicatedHostDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaa"; - const hostName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginDeleteAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a dedicated host. - * - * @summary Delete a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json - */ -async function dedicatedHostDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaaaaaa"; - const hostName = "aaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginDeleteAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); -} - -async function main() { - await dedicatedHostDeleteMaximumSetGen(); - await dedicatedHostDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsGetSample.js deleted file mode 100644 index fba776bc0634..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a dedicated host. - * - * @summary Retrieves information about a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Get.json - */ -async function getADedicatedHost() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; - const expand = "instanceView"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.get( - resourceGroupName, - hostGroupName, - hostName, - options, - ); - console.log(result); -} - -async function main() { - await getADedicatedHost(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsUpdateSample.js deleted file mode 100644 index d5f92566c3cb..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsUpdateSample.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a dedicated host . - * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json - */ -async function dedicatedHostUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaa"; - const parameters = { - autoReplaceOnFailure: true, - instanceView: { - availableCapacity: { - allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], - }, - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - licenseType: "Windows_Server_Hybrid", - platformFaultDomain: 1, - tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a dedicated host . - * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json - */ -async function dedicatedHostUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a dedicated host . - * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json - */ -async function dedicatedHostUpdateResize() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaa"; - const parameters = { sku: { name: "DSv3-Type1" } }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -async function main() { - await dedicatedHostUpdateMaximumSetGen(); - await dedicatedHostUpdateMinimumSetGen(); - await dedicatedHostUpdateResize(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesCreateOrUpdateSample.js deleted file mode 100644 index 0811bfc5fba8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesCreateOrUpdateSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Creates or updates a disk access resource - * - * @summary Creates or updates a disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Create.json - */ -async function createADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const diskAccess = { location: "West US" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginCreateOrUpdateAndWait( - resourceGroupName, - diskAccessName, - diskAccess, - ); - console.log(result); -} - -async function main() { - await createADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js deleted file mode 100644 index c1fcf855587a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a private endpoint connection under a disk access resource. - * - * @summary Deletes a private endpoint connection under a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json - */ -async function deleteAPrivateEndpointConnectionUnderADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginDeleteAPrivateEndpointConnectionAndWait( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - await deleteAPrivateEndpointConnectionUnderADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteSample.js deleted file mode 100644 index 45558cba5779..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a disk access resource. - * - * @summary Deletes a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Delete.json - */ -async function deleteADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginDeleteAndWait(resourceGroupName, diskAccessName); - console.log(result); -} - -async function main() { - await deleteADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetSample.js deleted file mode 100644 index e49731834544..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets information about a disk access resource. - * - * @summary Gets information about a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json - */ -async function getInformationAboutADiskAccessResourceWithPrivateEndpoints() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.get(resourceGroupName, diskAccessName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets information about a disk access resource. - * - * @summary Gets information about a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get.json - */ -async function getInformationAboutADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.get(resourceGroupName, diskAccessName); - console.log(result); -} - -async function main() { - await getInformationAboutADiskAccessResourceWithPrivateEndpoints(); - await getInformationAboutADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js deleted file mode 100644 index 22fb1c1e9cb7..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. - * - * @summary Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json - */ -async function approveAPrivateEndpointConnectionUnderADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; - const privateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approving myPrivateEndpointConnection", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginUpdateAPrivateEndpointConnectionAndWait( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - privateEndpointConnection, - ); - console.log(result); -} - -async function main() { - await approveAPrivateEndpointConnectionUnderADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateSample.js deleted file mode 100644 index fa28f11b87e6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Updates (patches) a disk access resource. - * - * @summary Updates (patches) a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Update.json - */ -async function updateADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const diskAccess = { - tags: { department: "Development", project: "PrivateEndpoints" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginUpdateAndWait( - resourceGroupName, - diskAccessName, - diskAccess, - ); - console.log(result); -} - -async function main() { - await updateADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsCreateOrUpdateSample.js deleted file mode 100644 index fd580fe48dc5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsCreateOrUpdateSample.js +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Creates or updates a disk encryption set - * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json - */ -async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet = { - activeKey: { - keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk encryption set - * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json - */ -async function createADiskEncryptionSetWithKeyVaultFromADifferentTenant() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet = { - activeKey: { - keyUrl: "https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - federatedClientId: "00000000-0000-0000-0000-000000000000", - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MicrosoftManagedIdentity/userAssignedIdentities/{identityName}": - {}, - }, - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk encryption set - * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json - */ -async function createADiskEncryptionSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet = { - activeKey: { - keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", - }, - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -async function main() { - await createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(); - await createADiskEncryptionSetWithKeyVaultFromADifferentTenant(); - await createADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsDeleteSample.js deleted file mode 100644 index 2b5b8d3dd8d1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsDeleteSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a disk encryption set. - * - * @summary Deletes a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json - */ -async function deleteADiskEncryptionSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginDeleteAndWait( - resourceGroupName, - diskEncryptionSetName, - ); - console.log(result); -} - -async function main() { - await deleteADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsGetSample.js deleted file mode 100644 index 0c887fc0541d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsGetSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets information about a disk encryption set. - * - * @summary Gets information about a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json - */ -async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.get(resourceGroupName, diskEncryptionSetName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets information about a disk encryption set. - * - * @summary Gets information about a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json - */ -async function getInformationAboutADiskEncryptionSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.get(resourceGroupName, diskEncryptionSetName); - console.log(result); -} - -async function main() { - await getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(); - await getInformationAboutADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsUpdateSample.js deleted file mode 100644 index 66de0d275b2c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsUpdateSample.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Updates (patches) a disk encryption set. - * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json - */ -async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet = { - activeKey: { - keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - rotationToLatestKeyVersionEnabled: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk encryption set. - * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json - */ -async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet = { - activeKey: { - keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - rotationToLatestKeyVersionEnabled: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk encryption set. - * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json - */ -async function updateADiskEncryptionSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet = { - activeKey: { - keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", - }, - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - tags: { department: "Development", project: "Encryption" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -async function main() { - await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(); - await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(); - await updateADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGetSample.js deleted file mode 100644 index 13a50e605348..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGetSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get disk restorePoint resource - * - * @summary Get disk restorePoint resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json - */ -async function getAnIncrementalDiskRestorePointResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.get( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get disk restorePoint resource - * - * @summary Get disk restorePoint resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json - */ -async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.get( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - ); - console.log(result); -} - -async function main() { - await getAnIncrementalDiskRestorePointResource(); - await getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGrantAccessSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGrantAccessSample.js deleted file mode 100644 index 3341f9e05a7b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGrantAccessSample.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Grants access to a diskRestorePoint. - * - * @summary Grants access to a diskRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json - */ -async function grantsAccessToADiskRestorePoint() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const grantAccessData = { - access: "Read", - durationInSeconds: 300, - fileFormat: "VHDX", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.beginGrantAccessAndWait( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - grantAccessData, - ); - console.log(result); -} - -async function main() { - await grantsAccessToADiskRestorePoint(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointListByRestorePointSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointListByRestorePointSample.js deleted file mode 100644 index de176e24d2ba..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointListByRestorePointSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Lists diskRestorePoints under a vmRestorePoint. - * - * @summary Lists diskRestorePoints under a vmRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json - */ -async function getAnIncrementalDiskRestorePointResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.diskRestorePointOperations.listByRestorePoint( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await getAnIncrementalDiskRestorePointResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointRevokeAccessSample.js deleted file mode 100644 index c474a4741a0d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointRevokeAccessSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Revokes access to a diskRestorePoint. - * - * @summary Revokes access to a diskRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json - */ -async function revokesAccessToADiskRestorePoint() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.beginRevokeAccessAndWait( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - ); - console.log(result); -} - -async function main() { - await revokesAccessToADiskRestorePoint(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/disksCreateOrUpdateSample.js deleted file mode 100644 index 5631bc046b19..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksCreateOrUpdateSample.js +++ /dev/null @@ -1,699 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json - */ -async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - securityProfile: { - secureVMDiskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDiskAccess.json - */ -async function createAManagedDiskAndAssociateWithDiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty" }, - diskAccessId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", - diskSizeGB: 200, - location: "West US", - networkAccessPolicy: "AllowPrivate", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json - */ -async function createAManagedDiskAndAssociateWithDiskEncryptionSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - encryption: { - diskEncryptionSetId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json - */ -async function createAManagedDiskByCopyingASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "Copy", - sourceResourceId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json - */ -async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "Import", - sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json - */ -async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "Import", - sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromImportSecure.json - */ -async function createAManagedDiskFromImportSecureCreateOption() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "ImportSecure", - securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", - sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - osType: "Windows", - securityProfile: { - securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromImportSecure_WithVMMetadata.json - */ -async function createAManagedDiskFromImportSecureCreateOptionWithMetadataUriForConfidentialVM() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "ImportSecure", - securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", - securityMetadataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd", - sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - osType: "Windows", - securityProfile: { - securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json - */ -async function createAManagedDiskFromUploadPreparedSecureCreateOption() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "UploadPreparedSecure", - uploadSizeBytes: 10737418752, - }, - location: "West US", - osType: "Windows", - securityProfile: { securityType: "TrustedLaunch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json - */ -async function createAManagedDiskFromAPlatformImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json - */ -async function createAManagedDiskFromAnAzureComputeGalleryCommunityImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "FromImage", - galleryImageReference: { - communityGalleryImageId: - "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json - */ -async function createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "FromImage", - galleryImageReference: { - sharedGalleryImageId: - "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json - */ -async function createAManagedDiskFromAnAzureComputeGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "FromImage", - galleryImageReference: { - id: "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json - */ -async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk2"; - const disk = { - creationData: { - createOption: "Copy", - sourceResourceId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json - */ -async function createAManagedDiskFromElasticSanVolumeSnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "CopyFromSanSnapshot", - elasticSanResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json - */ -async function createAManagedDiskWithAvailabilityPolicy() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - availabilityPolicy: { actionOnDiskDelay: "AutomaticReattach" }, - creationData: { createOption: "Empty" }, - diskSizeGB: 1024, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json - */ -async function createAManagedDiskWithDataAccessAuthMode() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty" }, - dataAccessAuthMode: "AzureActiveDirectory", - diskSizeGB: 200, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json - */ -async function createAManagedDiskWithOptimizedForFrequentAttach() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - optimizedForFrequentAttach: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_PerformancePlus.json - */ -async function createAManagedDiskWithPerformancePlus() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Upload", performancePlus: true }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json - */ -async function createAManagedDiskWithPremiumV2AccountType() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myPremiumV2Disk"; - const disk = { - creationData: { createOption: "Empty" }, - diskIopsReadWrite: 125, - diskMBpsReadWrite: 3000, - diskSizeGB: 200, - location: "West US", - sku: { name: "PremiumV2_LRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json - */ -async function createAManagedDiskWithSecurityProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}", - }, - }, - location: "North Central US", - osType: "Windows", - securityProfile: { securityType: "TrustedLaunch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json - */ -async function createAManagedDiskWithSsdZrsAccountType() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - sku: { name: "Premium_ZRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json - */ -async function createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myUltraReadOnlyDisk"; - const disk = { - creationData: { createOption: "Empty", logicalSectorSize: 4096 }, - diskIopsReadWrite: 125, - diskMBpsReadWrite: 3000, - diskSizeGB: 200, - encryption: { type: "EncryptionAtRestWithPlatformKey" }, - location: "West US", - sku: { name: "UltraSSD_LRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_UploadDisk.json - */ -async function createAManagedUploadDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_InExtendedLocation.json - */ -async function createAnEmptyManagedDiskInExtendedLocation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - extendedLocation: { name: "{edge-zone-id}", type: "EdgeZone" }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_Empty.json - */ -async function createAnEmptyManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json - */ -async function createAnUltraManagedDiskWithLogicalSectorSize512E() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - creationData: { createOption: "Empty", logicalSectorSize: 512 }, - diskSizeGB: 200, - location: "West US", - sku: { name: "UltraSSD_LRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -async function main() { - await createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(); - await createAManagedDiskAndAssociateWithDiskAccessResource(); - await createAManagedDiskAndAssociateWithDiskEncryptionSet(); - await createAManagedDiskByCopyingASnapshot(); - await createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(); - await createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(); - await createAManagedDiskFromImportSecureCreateOption(); - await createAManagedDiskFromImportSecureCreateOptionWithMetadataUriForConfidentialVM(); - await createAManagedDiskFromUploadPreparedSecureCreateOption(); - await createAManagedDiskFromAPlatformImage(); - await createAManagedDiskFromAnAzureComputeGalleryCommunityImage(); - await createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(); - await createAManagedDiskFromAnAzureComputeGalleryImage(); - await createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(); - await createAManagedDiskFromElasticSanVolumeSnapshot(); - await createAManagedDiskWithAvailabilityPolicy(); - await createAManagedDiskWithDataAccessAuthMode(); - await createAManagedDiskWithOptimizedForFrequentAttach(); - await createAManagedDiskWithPerformancePlus(); - await createAManagedDiskWithPremiumV2AccountType(); - await createAManagedDiskWithSecurityProfile(); - await createAManagedDiskWithSsdZrsAccountType(); - await createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(); - await createAManagedUploadDisk(); - await createAnEmptyManagedDiskInExtendedLocation(); - await createAnEmptyManagedDisk(); - await createAnUltraManagedDiskWithLogicalSectorSize512E(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/disksDeleteSample.js deleted file mode 100644 index db9d6fb77364..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksDeleteSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a disk. - * - * @summary Deletes a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Delete.json - */ -async function deleteAManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginDeleteAndWait(resourceGroupName, diskName); - console.log(result); -} - -async function main() { - await deleteAManagedDisk(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/disksGetSample.js deleted file mode 100644 index c717de1af91b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets information about a disk. - * - * @summary Gets information about a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Get.json - */ -async function getInformationAboutAManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myManagedDisk"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.get(resourceGroupName, diskName); - console.log(result); -} - -async function main() { - await getInformationAboutAManagedDisk(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksGrantAccessSample.js b/sdk/compute/arm-compute/samples/v23/javascript/disksGrantAccessSample.js deleted file mode 100644 index 0a799a57003f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksGrantAccessSample.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Grants access to a disk. - * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess.json - */ -async function getASasOnAManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData = { - access: "Read", - durationInSeconds: 300, - fileFormat: "VHD", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Grants access to a disk. - * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json - */ -async function getSasOnManagedDiskAndVMGuestState() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData = { - access: "Read", - durationInSeconds: 300, - getSecureVMGuestStateSAS: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Grants access to a disk. - * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestStateAndVMMetadata.json - */ -async function getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData = { - access: "Read", - durationInSeconds: 300, - getSecureVMGuestStateSAS: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); - console.log(result); -} - -async function main() { - await getASasOnAManagedDisk(); - await getSasOnManagedDiskAndVMGuestState(); - await getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v23/javascript/disksRevokeAccessSample.js deleted file mode 100644 index c976577a5f71..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksRevokeAccessSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Revokes access to a disk. - * - * @summary Revokes access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_EndGetAccess.json - */ -async function revokeAccessToAManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginRevokeAccessAndWait(resourceGroupName, diskName); - console.log(result); -} - -async function main() { - await revokeAccessToAManagedDisk(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/disksUpdateSample.js deleted file mode 100644 index b3c9af33bf7c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksUpdateSample.js +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json - */ -async function createOrUpdateABurstingEnabledManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { burstingEnabled: true, diskSizeGB: 1024 }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json - */ -async function updateAManagedDiskToAddAcceleratedNetworking() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - supportedCapabilities: { acceleratedNetwork: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json - */ -async function updateAManagedDiskToAddArchitecture() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { supportedCapabilities: { architecture: "Arm64" } }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json - */ -async function updateAManagedDiskToAddPurchasePlan() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - purchasePlan: { - name: "myPurchasePlanName", - product: "myPurchasePlanProduct", - promotionCode: "myPurchasePlanPromotionCode", - publisher: "myPurchasePlanPublisher", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json - */ -async function updateAManagedDiskToAddSupportsHibernation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { supportsHibernation: true }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_ChangeTier.json - */ -async function updateAManagedDiskToChangeTier() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { tier: "P30" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_DisableBursting.json - */ -async function updateAManagedDiskToDisableBursting() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { burstingEnabled: false }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json - */ -async function updateAManagedDiskToDisableOptimizedForFrequentAttach() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { optimizedForFrequentAttach: false }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json - */ -async function updateAManagedDiskWithDiskControllerTypes() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { - supportedCapabilities: { diskControllerTypes: "SCSI" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json - */ -async function updateManagedDiskToRemoveDiskAccessResourceAssociation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk = { networkAccessPolicy: "AllowAll" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk); - console.log(result); -} - -async function main() { - await createOrUpdateABurstingEnabledManagedDisk(); - await updateAManagedDiskToAddAcceleratedNetworking(); - await updateAManagedDiskToAddArchitecture(); - await updateAManagedDiskToAddPurchasePlan(); - await updateAManagedDiskToAddSupportsHibernation(); - await updateAManagedDiskToChangeTier(); - await updateAManagedDiskToDisableBursting(); - await updateAManagedDiskToDisableOptimizedForFrequentAttach(); - await updateAManagedDiskWithDiskControllerTypes(); - await updateManagedDiskToRemoveDiskAccessResourceAssociation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleriesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleriesCreateOrUpdateSample.js deleted file mode 100644 index d0f8c2436407..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleriesCreateOrUpdateSample.js +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Create.json - */ -async function createACommunityGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery = { - description: "This is the gallery description.", - location: "West US", - sharingProfile: { - communityGalleryInfo: { - eula: "eula", - publicNamePrefix: "PirPublic", - publisherContact: "pir@microsoft.com", - publisherUri: "uri", - }, - permissions: "Community", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_WithSharingProfile.json - */ -async function createOrUpdateASimpleGalleryWithSharingProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery = { - description: "This is the gallery description.", - location: "West US", - sharingProfile: { permissions: "Groups" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_SoftDeletionEnabled.json - */ -async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery = { - description: "This is the gallery description.", - location: "West US", - softDeletePolicy: { isSoftDeleteEnabled: true }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_WithManagedIdentity.json - */ -async function createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery = { - description: "This is the gallery description.", - identity: { - type: "SystemAssigned, UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/myIdentity": - {}, - }, - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create.json - */ -async function createOrUpdateASimpleGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery = { - description: "This is the gallery description.", - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -async function main() { - await createACommunityGallery(); - await createOrUpdateASimpleGalleryWithSharingProfile(); - await createOrUpdateASimpleGalleryWithSoftDeletionEnabled(); - await createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); - await createOrUpdateASimpleGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleriesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleriesDeleteSample.js deleted file mode 100644 index 97f717b9330a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleriesDeleteSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a Shared Image Gallery. - * - * @summary Delete a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Delete.json - */ -async function deleteAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginDeleteAndWait(resourceGroupName, galleryName); - console.log(result); -} - -async function main() { - await deleteAGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleriesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleriesGetSample.js deleted file mode 100644 index e63406b925b5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleriesGetSample.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Get.json - */ -async function getACommunityGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json - */ -async function getAGalleryWithExpandSharingProfileGroups() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const expand = "SharingProfile/Groups"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName, options); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json - */ -async function getAGalleryWithSelectPermissions() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const select = "Permissions"; - const options = { select }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName, options); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithManagedIdentity.json - */ -async function getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get.json - */ -async function getAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); - console.log(result); -} - -async function main() { - await getACommunityGallery(); - await getAGalleryWithExpandSharingProfileGroups(); - await getAGalleryWithSelectPermissions(); - await getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); - await getAGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleriesUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleriesUpdateSample.js deleted file mode 100644 index 05c3d26a74b9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleriesUpdateSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a Shared Image Gallery. - * - * @summary Update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Update.json - */ -async function updateASimpleGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery = { - description: "This is the gallery description.", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginUpdateAndWait(resourceGroupName, galleryName, gallery); - console.log(result); -} - -async function main() { - await updateASimpleGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsCreateOrUpdateSample.js deleted file mode 100644 index 0fb18ab4651a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsCreateOrUpdateSample.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a gallery Application Version. - * - * @summary Create or update a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json - */ -async function createOrUpdateASimpleGalleryApplicationVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const galleryApplicationVersion = { - location: "West US", - publishingProfile: { - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - endOfLifeDate: new Date("2019-07-01T07:00:00Z"), - manageActions: { - install: - 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', - remove: "del C:\\package ", - }, - replicaCount: 1, - source: { - mediaLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 1, - storageAccountType: "Standard_LRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - ); - console.log(result); -} - -async function main() { - await createOrUpdateASimpleGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsDeleteSample.js deleted file mode 100644 index 04990b96b1d5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery Application Version. - * - * @summary Delete a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json - */ -async function deleteAGalleryApplicationVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsGetSample.js deleted file mode 100644 index edb08248dd6c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsGetSample.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a gallery Application Version. - * - * @summary Retrieves information about a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json - */ -async function getAGalleryApplicationVersionWithReplicationStatus() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const expand = "ReplicationStatus"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.get( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery Application Version. - * - * @summary Retrieves information about a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get.json - */ -async function getAGalleryApplicationVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.get( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - ); - console.log(result); -} - -async function main() { - await getAGalleryApplicationVersionWithReplicationStatus(); - await getAGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsUpdateSample.js deleted file mode 100644 index 32decdfc9216..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsUpdateSample.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery Application Version. - * - * @summary Update a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json - */ -async function updateASimpleGalleryApplicationVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const galleryApplicationVersion = { - publishingProfile: { - endOfLifeDate: new Date("2019-07-01T07:00:00Z"), - manageActions: { - install: - 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', - remove: "del C:\\package ", - }, - replicaCount: 1, - source: { - mediaLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 1, - storageAccountType: "Standard_LRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - ); - console.log(result); -} - -async function main() { - await updateASimpleGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsCreateOrUpdateSample.js deleted file mode 100644 index eeef277610ee..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsCreateOrUpdateSample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a gallery Application Definition. - * - * @summary Create or update a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Create.json - */ -async function createOrUpdateASimpleGalleryApplication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplication = { - description: "This is the gallery application description.", - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - eula: "This is the gallery application EULA.", - location: "West US", - privacyStatementUri: "myPrivacyStatementUri}", - releaseNoteUri: "myReleaseNoteUri", - supportedOSType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - ); - console.log(result); -} - -async function main() { - await createOrUpdateASimpleGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsDeleteSample.js deleted file mode 100644 index 7cb21763035e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery Application. - * - * @summary Delete a gallery Application. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Delete.json - */ -async function deleteAGalleryApplication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsGetSample.js deleted file mode 100644 index 1a60ff59096d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a gallery Application Definition. - * - * @summary Retrieves information about a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Get.json - */ -async function getAGalleryApplication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.get( - resourceGroupName, - galleryName, - galleryApplicationName, - ); - console.log(result); -} - -async function main() { - await getAGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsUpdateSample.js deleted file mode 100644 index c749e47cbd97..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsUpdateSample.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery Application Definition. - * - * @summary Update a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Update.json - */ -async function updateASimpleGalleryApplication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplication = { - description: "This is the gallery application description.", - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - eula: "This is the gallery application EULA.", - privacyStatementUri: "myPrivacyStatementUri}", - releaseNoteUri: "myReleaseNoteUri", - supportedOSType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - ); - console.log(result); -} - -async function main() { - await updateASimpleGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsCreateOrUpdateSample.js deleted file mode 100644 index 6805e3373030..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsCreateOrUpdateSample.js +++ /dev/null @@ -1,884 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - virtualMachineId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - communityGalleryImageId: - "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - replicationMode: "Shallow", - targetRegions: [{ name: "West US", excludeFromLatest: false, regionalReplicaCount: 1 }], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", - }, - }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - securityProfile: { - uefiSettings: { - additionalSignatures: { - db: [{ type: "x509", value: [""] }], - dbx: [{ type: "x509", value: [""] }], - kek: [{ type: "sha256", value: [""] }], - }, - signatureTemplateNames: ["MicrosoftUefiCertificateAuthorityTemplate"], - }, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithAdditionalReplicaSets.json - */ -async function createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - additionalReplicaSets: [{ regionalReplicaCount: 1, storageAccountType: "PreviumV2_LRS" }], - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithStorageAccountStrategy.json - */ -async function createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - storageAccountStrategy: "PreferStandard_ZRS", - targetRegions: [ - { name: "West US" }, - { name: "East US" }, - { name: "East US 2", storageAccountType: "Premium_LRS" }, - ], - }, - storageProfile: { - source: { - virtualMachineId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json - */ -async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -async function main() { - await createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(); - await createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(); - await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(); - await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(); - await createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(); - await createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(); - await createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsDeleteSample.js deleted file mode 100644 index fed7d9e5534a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery image version. - * - * @summary Delete a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json - */ -async function deleteAGalleryImageVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsGetSample.js deleted file mode 100644 index 2586e5d67323..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsGetSample.js +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json - */ -async function getAGalleryImageVersionWithReplicationStatus() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ReplicationStatus"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json - */ -async function getAGalleryImageVersionWithSnapshotsAsASource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json - */ -async function getAGalleryImageVersionWithValidationProfileAndReplicationStatus() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ValidationProfile,ReplicationStatus"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfile.json - */ -async function getAGalleryImageVersionWithValidationProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ValidationProfile"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json - */ -async function getAGalleryImageVersionWithVhdAsASource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get.json - */ -async function getAGalleryImageVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main() { - await getAGalleryImageVersionWithReplicationStatus(); - await getAGalleryImageVersionWithSnapshotsAsASource(); - await getAGalleryImageVersionWithValidationProfileAndReplicationStatus(); - await getAGalleryImageVersionWithValidationProfile(); - await getAGalleryImageVersionWithVhdAsASource(); - await getAGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsUpdateSample.js deleted file mode 100644 index 694539e0972b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsUpdateSample.js +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery image version. - * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json - */ -async function restoreASoftDeletedGalleryImageVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - restore: true, - storageProfile: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a gallery image version. - * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update.json - */ -async function updateASimpleGalleryImageVersionManagedImageAsSource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - publishingProfile: { - targetRegions: [ - { name: "West US", regionalReplicaCount: 1 }, - { - name: "East US", - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a gallery image version. - * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json - */ -async function updateASimpleGalleryImageVersionWithoutSourceId() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion = { - publishingProfile: { - targetRegions: [ - { name: "West US", regionalReplicaCount: 1 }, - { - name: "East US", - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - storageProfile: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -async function main() { - await restoreASoftDeletedGalleryImageVersion(); - await updateASimpleGalleryImageVersionManagedImageAsSource(); - await updateASimpleGalleryImageVersionWithoutSourceId(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesCreateOrUpdateSample.js deleted file mode 100644 index 13f42c5d022b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesCreateOrUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a gallery image definition. - * - * @summary Create or update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Create.json - */ -async function createOrUpdateASimpleGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage = { - hyperVGeneration: "V1", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - location: "West US", - osState: "Generalized", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - ); - console.log(result); -} - -async function main() { - await createOrUpdateASimpleGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesDeleteSample.js deleted file mode 100644 index 71acc78f7994..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery image. - * - * @summary Delete a gallery image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Delete.json - */ -async function deleteAGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryImageName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesGetSample.js deleted file mode 100644 index 861d0b30c8a9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a gallery image definition. - * - * @summary Retrieves information about a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Get.json - */ -async function getAGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.get(resourceGroupName, galleryName, galleryImageName); - console.log(result); -} - -async function main() { - await getAGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesListByGallerySample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesListByGallerySample.js deleted file mode 100644 index d52a6309539b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesListByGallerySample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List gallery image definitions in a gallery. - * - * @summary List gallery image definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json - */ -async function listGalleryImagesInAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.galleryImages.listByGallery(resourceGroupName, galleryName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listGalleryImagesInAGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesUpdateSample.js deleted file mode 100644 index af586680ab9f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesUpdateSample.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery image definition. - * - * @summary Update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_UpdateFeatures.json - */ -async function updateAGalleryImageFeature() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage = { - allowUpdateImage: true, - features: [ - { - name: "SecurityType", - startsAtVersion: "2.0.0", - value: "TrustedLaunch", - }, - ], - hyperVGeneration: "V2", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - osState: "Generalized", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a gallery image definition. - * - * @summary Update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Update.json - */ -async function updateASimpleGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage = { - hyperVGeneration: "V1", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - osState: "Generalized", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - ); - console.log(result); -} - -async function main() { - await updateAGalleryImageFeature(); - await updateASimpleGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js deleted file mode 100644 index 677d1b943a2a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a gallery inVMAccessControlProfile version. - * - * @summary Create or update a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json - */ -async function createOrUpdateAGalleryInVMAccessControlProfileVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const galleryInVMAccessControlProfileVersion = { - defaultAccess: "Allow", - excludeFromLatest: false, - location: "West US", - mode: "Audit", - rules: { - identities: [ - { - name: "WinPA", - exePath: "C:\\Windows\\System32\\cscript.exe", - groupName: "Administrators", - processName: "cscript", - userName: "SYSTEM", - }, - ], - privileges: [ - { - name: "GoalState", - path: "/machine", - queryParameters: { comp: "goalstate" }, - }, - ], - roleAssignments: [{ identities: ["WinPA"], role: "Provisioning" }], - roles: [{ name: "Provisioning", privileges: ["GoalState"] }], - }, - targetLocations: [{ name: "West US" }, { name: "South Central US" }], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfileVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - ); - console.log(result); -} - -async function main() { - await createOrUpdateAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js deleted file mode 100644 index 2da743af761c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery inVMAccessControlProfile version. - * - * @summary Delete a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json - */ -async function deleteAGalleryInVMAccessControlProfileVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfileVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsGetSample.js deleted file mode 100644 index 0514ce080a34..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a gallery inVMAccessControlProfile version. - * - * @summary Retrieves information about a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json - */ -async function getAGalleryInVMAccessControlProfileVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfileVersions.get( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - ); - console.log(result); -} - -async function main() { - await getAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js deleted file mode 100644 index cbcafafe460f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery inVMAccessControlProfile version. - * - * @summary Update a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json - */ -async function updateAGalleryInVMAccessControlProfileVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const galleryInVMAccessControlProfileVersion = { - defaultAccess: "Allow", - excludeFromLatest: false, - mode: "Audit", - targetLocations: [{ name: "West US" }, { name: "South Central US" }, { name: "East US" }], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfileVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - ); - console.log(result); -} - -async function main() { - await updateAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js deleted file mode 100644 index f411768772a9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a gallery inVMAccessControlProfile. - * - * @summary Create or update a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json - */ -async function createOrUpdateAGalleryInVMAccessControlProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const galleryInVMAccessControlProfile = { - location: "West US", - properties: { applicableHostEndpoint: "WireServer", osType: "Linux" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfiles.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - ); - console.log(result); -} - -async function main() { - await createOrUpdateAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesDeleteSample.js deleted file mode 100644 index d6f3d2873e7a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery inVMAccessControlProfile. - * - * @summary Delete a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json - */ -async function deleteAGalleryInVMAccessControlProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfiles.beginDeleteAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesGetSample.js deleted file mode 100644 index f6c0ac973e53..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a gallery inVMAccessControlProfile. - * - * @summary Retrieves information about a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json - */ -async function getAGalleryInVMAccessControlProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfiles.get( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - ); - console.log(result); -} - -async function main() { - await getAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesUpdateSample.js deleted file mode 100644 index 434082f6d1e4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesUpdateSample.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery inVMAccessControlProfile. - * - * @summary Update a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json - */ -async function updateAGalleryInVMAccessControlProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const galleryInVMAccessControlProfile = { - properties: { applicableHostEndpoint: "WireServer", osType: "Linux" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfiles.beginUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - ); - console.log(result); -} - -async function main() { - await updateAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsDeleteSample.js deleted file mode 100644 index 5c805bef0d59..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery Script Version. - * - * @summary Delete a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Delete.json - */ -async function deleteAGalleryScriptVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryScriptVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsGetSample.js deleted file mode 100644 index f802b64cdb20..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsGetSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Custom ArmResourceRead operation template with CloudError as Error - * - * @summary Custom ArmResourceRead operation template with CloudError as Error - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json - */ -async function getAGalleryScriptVersionWithReplicationStatus() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.get( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Custom ArmResourceRead operation template with CloudError as Error - * - * @summary Custom ArmResourceRead operation template with CloudError as Error - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get.json - */ -async function getAGalleryScriptVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.get( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - ); - console.log(result); -} - -async function main() { - await getAGalleryScriptVersionWithReplicationStatus(); - await getAGalleryScriptVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsUpdateSample.js deleted file mode 100644 index 04edf4308b06..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsUpdateSample.js +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery Script Version. - * - * @summary Update a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Update.json - */ -async function updateASimpleGalleryScriptVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const galleryScriptVersion = { - publishingProfile: { - endOfLifeDate: new Date("2027-07-01T07:00:00Z"), - replicaCount: 2, - source: { - parameters: [ - { - name: "location", - type: "String", - defaultValue: "westus", - required: true, - }, - { - name: "myGalleryScriptParameter1", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: true, - }, - { - name: "myGalleryScriptParameter2", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: false, - }, - { - name: "numberOfUnits", - type: "Int", - description: "description of the parameter", - defaultValue: "3", - maxValue: "5", - minValue: "1", - required: true, - }, - { - name: "weightOfUnit", - type: "Double", - description: "description of the parameter", - defaultValue: "0.6", - maxValue: "2", - minValue: "0.1", - required: true, - }, - { - name: "typeOfProduct", - type: "Enum", - description: "description of the parameter", - defaultValue: "Fruit", - enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], - required: false, - }, - ], - scriptLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_LRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, - ); - console.log(result); -} - -async function main() { - await updateASimpleGalleryScriptVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsCreateOrUpdateSample.js deleted file mode 100644 index eca9d7209354..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsCreateOrUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts - * - * @summary Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Create.json - */ -async function createOrUpdateASimpleGalleryScript() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScript = { - location: "West US", - properties: { - description: "This is the gallery script description.", - eula: "This is the gallery script EULA.", - privacyStatementUri: "{myPrivacyStatementUri}", - releaseNoteUri: "{myReleaseNoteUri}", - supportedOSType: "Windows", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - ); - console.log(result); -} - -async function main() { - await createOrUpdateASimpleGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsDeleteSample.js deleted file mode 100644 index d17fb77889c9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a gallery Script Definition. - * - * @summary Delete a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Delete.json - */ -async function deleteAGalleryScript() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - ); - console.log(result); -} - -async function main() { - await deleteAGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsGetSample.js deleted file mode 100644 index 30c66ea1808f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a gallery script definition. - * - * @summary Retrieves information about a gallery script definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Get.json - */ -async function getAGalleryScript() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.get(resourceGroupName, galleryName, galleryScriptName); - console.log(result); -} - -async function main() { - await getAGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsListByGallerySample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsListByGallerySample.js deleted file mode 100644 index 45ac1bd28a62..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsListByGallerySample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List gallery Script Definitions in a gallery. - * - * @summary List gallery Script Definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_ListByGallery.json - */ -async function listGalleryScriptsInAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.galleryScripts.listByGallery(resourceGroupName, galleryName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listGalleryScriptsInAGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsUpdateSample.js deleted file mode 100644 index 0335164dac07..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsUpdateSample.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a gallery Script Definition. - * - * @summary Update a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Update.json - */ -async function updateASimpleGalleryScript() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScript = { - description: "This is the gallery script description.", - eula: "This is the gallery script EULA.", - privacyStatementUri: "{myPrivacyStatementUri}", - releaseNoteUri: "{myReleaseNoteUri}", - supportedOSType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - ); - console.log(result); -} - -async function main() { - await updateASimpleGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/gallerySharingProfileUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/gallerySharingProfileUpdateSample.js deleted file mode 100644 index 133da6f06baa..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/gallerySharingProfileUpdateSample.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update sharing profile of a gallery. - * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json - */ -async function addSharingIdToTheSharingProfileOfAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate = { - groups: [ - { - type: "Subscriptions", - ids: ["34a4ab42-0d72-47d9-bd1a-aed207386dac", "380fd389-260b-41aa-bad9-0a83108c370b"], - }, - { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] }, - ], - operationType: "Add", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update sharing profile of a gallery. - * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ResetSharingProfile.json - */ -async function resetSharingProfileOfAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate = { operationType: "Reset" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update sharing profile of a gallery. - * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_EnableCommunityGallery.json - */ -async function shareAGalleryToCommunity() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate = { operationType: "EnableCommunity" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); - console.log(result); -} - -async function main() { - await addSharingIdToTheSharingProfileOfAGallery(); - await resetSharingProfileOfAGallery(); - await shareAGalleryToCommunity(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/imagesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/imagesDeleteSample.js deleted file mode 100644 index 72a7fbd2f1a6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/imagesDeleteSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes an Image. - * - * @summary Deletes an Image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json - */ -async function imageDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait(resourceGroupName, imageName); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes an Image. - * - * @summary Deletes an Image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json - */ -async function imageDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait(resourceGroupName, imageName); - console.log(result); -} - -async function main() { - await imageDeleteMaximumSetGen(); - await imageDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/operationsListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/operationsListSample.js deleted file mode 100644 index d78ab71b6630..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/operationsListSample.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await operationsListMaximumSetGen(); - await operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsCreateOrUpdateSample.js deleted file mode 100644 index 1610ec6b9dbc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a proximity placement group. - * - * @summary Create or update a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json - */ -async function createOrUpdateAProximityPlacementGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const parameters = { - intent: { vmSizes: ["Basic_A0", "Basic_A2"] }, - location: "westus", - proximityPlacementGroupType: "Standard", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.createOrUpdate( - resourceGroupName, - proximityPlacementGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await createOrUpdateAProximityPlacementGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsDeleteSample.js deleted file mode 100644 index 271dcdcc3688..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsDeleteSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete a proximity placement group. - * - * @summary Delete a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json - */ -async function deleteAProximityPlacementGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.delete( - resourceGroupName, - proximityPlacementGroupName, - ); - console.log(result); -} - -async function main() { - await deleteAProximityPlacementGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsGetSample.js deleted file mode 100644 index 11c98f7216c9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsGetSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about a proximity placement group . - * - * @summary Retrieves information about a proximity placement group . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json - */ -async function getProximityPlacementGroups() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.get( - resourceGroupName, - proximityPlacementGroupName, - ); - console.log(result); -} - -async function main() { - await getProximityPlacementGroups(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsUpdateSample.js deleted file mode 100644 index 1ac987d2c3b9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsUpdateSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update a proximity placement group. - * - * @summary Update a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json - */ -async function updateAProximityPlacementGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const parameters = { - tags: { additionalProp1: "string" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.update( - resourceGroupName, - proximityPlacementGroupName, - parameters, - ); - console.log(result); -} - -async function main() { - await updateAProximityPlacementGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/resourceSkusListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/resourceSkusListSample.js deleted file mode 100644 index 50172f13a790..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/resourceSkusListSample.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json - */ -async function listsAllAvailableResourceSkUs() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.resourceSkus.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json - */ -async function listsAllAvailableResourceSkUsForTheSpecifiedRegion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const filter = "location eq 'westus'"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.resourceSkus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json - */ -async function listsAllAvailableResourceSkUsWithExtendedLocationInformation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const includeExtendedLocations = "true"; - const options = { includeExtendedLocations }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.resourceSkus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listsAllAvailableResourceSkUs(); - await listsAllAvailableResourceSkUsForTheSpecifiedRegion(); - await listsAllAvailableResourceSkUsWithExtendedLocationInformation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsDeleteSample.js deleted file mode 100644 index 311642b675d2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsDeleteSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * - * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json - */ -async function restorePointCollectionDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * - * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json - */ -async function restorePointCollectionDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -async function main() { - await restorePointCollectionDeleteMaximumSetGen(); - await restorePointCollectionDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsGetSample.js deleted file mode 100644 index 42845a818552..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsGetSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get the restore point collection. - * - * @summary The operation to get the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get.json - */ -async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.get( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the restore point collection. - * - * @summary The operation to get the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json - */ -async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.get( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -async function main() { - await getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(); - await getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsUpdateSample.js deleted file mode 100644 index 3d4360eacd57..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsUpdateSample.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update the restore point collection. - * - * @summary The operation to update the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json - */ -async function restorePointCollectionUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters = { - instantAccess: true, - source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", - }, - tags: { key8536: "aaaaaaaaaaaaaaaaaaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.update( - resourceGroupName, - restorePointCollectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update the restore point collection. - * - * @summary The operation to update the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json - */ -async function restorePointCollectionUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.update( - resourceGroupName, - restorePointCollectionName, - parameters, - ); - console.log(result); -} - -async function main() { - await restorePointCollectionUpdateMaximumSetGen(); - await restorePointCollectionUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointsCreateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/restorePointsCreateSample.js deleted file mode 100644 index a58f7c4af330..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointsCreateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed - * - * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json - */ -async function copyARestorePointToADifferentRegion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const parameters = { - sourceRestorePoint: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginCreateAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed - * - * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Create.json - */ -async function createARestorePoint() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const parameters = { - excludeDisks: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", - }, - ], - instantAccessDurationMinutes: 120, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginCreateAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - ); - console.log(result); -} - -async function main() { - await copyARestorePointToADifferentRegion(); - await createARestorePoint(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/restorePointsDeleteSample.js deleted file mode 100644 index b9652c5258e8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointsDeleteSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete the restore point. - * - * @summary The operation to delete the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json - */ -async function restorePointDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaaaa"; - const restorePointName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the restore point. - * - * @summary The operation to delete the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json - */ -async function restorePointDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; - const restorePointName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -async function main() { - await restorePointDeleteMaximumSetGen(); - await restorePointDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/restorePointsGetSample.js deleted file mode 100644 index a1f1fa4691fa..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointsGetSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get the restore point. - * - * @summary The operation to get the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get.json - */ -async function getARestorePoint() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.get( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the restore point. - * - * @summary The operation to get the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json - */ -async function getRestorePointWithInstanceView() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.get( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -async function main() { - await getARestorePoint(); - await getRestorePointWithInstanceView(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesGetSample.js deleted file mode 100644 index 292599bbecae..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a shared gallery by subscription id or tenant id. - * - * @summary Get a shared gallery by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json - */ -async function getASharedGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sharedGalleries.get(location, galleryUniqueName); - console.log(result); -} - -async function main() { - await getASharedGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsGetSample.js deleted file mode 100644 index 036234ec7f28..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Get a shared gallery image version by subscription id or tenant id. - * - * @summary Get a shared gallery image version by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json - */ -async function getASharedGalleryImageVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "myGalleryImageVersionName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sharedGalleryImageVersions.get( - location, - galleryUniqueName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main() { - await getASharedGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/snapshotsCreateOrUpdateSample.js deleted file mode 100644 index d833f0e0eb0e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsCreateOrUpdateSample.js +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json - */ -async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot1"; - const snapshot = { - creationData: { - createOption: "Import", - sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json - */ -async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot1"; - const snapshot = { - creationData: { - createOption: "Import", - sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json - */ -async function createASnapshotFromAnElasticSanVolumeSnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot = { - creationData: { - createOption: "CopyFromSanSnapshot", - elasticSanResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json - */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot = { - creationData: { - createOption: "CopyStart", - provisionedBandwidthCopySpeed: "Enhanced", - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json - */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot = { - creationData: { - createOption: "CopyStart", - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json - */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot = { - creationData: { - createOption: "Copy", - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_InstantAccessSnapshot.json - */ -async function createASnapshotWhichCanBeInstantlyAccessable() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot = { - creationData: { - createOption: "Copy", - instantAccessDurationMinutes: 120, - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -async function main() { - await createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(); - await createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(); - await createASnapshotFromAnElasticSanVolumeSnapshot(); - await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(); - await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(); - await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(); - await createASnapshotWhichCanBeInstantlyAccessable(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/snapshotsDeleteSample.js deleted file mode 100644 index 26d362bde6fa..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsDeleteSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a snapshot. - * - * @summary Deletes a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Delete.json - */ -async function deleteASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginDeleteAndWait(resourceGroupName, snapshotName); - console.log(result); -} - -async function main() { - await deleteASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGetSample.js deleted file mode 100644 index d871ac7736ee..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGetSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets information about a snapshot. - * - * @summary Gets information about a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Get.json - */ -async function getInformationAboutASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.get(resourceGroupName, snapshotName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets information about a snapshot. - * - * @summary Gets information about a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json - */ -async function getInformationAboutAnIncrementalSnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "myIncrementalSnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.get(resourceGroupName, snapshotName); - console.log(result); -} - -async function main() { - await getInformationAboutASnapshot(); - await getInformationAboutAnIncrementalSnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGrantAccessSample.js b/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGrantAccessSample.js deleted file mode 100644 index 5ea2e7f0d9c5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGrantAccessSample.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Grants access to a snapshot. - * - * @summary Grants access to a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json - */ -async function getASasOnASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const grantAccessData = { - access: "Read", - durationInSeconds: 300, - fileFormat: "VHDX", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginGrantAccessAndWait( - resourceGroupName, - snapshotName, - grantAccessData, - ); - console.log(result); -} - -async function main() { - await getASasOnASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v23/javascript/snapshotsRevokeAccessSample.js deleted file mode 100644 index 6a0aa3153e1c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsRevokeAccessSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Revokes access to a snapshot. - * - * @summary Revokes access to a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_EndGetAccess.json - */ -async function revokeAccessToASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginRevokeAccessAndWait(resourceGroupName, snapshotName); - console.log(result); -} - -async function main() { - await revokeAccessToASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/snapshotsUpdateSample.js deleted file mode 100644 index 5ca008296c6c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsUpdateSample.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Updates (patches) a snapshot. - * - * @summary Updates (patches) a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json - */ -async function updateASnapshotWithAcceleratedNetworking() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot = { - diskSizeGB: 20, - supportedCapabilities: { acceleratedNetwork: false }, - tags: { department: "Development", project: "UpdateSnapshots" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a snapshot. - * - * @summary Updates (patches) a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update.json - */ -async function updateASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot = { - diskSizeGB: 20, - tags: { department: "Development", project: "UpdateSnapshots" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -async function main() { - await updateASnapshotWithAcceleratedNetworking(); - await updateASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysCreateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysCreateSample.js deleted file mode 100644 index d0ae8f6819fc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysCreateSample.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Creates a new SSH public key resource. - * - * @summary Creates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json - */ -async function createANewSshPublicKeyResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters = { - location: "westus", - publicKey: "{ssh-rsa public key}", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.create(resourceGroupName, sshPublicKeyName, parameters); - console.log(result); -} - -async function main() { - await createANewSshPublicKeyResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysDeleteSample.js deleted file mode 100644 index 73165a71676d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysDeleteSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Delete an SSH public key. - * - * @summary Delete an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json - */ -async function sshPublicKeyDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.delete(resourceGroupName, sshPublicKeyName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an SSH public key. - * - * @summary Delete an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json - */ -async function sshPublicKeyDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.delete(resourceGroupName, sshPublicKeyName); - console.log(result); -} - -async function main() { - await sshPublicKeyDeleteMaximumSetGen(); - await sshPublicKeyDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGenerateKeyPairSample.js b/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGenerateKeyPairSample.js deleted file mode 100644 index 9d0605bf5c07..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGenerateKeyPairSample.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json - */ -async function generateAnSshKeyPairWithEd25519Encryption() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters = { - encryptionType: "Ed25519", - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json - */ -async function generateAnSshKeyPairWithRsaEncryption() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters = { - encryptionType: "RSA", - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json - */ -async function generateAnSshKeyPair() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.generateKeyPair(resourceGroupName, sshPublicKeyName); - console.log(result); -} - -async function main() { - await generateAnSshKeyPairWithEd25519Encryption(); - await generateAnSshKeyPairWithRsaEncryption(); - await generateAnSshKeyPair(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGetSample.js deleted file mode 100644 index f8e46c47142d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about an SSH public key. - * - * @summary Retrieves information about an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json - */ -async function getAnSshPublicKey() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.get(resourceGroupName, sshPublicKeyName); - console.log(result); -} - -async function main() { - await getAnSshPublicKey(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysUpdateSample.js deleted file mode 100644 index 1afc61eec725..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysUpdateSample.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Updates a new SSH public key resource. - * - * @summary Updates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json - */ -async function sshPublicKeyUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaaa"; - const parameters = { - publicKey: "{ssh-rsa public key}", - tags: { key2854: "a" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.update(resourceGroupName, sshPublicKeyName, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a new SSH public key resource. - * - * @summary Updates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json - */ -async function sshPublicKeyUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.update(resourceGroupName, sshPublicKeyName, parameters); - console.log(result); -} - -async function main() { - await sshPublicKeyUpdateMaximumSetGen(); - await sshPublicKeyUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesGetSample.js deleted file mode 100644 index 9b62fc23ff73..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesGetSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a virtual machine extension image. - * - * @summary Gets a virtual machine extension image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json - */ -async function virtualMachineExtensionImageGetMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaaaaaaaaaaaaaaaa"; - const version = "aaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.get( - location, - publisherName, - typeParam, - version, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine extension image. - * - * @summary Gets a virtual machine extension image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json - */ -async function virtualMachineExtensionImageGetMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aa"; - const version = "aaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.get( - location, - publisherName, - typeParam, - version, - ); - console.log(result); -} - -async function main() { - await virtualMachineExtensionImageGetMaximumSetGen(); - await virtualMachineExtensionImageGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListTypesSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListTypesSample.js deleted file mode 100644 index 7c1c0c950b15..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListTypesSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image types. - * - * @summary Gets a list of virtual machine extension image types. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json - */ -async function virtualMachineExtensionImageListTypesMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listTypes(location, publisherName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image types. - * - * @summary Gets a list of virtual machine extension image types. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json - */ -async function virtualMachineExtensionImageListTypesMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listTypes(location, publisherName); - console.log(result); -} - -async function main() { - await virtualMachineExtensionImageListTypesMaximumSetGen(); - await virtualMachineExtensionImageListTypesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListVersionsSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListVersionsSample.js deleted file mode 100644 index 0a889e8d2116..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListVersionsSample.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image versions. - * - * @summary Gets a list of virtual machine extension image versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json - */ -async function virtualMachineExtensionImageListVersionsMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaaaaaaaaaaaaaaaa"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 22; - const orderby = "a"; - const options = { - filter, - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listVersions( - location, - publisherName, - typeParam, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image versions. - * - * @summary Gets a list of virtual machine extension image versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json - */ -async function virtualMachineExtensionImageListVersionsMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listVersions( - location, - publisherName, - typeParam, - ); - console.log(result); -} - -async function main() { - await virtualMachineExtensionImageListVersionsMaximumSetGen(); - await virtualMachineExtensionImageListVersionsMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsCreateOrUpdateSample.js deleted file mode 100644 index 2a7e1e551216..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsCreateOrUpdateSample.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create or update the extension. - * - * @summary The operation to create or update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineExtensionCreateOrUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaaaaaaaa"; - const extensionParameters = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "a", - instanceView: { - name: "aaaaaaaaaaaaaaaaa", - type: "aaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - substatuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - }, - location: "westus", - protectedSettings: {}, - publisher: "extPublisher", - settings: {}, - suppressFailures: true, - tags: { key9183: "aa" }, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update the extension. - * - * @summary The operation to create or update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineExtensionCreateOrUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const extensionParameters = { location: "westus" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineExtensionCreateOrUpdateMaximumSetGen(); - await virtualMachineExtensionCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsDeleteSample.js deleted file mode 100644 index fb2473c27ca5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsDeleteSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json - */ -async function virtualMachineExtensionDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginDeleteAndWait( - resourceGroupName, - vmName, - vmExtensionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json - */ -async function virtualMachineExtensionDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginDeleteAndWait( - resourceGroupName, - vmName, - vmExtensionName, - ); - console.log(result); -} - -async function main() { - await virtualMachineExtensionDeleteMaximumSetGen(); - await virtualMachineExtensionDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsGetSample.js deleted file mode 100644 index e5d83b0b6363..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsGetSample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json - */ -async function virtualMachineExtensionGetMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaa"; - const expand = "aaaaaa"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.get( - resourceGroupName, - vmName, - vmExtensionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json - */ -async function virtualMachineExtensionGetMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.get( - resourceGroupName, - vmName, - vmExtensionName, - ); - console.log(result); -} - -async function main() { - await virtualMachineExtensionGetMaximumSetGen(); - await virtualMachineExtensionGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsListSample.js deleted file mode 100644 index 80b1d5522cc5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsListSample.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. - * - * @summary The operation to get all extensions of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json - */ -async function virtualMachineExtensionListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaa"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.list(resourceGroupName, vmName, options); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. - * - * @summary The operation to get all extensions of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json - */ -async function virtualMachineExtensionListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.list(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await virtualMachineExtensionListMaximumSetGen(); - await virtualMachineExtensionListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsUpdateSample.js deleted file mode 100644 index bc240ba2fe90..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsUpdateSample.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update the extension. - * - * @summary The operation to update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json - */ -async function updateVMExtension() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const extensionParameters = { - type: "extType", - autoUpgradeMinorVersion: true, - protectedSettingsFromKeyVault: { - secretUrl: - "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", - sourceVault: { - id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", - }, - }, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - suppressFailures: true, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main() { - await updateVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneGetSample.js deleted file mode 100644 index eb1e30b6c027..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneGetSample.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a virtual machine image in an edge zone. - * - * @summary Gets a virtual machine image in an edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneGetMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.get( - location, - edgeZone, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine image in an edge zone. - * - * @summary Gets a virtual machine image in an edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneGetMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaa"; - const version = "aa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.get( - location, - edgeZone, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -async function main() { - await virtualMachineImagesEdgeZoneGetMaximumSetGen(); - await virtualMachineImagesEdgeZoneGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSample.js deleted file mode 100644 index 3319c3305197..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSample.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 12; - const orderby = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const options = { - expand, - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.list( - location, - edgeZone, - publisherName, - offer, - skus, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.list( - location, - edgeZone, - publisherName, - offer, - skus, - ); - console.log(result); -} - -async function main() { - await virtualMachineImagesEdgeZoneListMaximumSetGen(); - await virtualMachineImagesEdgeZoneListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSkusSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSkusSample.js deleted file mode 100644 index 919f165e9088..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSkusSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaa"; - const edgeZone = "aaaaa"; - const publisherName = "aaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.listSkus( - location, - edgeZone, - publisherName, - offer, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaa"; - const offer = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.listSkus( - location, - edgeZone, - publisherName, - offer, - ); - console.log(result); -} - -async function main() { - await virtualMachineImagesEdgeZoneListSkusMaximumSetGen(); - await virtualMachineImagesEdgeZoneListSkusMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesGetSample.js deleted file mode 100644 index f5359d8d12a9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesGetSample.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a virtual machine image. - * - * @summary Gets a virtual machine image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json - */ -async function virtualMachineImageGetMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaa"; - const publisherName = "aaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.get( - location, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine image. - * - * @summary Gets a virtual machine image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json - */ -async function virtualMachineImageGetMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaa"; - const offer = "aa"; - const skus = "aaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.get( - location, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -async function main() { - await virtualMachineImageGetMaximumSetGen(); - await virtualMachineImageGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListOffersSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListOffersSample.js deleted file mode 100644 index 61a77a0e0b84..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListOffersSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. - * - * @summary Gets a list of virtual machine image offers for the specified location and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json - */ -async function virtualMachineImageListOffersMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaa"; - const publisherName = "aaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listOffers(location, publisherName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. - * - * @summary Gets a list of virtual machine image offers for the specified location and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json - */ -async function virtualMachineImageListOffersMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listOffers(location, publisherName); - console.log(result); -} - -async function main() { - await virtualMachineImageListOffersMaximumSetGen(); - await virtualMachineImageListOffersMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSample.js deleted file mode 100644 index dc4177db02b1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSample.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json - */ -async function virtualMachineImageListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaa"; - const publisherName = "aaaaaa"; - const offer = "aaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 18; - const orderby = "aa"; - const options = { - expand, - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.list( - location, - publisherName, - offer, - skus, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json - */ -async function virtualMachineImageListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaa"; - const publisherName = "aaaaaaaaaaa"; - const offer = "aaaaaaaaaa"; - const skus = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.list(location, publisherName, offer, skus); - console.log(result); -} - -async function main() { - await virtualMachineImageListMaximumSetGen(); - await virtualMachineImageListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSkusSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSkusSample.js deleted file mode 100644 index ecca9549bce9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSkusSample.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json - */ -async function virtualMachineImageListSkusMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listSkus(location, publisherName, offer); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json - */ -async function virtualMachineImageListSkusMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aaaaaaaaaaaaa"; - const offer = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listSkus(location, publisherName, offer); - console.log(result); -} - -async function main() { - await virtualMachineImageListSkusMaximumSetGen(); - await virtualMachineImageListSkusMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListWithPropertiesSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListWithPropertiesSample.js deleted file mode 100644 index 97623edbece2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListWithPropertiesSample.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to - * - * @summary - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json - */ -async function virtualMachineImagesListWithPropertiesMaximumSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; - const publisherName = "MicrosoftWindowsServer"; - const offer = "WindowsServer"; - const skus = "2022-datacenter-azure-edition"; - const expand = "Properties"; - const top = 4; - const orderby = "aa"; - const options = { - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listWithProperties( - location, - publisherName, - offer, - skus, - expand, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to - * - * @summary - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MinimumSet_Gen.json - */ -async function virtualMachineImagesListWithPropertiesMinimumSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; - const publisherName = "MicrosoftWindowsServer"; - const offer = "WindowsServer"; - const skus = "2022-datacenter-azure-edition"; - const expand = "Properties"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listWithProperties( - location, - publisherName, - offer, - skus, - expand, - ); - console.log(result); -} - -async function main() { - await virtualMachineImagesListWithPropertiesMaximumSet(); - await virtualMachineImagesListWithPropertiesMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js deleted file mode 100644 index 4666d7c7aa80..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create or update the run command. - * - * @summary The operation to create or update the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json - */ -async function createOrUpdateARunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const runCommand = { - asyncExecution: false, - errorBlobUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", - location: "West US", - outputBlobManagedIdentity: { - clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a", - }, - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", - }, - timeoutInSeconds: 3600, - treatFailureAsDeploymentFailure: false, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main() { - await createOrUpdateARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsDeleteSample.js deleted file mode 100644 index 5aad98e83b78..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsDeleteSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete the run command. - * - * @summary The operation to delete the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json - */ -async function deleteARunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.beginDeleteAndWait( - resourceGroupName, - vmName, - runCommandName, - ); - console.log(result); -} - -async function main() { - await deleteARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js deleted file mode 100644 index a146f6b1c9d8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get the run command. - * - * @summary The operation to get the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json - */ -async function getARunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.getByVirtualMachine( - resourceGroupName, - vmName, - runCommandName, - ); - console.log(result); -} - -async function main() { - await getARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetSample.js deleted file mode 100644 index c8a02b7e49ff..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets specific run command for a subscription in a location. - * - * @summary Gets specific run command for a subscription in a location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_Get.json - */ -async function virtualMachineRunCommandGet() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; - const location = "SoutheastAsia"; - const commandId = "RunPowerShellScript"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.get(location, commandId); - console.log(result); -} - -async function main() { - await virtualMachineRunCommandGet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsUpdateSample.js deleted file mode 100644 index 9f6783c7f988..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsUpdateSample.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update the run command. - * - * @summary The operation to update the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json - */ -async function updateARunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const runCommand = { - asyncExecution: false, - errorBlobManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - script: "Write-Host Hello World! ; Remove-Item C:\test\testFile.txt", - }, - timeoutInSeconds: 3600, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.beginUpdateAndWait( - resourceGroupName, - vmName, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main() { - await updateARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js deleted file mode 100644 index 37e85490ea19..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create or update an extension. - * - * @summary The operation to create or update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaa"; - const extensionParameters = { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update an extension. - * - * @summary The operation to create or update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaa"; - const extensionParameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen(); - await virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsDeleteSample.js deleted file mode 100644 index 7094d03f4346..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsDeleteSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetExtensionDeleteMaximumSetGen(); - await virtualMachineScaleSetExtensionDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsGetSample.js deleted file mode 100644 index 0f309d7902bc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsGetSample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionGetMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaa"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.get( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionGetMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "a"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.get( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetExtensionGetMaximumSetGen(); - await virtualMachineScaleSetExtensionGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsListSample.js deleted file mode 100644 index 44af47b8b15d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsListSample.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all extensions in a VM scale set. - * - * @summary Gets a list of all extensions in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetExtensions.list( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all extensions in a VM scale set. - * - * @summary Gets a list of all extensions in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetExtensions.list( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await virtualMachineScaleSetExtensionListMaximumSetGen(); - await virtualMachineScaleSetExtensionListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsUpdateSample.js deleted file mode 100644 index a8aa4c6d8df1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsUpdateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update an extension. - * - * @summary The operation to update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaa"; - const extensionParameters = { - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update an extension. - * - * @summary The operation to update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aa"; - const extensionParameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetExtensionUpdateMaximumSetGen(); - await virtualMachineScaleSetExtensionUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js deleted file mode 100644 index f4d73654cf02..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. - * - * @summary Cancels the current virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. - * - * @summary Cancels the current virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen(); - await virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js deleted file mode 100644 index 8a6d8b12dc68..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @summary Gets the status of the latest virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @summary Gets the status of the latest virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen(); - await virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js deleted file mode 100644 index 15e35c555361..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create or update the VMSS VM extension. - * - * @summary The operation to create or update the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json - */ -async function createVirtualMachineScaleSetVMExtension() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const extensionParameters = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main() { - await createVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js deleted file mode 100644 index d40ca353c4d4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete the VMSS VM extension. - * - * @summary The operation to delete the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json - */ -async function deleteVirtualMachineScaleSetVMExtension() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - ); - console.log(result); -} - -async function main() { - await deleteVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsGetSample.js deleted file mode 100644 index 2f8cabc58edd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get the VMSS VM extension. - * - * @summary The operation to get the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json - */ -async function getVirtualMachineScaleSetVMExtension() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMExtensions.get( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - ); - console.log(result); -} - -async function main() { - await getVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js deleted file mode 100644 index 07a2b82c7774..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update the VMSS VM extension. - * - * @summary The operation to update the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json - */ -async function updateVirtualMachineScaleSetVMExtension() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const extensionParameters = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main() { - await updateVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js deleted file mode 100644 index 3507f404a1e9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to create or update the VMSS VM run command. - * - * @summary The operation to create or update the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json - */ -async function createVirtualMachineScaleSetVMRunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const runCommand = { - asyncExecution: false, - errorBlobManagedIdentity: {}, - errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", - location: "West US", - outputBlobManagedIdentity: { - clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a", - }, - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", - scriptUriManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - }, - timeoutInSeconds: 3600, - treatFailureAsDeploymentFailure: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMRunCommands.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main() { - await createVirtualMachineScaleSetVMRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js deleted file mode 100644 index f5fa2d6dc933..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete the VMSS VM run command. - * - * @summary The operation to delete the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json - */ -async function deleteVirtualMachineScaleSetVMRunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMRunCommands.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - ); - console.log(result); -} - -async function main() { - await deleteVirtualMachineScaleSetVMRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js deleted file mode 100644 index 65e28b2ec714..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to get the VMSS VM run command. - * - * @summary The operation to get the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json - */ -async function getVirtualMachineScaleSetVMRunCommands() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMRunCommands.get( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - ); - console.log(result); -} - -async function main() { - await getVirtualMachineScaleSetVMRunCommands(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js deleted file mode 100644 index 7ecdd497f544..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to update the VMSS VM run command. - * - * @summary The operation to update the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json - */ -async function updateVirtualMachineScaleSetVMRunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const runCommand = { - source: { - scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", - scriptUriManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMRunCommands.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main() { - await updateVirtualMachineScaleSetVMRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSApproveRollingUpgradeSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSApproveRollingUpgradeSample.js deleted file mode 100644 index 31b16f00e96d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSApproveRollingUpgradeSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * - * @summary Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json - */ -async function virtualMachineScaleSetVMApproveRollingUpgrade() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "vmssToApproveRollingUpgradeOn"; - const instanceId = "0123"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginApproveRollingUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMApproveRollingUpgrade(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSAttachDetachDataDisksSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSAttachDetachDataDisksSample.js deleted file mode 100644 index 7f4a4f3958f0..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSAttachDetachDataDisksSample.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Attach and detach data disks to/from a virtual machine in a VM scale set. - * - * @summary Attach and detach data disks to/from a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "azure-vmscaleset"; - const instanceId = "0"; - const parameters = { - dataDisksToAttach: [ - { - caching: "ReadOnly", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - lun: 1, - writeAcceleratorEnabled: true, - }, - { - caching: "ReadWrite", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", - lun: 2, - writeAcceleratorEnabled: false, - }, - ], - dataDisksToDetach: [ - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Attach and detach data disks to/from a virtual machine in a VM scale set. - * - * @summary Attach and detach data disks to/from a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "azure-vmscaleset"; - const instanceId = "0"; - const parameters = { - dataDisksToAttach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - }, - ], - dataDisksToDetach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(); - await virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeleteSample.js deleted file mode 100644 index ac08c67cf919..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeleteSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a virtual machine from a VM scale set. - * - * @summary Deletes a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json - */ -async function forceDeleteAVirtualMachineFromAVMScaleSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const forceDeletion = true; - const options = { - forceDeletion, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -async function main() { - await forceDeleteAVirtualMachineFromAVMScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetSample.js deleted file mode 100644 index 53e65e68c344..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetSample.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json - */ -async function getVMScaleSetVMWithResiliencyView() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "1"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json - */ -async function getVMScaleSetVMWithUserData() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json - */ -async function getVMScaleSetVMWithVMSizeProperties() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await getVMScaleSetVMWithResiliencyView(); - await getVMScaleSetVMWithUserData(); - await getVMScaleSetVMWithVMSizeProperties(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSListSample.js deleted file mode 100644 index d7d8749eaeee..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSListSample.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json - */ -async function listVmssVMSWithResilientVmdeletionStatus() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "resourceGroupname"; - const virtualMachineScaleSetName = "vmssName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; - const filter = "aaaaaaaaaaaaaa"; - const select = "aaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaa"; - const options = { - filter, - select, - expand, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const virtualMachineScaleSetName = "aaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await listVmssVMSWithResilientVmdeletionStatus(); - await virtualMachineScaleSetVMListMaximumSetGen(); - await virtualMachineScaleSetVMListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js deleted file mode 100644 index 1c06da4b778c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. - * - * @summary Performs maintenance on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. - * - * @summary Performs maintenance on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaa"; - const instanceId = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(); - await virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPowerOffSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPowerOffSample.js deleted file mode 100644 index 7316c0edb7a2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPowerOffSample.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMPowerOffMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; - const instanceId = "aaaaaaaaa"; - const skipShutdown = true; - const options = { - skipShutdown, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMPowerOffMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMPowerOffMaximumSetGen(); - await virtualMachineScaleSetVMPowerOffMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRedeploySample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRedeploySample.js deleted file mode 100644 index c3279303ff2e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRedeploySample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMRedeployMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMRedeployMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMRedeployMaximumSetGen(); - await virtualMachineScaleSetVMRedeployMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageAllSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageAllSample.js deleted file mode 100644 index 3bf227d2d29b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageAllSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * - * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageAllMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * - * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageAllMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMReimageAllMaximumSetGen(); - await virtualMachineScaleSetVMReimageAllMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageSample.js deleted file mode 100644 index e10e2d5cf7f1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageSample.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmScaleSetVMReimageInput = { - forceUpdateOSDiskForEphemeral: true, - tempDisk: true, - }; - const options = { - vmScaleSetVMReimageInput, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaa"; - const instanceId = "aaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMReimageMaximumSetGen(); - await virtualMachineScaleSetVMReimageMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRestartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRestartSample.js deleted file mode 100644 index f8cb1e2100b0..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRestartSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Restarts a virtual machine in a VM scale set. - * - * @summary Restarts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMRestartMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aa"; - const instanceId = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restarts a virtual machine in a VM scale set. - * - * @summary Restarts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMRestartMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const instanceId = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMRestartMaximumSetGen(); - await virtualMachineScaleSetVMRestartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js deleted file mode 100644 index 9ee6186683f6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @summary The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json - */ -async function retrieveBootDiagnosticsDataOfAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const sasUriExpirationTimeInMinutes = 60; - const options = { sasUriExpirationTimeInMinutes }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -async function main() { - await retrieveBootDiagnosticsDataOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRunCommandSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRunCommandSample.js deleted file mode 100644 index d31a9dd07f15..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRunCommandSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Run command on a virtual machine in a VM scale set. - * - * @summary Run command on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json - */ -async function virtualMachineScaleSetVMSRunCommand() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const instanceId = "0"; - const parameters = { - commandId: "RunPowerShellScript", - script: ["Write-Host Hello World!"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRunCommandAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMSRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js deleted file mode 100644 index 02b8f4245e03..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @summary The operation to simulate the eviction of spot virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json - */ -async function simulateEvictionAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmScaleSetName = "VmScaleSetName"; - const instanceId = "InstanceId"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.simulateEviction( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await simulateEvictionAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSStartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSStartSample.js deleted file mode 100644 index 166b7f44ca02..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSStartSample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Starts a virtual machine in a VM scale set. - * - * @summary Starts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMStartMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Starts a virtual machine in a VM scale set. - * - * @summary Starts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMStartMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMStartMaximumSetGen(); - await virtualMachineScaleSetVMStartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSUpdateSample.js deleted file mode 100644 index 8508bab9fd37..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSUpdateSample.js +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Updates a virtual machine of a VM scale set. - * - * @summary Updates a virtual machine of a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters = { - additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, - availabilitySet: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - diagnosticsProfile: { - bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" }, - }, - hardwareProfile: { - vmSize: "Basic_A0", - vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 }, - }, - instanceView: { - bootDiagnostics: { - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - }, - disks: [ - { - name: "aaaaaaaaaaa", - encryptionSettings: [ - { - diskEncryptionKey: { - secretUrl: "aaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - enabled: true, - keyEncryptionKey: { - keyUrl: "aaaaaaaaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - }, - ], - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - ], - maintenanceRedeployStatus: { - isCustomerInitiatedMaintenanceAllowed: true, - lastOperationMessage: "aaaaaa", - lastOperationResultCode: "None", - maintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), - maintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), - preMaintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), - preMaintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), - }, - placementGroupId: "aaa", - platformFaultDomain: 14, - platformUpdateDomain: 23, - rdpThumbPrint: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - vmAgent: { - extensionHandlers: [ - { - type: "aaaaaaaaaaaaa", - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - typeHandlerVersion: "aaaaa", - }, - ], - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - vmAgentVersion: "aaaaaaaaaaaaaaaaaaaaaaa", - }, - vmHealth: { - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - }, - extensions: [ - { - name: "aaaaaaaaaaaaaaaaa", - type: "aaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - substatuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - }, - ], - }, - licenseType: "aaaaaaaaaa", - location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "aaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { dnsServers: ["aaaaaa"] }, - dscpConfiguration: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - enableAcceleratedNetworking: true, - enableFpga: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "aa", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - applicationSecurityGroups: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 2, - ipTags: [ - { - ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", - tag: "aaaaaaaaaaaaaaaaaaaa", - }, - ], - publicIPAddressVersion: "IPv4", - publicIPAllocationMethod: "Dynamic", - publicIPPrefix: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "Basic", tier: "Regional" }, - }, - subnet: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - ], - networkSecurityGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - primary: true, - }, - ], - networkInterfaces: [ - { - deleteOption: "Delete", - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", - primary: true, - }, - ], - }, - networkProfileConfiguration: { - networkInterfaceConfigurations: [ - { - name: "vmsstestnetconfig5415", - deleteOption: "Delete", - dnsSettings: { dnsServers: [] }, - enableAcceleratedNetworking: true, - enableFpga: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "vmsstestnetconfig9693", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - applicationSecurityGroups: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerInboundNatPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "aaaaaaaaaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 18, - ipTags: [{ ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }], - publicIPAddressVersion: "IPv4", - publicIPPrefix: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "Basic", tier: "Regional" }, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503", - }, - }, - ], - networkSecurityGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "aaaaaaaaaaaaaaaa", - adminUsername: "Foo12", - allowExtensionOperations: true, - computerName: "test000000", - customData: "aaaa", - linuxConfiguration: { - disablePasswordAuthentication: true, - patchSettings: { - assessmentMode: "ImageDefault", - patchMode: "ImageDefault", - }, - provisionVMAgent: true, - ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] }, - }, - requireGuestProvisionSignal: true, - secrets: [], - windowsConfiguration: { - additionalUnattendContent: [ - { - componentName: "Microsoft-Windows-Shell-Setup", - content: "aaaaaaaaaaaaaaaaaaaa", - passName: "OobeSystem", - settingName: "AutoLogon", - }, - ], - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "ImageDefault", - enableHotpatching: true, - patchMode: "Manual", - }, - provisionVMAgent: true, - timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - winRM: { - listeners: [{ certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }], - }, - }, - }, - plan: { - name: "aaaaaaaaaa", - product: "aaaaaaaaaaaaaaaaaaaa", - promotionCode: "aaaaaaaaaaaaaaaaaaaa", - publisher: "aaaaaaaaaaaaaaaaaaaaaa", - }, - protectionPolicy: { - protectFromScaleIn: true, - protectFromScaleSetActions: true, - }, - securityProfile: { - encryptionAtHost: true, - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - sku: { name: "Classic", capacity: 29, tier: "aaaaaaaaaaaaaa" }, - storageProfile: { - dataDisks: [ - { - name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - caching: "None", - createOption: "Empty", - deleteOption: "Delete", - detachOption: "ForceDetach", - diskSizeGB: 128, - image: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - lun: 1, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - storageAccountType: "Standard_LRS", - }, - toBeDetached: true, - vhd: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - writeAcceleratorEnabled: true, - }, - ], - imageReference: { - id: "a", - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", - sku: "2012-R2-Datacenter", - version: "4.127.20180315", - }, - osDisk: { - name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", - caching: "None", - createOption: "FromImage", - deleteOption: "Delete", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - diskSizeGB: 127, - encryptionSettings: { - diskEncryptionKey: { - secretUrl: "aaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - enabled: true, - keyEncryptionKey: { - keyUrl: "aaaaaaaaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - }, - image: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", - storageAccountType: "Standard_LRS", - }, - osType: "Windows", - vhd: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - writeAcceleratorEnabled: true, - }, - }, - tags: {}, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a virtual machine of a VM scale set. - * - * @summary Updates a virtual machine of a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaa"; - const parameters = { location: "westus" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetVMUpdateMaximumSetGen(); - await virtualMachineScaleSetVMUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js deleted file mode 100644 index a218a43d6f6b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * - * @summary Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json - */ -async function virtualMachineScaleSetApproveRollingUpgrade() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "vmssToApproveRollingUpgradeOn"; - const vmInstanceIDs = { - instanceIds: ["0", "1", "2"], - }; - const options = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginApproveRollingUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetApproveRollingUpgrade(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js deleted file mode 100644 index 1bdd9ca600cb..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters = { - activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const parameters = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.convertToSinglePlacementGroup( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen(); - await virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js deleted file mode 100644 index 4d0ab14bae1b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js +++ /dev/null @@ -1,3802 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json - */ -async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json - */ -async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - protectedSettingsFromKeyVault: { - secretUrl: - "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", - sourceVault: { - id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", - }, - }, - publisher: "{extension-Publisher}", - settings: {}, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json - */ -async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json - */ -async function createAPlatformImageScaleSetWithUnmanagedOSDisks() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - vhdContainers: [ - "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer", - ], - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json - */ -async function createAScaleSetFromACustomImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json - */ -async function createAScaleSetFromAGeneralizedSharedImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json - */ -async function createAScaleSetFromASpecializedSharedImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json - */ -async function createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{nicConfig1-name}", - disableTcpStateTracking: true, - enableAcceleratedNetworking: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - { - name: "{nicConfig2-name}", - disableTcpStateTracking: false, - enableAcceleratedNetworking: false, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{nicConfig2-name}", - primary: true, - privateIPAddressVersion: "IPv4", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json - */ -async function createAScaleSetWithApplicationProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - applicationProfile: { - galleryApplications: [ - { - configurationReference: - "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", - enableAutomaticUpgrade: false, - order: 1, - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", - tags: "myTag1", - treatFailureAsDeploymentFailure: true, - }, - { - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticZoneRebalancingPolicy.json - */ -async function createAScaleSetWithAutomaticZoneRebalancingEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: false, - resiliencyPolicy: { - automaticZoneRebalancingPolicy: { - enabled: true, - rebalanceBehavior: "CreateBeforeDelete", - rebalanceStrategy: "Recreate", - }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json - */ -async function createAScaleSetWithDiskControllerType() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - hardwareProfile: { - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - diskControllerType: "NVMe", - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json - */ -async function createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { - caching: "ReadWrite", - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - ], - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json - */ -async function createAScaleSetWithFpgaNetworkInterfaces() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - { - name: "{fpgaNic-Name}", - enableAcceleratedNetworking: false, - enableFpga: true, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{fpgaNic-Name}", - primary: true, - privateIPAddressVersion: "IPv4", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json - */ -async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { encryptionAtHost: true }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxInstancePercentPerZonePolicy.json - */ -async function createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: false, - resiliencyPolicy: { - zoneAllocationPolicy: { - maxInstancePercentPerZonePolicy: { enabled: true, value: 50 }, - }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json - */ -async function createAScaleSetWithNetworkInterfacesWithPublicIPAddressDnsSettings() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{nicConfig1-name}", - auxiliaryMode: "AcceleratedConnections", - auxiliarySku: "A1", - disableTcpStateTracking: true, - enableAcceleratedNetworking: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - tags: { nicTag: "tag" }, - }, - { - name: "{nicConfig2-name}", - disableTcpStateTracking: false, - enableAcceleratedNetworking: false, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{nicConfig2-name}", - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "publicip", - dnsSettings: { - domainNameLabel: "vmsstestlabel01", - domainNameLabelScope: "NoReuse", - }, - idleTimeoutInMinutes: 10, - tags: { pipTag: "tag" }, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json - */ -async function createAScaleSetWithOSImageScheduledEventsEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - scheduledEventsProfile: { - osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json - */ -async function createAScaleSetWithProxyAgentSettingsOfEnabledAndMode() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - proxyAgentSettings: { - addProxyAgentExtension: true, - enabled: true, - imds: { - inVMAccessControlProfileReferenceId: - "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", - }, - wireServer: { - inVMAccessControlProfileReferenceId: - "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", - }, - }, - }, - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-jammy", - publisher: "Canonical", - sku: "22_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json - */ -async function createAScaleSetWithResilientVMCreationEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: false, - resiliencyPolicy: { resilientVMCreationPolicy: { enabled: true } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json - */ -async function createAScaleSetWithResilientVMDeletionEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: false, - resiliencyPolicy: { resilientVMDeletionPolicy: { enabled: true } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json - */ -async function createAScaleSetWithSecurityPostureReference() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "eastus2euap", - overprovision: true, - sku: { name: "Standard_A1", capacity: 3, tier: "Standard" }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "Automatic", - }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityPostureReference: { - id: "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2022-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json - */ -async function createAScaleSetWithSecurityTypeAsConfidentialVM() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DC2as_v5", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2019-datacenter-cvm", - publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, - storageAccountType: "StandardSSD_LRS", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json - */ -async function createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTpmSecurityEncryptionType() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DC2es_v5", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2022-datacenter-cvm", - publisher: "UbuntuServer", - sku: "linux-cvm", - version: "17763.2183.2109130127", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "NonPersistedTPM" }, - storageAccountType: "StandardSSD_LRS", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json - */ -async function createAScaleSetWithServiceArtifactReference() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "eastus2euap", - overprovision: true, - sku: { name: "Standard_A1", capacity: 3, tier: "Standard" }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "Automatic", - }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - serviceArtifactReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2022-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json - */ -async function createAScaleSetWithUefiSettingsOfSecureBootAndVTpm() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "windowsserver-gen2preview-preview", - publisher: "MicrosoftWindowsServer", - sku: "windows10-tvm", - version: "18363.592.2001092016", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json - */ -async function createAScaleSetWithAMarketplaceImagePlan() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json - */ -async function createAScaleSetWithAnAzureApplicationGateway() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}", - }, - ], - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json - */ -async function createAScaleSetWithAnAzureLoadBalancer() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}", - }, - ], - loadBalancerInboundNatPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}", - }, - ], - publicIPAddressConfiguration: { - name: "{vmss-name}", - publicIPAddressVersion: "IPv4", - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json - */ -async function createAScaleSetWithAutomaticRepairsEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json - */ -async function createAScaleSetWithBootDiagnostics() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json - */ -async function createAScaleSetWithEmptyDataDisksOnEachVM() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - diskSizeGB: 512, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json - */ -async function createAScaleSetWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json - */ -async function createAScaleSetWithEphemeralOSDisksUsingPlacementProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json - */ -async function createAScaleSetWithEphemeralOSDisks() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local" }, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json - */ -async function createAScaleSetWithExtensionTimeBudget() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensionsTimeBudget: "PT1H20M", - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - publisher: "{extension-Publisher}", - settings: {}, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json - */ -async function createAScaleSetWithManagedBootDiagnostics() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { bootDiagnostics: { enabled: true } }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json - */ -async function createAScaleSetWithPasswordAuthentication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPlacement.json - */ -async function createAScaleSetWithPlacementPolicyAuto() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: false, - placement: { includeZones: ["1", "3"], zonePlacementPolicy: "Auto" }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json - */ -async function createAScaleSetWithPremiumStorage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json - */ -async function createAScaleSetWithPriorityMixPolicy() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - orchestrationMode: "Flexible", - platformFaultDomainCount: 1, - priorityMixPolicy: { - baseRegularPriorityCount: 10, - regularPriorityPercentageAboveBase: 50, - }, - sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, - virtualMachineProfile: { - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableAcceleratedNetworking: false, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [], - loadBalancerBackendAddressPools: [], - primary: true, - publicIPAddressConfiguration: { - name: "{vmss-name}", - idleTimeoutInMinutes: 15, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json - */ -async function createAScaleSetWithScaleInPolicy() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - scaleInPolicy: { - forceDeletion: true, - prioritizeUnhealthyVMs: true, - rules: ["OldestVM"], - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json - */ -async function createAScaleSetWithSkuProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - orchestrationMode: "Flexible", - priorityMixPolicy: { - baseRegularPriorityCount: 4, - regularPriorityPercentageAboveBase: 50, - }, - singlePlacementGroup: false, - sku: { name: "Mix", capacity: 10 }, - skuProfile: { - allocationStrategy: "CapacityOptimized", - vmSizes: [ - { name: "Standard_D8s_v5" }, - { name: "Standard_E16s_v5" }, - { name: "Standard_D2s_v5" }, - ], - }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile_Prioritized.json - */ -async function createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - orchestrationMode: "Flexible", - priorityMixPolicy: { - baseRegularPriorityCount: 4, - regularPriorityPercentageAboveBase: 50, - }, - singlePlacementGroup: false, - sku: { name: "Mix", capacity: 10 }, - skuProfile: { - allocationStrategy: "Prioritized", - vmSizes: [ - { name: "Standard_D8s_v5", rank: 0 }, - { name: "Standard_E16s_v5", rank: 1 }, - { name: "Standard_D2s_v5", rank: 2 }, - ], - }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json - */ -async function createAScaleSetWithSpotRestorePolicy() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, - spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json - */ -async function createAScaleSetWithSshAuthentication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - linuxConfiguration: { - disablePasswordAuthentication: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json - */ -async function createAScaleSetWithTerminateScheduledEventsEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - scheduledEventsProfile: { - terminateNotificationProfile: { - enable: true, - notBeforeTimeout: "PT5M", - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json - */ -async function createAScaleSetWithUserData() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json - */ -async function createAScaleSetWithVirtualMachinesInDifferentZones() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "centralus", - overprovision: true, - sku: { name: "Standard_A1_v2", capacity: 2, tier: "Standard" }, - upgradePolicy: { mode: "Automatic" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - diskSizeGB: 512, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - zones: ["1", "3"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json - */ -async function createAScaleSetWithVMSizeProperties() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - hardwareProfile: { - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json - */ -async function createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { enable: true }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - zonalPlatformFaultDomainAlignMode: "Aligned", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithHighSpeedInterconnectPlacement.json - */ -async function createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - highSpeedInterconnectPlacement: "None", - location: "westus", - orchestrationMode: "Flexible", - platformFaultDomainCount: 1, - sku: { name: "Standard_D1_v2", capacity: 2, tier: "Standard" }, - virtualMachineProfile: { - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableAcceleratedNetworking: false, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [], - loadBalancerBackendAddressPools: [], - primary: true, - publicIPAddressConfiguration: { - name: "{vmss-name}", - idleTimeoutInMinutes: 15, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxZoneCount.json - */ -async function createAZonesAutoScaleSetWithMaxZoneCount() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: false, - placement: { zonePlacementPolicy: "Auto" }, - resiliencyPolicy: { zoneAllocationPolicy: { maxZoneCount: 2 } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json - */ -async function createOrUpdateAScaleSetWithCapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - capacityReservation: { - capacityReservationGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", - }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main() { - await createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(); - await createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(); - await createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage(); - await createAPlatformImageScaleSetWithUnmanagedOSDisks(); - await createAScaleSetFromACustomImage(); - await createAScaleSetFromAGeneralizedSharedImage(); - await createAScaleSetFromASpecializedSharedImage(); - await createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(); - await createAScaleSetWithApplicationProfile(); - await createAScaleSetWithAutomaticZoneRebalancingEnabled(); - await createAScaleSetWithDiskControllerType(); - await createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk(); - await createAScaleSetWithFpgaNetworkInterfaces(); - await createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(); - await createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(); - await createAScaleSetWithNetworkInterfacesWithPublicIPAddressDnsSettings(); - await createAScaleSetWithOSImageScheduledEventsEnabled(); - await createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(); - await createAScaleSetWithResilientVMCreationEnabled(); - await createAScaleSetWithResilientVMDeletionEnabled(); - await createAScaleSetWithSecurityPostureReference(); - await createAScaleSetWithSecurityTypeAsConfidentialVM(); - await createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTpmSecurityEncryptionType(); - await createAScaleSetWithServiceArtifactReference(); - await createAScaleSetWithUefiSettingsOfSecureBootAndVTpm(); - await createAScaleSetWithAMarketplaceImagePlan(); - await createAScaleSetWithAnAzureApplicationGateway(); - await createAScaleSetWithAnAzureLoadBalancer(); - await createAScaleSetWithAutomaticRepairsEnabled(); - await createAScaleSetWithBootDiagnostics(); - await createAScaleSetWithEmptyDataDisksOnEachVM(); - await createAScaleSetWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(); - await createAScaleSetWithEphemeralOSDisksUsingPlacementProperty(); - await createAScaleSetWithEphemeralOSDisks(); - await createAScaleSetWithExtensionTimeBudget(); - await createAScaleSetWithManagedBootDiagnostics(); - await createAScaleSetWithPasswordAuthentication(); - await createAScaleSetWithPlacementPolicyAuto(); - await createAScaleSetWithPremiumStorage(); - await createAScaleSetWithPriorityMixPolicy(); - await createAScaleSetWithScaleInPolicy(); - await createAScaleSetWithSkuProfile(); - await createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(); - await createAScaleSetWithSpotRestorePolicy(); - await createAScaleSetWithSshAuthentication(); - await createAScaleSetWithTerminateScheduledEventsEnabled(); - await createAScaleSetWithUserData(); - await createAScaleSetWithVirtualMachinesInDifferentZones(); - await createAScaleSetWithVMSizeProperties(); - await createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(); - await createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(); - await createAZonesAutoScaleSetWithMaxZoneCount(); - await createOrUpdateAScaleSetWithCapacityReservation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeallocateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeallocateSample.js deleted file mode 100644 index b0ed403cd927..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeallocateSample.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetDeallocateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const hibernate = true; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options = { - hibernate, - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetDeallocateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetDeallocateMaximumSetGen(); - await virtualMachineScaleSetDeallocateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteInstancesSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteInstancesSample.js deleted file mode 100644 index b8e011bef67d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteInstancesSample.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes virtual machines in a VM scale set. - * - * @summary Deletes virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetDeleteInstancesMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; - const forceDeletion = true; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const options = { - forceDeletion, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes virtual machines in a VM scale set. - * - * @summary Deletes virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetDeleteInstancesMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetDeleteInstancesMaximumSetGen(); - await virtualMachineScaleSetDeleteInstancesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteSample.js deleted file mode 100644 index 20132af80f99..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a VM scale set. - * - * @summary Deletes a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json - */ -async function forceDeleteAVMScaleSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const forceDeletion = true; - const options = { - forceDeletion, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -async function main() { - await forceDeleteAVMScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetInstanceViewSample.js deleted file mode 100644 index 05c2fcaf6e3c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetInstanceViewSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the status of a VM scale set instance. - * - * @summary Gets the status of a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetGetInstanceViewMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.getInstanceView( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the status of a VM scale set instance. - * - * @summary Gets the status of a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetGetInstanceViewMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.getInstanceView( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetGetInstanceViewMaximumSetGen(); - await virtualMachineScaleSetGetInstanceViewMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js deleted file mode 100644 index 1040168ab3f6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. - * - * @summary Gets list of OS upgrades on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listOSUpgradeHistory( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. - * - * @summary Gets list of OS upgrades on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listOSUpgradeHistory( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen(); - await virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetSample.js deleted file mode 100644 index 8d63c185937c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetSample.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json - */ -async function getVMScaleSetVMWithDiskControllerType() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const expand = "userData"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json - */ -async function getAVirtualMachineScaleSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get(resourceGroupName, vmScaleSetName); - console.log(result); -} - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json - */ -async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get(resourceGroupName, vmScaleSetName); - console.log(result); -} - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json - */ -async function getAVirtualMachineScaleSetWithUserData() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const expand = "userData"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -async function main() { - await getVMScaleSetVMWithDiskControllerType(); - await getAVirtualMachineScaleSet(); - await getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(); - await getAVirtualMachineScaleSetWithUserData(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSample.js deleted file mode 100644 index 34884c650632..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSample.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. - * - * @summary Gets a list of all VM scale sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. - * - * @summary Gets a list of all VM scale sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await virtualMachineScaleSetListMaximumSetGen(); - await virtualMachineScaleSetListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPowerOffSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPowerOffSample.js deleted file mode 100644 index 47e44f9d45b9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPowerOffSample.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetPowerOffMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; - const skipShutdown = true; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options = { - skipShutdown, - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetPowerOffMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetPowerOffMaximumSetGen(); - await virtualMachineScaleSetPowerOffMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReapplySample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReapplySample.js deleted file mode 100644 index ccbfafadbe5c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReapplySample.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * - * @summary Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetsReapplyMaximumSetGen() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "b4f1213b-cacc-4816-8bfb-f30f90643de8"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "VirtualMachineScaleSetReapplyTestRG"; - const vmScaleSetName = "VMSSReapply-Test-ScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReapplyAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * - * @summary Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetsReapplyMinimumSetGen() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "b4f1213b-cacc-4816-8bfb-f30f90643de8"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "VirtualMachineScaleSetReapplyTestRG"; - const vmScaleSetName = "VMSSReapply-Test-ScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReapplyAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetsReapplyMaximumSetGen(); - await virtualMachineScaleSetsReapplyMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRedeploySample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRedeploySample.js deleted file mode 100644 index 14b5fd8315ae..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRedeploySample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * - * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRedeployMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * - * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRedeployMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetRedeployMaximumSetGen(); - await virtualMachineScaleSetRedeployMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageAllSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageAllSample.js deleted file mode 100644 index 612535d9e363..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageAllSample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * - * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetReimageAllMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * - * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetReimageAllMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetReimageAllMaximumSetGen(); - await virtualMachineScaleSetReimageAllMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageSample.js deleted file mode 100644 index 31e48c23b601..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageSample.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * - * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetReimageMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmScaleSetReimageInput = { - forceUpdateOSDiskForEphemeral: true, - instanceIds: ["aaaaaaaaaa"], - tempDisk: true, - }; - const options = { - vmScaleSetReimageInput, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * - * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetReimageMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetReimageMaximumSetGen(); - await virtualMachineScaleSetReimageMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRestartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRestartSample.js deleted file mode 100644 index 27872e7ebe1b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRestartSample.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. - * - * @summary Restarts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRestartMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. - * - * @summary Restarts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRestartMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetRestartMaximumSetGen(); - await virtualMachineScaleSetRestartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsScaleOutSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsScaleOutSample.js deleted file mode 100644 index 8e337325b1cc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsScaleOutSample.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Scales out one or more virtual machines in a VM scale set. - * - * @summary Scales out one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json - */ -async function virtualMachineScaleSetScaleOut() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters = { - capacity: 5, - properties: { zone: "1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginScaleOutAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetScaleOut(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js deleted file mode 100644 index db778fe77518..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Changes ServiceState property for a given service - * - * @summary Changes ServiceState property for a given service - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetOrchestrationServiceStateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const parameters = { - action: "Resume", - serviceName: "AutomaticRepairs", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Changes ServiceState property for a given service - * - * @summary Changes ServiceState property for a given service - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetOrchestrationServiceStateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters = { - action: "Resume", - serviceName: "AutomaticRepairs", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetOrchestrationServiceStateMaximumSetGen(); - await virtualMachineScaleSetOrchestrationServiceStateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsStartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsStartSample.js deleted file mode 100644 index b426f18e3530..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsStartSample.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. - * - * @summary Starts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetStartMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options = { vmInstanceIDs }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. - * - * @summary Starts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetStartMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetStartMaximumSetGen(); - await virtualMachineScaleSetStartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateInstancesSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateInstancesSample.js deleted file mode 100644 index 846a8760aac2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateInstancesSample.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetUpdateInstancesMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetUpdateInstancesMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); -} - -async function main() { - await virtualMachineScaleSetUpdateInstancesMaximumSetGen(); - await virtualMachineScaleSetUpdateInstancesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAssessPatchesSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAssessPatchesSample.js deleted file mode 100644 index 3665077bcf07..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAssessPatchesSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Assess patches on the VM. - * - * @summary Assess patches on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json - */ -async function assessPatchStateOfAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const vmName = "myVMName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAssessPatchesAndWait(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await assessPatchStateOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAttachDetachDataDisksSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAttachDetachDataDisksSample.js deleted file mode 100644 index 0e57d06774c9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAttachDetachDataDisksSample.js +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Attach and detach data disks to/from the virtual machine. - * - * @summary Attach and detach data disks to/from the virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json - */ -async function virtualMachineAttachDetachDataDisksMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters = { - dataDisksToAttach: [ - { - caching: "ReadOnly", - deleteOption: "Delete", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - lun: 1, - writeAcceleratorEnabled: true, - }, - { - caching: "ReadWrite", - deleteOption: "Detach", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", - lun: 2, - writeAcceleratorEnabled: false, - }, - ], - dataDisksToDetach: [ - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Attach and detach data disks to/from the virtual machine. - * - * @summary Attach and detach data disks to/from the virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json - */ -async function virtualMachineAttachDetachDataDisksMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "azure-vm"; - const parameters = { - dataDisksToAttach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - }, - ], - dataDisksToDetach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineAttachDetachDataDisksMaximumSetGen(); - await virtualMachineAttachDetachDataDisksMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCaptureSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCaptureSample.js deleted file mode 100644 index c41a49668c63..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCaptureSample.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * - * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json - */ -async function virtualMachineCaptureMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters = { - destinationContainerName: "aaaaaaa", - overwriteVhds: true, - vhdPrefix: "aaaaaaaaa", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCaptureAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * - * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json - */ -async function virtualMachineCaptureMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const parameters = { - destinationContainerName: "aaaaaaa", - overwriteVhds: true, - vhdPrefix: "aaaaaaaaa", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCaptureAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineCaptureMaximumSetGen(); - await virtualMachineCaptureMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesConvertToManagedDisksSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesConvertToManagedDisksSample.js deleted file mode 100644 index 5ac3301ca118..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesConvertToManagedDisksSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * - * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json - */ -async function virtualMachineConvertToManagedDisksMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * - * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json - */ -async function virtualMachineConvertToManagedDisksMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main() { - await virtualMachineConvertToManagedDisksMaximumSetGen(); - await virtualMachineConvertToManagedDisksMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeallocateSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeallocateSample.js deleted file mode 100644 index b45e6948fa12..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeallocateSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * - * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json - */ -async function virtualMachineDeallocateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaa"; - const hibernate = true; - const options = { hibernate }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeallocateAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * - * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json - */ -async function virtualMachineDeallocateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeallocateAndWait(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await virtualMachineDeallocateMaximumSetGen(); - await virtualMachineDeallocateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeleteSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeleteSample.js deleted file mode 100644 index 3df9133a0263..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeleteSample.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to delete a virtual machine. - * - * @summary The operation to delete a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json - */ -async function forceDeleteAVM() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const forceDeletion = true; - const options = { forceDeletion }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeleteAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -async function main() { - await forceDeleteAVM(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGetSample.js deleted file mode 100644 index 7156bfdead96..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGetSample.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get.json - */ -async function getAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const expand = "userData"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName, options); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json - */ -async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json - */ -async function getAVirtualMachineWithDiskControllerTypeProperties() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const expand = "userData"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName, options); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json - */ -async function getAVirtualMachineWithVMSizeProperties() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await getAVirtualMachine(); - await getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); - await getAVirtualMachineWithDiskControllerTypeProperties(); - await getAVirtualMachineWithVMSizeProperties(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstanceViewSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstanceViewSample.js deleted file mode 100644 index eb86121cc2ef..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstanceViewSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. - * - * @summary Retrieves information about the run-time state of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json - */ -async function getVirtualMachineInstanceView() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.instanceView(resourceGroupName, vmName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. - * - * @summary Retrieves information about the run-time state of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json - */ -async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.instanceView(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await getVirtualMachineInstanceView(); - await getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesMigrateToVMScaleSetSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesMigrateToVMScaleSetSample.js deleted file mode 100644 index a135959fefdc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesMigrateToVMScaleSetSample.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * - * @summary Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json - */ -async function migrateAVirtualMachineToFlexibleVirtualMachineScaleSer() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters = { - targetFaultDomain: 0, - targetVMSize: "Standard_D1_v2", - }; - const options = { - parameters, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginMigrateToVMScaleSetAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -async function main() { - await migrateAVirtualMachineToFlexibleVirtualMachineScaleSer(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPerformMaintenanceSample.js deleted file mode 100644 index 509f0bef4644..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPerformMaintenanceSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to perform maintenance on a virtual machine. - * - * @summary The operation to perform maintenance on a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json - */ -async function virtualMachinePerformMaintenanceMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPerformMaintenanceAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to perform maintenance on a virtual machine. - * - * @summary The operation to perform maintenance on a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json - */ -async function virtualMachinePerformMaintenanceMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPerformMaintenanceAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main() { - await virtualMachinePerformMaintenanceMaximumSetGen(); - await virtualMachinePerformMaintenanceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPowerOffSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPowerOffSample.js deleted file mode 100644 index 89454f7b0327..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPowerOffSample.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * - * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json - */ -async function virtualMachinePowerOffMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skipShutdown = true; - const options = { skipShutdown }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPowerOffAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * - * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json - */ -async function virtualMachinePowerOffMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPowerOffAndWait(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await virtualMachinePowerOffMaximumSetGen(); - await virtualMachinePowerOffMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReapplySample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReapplySample.js deleted file mode 100644 index e8ca0c873850..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReapplySample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to reapply a virtual machine's state. - * - * @summary The operation to reapply a virtual machine's state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json - */ -async function reapplyTheStateOfAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReapplyAndWait(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await reapplyTheStateOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRedeploySample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRedeploySample.js deleted file mode 100644 index 79723e4d9865..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRedeploySample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json - */ -async function virtualMachineRedeployMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRedeployAndWait(resourceGroupName, vmName); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json - */ -async function virtualMachineRedeployMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRedeployAndWait(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await virtualMachineRedeployMaximumSetGen(); - await virtualMachineRedeployMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRestartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRestartSample.js deleted file mode 100644 index dc5850c9af44..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRestartSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to restart a virtual machine. - * - * @summary The operation to restart a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json - */ -async function virtualMachineRestartMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRestartAndWait(resourceGroupName, vmName); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to restart a virtual machine. - * - * @summary The operation to restart a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json - */ -async function virtualMachineRestartMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRestartAndWait(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await virtualMachineRestartMaximumSetGen(); - await virtualMachineRestartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRunCommandSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRunCommandSample.js deleted file mode 100644 index 1e9891060d48..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRunCommandSample.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Run command on the VM. - * - * @summary Run command on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand.json - */ -async function virtualMachineRunCommand() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "crptestar98131"; - const vmName = "vm3036"; - const parameters = { commandId: "RunPowerShellScript" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRunCommandAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -async function main() { - await virtualMachineRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesSimulateEvictionSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesSimulateEvictionSample.js deleted file mode 100644 index a2dc5afdf4ae..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesSimulateEvictionSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine. - * - * @summary The operation to simulate the eviction of spot virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json - */ -async function simulateEvictionAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.simulateEviction(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await simulateEvictionAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesStartSample.js b/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesStartSample.js deleted file mode 100644 index 9c10edc467cc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesStartSample.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to The operation to start a virtual machine. - * - * @summary The operation to start a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json - */ -async function virtualMachineStartMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginStartAndWait(resourceGroupName, vmName); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to start a virtual machine. - * - * @summary The operation to start a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json - */ -async function virtualMachineStartMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginStartAndWait(resourceGroupName, vmName); - console.log(result); -} - -async function main() { - await virtualMachineStartMaximumSetGen(); - await virtualMachineStartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts deleted file mode 100644 index e5f83c32a932..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Cancel the migration operation on an Availability Set. - * - * @summary Cancel the migration operation on an Availability Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json - */ -async function availabilitySetCancelMigrationToVirtualMachineScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.cancelMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - ); - console.log(result); -} - -async function main(): Promise { - await availabilitySetCancelMigrationToVirtualMachineScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts deleted file mode 100644 index 049bd23835ee..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - ConvertToVirtualMachineScaleSetInput, - AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. - * - * @summary Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json - */ -async function availabilitySetConvertToVirtualMachineScaleSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: ConvertToVirtualMachineScaleSetInput = { - virtualMachineScaleSetName: "{vmss-name}", - }; - const options: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams = - { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.beginConvertToVirtualMachineScaleSetAndWait( - resourceGroupName, - availabilitySetName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await availabilitySetConvertToVirtualMachineScaleSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCreateOrUpdateSample.ts deleted file mode 100644 index 3b8ea81e8d56..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCreateOrUpdateSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { AvailabilitySet} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update an availability set. - * - * @summary Create or update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json - */ -async function createAnAvailabilitySetWithScheduledEventPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: AvailabilitySet = { - location: "westus", - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.createOrUpdate( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an availability set. - * - * @summary Create or update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create.json - */ -async function createAnAvailabilitySet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: AvailabilitySet = { - location: "westus", - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.createOrUpdate( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createAnAvailabilitySetWithScheduledEventPolicy(); - await createAnAvailabilitySet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsDeleteSample.ts deleted file mode 100644 index 01ea82836020..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsDeleteSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an availability set. - * - * @summary Delete an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json - */ -async function availabilitySetDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.delete( - resourceGroupName, - availabilitySetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an availability set. - * - * @summary Delete an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json - */ -async function availabilitySetDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.delete( - resourceGroupName, - availabilitySetName, - ); - console.log(result); -} - -async function main(): Promise { - await availabilitySetDeleteMaximumSetGen(); - await availabilitySetDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsGetSample.ts deleted file mode 100644 index 1404f5116783..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsGetSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about an availability set. - * - * @summary Retrieves information about an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json - */ -async function availabilitySetGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about an availability set. - * - * @summary Retrieves information about an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json - */ -async function availabilitySetGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.get( - resourceGroupName, - availabilitySetName, - ); - console.log(result); -} - -async function main(): Promise { - await availabilitySetGetMaximumSetGen(); - await availabilitySetGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListBySubscriptionSample.ts deleted file mode 100644 index 2b511063e7cc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListBySubscriptionSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - AvailabilitySetsListBySubscriptionOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all availability sets in a subscription. - * - * @summary Lists all availability sets in a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json - */ -async function listAvailabilitySetsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const expand = "virtualMachines\\$ref"; - const options: AvailabilitySetsListBySubscriptionOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.availabilitySets.listBySubscription( - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listAvailabilitySetsInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListSample.ts deleted file mode 100644 index dc42b0b89f8e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all availability sets in a resource group. - * - * @summary Lists all availability sets in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json - */ -async function availabilitySetListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.availabilitySets.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all availability sets in a resource group. - * - * @summary Lists all availability sets in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json - */ -async function availabilitySetListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.availabilitySets.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await availabilitySetListMaximumSetGen(); - await availabilitySetListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts deleted file mode 100644 index f1b2cac41bf2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - MigrateToVirtualMachineScaleSetInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. - * - * @summary Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json - */ -async function availabilitySetStartMigrationToVirtualMachineScaleSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: MigrateToVirtualMachineScaleSetInput = { - virtualMachineScaleSetFlexible: { - id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.startMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await availabilitySetStartMigrationToVirtualMachineScaleSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsUpdateSample.ts deleted file mode 100644 index d1b38fe81f96..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - AvailabilitySetUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an availability set. - * - * @summary Update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json - */ -async function availabilitySetUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaa"; - const parameters: AvailabilitySetUpdate = { - platformFaultDomainCount: 2, - platformUpdateDomainCount: 20, - proximityPlacementGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, - tags: { key2574: "aaaaaaaa" }, - virtualMachines: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.update( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an availability set. - * - * @summary Update an availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json - */ -async function availabilitySetUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: AvailabilitySetUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.availabilitySets.update( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await availabilitySetUpdateMaximumSetGen(); - await availabilitySetUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts deleted file mode 100644 index d685ac2e7c4d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - MigrateToVirtualMachineScaleSetInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. - * - * @summary Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json - */ -async function availabilitySetValidateMigrationToVirtualMachineScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "myAvailabilitySet"; - const parameters: MigrateToVirtualMachineScaleSetInput = { - virtualMachineScaleSetFlexible: { - id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.availabilitySets.validateMigrationToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await availabilitySetValidateMigrationToVirtualMachineScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts deleted file mode 100644 index f52fa73aa4c8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CapacityReservationGroup} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json - */ -async function createOrUpdateABlockCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const parameters: CapacityReservationGroup = { - location: "westus", - reservationType: "Block", - tags: { department: "finance" }, - zones: ["1", "2"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json - */ -async function createOrUpdateACapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const parameters: CapacityReservationGroup = { - location: "westus", - sharingProfile: { - subscriptionIds: [ - { id: "/subscriptions/{subscription-id1}" }, - { id: "/subscriptions/{subscription-id2}" }, - ], - }, - tags: { department: "finance" }, - zones: ["1", "2"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservationGroup_CreateOrUpdate.json - */ -async function createOrUpdateATargetedCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const parameters: CapacityReservationGroup = { - location: "westus", - reservationType: "Targeted", - sharingProfile: { - subscriptionIds: [ - { id: "/subscriptions/{subscription-id1}" }, - { id: "/subscriptions/{subscription-id2}" }, - ], - }, - tags: { department: "finance" }, - zones: ["1", "2"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.createOrUpdate( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateABlockCapacityReservationGroup(); - await createOrUpdateACapacityReservationGroup(); - await createOrUpdateATargetedCapacityReservationGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsGetSample.ts deleted file mode 100644 index aa3ed9c8e957..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsGetSample.ts +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CapacityReservationGroupsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. - * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_Get.json - */ -async function getABlockCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const expand = "instanceView"; - const options: CapacityReservationGroupsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. - * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json - */ -async function getACapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const expand = "instanceView"; - const options: CapacityReservationGroupsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about a capacity reservation group. - * - * @summary The operation that retrieves information about a capacity reservation group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservationGroup_Get.json - */ -async function getATargetedCapacityReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const expand = "instanceView"; - const options: CapacityReservationGroupsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.get( - resourceGroupName, - capacityReservationGroupName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await getABlockCapacityReservationGroup(); - await getACapacityReservationGroup(); - await getATargetedCapacityReservationGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts deleted file mode 100644 index d841978eee8f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CapacityReservationGroupsListByResourceGroupOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. - * - * @summary Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json - */ -async function listCapacityReservationGroupsInResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const expand = "virtualMachines/$ref"; - const options: CapacityReservationGroupsListByResourceGroupOptionalParams = { - expand, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listByResourceGroup( - resourceGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCapacityReservationGroupsInResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsUpdateSample.ts deleted file mode 100644 index c7f7779430c6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsUpdateSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CapacityReservationGroupUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * - * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json - */ -async function capacityReservationGroupUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; - const parameters: CapacityReservationGroupUpdate = { - instanceView: {}, - tags: { key5355: "aaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.update( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * - * @summary The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json - */ -async function capacityReservationGroupUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaa"; - const parameters: CapacityReservationGroupUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.update( - resourceGroupName, - capacityReservationGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await capacityReservationGroupUpdateMaximumSetGen(); - await capacityReservationGroupUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsCreateOrUpdateSample.ts deleted file mode 100644 index 1a298b25c165..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsCreateOrUpdateSample.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CapacityReservation} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json - */ -async function createOrUpdateABlockCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const capacityReservationName = "blockCapacityReservation"; - const parameters: CapacityReservation = { - location: "westus", - scheduleProfile: { end: "2025-08-02", start: "2025-08-01" }, - sku: { name: "Standard_ND96isr_H100_v5", capacity: 1 }, - tags: { department: "HR" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json - */ -async function createOrUpdateACapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const capacityReservationName = "myCapacityReservation"; - const parameters: CapacityReservation = { - location: "westus", - sku: { name: "Standard_DS1_v2", capacity: 4 }, - tags: { department: "HR" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * - * @summary The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_CreateOrUpdate.json - */ -async function createOrUpdateATargetedCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const capacityReservationName = "targetedCapacityReservation"; - const parameters: CapacityReservation = { - location: "westus", - sku: { name: "Standard_DS1_v2", capacity: 4 }, - tags: { department: "HR" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginCreateOrUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateABlockCapacityReservation(); - await createOrUpdateACapacityReservation(); - await createOrUpdateATargetedCapacityReservation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsGetSample.ts deleted file mode 100644 index f77389ae8400..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsGetSample.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CapacityReservationsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. - * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_Get.json - */ -async function getABlockCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; - const capacityReservationName = "blockCapacityReservation"; - const expand = "instanceView"; - const options: CapacityReservationsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. - * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Get.json - */ -async function getACapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; - const capacityReservationName = "myCapacityReservation"; - const expand = "instanceView"; - const options: CapacityReservationsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation that retrieves information about the capacity reservation. - * - * @summary The operation that retrieves information about the capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_Get.json - */ -async function getATargetedCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; - const capacityReservationName = "targetedCapacityReservation"; - const expand = "instanceView"; - const options: CapacityReservationsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.get( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await getABlockCapacityReservation(); - await getACapacityReservation(); - await getATargetedCapacityReservation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsUpdateSample.ts deleted file mode 100644 index e0d003865b4a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsUpdateSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CapacityReservationUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update a capacity reservation. - * - * @summary The operation to update a capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json - */ -async function capacityReservationUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaa"; - const capacityReservationName = "aaaaaaaaaaaaaaaaaaa"; - const parameters: CapacityReservationUpdate = { - instanceView: { - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - utilizationInfo: {}, - }, - sku: { name: "Standard_DS1_v2", capacity: 7, tier: "aaa" }, - tags: { key4974: "aaaaaaaaaaaaaaaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update a capacity reservation. - * - * @summary The operation to update a capacity reservation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json - */ -async function capacityReservationUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const capacityReservationName = "aaa"; - const parameters: CapacityReservationUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginUpdateAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await capacityReservationUpdateMaximumSetGen(); - await capacityReservationUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts deleted file mode 100644 index 378226bb01b1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. - * - * @summary Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamily_Get.json - */ -async function getCloudServiceOSFamily(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const osFamilyName = "3"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceOperatingSystems.getOSFamily( - location, - osFamilyName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceOSFamily(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts deleted file mode 100644 index 61587b927621..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. - * - * @summary Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_Get.json - */ -async function getCloudServiceOSVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const osVersionName = "WA-GUEST-OS-3.90_202010-02"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceOperatingSystems.getOSVersion( - location, - osVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceOSVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts deleted file mode 100644 index 98c1f88f8cc3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * - * @summary Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamilies_List.json - */ -async function listCloudServiceOSFamiliesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceOperatingSystems.listOSFamilies( - location, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServiceOSFamiliesInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts deleted file mode 100644 index 2002cd5f2993..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * - * @summary Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_List.json - */ -async function listCloudServiceOSVersionsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus2"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceOperatingSystems.listOSVersions( - location, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServiceOSVersionsInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesDeleteSample.ts deleted file mode 100644 index 7ca8d19e9601..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a role instance from a cloud service. - * - * @summary Deletes a role instance from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete.json - */ -async function deleteCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginDeleteAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts deleted file mode 100644 index 29f24619790a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about the run-time state of a role instance in a cloud service. - * - * @summary Retrieves information about the run-time state of a role instance in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_InstanceView.json - */ -async function getInstanceViewOfCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.getInstanceView( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getInstanceViewOfCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts deleted file mode 100644 index 445389f91c0d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a remote desktop file for a role instance in a cloud service. - * - * @summary Gets a remote desktop file for a role instance in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json - */ -async function getCloudServiceRole(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcloudService"; - const cloudServiceName = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.getRemoteDesktopFile( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceRole(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetSample.ts deleted file mode 100644 index d270920b7ed0..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a role instance from a cloud service. - * - * @summary Gets a role instance from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get.json - */ -async function getCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.get( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesListSample.ts deleted file mode 100644 index 918c4432697e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * - * @summary Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRolesInstance_List.json - */ -async function listRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceRoleInstances.list( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRebuildSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRebuildSample.ts deleted file mode 100644 index 5c9d7c9c9af1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRebuildSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. - * - * @summary The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild.json - */ -async function rebuildCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginRebuildAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await rebuildCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesReimageSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesReimageSample.ts deleted file mode 100644 index 0bd54930c717..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesReimageSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * - * @summary The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage.json - */ -async function reimageCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginReimageAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await reimageCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRestartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRestartSample.ts deleted file mode 100644 index 76e681aa4ae6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRestartSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. - * - * @summary The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart.json - */ -async function restartCloudServiceRoleInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleInstanceName = "{roleInstance-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoleInstances.beginRestartAndWait( - roleInstanceName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await restartCloudServiceRoleInstance(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesGetSample.ts deleted file mode 100644 index d5b0ef87d0f3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a role from a cloud service. - * - * @summary Gets a role from a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_Get.json - */ -async function getCloudServiceRole(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const roleName = "{role-name}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServiceRoles.get( - roleName, - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceRole(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesListSample.ts deleted file mode 100644 index 99f72ff3dd71..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesListSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. - * - * @summary Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_List.json - */ -async function listRolesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServiceRoles.list( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listRolesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesCreateOrUpdateSample.ts deleted file mode 100644 index 7fc8e0a05215..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesCreateOrUpdateSample.ts +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CloudService, - CloudServicesCreateOrUpdateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole.json - */ -async function createNewCloudServiceWithMultipleRoles(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - { - name: "ContosoBackend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole_WithZones.json - */ -async function createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - { - name: "ContosoBackend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - zones: ["1"], - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRole.json - */ -async function createNewCloudServiceWithSingleRole(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "myLoadBalancer", - properties: { - frontendIpConfigurations: [ - { - name: "myfe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json - */ -async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - osProfile: { - secrets: [ - { - sourceVault: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}", - }, - vaultCertificates: [ - { - certificateUrl: - "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}", - isBootstrapCertificate: true, - }, - ], - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * - * @summary Create or update a cloud service. Please note some properties can be set only during cloud service creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndRDP.json - */ -async function createNewCloudServiceWithSingleRoleAndRdpExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudService = { - location: "westus", - properties: { - configuration: "{ServiceConfiguration}", - extensionProfile: { - extensions: [ - { - name: "RDPExtension", - properties: { - type: "RDP", - autoUpgradeMinorVersion: false, - protectedSettings: - "{password}", - publisher: "Microsoft.Windows.Azure.Extensions", - settings: - "UserAzure10/22/2021 15:05:45", - typeHandlerVersion: "1.2", - }, - }, - ], - }, - networkProfile: { - loadBalancerConfigurations: [ - { - name: "contosolb", - properties: { - frontendIpConfigurations: [ - { - name: "contosofe", - properties: { - publicIPAddress: { - id: "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip", - }, - }, - }, - ], - }, - }, - ], - }, - packageUrl: "{PackageUrl}", - roleProfile: { - roles: [ - { - name: "ContosoFrontend", - sku: { name: "Standard_D1_v2", capacity: 1, tier: "Standard" }, - }, - ], - }, - upgradeMode: "Auto", - }, - }; - const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginCreateOrUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await createNewCloudServiceWithMultipleRoles(); - await createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone(); - await createNewCloudServiceWithSingleRole(); - await createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(); - await createNewCloudServiceWithSingleRoleAndRdpExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteInstancesSample.ts deleted file mode 100644 index 7e289a8b33fd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteInstancesSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesDeleteInstancesOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes role instances in a cloud service. - * - * @summary Deletes role instances in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json - */ -async function deleteCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesDeleteInstancesOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginDeleteInstancesAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await deleteCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteSample.ts deleted file mode 100644 index 8abc4febbed5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a cloud service. - * - * @summary Deletes a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Delete.json - */ -async function deleteCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginDeleteAndWait( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetInstanceViewSample.ts deleted file mode 100644 index 0985609302bb..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetInstanceViewSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the status of a cloud service. - * - * @summary Gets the status of a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_InstanceViewWithMultiRole.json - */ -async function getCloudServiceInstanceViewWithMultipleRoles(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.getInstanceView( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceInstanceViewWithMultipleRoles(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetSample.ts deleted file mode 100644 index 87e01b983e78..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Display information about a cloud service. - * - * @summary Display information about a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_WithMultiRoleAndRDP.json - */ -async function getCloudServiceWithMultipleRolesAndRdpExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.get( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceWithMultipleRolesAndRdpExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListAllSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListAllSample.ts deleted file mode 100644 index c2e6e49929cd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListAllSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * - * @summary Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_BySubscription.json - */ -async function listCloudServicesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServices.listAll()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServicesInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListSample.ts deleted file mode 100644 index c01427141653..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * - * @summary Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_ByResourceGroup.json - */ -async function listCloudServicesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServices.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCloudServicesInAResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesPowerOffSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesPowerOffSample.ts deleted file mode 100644 index 92203d3f2dd5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesPowerOffSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. - * - * @summary Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_PowerOff.json - */ -async function stopOrPowerOffCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginPowerOffAndWait( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await stopOrPowerOffCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRebuildSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRebuildSample.ts deleted file mode 100644 index 0b72f916d574..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRebuildSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesRebuildOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. - * - * @summary Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json - */ -async function rebuildCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesRebuildOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginRebuildAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await rebuildCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesReimageSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesReimageSample.ts deleted file mode 100644 index c4a492f145f5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesReimageSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * - * @summary Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json - */ -async function reimageCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesReimageOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginReimageAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await reimageCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRestartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRestartSample.ts deleted file mode 100644 index 40f42c29bfb6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRestartSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RoleInstances, - CloudServicesRestartOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restarts one or more role instances in a cloud service. - * - * @summary Restarts one or more role instances in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json - */ -async function restartCloudServiceRoleInstancesInACloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: RoleInstances = { - roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"], - }; - const options: CloudServicesRestartOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginRestartAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await restartCloudServiceRoleInstancesInACloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesStartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesStartSample.ts deleted file mode 100644 index 72be38e693e7..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesStartSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Starts the cloud service. - * - * @summary Starts the cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Start.json - */ -async function startCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginStartAndWait( - resourceGroupName, - cloudServiceName, - ); - console.log(result); -} - -async function main(): Promise { - await startCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts deleted file mode 100644 index 31bce4ea995a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * - * @summary Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Get.json - */ -async function getCloudServiceUpdateDomain(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const updateDomain = 1; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServicesUpdateDomain.getUpdateDomain( - resourceGroupName, - cloudServiceName, - updateDomain, - ); - console.log(result); -} - -async function main(): Promise { - await getCloudServiceUpdateDomain(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts deleted file mode 100644 index 7782df0e3ae8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all update domains in a cloud service. - * - * @summary Gets a list of all update domains in a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_List.json - */ -async function listUpdateDomainsInCloudService(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.cloudServicesUpdateDomain.listUpdateDomains( - resourceGroupName, - cloudServiceName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listUpdateDomainsInCloudService(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts deleted file mode 100644 index fa0d3c81a7d1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates the role instances in the specified update domain. - * - * @summary Updates the role instances in the specified update domain. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Update.json - */ -async function updateCloudServiceToSpecifiedDomain(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const updateDomain = 1; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.cloudServicesUpdateDomain.beginWalkUpdateDomainAndWait( - resourceGroupName, - cloudServiceName, - updateDomain, - ); - console.log(result); -} - -async function main(): Promise { - await updateCloudServiceToSpecifiedDomain(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateSample.ts deleted file mode 100644 index 52c53284a225..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - CloudServiceUpdate, - CloudServicesUpdateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a cloud service. - * - * @summary Update a cloud service. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Update_ToIncludeTags.json - */ -async function updateExistingCloudServiceToAddTags(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ConstosoRG"; - const cloudServiceName = "{cs-name}"; - const parameters: CloudServiceUpdate = { tags: { documentation: "RestAPI" } }; - const options: CloudServicesUpdateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.cloudServices.beginUpdateAndWait( - resourceGroupName, - cloudServiceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await updateExistingCloudServiceToAddTags(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleriesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleriesGetSample.ts deleted file mode 100644 index 94c05338ac5a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleriesGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a community gallery by gallery public name. - * - * @summary Get a community gallery by gallery public name. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json - */ -async function getACommunityGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.communityGalleries.get( - location, - publicGalleryName, - ); - console.log(result); -} - -async function main(): Promise { - await getACommunityGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsGetSample.ts deleted file mode 100644 index b597153791cf..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsGetSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a community gallery image version. - * - * @summary Get a community gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json - */ -async function getACommunityGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "myGalleryImageVersionName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.communityGalleryImageVersions.get( - location, - publicGalleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getACommunityGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts deleted file mode 100644 index e6cf03483493..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - DedicatedHostGroup} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * - * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json - */ -async function createOrUpdateADedicatedHostGroupWithUltraSsdSupport(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const parameters: DedicatedHostGroup = { - additionalCapabilities: { ultraSSDEnabled: true }, - location: "westus", - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { department: "finance" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.createOrUpdate( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * - * @summary Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json - */ -async function createOrUpdateADedicatedHostGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const parameters: DedicatedHostGroup = { - location: "westus", - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { department: "finance" }, - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.createOrUpdate( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateADedicatedHostGroupWithUltraSsdSupport(); - await createOrUpdateADedicatedHostGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsDeleteSample.ts deleted file mode 100644 index 42db101ece26..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsDeleteSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a dedicated host group. - * - * @summary Delete a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json - */ -async function dedicatedHostGroupDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.delete( - resourceGroupName, - hostGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a dedicated host group. - * - * @summary Delete a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json - */ -async function dedicatedHostGroupDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.delete( - resourceGroupName, - hostGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await dedicatedHostGroupDeleteMaximumSetGen(); - await dedicatedHostGroupDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsGetSample.ts deleted file mode 100644 index bc135d813ea0..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsGetSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a dedicated host group. - * - * @summary Retrieves information about a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json - */ -async function createADedicatedHostGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.get( - resourceGroupName, - hostGroupName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a dedicated host group. - * - * @summary Retrieves information about a dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json - */ -async function createAnUltraSsdEnabledDedicatedHostGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.get( - resourceGroupName, - hostGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await createADedicatedHostGroup(); - await createAnUltraSsdEnabledDedicatedHostGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsUpdateSample.ts deleted file mode 100644 index 5305714eb444..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsUpdateSample.ts +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - DedicatedHostGroupUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an dedicated host group. - * - * @summary Update an dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json - */ -async function dedicatedHostGroupUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; - const parameters: DedicatedHostGroupUpdate = { - instanceView: { - hosts: [ - { - availableCapacity: { - allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], - }, - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - ], - }, - platformFaultDomainCount: 3, - supportAutomaticPlacement: true, - tags: { key9921: "aaaaaaaaaa" }, - zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.update( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update an dedicated host group. - * - * @summary Update an dedicated host group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json - */ -async function dedicatedHostGroupUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaa"; - const parameters: DedicatedHostGroupUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHostGroups.update( - resourceGroupName, - hostGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await dedicatedHostGroupUpdateMaximumSetGen(); - await dedicatedHostGroupUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsCreateOrUpdateSample.ts deleted file mode 100644 index c0ecc86e58b2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsCreateOrUpdateSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { DedicatedHost} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a dedicated host . - * - * @summary Create or update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json - */ -async function createOrUpdateADedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myDedicatedHost"; - const parameters: DedicatedHost = { - location: "westus", - platformFaultDomain: 1, - sku: { name: "DSv3-Type1" }, - tags: { department: "HR" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginCreateOrUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateADedicatedHost(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsDeleteSample.ts deleted file mode 100644 index a5f96d594b60..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsDeleteSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a dedicated host. - * - * @summary Delete a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json - */ -async function dedicatedHostDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaa"; - const hostName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginDeleteAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a dedicated host. - * - * @summary Delete a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json - */ -async function dedicatedHostDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaaaaaa"; - const hostName = "aaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginDeleteAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); -} - -async function main(): Promise { - await dedicatedHostDeleteMaximumSetGen(); - await dedicatedHostDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsGetSample.ts deleted file mode 100644 index b9949ffddbc7..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsGetSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - DedicatedHostsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a dedicated host. - * - * @summary Retrieves information about a dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Get.json - */ -async function getADedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; - const expand = "instanceView"; - const options: DedicatedHostsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.get( - resourceGroupName, - hostGroupName, - hostName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await getADedicatedHost(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsUpdateSample.ts deleted file mode 100644 index 901afc72aa42..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsUpdateSample.ts +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - DedicatedHostUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a dedicated host . - * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json - */ -async function dedicatedHostUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaa"; - const parameters: DedicatedHostUpdate = { - autoReplaceOnFailure: true, - instanceView: { - availableCapacity: { - allocatableVMs: [{ count: 26, vmSize: "aaaaaaaaaaaaaaaaaaaa" }], - }, - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - licenseType: "Windows_Server_Hybrid", - platformFaultDomain: 1, - tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a dedicated host . - * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json - */ -async function dedicatedHostUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: DedicatedHostUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a dedicated host . - * - * @summary Update a dedicated host . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json - */ -async function dedicatedHostUpdateResize(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaa"; - const hostName = "aaaaaaaaaaaaaaaaaaaaa"; - const parameters: DedicatedHostUpdate = { sku: { name: "DSv3-Type1" } }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginUpdateAndWait( - resourceGroupName, - hostGroupName, - hostName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await dedicatedHostUpdateMaximumSetGen(); - await dedicatedHostUpdateMinimumSetGen(); - await dedicatedHostUpdateResize(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesCreateOrUpdateSample.ts deleted file mode 100644 index 2bb4701d761c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesCreateOrUpdateSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { DiskAccess} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates a disk access resource - * - * @summary Creates or updates a disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Create.json - */ -async function createADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const diskAccess: DiskAccess = { location: "West US" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginCreateOrUpdateAndWait( - resourceGroupName, - diskAccessName, - diskAccess, - ); - console.log(result); -} - -async function main(): Promise { - await createADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts deleted file mode 100644 index 3c8af417e035..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a private endpoint connection under a disk access resource. - * - * @summary Deletes a private endpoint connection under a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json - */ -async function deleteAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskAccesses.beginDeleteAPrivateEndpointConnectionAndWait( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAPrivateEndpointConnectionUnderADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteSample.ts deleted file mode 100644 index d2c663c0ffd8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a disk access resource. - * - * @summary Deletes a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Delete.json - */ -async function deleteADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginDeleteAndWait( - resourceGroupName, - diskAccessName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetSample.ts deleted file mode 100644 index c92904182a37..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets information about a disk access resource. - * - * @summary Gets information about a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json - */ -async function getInformationAboutADiskAccessResourceWithPrivateEndpoints(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.get( - resourceGroupName, - diskAccessName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets information about a disk access resource. - * - * @summary Gets information about a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get.json - */ -async function getInformationAboutADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.get( - resourceGroupName, - diskAccessName, - ); - console.log(result); -} - -async function main(): Promise { - await getInformationAboutADiskAccessResourceWithPrivateEndpoints(); - await getInformationAboutADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts deleted file mode 100644 index c5dc1ecf14d6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - PrivateEndpointConnection} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. - * - * @summary Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json - */ -async function approveAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; - const privateEndpointConnection: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approving myPrivateEndpointConnection", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskAccesses.beginUpdateAPrivateEndpointConnectionAndWait( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - privateEndpointConnection, - ); - console.log(result); -} - -async function main(): Promise { - await approveAPrivateEndpointConnectionUnderADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateSample.ts deleted file mode 100644 index 9d4214e60291..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { DiskAccessUpdate} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates (patches) a disk access resource. - * - * @summary Updates (patches) a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Update.json - */ -async function updateADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const diskAccess: DiskAccessUpdate = { - tags: { department: "Development", project: "PrivateEndpoints" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskAccesses.beginUpdateAndWait( - resourceGroupName, - diskAccessName, - diskAccess, - ); - console.log(result); -} - -async function main(): Promise { - await updateADiskAccessResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts deleted file mode 100644 index 1aa5b0f4eded..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { DiskEncryptionSet} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates a disk encryption set - * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json - */ -async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSet = { - activeKey: { - keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk encryption set - * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json - */ -async function createADiskEncryptionSetWithKeyVaultFromADifferentTenant(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSet = { - activeKey: { - keyUrl: - "https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - federatedClientId: "00000000-0000-0000-0000-000000000000", - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MicrosoftManagedIdentity/userAssignedIdentities/{identityName}": - {}, - }, - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk encryption set - * - * @summary Creates or updates a disk encryption set - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json - */ -async function createADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSet = { - activeKey: { - keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", - }, - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginCreateOrUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -async function main(): Promise { - await createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(); - await createADiskEncryptionSetWithKeyVaultFromADifferentTenant(); - await createADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsDeleteSample.ts deleted file mode 100644 index 799370e15ed7..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a disk encryption set. - * - * @summary Deletes a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json - */ -async function deleteADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginDeleteAndWait( - resourceGroupName, - diskEncryptionSetName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsGetSample.ts deleted file mode 100644 index 1f53b82fab57..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsGetSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets information about a disk encryption set. - * - * @summary Gets information about a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json - */ -async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.get( - resourceGroupName, - diskEncryptionSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets information about a disk encryption set. - * - * @summary Gets information about a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json - */ -async function getInformationAboutADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.get( - resourceGroupName, - diskEncryptionSetName, - ); - console.log(result); -} - -async function main(): Promise { - await getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(); - await getInformationAboutADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsUpdateSample.ts deleted file mode 100644 index 3b3fec5c97b6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsUpdateSample.ts +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - DiskEncryptionSetUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates (patches) a disk encryption set. - * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json - */ -async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSetUpdate = { - activeKey: { - keyUrl: - "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - rotationToLatestKeyVersionEnabled: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk encryption set. - * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json - */ -async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSetUpdate = { - activeKey: { - keyUrl: - "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - identity: { type: "SystemAssigned" }, - rotationToLatestKeyVersionEnabled: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk encryption set. - * - * @summary Updates (patches) a disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json - */ -async function updateADiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; - const diskEncryptionSet: DiskEncryptionSetUpdate = { - activeKey: { - keyUrl: - "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", - }, - }, - encryptionType: "EncryptionAtRestWithCustomerKey", - tags: { department: "Development", project: "Encryption" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskEncryptionSets.beginUpdateAndWait( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - ); - console.log(result); -} - -async function main(): Promise { - await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(); - await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(); - await updateADiskEncryptionSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGetSample.ts deleted file mode 100644 index 1496c06aa8bf..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGetSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get disk restorePoint resource - * - * @summary Get disk restorePoint resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json - */ -async function getAnIncrementalDiskRestorePointResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.get( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get disk restorePoint resource - * - * @summary Get disk restorePoint resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json - */ -async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.diskRestorePointOperations.get( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - ); - console.log(result); -} - -async function main(): Promise { - await getAnIncrementalDiskRestorePointResource(); - await getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGrantAccessSample.ts deleted file mode 100644 index 7a346da0f0e2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGrantAccessSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { GrantAccessData} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Grants access to a diskRestorePoint. - * - * @summary Grants access to a diskRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json - */ -async function grantsAccessToADiskRestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const grantAccessData: GrantAccessData = { - access: "Read", - durationInSeconds: 300, - fileFormat: "VHDX", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskRestorePointOperations.beginGrantAccessAndWait( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - grantAccessData, - ); - console.log(result); -} - -async function main(): Promise { - await grantsAccessToADiskRestorePoint(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointListByRestorePointSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointListByRestorePointSample.ts deleted file mode 100644 index 4d30dca40096..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointListByRestorePointSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists diskRestorePoints under a vmRestorePoint. - * - * @summary Lists diskRestorePoints under a vmRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json - */ -async function getAnIncrementalDiskRestorePointResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.diskRestorePointOperations.listByRestorePoint( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await getAnIncrementalDiskRestorePointResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointRevokeAccessSample.ts deleted file mode 100644 index 3233ea4bd1de..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointRevokeAccessSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Revokes access to a diskRestorePoint. - * - * @summary Revokes access to a diskRestorePoint. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json - */ -async function revokesAccessToADiskRestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpc"; - const vmRestorePointName = "vmrp"; - const diskRestorePointName = - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.diskRestorePointOperations.beginRevokeAccessAndWait( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - ); - console.log(result); -} - -async function main(): Promise { - await revokesAccessToADiskRestorePoint(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/disksCreateOrUpdateSample.ts deleted file mode 100644 index 4126f7899ffd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksCreateOrUpdateSample.ts +++ /dev/null @@ -1,869 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { Disk} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json - */ -async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - securityProfile: { - secureVMDiskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDiskAccess.json - */ -async function createAManagedDiskAndAssociateWithDiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskAccessId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", - diskSizeGB: 200, - location: "West US", - networkAccessPolicy: "AllowPrivate", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json - */ -async function createAManagedDiskAndAssociateWithDiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - encryption: { - diskEncryptionSetId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json - */ -async function createAManagedDiskByCopyingASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "Copy", - sourceResourceId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json - */ -async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json - */ -async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromImportSecure.json - */ -async function createAManagedDiskFromImportSecureCreateOption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "ImportSecure", - securityDataUri: - "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - osType: "Windows", - securityProfile: { - securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromImportSecure_WithVMMetadata.json - */ -async function createAManagedDiskFromImportSecureCreateOptionWithMetadataUriForConfidentialVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "ImportSecure", - securityDataUri: - "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", - securityMetadataUri: - "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - osType: "Windows", - securityProfile: { - securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json - */ -async function createAManagedDiskFromUploadPreparedSecureCreateOption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "UploadPreparedSecure", - uploadSizeBytes: 10737418752, - }, - location: "West US", - osType: "Windows", - securityProfile: { securityType: "TrustedLaunch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json - */ -async function createAManagedDiskFromAPlatformImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json - */ -async function createAManagedDiskFromAnAzureComputeGalleryCommunityImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - galleryImageReference: { - communityGalleryImageId: - "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json - */ -async function createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - galleryImageReference: { - sharedGalleryImageId: - "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json - */ -async function createAManagedDiskFromAnAzureComputeGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - galleryImageReference: { - id: "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0", - }, - }, - location: "West US", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json - */ -async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk2"; - const disk: Disk = { - creationData: { - createOption: "Copy", - sourceResourceId: - "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json - */ -async function createAManagedDiskFromElasticSanVolumeSnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "CopyFromSanSnapshot", - elasticSanResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json - */ -async function createAManagedDiskWithAvailabilityPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - availabilityPolicy: { actionOnDiskDelay: "AutomaticReattach" }, - creationData: { createOption: "Empty" }, - diskSizeGB: 1024, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json - */ -async function createAManagedDiskWithDataAccessAuthMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - dataAccessAuthMode: "AzureActiveDirectory", - diskSizeGB: 200, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json - */ -async function createAManagedDiskWithOptimizedForFrequentAttach(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - optimizedForFrequentAttach: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_PerformancePlus.json - */ -async function createAManagedDiskWithPerformancePlus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Upload", performancePlus: true }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json - */ -async function createAManagedDiskWithPremiumV2AccountType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myPremiumV2Disk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskIopsReadWrite: 125, - diskMBpsReadWrite: 3000, - diskSizeGB: 200, - location: "West US", - sku: { name: "PremiumV2_LRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json - */ -async function createAManagedDiskWithSecurityProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { - createOption: "FromImage", - imageReference: { - id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}", - }, - }, - location: "North Central US", - osType: "Windows", - securityProfile: { securityType: "TrustedLaunch" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json - */ -async function createAManagedDiskWithSsdZrsAccountType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - sku: { name: "Premium_ZRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json - */ -async function createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myUltraReadOnlyDisk"; - const disk: Disk = { - creationData: { createOption: "Empty", logicalSectorSize: 4096 }, - diskIopsReadWrite: 125, - diskMBpsReadWrite: 3000, - diskSizeGB: 200, - encryption: { type: "EncryptionAtRestWithPlatformKey" }, - location: "West US", - sku: { name: "UltraSSD_LRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_UploadDisk.json - */ -async function createAManagedUploadDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_InExtendedLocation.json - */ -async function createAnEmptyManagedDiskInExtendedLocation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - extendedLocation: { name: "{edge-zone-id}", type: "EdgeZone" }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_Empty.json - */ -async function createAnEmptyManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty" }, - diskSizeGB: 200, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a disk. - * - * @summary Creates or updates a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json - */ -async function createAnUltraManagedDiskWithLogicalSectorSize512E(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: Disk = { - creationData: { createOption: "Empty", logicalSectorSize: 512 }, - diskSizeGB: 200, - location: "West US", - sku: { name: "UltraSSD_LRS" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginCreateOrUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -async function main(): Promise { - await createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(); - await createAManagedDiskAndAssociateWithDiskAccessResource(); - await createAManagedDiskAndAssociateWithDiskEncryptionSet(); - await createAManagedDiskByCopyingASnapshot(); - await createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(); - await createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(); - await createAManagedDiskFromImportSecureCreateOption(); - await createAManagedDiskFromImportSecureCreateOptionWithMetadataUriForConfidentialVM(); - await createAManagedDiskFromUploadPreparedSecureCreateOption(); - await createAManagedDiskFromAPlatformImage(); - await createAManagedDiskFromAnAzureComputeGalleryCommunityImage(); - await createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(); - await createAManagedDiskFromAnAzureComputeGalleryImage(); - await createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(); - await createAManagedDiskFromElasticSanVolumeSnapshot(); - await createAManagedDiskWithAvailabilityPolicy(); - await createAManagedDiskWithDataAccessAuthMode(); - await createAManagedDiskWithOptimizedForFrequentAttach(); - await createAManagedDiskWithPerformancePlus(); - await createAManagedDiskWithPremiumV2AccountType(); - await createAManagedDiskWithSecurityProfile(); - await createAManagedDiskWithSsdZrsAccountType(); - await createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(); - await createAManagedUploadDisk(); - await createAnEmptyManagedDiskInExtendedLocation(); - await createAnEmptyManagedDisk(); - await createAnUltraManagedDiskWithLogicalSectorSize512E(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/disksDeleteSample.ts deleted file mode 100644 index 4b63ce565aad..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a disk. - * - * @summary Deletes a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Delete.json - */ -async function deleteAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginDeleteAndWait( - resourceGroupName, - diskName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAManagedDisk(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/disksGetSample.ts deleted file mode 100644 index 3ccd35b0827b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets information about a disk. - * - * @summary Gets information about a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Get.json - */ -async function getInformationAboutAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myManagedDisk"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.get(resourceGroupName, diskName); - console.log(result); -} - -async function main(): Promise { - await getInformationAboutAManagedDisk(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/disksGrantAccessSample.ts deleted file mode 100644 index 9b87e456f201..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksGrantAccessSample.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { GrantAccessData} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Grants access to a disk. - * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess.json - */ -async function getASasOnAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData: GrantAccessData = { - access: "Read", - durationInSeconds: 300, - fileFormat: "VHD", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Grants access to a disk. - * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json - */ -async function getSasOnManagedDiskAndVMGuestState(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData: GrantAccessData = { - access: "Read", - durationInSeconds: 300, - getSecureVMGuestStateSAS: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Grants access to a disk. - * - * @summary Grants access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestStateAndVMMetadata.json - */ -async function getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const grantAccessData: GrantAccessData = { - access: "Read", - durationInSeconds: 300, - getSecureVMGuestStateSAS: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginGrantAccessAndWait( - resourceGroupName, - diskName, - grantAccessData, - ); - console.log(result); -} - -async function main(): Promise { - await getASasOnAManagedDisk(); - await getSasOnManagedDiskAndVMGuestState(); - await getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/disksRevokeAccessSample.ts deleted file mode 100644 index 219db5be7857..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksRevokeAccessSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Revokes access to a disk. - * - * @summary Revokes access to a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_EndGetAccess.json - */ -async function revokeAccessToAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginRevokeAccessAndWait( - resourceGroupName, - diskName, - ); - console.log(result); -} - -async function main(): Promise { - await revokeAccessToAManagedDisk(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/disksUpdateSample.ts deleted file mode 100644 index 2559fabf8793..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksUpdateSample.ts +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { DiskUpdate} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json - */ -async function createOrUpdateABurstingEnabledManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { burstingEnabled: true, diskSizeGB: 1024 }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json - */ -async function updateAManagedDiskToAddAcceleratedNetworking(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { - supportedCapabilities: { acceleratedNetwork: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json - */ -async function updateAManagedDiskToAddArchitecture(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { supportedCapabilities: { architecture: "Arm64" } }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json - */ -async function updateAManagedDiskToAddPurchasePlan(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { - purchasePlan: { - name: "myPurchasePlanName", - product: "myPurchasePlanProduct", - promotionCode: "myPurchasePlanPromotionCode", - publisher: "myPurchasePlanPublisher", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json - */ -async function updateAManagedDiskToAddSupportsHibernation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { supportsHibernation: true }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_ChangeTier.json - */ -async function updateAManagedDiskToChangeTier(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { tier: "P30" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_DisableBursting.json - */ -async function updateAManagedDiskToDisableBursting(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { burstingEnabled: false }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json - */ -async function updateAManagedDiskToDisableOptimizedForFrequentAttach(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { optimizedForFrequentAttach: false }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json - */ -async function updateAManagedDiskWithDiskControllerTypes(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { - supportedCapabilities: { diskControllerTypes: "SCSI" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a disk. - * - * @summary Updates (patches) a disk. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json - */ -async function updateManagedDiskToRemoveDiskAccessResourceAssociation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskName = "myDisk"; - const disk: DiskUpdate = { networkAccessPolicy: "AllowAll" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.disks.beginUpdateAndWait( - resourceGroupName, - diskName, - disk, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateABurstingEnabledManagedDisk(); - await updateAManagedDiskToAddAcceleratedNetworking(); - await updateAManagedDiskToAddArchitecture(); - await updateAManagedDiskToAddPurchasePlan(); - await updateAManagedDiskToAddSupportsHibernation(); - await updateAManagedDiskToChangeTier(); - await updateAManagedDiskToDisableBursting(); - await updateAManagedDiskToDisableOptimizedForFrequentAttach(); - await updateAManagedDiskWithDiskControllerTypes(); - await updateManagedDiskToRemoveDiskAccessResourceAssociation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesCreateOrUpdateSample.ts deleted file mode 100644 index 5f40d2296f2f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesCreateOrUpdateSample.ts +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { Gallery} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Create.json - */ -async function createACommunityGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - location: "West US", - sharingProfile: { - communityGalleryInfo: { - eula: "eula", - publicNamePrefix: "PirPublic", - publisherContact: "pir@microsoft.com", - publisherUri: "uri", - }, - permissions: "Community", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_WithSharingProfile.json - */ -async function createOrUpdateASimpleGalleryWithSharingProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - location: "West US", - sharingProfile: { permissions: "Groups" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_SoftDeletionEnabled.json - */ -async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - location: "West US", - softDeletePolicy: { isSoftDeleteEnabled: true }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create_WithManagedIdentity.json - */ -async function createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - identity: { - type: "SystemAssigned, UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/myIdentity": - {}, - }, - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a Shared Image Gallery. - * - * @summary Create or update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Create.json - */ -async function createOrUpdateASimpleGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: Gallery = { - description: "This is the gallery description.", - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -async function main(): Promise { - await createACommunityGallery(); - await createOrUpdateASimpleGalleryWithSharingProfile(); - await createOrUpdateASimpleGalleryWithSoftDeletionEnabled(); - await createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); - await createOrUpdateASimpleGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesDeleteSample.ts deleted file mode 100644 index befc53fd2567..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a Shared Image Gallery. - * - * @summary Delete a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Delete.json - */ -async function deleteAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginDeleteAndWait( - resourceGroupName, - galleryName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesGetSample.ts deleted file mode 100644 index 83c003e167d1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesGetSample.ts +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleriesGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Get.json - */ -async function getACommunityGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json - */ -async function getAGalleryWithExpandSharingProfileGroups(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const expand = "SharingProfile/Groups"; - const options: GalleriesGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get( - resourceGroupName, - galleryName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json - */ -async function getAGalleryWithSelectPermissions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const select = "Permissions"; - const options: GalleriesGetOptionalParams = { select }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get( - resourceGroupName, - galleryName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get_WithManagedIdentity.json - */ -async function getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a Shared Image Gallery. - * - * @summary Retrieves information about a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Get.json - */ -async function getAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.get(resourceGroupName, galleryName); - console.log(result); -} - -async function main(): Promise { - await getACommunityGallery(); - await getAGalleryWithExpandSharingProfileGroups(); - await getAGalleryWithSelectPermissions(); - await getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); - await getAGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesUpdateSample.ts deleted file mode 100644 index 52bc18cad7af..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesUpdateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { GalleryUpdate} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a Shared Image Gallery. - * - * @summary Update a Shared Image Gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Update.json - */ -async function updateASimpleGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const gallery: GalleryUpdate = { - description: "This is the gallery description.", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleries.beginUpdateAndWait( - resourceGroupName, - galleryName, - gallery, - ); - console.log(result); -} - -async function main(): Promise { - await updateASimpleGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts deleted file mode 100644 index 1b383b447d8d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryApplicationVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a gallery Application Version. - * - * @summary Create or update a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json - */ -async function createOrUpdateASimpleGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const galleryApplicationVersion: GalleryApplicationVersion = { - location: "West US", - publishingProfile: { - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - endOfLifeDate: new Date("2019-07-01T07:00:00Z"), - manageActions: { - install: - 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', - remove: "del C:\\package ", - }, - replicaCount: 1, - source: { - mediaLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 1, - storageAccountType: "Standard_LRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryApplicationVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateASimpleGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsDeleteSample.ts deleted file mode 100644 index 53484e0a15a1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery Application Version. - * - * @summary Delete a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json - */ -async function deleteAGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsGetSample.ts deleted file mode 100644 index 0696ac743ebd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsGetSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryApplicationVersionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a gallery Application Version. - * - * @summary Retrieves information about a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json - */ -async function getAGalleryApplicationVersionWithReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const expand = "ReplicationStatus"; - const options: GalleryApplicationVersionsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.get( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery Application Version. - * - * @summary Retrieves information about a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get.json - */ -async function getAGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.get( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryApplicationVersionWithReplicationStatus(); - await getAGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsUpdateSample.ts deleted file mode 100644 index 7323a54fdabf..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsUpdateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryApplicationVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery Application Version. - * - * @summary Update a gallery Application Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json - */ -async function updateASimpleGalleryApplicationVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplicationVersionName = "1.0.0"; - const galleryApplicationVersion: GalleryApplicationVersionUpdate = { - publishingProfile: { - endOfLifeDate: new Date("2019-07-01T07:00:00Z"), - manageActions: { - install: - 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', - remove: "del C:\\package ", - }, - replicaCount: 1, - source: { - mediaLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 1, - storageAccountType: "Standard_LRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplicationVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - ); - console.log(result); -} - -async function main(): Promise { - await updateASimpleGalleryApplicationVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsCreateOrUpdateSample.ts deleted file mode 100644 index cba7f75175e3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsCreateOrUpdateSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryApplication} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a gallery Application Definition. - * - * @summary Create or update a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Create.json - */ -async function createOrUpdateASimpleGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplication: GalleryApplication = { - description: "This is the gallery application description.", - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - eula: "This is the gallery application EULA.", - location: "West US", - privacyStatementUri: "myPrivacyStatementUri}", - releaseNoteUri: "myReleaseNoteUri", - supportedOSType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateASimpleGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsDeleteSample.ts deleted file mode 100644 index 617bda01ee43..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery Application. - * - * @summary Delete a gallery Application. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Delete.json - */ -async function deleteAGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsGetSample.ts deleted file mode 100644 index 184a7438c5fe..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a gallery Application Definition. - * - * @summary Retrieves information about a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Get.json - */ -async function getAGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.get( - resourceGroupName, - galleryName, - galleryApplicationName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsUpdateSample.ts deleted file mode 100644 index e5ef687ffac1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsUpdateSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryApplicationUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery Application Definition. - * - * @summary Update a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Update.json - */ -async function updateASimpleGalleryApplication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; - const galleryApplication: GalleryApplicationUpdate = { - description: "This is the gallery application description.", - customActions: [ - { - name: "myCustomAction", - description: "This is the custom action description.", - parameters: [ - { - name: "myCustomActionParameter", - type: "String", - description: "This is the description of the parameter", - defaultValue: "default value of parameter.", - required: false, - }, - ], - script: "myCustomActionScript", - }, - ], - eula: "This is the gallery application EULA.", - privacyStatementUri: "myPrivacyStatementUri}", - releaseNoteUri: "myReleaseNoteUri", - supportedOSType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryApplications.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - ); - console.log(result); -} - -async function main(): Promise { - await updateASimpleGalleryApplication(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts deleted file mode 100644 index c8c67e48758b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,914 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryImageVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - virtualMachineId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - communityGalleryImageId: - "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - replicationMode: "Shallow", - targetRegions: [ - { name: "West US", excludeFromLatest: false, regionalReplicaCount: 1 }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", - }, - }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - securityProfile: { - uefiSettings: { - additionalSignatures: { - db: [{ type: "x509", value: [""] }], - dbx: [{ type: "x509", value: [""] }], - kek: [{ type: "sha256", value: [""] }], - }, - signatureTemplateNames: ["MicrosoftUefiCertificateAuthorityTemplate"], - }, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD.json - */ -async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - dataDiskImages: [ - { - hostCaching: "None", - lun: 1, - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - ], - osDiskImage: { - hostCaching: "ReadOnly", - source: { - storageAccountId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", - uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithAdditionalReplicaSets.json - */ -async function createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - additionalReplicaSets: [ - { regionalReplicaCount: 1, storageAccountType: "PreviumV2_LRS" }, - ], - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithStorageAccountStrategy.json - */ -async function createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - storageAccountStrategy: "PreferStandard_ZRS", - targetRegions: [ - { name: "West US" }, - { name: "East US" }, - { name: "East US 2", storageAccountType: "Premium_LRS" }, - ], - }, - storageProfile: { - source: { - virtualMachineId: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a gallery image version. - * - * @summary Create or update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json - */ -async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersion = { - location: "West US", - publishingProfile: { - targetRegions: [ - { - name: "West US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 1, - }, - { - name: "East US", - encryption: { - dataDiskImages: [ - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", - lun: 0, - }, - { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - lun: 1, - }, - ], - osDiskImage: { - diskEncryptionSetId: - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", - }, - }, - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - safetyProfile: { - allowDeletionOfReplicatedLocations: false, - blockDeletionBeforeEndOfLife: false, - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(); - await createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(); - await createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(); - await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(); - await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(); - await createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(); - await createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(); - await createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsDeleteSample.ts deleted file mode 100644 index d6f918fb29ec..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery image version. - * - * @summary Delete a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json - */ -async function deleteAGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsGetSample.ts deleted file mode 100644 index f75b8ba77ed1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsGetSample.ts +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryImageVersionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json - */ -async function getAGalleryImageVersionWithReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ReplicationStatus"; - const options: GalleryImageVersionsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json - */ -async function getAGalleryImageVersionWithSnapshotsAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json - */ -async function getAGalleryImageVersionWithValidationProfileAndReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ValidationProfile,ReplicationStatus"; - const options: GalleryImageVersionsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfile.json - */ -async function getAGalleryImageVersionWithValidationProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const expand = "ValidationProfile"; - const options: GalleryImageVersionsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json - */ -async function getAGalleryImageVersionWithVhdAsASource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about a gallery image version. - * - * @summary Retrieves information about a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get.json - */ -async function getAGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.get( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryImageVersionWithReplicationStatus(); - await getAGalleryImageVersionWithSnapshotsAsASource(); - await getAGalleryImageVersionWithValidationProfileAndReplicationStatus(); - await getAGalleryImageVersionWithValidationProfile(); - await getAGalleryImageVersionWithVhdAsASource(); - await getAGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsUpdateSample.ts deleted file mode 100644 index 5b8af71d2b16..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsUpdateSample.ts +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryImageVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery image version. - * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json - */ -async function restoreASoftDeletedGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersionUpdate = { - restore: true, - storageProfile: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a gallery image version. - * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update.json - */ -async function updateASimpleGalleryImageVersionManagedImageAsSource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersionUpdate = { - publishingProfile: { - targetRegions: [ - { name: "West US", regionalReplicaCount: 1 }, - { - name: "East US", - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - storageProfile: { - source: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a gallery image version. - * - * @summary Update a gallery image version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json - */ -async function updateASimpleGalleryImageVersionWithoutSourceId(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "1.0.0"; - const galleryImageVersion: GalleryImageVersionUpdate = { - publishingProfile: { - targetRegions: [ - { name: "West US", regionalReplicaCount: 1 }, - { - name: "East US", - regionalReplicaCount: 2, - storageAccountType: "Standard_ZRS", - }, - ], - }, - storageProfile: {}, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImageVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - ); - console.log(result); -} - -async function main(): Promise { - await restoreASoftDeletedGalleryImageVersion(); - await updateASimpleGalleryImageVersionManagedImageAsSource(); - await updateASimpleGalleryImageVersionWithoutSourceId(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesCreateOrUpdateSample.ts deleted file mode 100644 index 67d87853f57f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesCreateOrUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { GalleryImage} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a gallery image definition. - * - * @summary Create or update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Create.json - */ -async function createOrUpdateASimpleGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage: GalleryImage = { - hyperVGeneration: "V1", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - location: "West US", - osState: "Generalized", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateASimpleGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesDeleteSample.ts deleted file mode 100644 index 34147910e471..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery image. - * - * @summary Delete a gallery image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Delete.json - */ -async function deleteAGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryImageName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesGetSample.ts deleted file mode 100644 index e3c197c584f8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a gallery image definition. - * - * @summary Retrieves information about a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Get.json - */ -async function getAGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.get( - resourceGroupName, - galleryName, - galleryImageName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesListByGallerySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesListByGallerySample.ts deleted file mode 100644 index 9b43313fa3e6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesListByGallerySample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List gallery image definitions in a gallery. - * - * @summary List gallery image definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json - */ -async function listGalleryImagesInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.galleryImages.listByGallery( - resourceGroupName, - galleryName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listGalleryImagesInAGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesUpdateSample.ts deleted file mode 100644 index 8ad9a0c4ff13..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesUpdateSample.ts +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryImageUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery image definition. - * - * @summary Update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_UpdateFeatures.json - */ -async function updateAGalleryImageFeature(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage: GalleryImageUpdate = { - allowUpdateImage: true, - features: [ - { - name: "SecurityType", - startsAtVersion: "2.0.0", - value: "TrustedLaunch", - }, - ], - hyperVGeneration: "V2", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - osState: "Generalized", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a gallery image definition. - * - * @summary Update a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Update.json - */ -async function updateASimpleGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; - const galleryImage: GalleryImageUpdate = { - hyperVGeneration: "V1", - identifier: { - offer: "myOfferName", - publisher: "myPublisherName", - sku: "mySkuName", - }, - osState: "Generalized", - osType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryImages.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - ); - console.log(result); -} - -async function main(): Promise { - await updateAGalleryImageFeature(); - await updateASimpleGalleryImage(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts deleted file mode 100644 index 4387be7ea26e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryInVMAccessControlProfileVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a gallery inVMAccessControlProfile version. - * - * @summary Create or update a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json - */ -async function createOrUpdateAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion = - { - defaultAccess: "Allow", - excludeFromLatest: false, - location: "West US", - mode: "Audit", - rules: { - identities: [ - { - name: "WinPA", - exePath: "C:\\Windows\\System32\\cscript.exe", - groupName: "Administrators", - processName: "cscript", - userName: "SYSTEM", - }, - ], - privileges: [ - { - name: "GoalState", - path: "/machine", - queryParameters: { comp: "goalstate" }, - }, - ], - roleAssignments: [{ identities: ["WinPA"], role: "Provisioning" }], - roles: [{ name: "Provisioning", privileges: ["GoalState"] }], - }, - targetLocations: [{ name: "West US" }, { name: "South Central US" }], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfileVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts deleted file mode 100644 index 5f43a5e435ef..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery inVMAccessControlProfile version. - * - * @summary Delete a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json - */ -async function deleteAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfileVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts deleted file mode 100644 index 553c579d3815..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a gallery inVMAccessControlProfile version. - * - * @summary Retrieves information about a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json - */ -async function getAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfileVersions.get( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts deleted file mode 100644 index d4c24d638631..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryInVMAccessControlProfileVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery inVMAccessControlProfile version. - * - * @summary Update a gallery inVMAccessControlProfile version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json - */ -async function updateAGalleryInVMAccessControlProfileVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const inVMAccessControlProfileVersionName = "1.0.0"; - const galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate = - { - defaultAccess: "Allow", - excludeFromLatest: false, - mode: "Audit", - targetLocations: [ - { name: "West US" }, - { name: "South Central US" }, - { name: "East US" }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfileVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - ); - console.log(result); -} - -async function main(): Promise { - await updateAGalleryInVMAccessControlProfileVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts deleted file mode 100644 index 662c42165e35..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryInVMAccessControlProfile} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a gallery inVMAccessControlProfile. - * - * @summary Create or update a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json - */ -async function createOrUpdateAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile = { - location: "West US", - properties: { applicableHostEndpoint: "WireServer", osType: "Linux" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfiles.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts deleted file mode 100644 index 6b8f565f63e4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery inVMAccessControlProfile. - * - * @summary Delete a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json - */ -async function deleteAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfiles.beginDeleteAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesGetSample.ts deleted file mode 100644 index 9aa8c274d836..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a gallery inVMAccessControlProfile. - * - * @summary Retrieves information about a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json - */ -async function getAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryInVMAccessControlProfiles.get( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts deleted file mode 100644 index daa804c66bf4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryInVMAccessControlProfileUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery inVMAccessControlProfile. - * - * @summary Update a gallery inVMAccessControlProfile. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json - */ -async function updateAGalleryInVMAccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; - const galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate = - { properties: { applicableHostEndpoint: "WireServer", osType: "Linux" } }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.galleryInVMAccessControlProfiles.beginUpdateAndWait( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - ); - console.log(result); -} - -async function main(): Promise { - await updateAGalleryInVMAccessControlProfile(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsDeleteSample.ts deleted file mode 100644 index 15763088adcf..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery Script Version. - * - * @summary Delete a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Delete.json - */ -async function deleteAGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryScriptVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsGetSample.ts deleted file mode 100644 index 6ecfb16bbace..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsGetSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Custom ArmResourceRead operation template with CloudError as Error - * - * @summary Custom ArmResourceRead operation template with CloudError as Error - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json - */ -async function getAGalleryScriptVersionWithReplicationStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.get( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Custom ArmResourceRead operation template with CloudError as Error - * - * @summary Custom ArmResourceRead operation template with CloudError as Error - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get.json - */ -async function getAGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.get( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryScriptVersionWithReplicationStatus(); - await getAGalleryScriptVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsUpdateSample.ts deleted file mode 100644 index 2edbdc805f93..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsUpdateSample.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryScriptVersionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery Script Version. - * - * @summary Update a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Update.json - */ -async function updateASimpleGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const galleryScriptVersion: GalleryScriptVersionUpdate = { - publishingProfile: { - endOfLifeDate: new Date("2027-07-01T07:00:00Z"), - replicaCount: 2, - source: { - parameters: [ - { - name: "location", - type: "String", - defaultValue: "westus", - required: true, - }, - { - name: "myGalleryScriptParameter1", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: true, - }, - { - name: "myGalleryScriptParameter2", - type: "String", - description: "description of the parameter", - defaultValue: "default value of parameter", - required: false, - }, - { - name: "numberOfUnits", - type: "Int", - description: "description of the parameter", - defaultValue: "3", - maxValue: "5", - minValue: "1", - required: true, - }, - { - name: "weightOfUnit", - type: "Double", - description: "description of the parameter", - defaultValue: "0.6", - maxValue: "2", - minValue: "0.1", - required: true, - }, - { - name: "typeOfProduct", - type: "Enum", - description: "description of the parameter", - defaultValue: "Fruit", - enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], - required: false, - }, - ], - scriptLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", - }, - storageAccountType: "Standard_LRS", - targetRegions: [ - { - name: "West US", - excludeFromLatest: false, - regionalReplicaCount: 2, - storageAccountType: "Standard_LRS", - }, - ], - }, - safetyProfile: { allowDeletionOfReplicatedLocations: false }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, - ); - console.log(result); -} - -async function main(): Promise { - await updateASimpleGalleryScriptVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsCreateOrUpdateSample.ts deleted file mode 100644 index 1e5cf8896053..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { GalleryScript} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts - * - * @summary Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Create.json - */ -async function createOrUpdateASimpleGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScript: GalleryScript = { - location: "West US", - properties: { - description: "This is the gallery script description.", - eula: "This is the gallery script EULA.", - privacyStatementUri: "{myPrivacyStatementUri}", - releaseNoteUri: "{myReleaseNoteUri}", - supportedOSType: "Windows", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateASimpleGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsDeleteSample.ts deleted file mode 100644 index 08eedb573942..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a gallery Script Definition. - * - * @summary Delete a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Delete.json - */ -async function deleteAGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginDeleteAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsGetSample.ts deleted file mode 100644 index 5ca63f38f39e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a gallery script definition. - * - * @summary Retrieves information about a gallery script definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Get.json - */ -async function getAGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.get( - resourceGroupName, - galleryName, - galleryScriptName, - ); - console.log(result); -} - -async function main(): Promise { - await getAGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsUpdateSample.ts deleted file mode 100644 index 8e3d12b8f914..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsUpdateSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - GalleryScriptUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a gallery Script Definition. - * - * @summary Update a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Update.json - */ -async function updateASimpleGalleryScript(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScript: GalleryScriptUpdate = { - description: "This is the gallery script description.", - eula: "This is the gallery script EULA.", - privacyStatementUri: "{myPrivacyStatementUri}", - releaseNoteUri: "{myReleaseNoteUri}", - supportedOSType: "Windows", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScripts.beginUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - ); - console.log(result); -} - -async function main(): Promise { - await updateASimpleGalleryScript(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/gallerySharingProfileUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/gallerySharingProfileUpdateSample.ts deleted file mode 100644 index 3f725dbc1177..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/gallerySharingProfileUpdateSample.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { SharingUpdate} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update sharing profile of a gallery. - * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json - */ -async function addSharingIdToTheSharingProfileOfAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate: SharingUpdate = { - groups: [ - { - type: "Subscriptions", - ids: [ - "34a4ab42-0d72-47d9-bd1a-aed207386dac", - "380fd389-260b-41aa-bad9-0a83108c370b", - ], - }, - { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] }, - ], - operationType: "Add", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update sharing profile of a gallery. - * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ResetSharingProfile.json - */ -async function resetSharingProfileOfAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate: SharingUpdate = { operationType: "Reset" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update sharing profile of a gallery. - * - * @summary Update sharing profile of a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_EnableCommunityGallery.json - */ -async function shareAGalleryToCommunity(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const sharingUpdate: SharingUpdate = { operationType: "EnableCommunity" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.gallerySharingProfile.beginUpdateAndWait( - resourceGroupName, - galleryName, - sharingUpdate, - ); - console.log(result); -} - -async function main(): Promise { - await addSharingIdToTheSharingProfileOfAGallery(); - await resetSharingProfileOfAGallery(); - await shareAGalleryToCommunity(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/imagesDeleteSample.ts deleted file mode 100644 index 179dfe8d792b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesDeleteSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes an Image. - * - * @summary Deletes an Image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json - */ -async function imageDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait( - resourceGroupName, - imageName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes an Image. - * - * @summary Deletes an Image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json - */ -async function imageDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const imageName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait( - resourceGroupName, - imageName, - ); - console.log(result); -} - -async function main(): Promise { - await imageDeleteMaximumSetGen(); - await imageDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/operationsListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/operationsListSample.ts deleted file mode 100644 index 97d841b9ecdc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await operationsListMaximumSetGen(); - await operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts deleted file mode 100644 index f2b3d05fdacd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - ProximityPlacementGroup} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a proximity placement group. - * - * @summary Create or update a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json - */ -async function createOrUpdateAProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const parameters: ProximityPlacementGroup = { - intent: { vmSizes: ["Basic_A0", "Basic_A2"] }, - location: "westus", - proximityPlacementGroupType: "Standard", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.createOrUpdate( - resourceGroupName, - proximityPlacementGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateAProximityPlacementGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsDeleteSample.ts deleted file mode 100644 index e61d7a349413..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete a proximity placement group. - * - * @summary Delete a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json - */ -async function deleteAProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.delete( - resourceGroupName, - proximityPlacementGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteAProximityPlacementGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsGetSample.ts deleted file mode 100644 index 8ae8098691b4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about a proximity placement group . - * - * @summary Retrieves information about a proximity placement group . - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json - */ -async function getProximityPlacementGroups(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.get( - resourceGroupName, - proximityPlacementGroupName, - ); - console.log(result); -} - -async function main(): Promise { - await getProximityPlacementGroups(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsUpdateSample.ts deleted file mode 100644 index b5d25959b887..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsUpdateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - ProximityPlacementGroupUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update a proximity placement group. - * - * @summary Update a proximity placement group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json - */ -async function updateAProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const proximityPlacementGroupName = "myProximityPlacementGroup"; - const parameters: ProximityPlacementGroupUpdate = { - tags: { additionalProp1: "string" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.proximityPlacementGroups.update( - resourceGroupName, - proximityPlacementGroupName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await updateAProximityPlacementGroup(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/resourceSkusListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/resourceSkusListSample.ts deleted file mode 100644 index c3a4a7f9ac81..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/resourceSkusListSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - ResourceSkusListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json - */ -async function listsAllAvailableResourceSkUs(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.resourceSkus.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json - */ -async function listsAllAvailableResourceSkUsForTheSpecifiedRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const filter = "location eq 'westus'"; - const options: ResourceSkusListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.resourceSkus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets the list of Microsoft.Compute SKUs available for your Subscription. - * - * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json - */ -async function listsAllAvailableResourceSkUsWithExtendedLocationInformation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const includeExtendedLocations = "true"; - const options: ResourceSkusListOptionalParams = { includeExtendedLocations }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.resourceSkus.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listsAllAvailableResourceSkUs(); - await listsAllAvailableResourceSkUsForTheSpecifiedRegion(); - await listsAllAvailableResourceSkUsWithExtendedLocationInformation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsDeleteSample.ts deleted file mode 100644 index c2f3c1f7faee..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsDeleteSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * - * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json - */ -async function restorePointCollectionDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * - * @summary The operation to delete the restore point collection. This operation will also delete all the contained restore points. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json - */ -async function restorePointCollectionDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -async function main(): Promise { - await restorePointCollectionDeleteMaximumSetGen(); - await restorePointCollectionDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsGetSample.ts deleted file mode 100644 index 705c22494d50..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsGetSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get the restore point collection. - * - * @summary The operation to get the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get.json - */ -async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.get( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the restore point collection. - * - * @summary The operation to get the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json - */ -async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.get( - resourceGroupName, - restorePointCollectionName, - ); - console.log(result); -} - -async function main(): Promise { - await getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(); - await getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsUpdateSample.ts deleted file mode 100644 index 832862a0c49d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsUpdateSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - RestorePointCollectionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update the restore point collection. - * - * @summary The operation to update the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json - */ -async function restorePointCollectionUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: RestorePointCollectionUpdate = { - instantAccess: true, - source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", - }, - tags: { key8536: "aaaaaaaaaaaaaaaaaaa" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.update( - resourceGroupName, - restorePointCollectionName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update the restore point collection. - * - * @summary The operation to update the restore point collection. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json - */ -async function restorePointCollectionUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaa"; - const parameters: RestorePointCollectionUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.update( - resourceGroupName, - restorePointCollectionName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await restorePointCollectionUpdateMaximumSetGen(); - await restorePointCollectionUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsCreateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsCreateSample.ts deleted file mode 100644 index 9f24e748cd79..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsCreateSample.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { RestorePoint} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed - * - * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json - */ -async function copyARestorePointToADifferentRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const parameters: RestorePoint = { - sourceRestorePoint: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginCreateAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create the restore point. Updating properties of an existing restore point is not allowed - * - * @summary The operation to create the restore point. Updating properties of an existing restore point is not allowed - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Create.json - */ -async function createARestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const parameters: RestorePoint = { - excludeDisks: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", - }, - ], - instantAccessDurationMinutes: 120, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginCreateAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await copyARestorePointToADifferentRegion(); - await createARestorePoint(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsDeleteSample.ts deleted file mode 100644 index 26086cc25a4a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsDeleteSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete the restore point. - * - * @summary The operation to delete the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json - */ -async function restorePointDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaaaaaaa"; - const restorePointName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the restore point. - * - * @summary The operation to delete the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json - */ -async function restorePointDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const restorePointCollectionName = "aaaaaaaaaaaaaaaaa"; - const restorePointName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.beginDeleteAndWait( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -async function main(): Promise { - await restorePointDeleteMaximumSetGen(); - await restorePointDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsGetSample.ts deleted file mode 100644 index 83eb4e410802..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsGetSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get the restore point. - * - * @summary The operation to get the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get.json - */ -async function getARestorePoint(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.get( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the restore point. - * - * @summary The operation to get the restore point. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json - */ -async function getRestorePointWithInstanceView(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "rpcName"; - const restorePointName = "rpName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePoints.get( - resourceGroupName, - restorePointCollectionName, - restorePointName, - ); - console.log(result); -} - -async function main(): Promise { - await getARestorePoint(); - await getRestorePointWithInstanceView(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesGetSample.ts deleted file mode 100644 index 789df82e9e52..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a shared gallery by subscription id or tenant id. - * - * @summary Get a shared gallery by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json - */ -async function getASharedGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sharedGalleries.get(location, galleryUniqueName); - console.log(result); -} - -async function main(): Promise { - await getASharedGallery(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsGetSample.ts deleted file mode 100644 index 53a2e5c47557..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsGetSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get a shared gallery image version by subscription id or tenant id. - * - * @summary Get a shared gallery image version by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json - */ -async function getASharedGalleryImageVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; - const galleryImageVersionName = "myGalleryImageVersionName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sharedGalleryImageVersions.get( - location, - galleryUniqueName, - galleryImageName, - galleryImageVersionName, - ); - console.log(result); -} - -async function main(): Promise { - await getASharedGalleryImageVersion(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsCreateOrUpdateSample.ts deleted file mode 100644 index a9664e245231..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsCreateOrUpdateSample.ts +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { Snapshot} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json - */ -async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot1"; - const snapshot: Snapshot = { - creationData: { - createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - storageAccountId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json - */ -async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot1"; - const snapshot: Snapshot = { - creationData: { - createOption: "Import", - sourceUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json - */ -async function createASnapshotFromAnElasticSanVolumeSnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot: Snapshot = { - creationData: { - createOption: "CopyFromSanSnapshot", - elasticSanResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json - */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { - creationData: { - createOption: "CopyStart", - provisionedBandwidthCopySpeed: "Enhanced", - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json - */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { - creationData: { - createOption: "CopyStart", - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json - */ -async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { - creationData: { - createOption: "Copy", - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates a snapshot. - * - * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_InstantAccessSnapshot.json - */ -async function createASnapshotWhichCanBeInstantlyAccessable(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot2"; - const snapshot: Snapshot = { - creationData: { - createOption: "Copy", - instantAccessDurationMinutes: 120, - sourceResourceId: - "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", - }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginCreateOrUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -async function main(): Promise { - await createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(); - await createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(); - await createASnapshotFromAnElasticSanVolumeSnapshot(); - await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(); - await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(); - await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(); - await createASnapshotWhichCanBeInstantlyAccessable(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsDeleteSample.ts deleted file mode 100644 index 59712e136a82..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsDeleteSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a snapshot. - * - * @summary Deletes a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Delete.json - */ -async function deleteASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginDeleteAndWait( - resourceGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGetSample.ts deleted file mode 100644 index becd274d52f9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGetSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets information about a snapshot. - * - * @summary Gets information about a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Get.json - */ -async function getInformationAboutASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.get(resourceGroupName, snapshotName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets information about a snapshot. - * - * @summary Gets information about a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json - */ -async function getInformationAboutAnIncrementalSnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "myIncrementalSnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.get(resourceGroupName, snapshotName); - console.log(result); -} - -async function main(): Promise { - await getInformationAboutASnapshot(); - await getInformationAboutAnIncrementalSnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGrantAccessSample.ts deleted file mode 100644 index a49992431343..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGrantAccessSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { GrantAccessData} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Grants access to a snapshot. - * - * @summary Grants access to a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json - */ -async function getASasOnASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const grantAccessData: GrantAccessData = { - access: "Read", - durationInSeconds: 300, - fileFormat: "VHDX", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginGrantAccessAndWait( - resourceGroupName, - snapshotName, - grantAccessData, - ); - console.log(result); -} - -async function main(): Promise { - await getASasOnASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsRevokeAccessSample.ts deleted file mode 100644 index 8142776cd2dc..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsRevokeAccessSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Revokes access to a snapshot. - * - * @summary Revokes access to a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_EndGetAccess.json - */ -async function revokeAccessToASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginRevokeAccessAndWait( - resourceGroupName, - snapshotName, - ); - console.log(result); -} - -async function main(): Promise { - await revokeAccessToASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsUpdateSample.ts deleted file mode 100644 index 563a6b933685..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsUpdateSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { SnapshotUpdate} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates (patches) a snapshot. - * - * @summary Updates (patches) a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json - */ -async function updateASnapshotWithAcceleratedNetworking(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot: SnapshotUpdate = { - diskSizeGB: 20, - supportedCapabilities: { acceleratedNetwork: false }, - tags: { department: "Development", project: "UpdateSnapshots" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates (patches) a snapshot. - * - * @summary Updates (patches) a snapshot. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update.json - */ -async function updateASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const snapshotName = "mySnapshot"; - const snapshot: SnapshotUpdate = { - diskSizeGB: 20, - tags: { department: "Development", project: "UpdateSnapshots" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.snapshots.beginUpdateAndWait( - resourceGroupName, - snapshotName, - snapshot, - ); - console.log(result); -} - -async function main(): Promise { - await updateASnapshotWithAcceleratedNetworking(); - await updateASnapshot(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysCreateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysCreateSample.ts deleted file mode 100644 index df9df4b1feda..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysCreateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - SshPublicKeyResource} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a new SSH public key resource. - * - * @summary Creates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json - */ -async function createANewSshPublicKeyResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters: SshPublicKeyResource = { - location: "westus", - publicKey: "{ssh-rsa public key}", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.create( - resourceGroupName, - sshPublicKeyName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createANewSshPublicKeyResource(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysDeleteSample.ts deleted file mode 100644 index 6161bdc2fc98..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysDeleteSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Delete an SSH public key. - * - * @summary Delete an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json - */ -async function sshPublicKeyDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.delete( - resourceGroupName, - sshPublicKeyName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete an SSH public key. - * - * @summary Delete an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json - */ -async function sshPublicKeyDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.delete( - resourceGroupName, - sshPublicKeyName, - ); - console.log(result); -} - -async function main(): Promise { - await sshPublicKeyDeleteMaximumSetGen(); - await sshPublicKeyDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGenerateKeyPairSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGenerateKeyPairSample.ts deleted file mode 100644 index 055866c9ae7d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGenerateKeyPairSample.ts +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - SshGenerateKeyPairInputParameters, - SshPublicKeysGenerateKeyPairOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json - */ -async function generateAnSshKeyPairWithEd25519Encryption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters: SshGenerateKeyPairInputParameters = { - encryptionType: "Ed25519", - }; - const options: SshPublicKeysGenerateKeyPairOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json - */ -async function generateAnSshKeyPairWithRsaEncryption(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const parameters: SshGenerateKeyPairInputParameters = { - encryptionType: "RSA", - }; - const options: SshPublicKeysGenerateKeyPairOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * - * @summary Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json - */ -async function generateAnSshKeyPair(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.generateKeyPair( - resourceGroupName, - sshPublicKeyName, - ); - console.log(result); -} - -async function main(): Promise { - await generateAnSshKeyPairWithEd25519Encryption(); - await generateAnSshKeyPairWithRsaEncryption(); - await generateAnSshKeyPair(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGetSample.ts deleted file mode 100644 index 7520228ff502..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about an SSH public key. - * - * @summary Retrieves information about an SSH public key. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json - */ -async function getAnSshPublicKey(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const sshPublicKeyName = "mySshPublicKeyName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.get( - resourceGroupName, - sshPublicKeyName, - ); - console.log(result); -} - -async function main(): Promise { - await getAnSshPublicKey(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysUpdateSample.ts deleted file mode 100644 index 30422492e7d5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysUpdateSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - SshPublicKeyUpdateResource} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a new SSH public key resource. - * - * @summary Updates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json - */ -async function sshPublicKeyUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaaa"; - const parameters: SshPublicKeyUpdateResource = { - publicKey: "{ssh-rsa public key}", - tags: { key2854: "a" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.update( - resourceGroupName, - sshPublicKeyName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a new SSH public key resource. - * - * @summary Updates a new SSH public key resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json - */ -async function sshPublicKeyUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const sshPublicKeyName = "aaaaaaaaaaa"; - const parameters: SshPublicKeyUpdateResource = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.sshPublicKeys.update( - resourceGroupName, - sshPublicKeyName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await sshPublicKeyUpdateMaximumSetGen(); - await sshPublicKeyUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesGetSample.ts deleted file mode 100644 index cdfaa7668ef2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesGetSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a virtual machine extension image. - * - * @summary Gets a virtual machine extension image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json - */ -async function virtualMachineExtensionImageGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaaaaaaaaaaaaaaaa"; - const version = "aaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.get( - location, - publisherName, - typeParam, - version, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine extension image. - * - * @summary Gets a virtual machine extension image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json - */ -async function virtualMachineExtensionImageGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aa"; - const version = "aaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.get( - location, - publisherName, - typeParam, - version, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineExtensionImageGetMaximumSetGen(); - await virtualMachineExtensionImageGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListTypesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListTypesSample.ts deleted file mode 100644 index 7bc4a6457127..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListTypesSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image types. - * - * @summary Gets a list of virtual machine extension image types. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json - */ -async function virtualMachineExtensionImageListTypesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listTypes( - location, - publisherName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image types. - * - * @summary Gets a list of virtual machine extension image types. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json - */ -async function virtualMachineExtensionImageListTypesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listTypes( - location, - publisherName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineExtensionImageListTypesMaximumSetGen(); - await virtualMachineExtensionImageListTypesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts deleted file mode 100644 index 7e21e94e5269..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineExtensionImagesListVersionsOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image versions. - * - * @summary Gets a list of virtual machine extension image versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json - */ -async function virtualMachineExtensionImageListVersionsMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaaaaaaaaaaaaaaaa"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 22; - const orderby = "a"; - const options: VirtualMachineExtensionImagesListVersionsOptionalParams = { - filter, - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listVersions( - location, - publisherName, - typeParam, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine extension image versions. - * - * @summary Gets a list of virtual machine extension image versions. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json - */ -async function virtualMachineExtensionImageListVersionsMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const typeParam = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensionImages.listVersions( - location, - publisherName, - typeParam, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineExtensionImageListVersionsMaximumSetGen(); - await virtualMachineExtensionImageListVersionsMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts deleted file mode 100644 index 38d283552cd6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineExtension} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create or update the extension. - * - * @summary The operation to create or update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineExtensionCreateOrUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaaaaaaaa"; - const extensionParameters: VirtualMachineExtension = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "a", - instanceView: { - name: "aaaaaaaaaaaaaaaaa", - type: "aaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - substatuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - }, - location: "westus", - protectedSettings: {}, - publisher: "extPublisher", - settings: {}, - suppressFailures: true, - tags: { key9183: "aa" }, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update the extension. - * - * @summary The operation to create or update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineExtensionCreateOrUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineExtension = { location: "westus" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineExtensionCreateOrUpdateMaximumSetGen(); - await virtualMachineExtensionCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsDeleteSample.ts deleted file mode 100644 index 304e7b25dcd3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsDeleteSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json - */ -async function virtualMachineExtensionDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginDeleteAndWait( - resourceGroupName, - vmName, - vmExtensionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json - */ -async function virtualMachineExtensionDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginDeleteAndWait( - resourceGroupName, - vmName, - vmExtensionName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineExtensionDeleteMaximumSetGen(); - await virtualMachineExtensionDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsGetSample.ts deleted file mode 100644 index 084ab374b52c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsGetSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineExtensionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json - */ -async function virtualMachineExtensionGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmExtensionName = "aaaaaaa"; - const expand = "aaaaaa"; - const options: VirtualMachineExtensionsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.get( - resourceGroupName, - vmName, - vmExtensionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json - */ -async function virtualMachineExtensionGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.get( - resourceGroupName, - vmName, - vmExtensionName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineExtensionGetMaximumSetGen(); - await virtualMachineExtensionGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsListSample.ts deleted file mode 100644 index 1226dc1c7957..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsListSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineExtensionsListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. - * - * @summary The operation to get all extensions of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json - */ -async function virtualMachineExtensionListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaa"; - const options: VirtualMachineExtensionsListOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.list( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get all extensions of a Virtual Machine. - * - * @summary The operation to get all extensions of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json - */ -async function virtualMachineExtensionListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.list( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineExtensionListMaximumSetGen(); - await virtualMachineExtensionListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsUpdateSample.ts deleted file mode 100644 index a5f9ccfb566b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsUpdateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineExtensionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update the extension. - * - * @summary The operation to update the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json - */ -async function updateVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineExtensionUpdate = { - type: "extType", - autoUpgradeMinorVersion: true, - protectedSettingsFromKeyVault: { - secretUrl: - "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", - sourceVault: { - id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", - }, - }, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - suppressFailures: true, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineExtensions.beginUpdateAndWait( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main(): Promise { - await updateVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts deleted file mode 100644 index 235e2baa00e8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a virtual machine image in an edge zone. - * - * @summary Gets a virtual machine image in an edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.get( - location, - edgeZone, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine image in an edge zone. - * - * @summary Gets a virtual machine image in an edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaa"; - const version = "aa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.get( - location, - edgeZone, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImagesEdgeZoneGetMaximumSetGen(); - await virtualMachineImagesEdgeZoneGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSample.ts deleted file mode 100644 index aa37e6826706..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSample.ts +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineImagesEdgeZoneListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 12; - const orderby = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const options: VirtualMachineImagesEdgeZoneListOptionalParams = { - expand, - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.list( - location, - edgeZone, - publisherName, - offer, - skus, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.list( - location, - edgeZone, - publisherName, - offer, - skus, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImagesEdgeZoneListMaximumSetGen(); - await virtualMachineImagesEdgeZoneListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts deleted file mode 100644 index 79f8d1ab43d5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaa"; - const edgeZone = "aaaaa"; - const publisherName = "aaaaaaaaaaaa"; - const offer = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.listSkus( - location, - edgeZone, - publisherName, - offer, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json - */ -async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaa"; - const offer = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.listSkus( - location, - edgeZone, - publisherName, - offer, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImagesEdgeZoneListSkusMaximumSetGen(); - await virtualMachineImagesEdgeZoneListSkusMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesGetSample.ts deleted file mode 100644 index 85a2e94ba05d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesGetSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a virtual machine image. - * - * @summary Gets a virtual machine image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json - */ -async function virtualMachineImageGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaa"; - const publisherName = "aaa"; - const offer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.get( - location, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine image. - * - * @summary Gets a virtual machine image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json - */ -async function virtualMachineImageGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaa"; - const offer = "aa"; - const skus = "aaaaaaaaa"; - const version = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.get( - location, - publisherName, - offer, - skus, - version, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImageGetMaximumSetGen(); - await virtualMachineImageGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListOffersSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListOffersSample.ts deleted file mode 100644 index 4670f2c0aba7..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListOffersSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. - * - * @summary Gets a list of virtual machine image offers for the specified location and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json - */ -async function virtualMachineImageListOffersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaa"; - const publisherName = "aaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listOffers( - location, - publisherName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location and publisher. - * - * @summary Gets a list of virtual machine image offers for the specified location and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json - */ -async function virtualMachineImageListOffersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listOffers( - location, - publisherName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImageListOffersMaximumSetGen(); - await virtualMachineImageListOffersMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSample.ts deleted file mode 100644 index 9773eddd83dd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineImagesListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json - */ -async function virtualMachineImageListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaa"; - const publisherName = "aaaaaa"; - const offer = "aaaaaaaaaaaaaaaa"; - const skus = "aaaaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const top = 18; - const orderby = "aa"; - const options: VirtualMachineImagesListOptionalParams = { - expand, - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.list( - location, - publisherName, - offer, - skus, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * - * @summary Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json - */ -async function virtualMachineImageListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaa"; - const publisherName = "aaaaaaaaaaa"; - const offer = "aaaaaaaaaa"; - const skus = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.list( - location, - publisherName, - offer, - skus, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImageListMaximumSetGen(); - await virtualMachineImageListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSkusSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSkusSample.ts deleted file mode 100644 index 497f89d40fa0..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSkusSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json - */ -async function virtualMachineImageListSkusMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const offer = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listSkus( - location, - publisherName, - offer, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * - * @summary Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json - */ -async function virtualMachineImageListSkusMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const publisherName = "aaaaaaaaaaaaa"; - const offer = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listSkus( - location, - publisherName, - offer, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImageListSkusMaximumSetGen(); - await virtualMachineImageListSkusMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListWithPropertiesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListWithPropertiesSample.ts deleted file mode 100644 index 4a0d7fdb1338..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListWithPropertiesSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineImagesListWithPropertiesOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to - * - * @summary - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json - */ -async function virtualMachineImagesListWithPropertiesMaximumSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; - const publisherName = "MicrosoftWindowsServer"; - const offer = "WindowsServer"; - const skus = "2022-datacenter-azure-edition"; - const expand = "Properties"; - const top = 4; - const orderby = "aa"; - const options: VirtualMachineImagesListWithPropertiesOptionalParams = { - top, - orderby, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listWithProperties( - location, - publisherName, - offer, - skus, - expand, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to - * - * @summary - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MinimumSet_Gen.json - */ -async function virtualMachineImagesListWithPropertiesMinimumSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; - const publisherName = "MicrosoftWindowsServer"; - const offer = "WindowsServer"; - const skus = "2022-datacenter-azure-edition"; - const expand = "Properties"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listWithProperties( - location, - publisherName, - offer, - skus, - expand, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineImagesListWithPropertiesMaximumSet(); - await virtualMachineImagesListWithPropertiesMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts deleted file mode 100644 index 9dccf43e4a21..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineRunCommand} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create or update the run command. - * - * @summary The operation to create or update the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json - */ -async function createOrUpdateARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommand = { - asyncExecution: false, - errorBlobUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", - location: "West US", - outputBlobManagedIdentity: { - clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a", - }, - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - scriptUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", - }, - timeoutInSeconds: 3600, - treatFailureAsDeploymentFailure: false, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineRunCommands.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsDeleteSample.ts deleted file mode 100644 index 64ad7ef7d5a4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsDeleteSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete the run command. - * - * @summary The operation to delete the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json - */ -async function deleteARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.beginDeleteAndWait( - resourceGroupName, - vmName, - runCommandName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts deleted file mode 100644 index b5ac330bd502..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get the run command. - * - * @summary The operation to get the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json - */ -async function getARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.getByVirtualMachine( - resourceGroupName, - vmName, - runCommandName, - ); - console.log(result); -} - -async function main(): Promise { - await getARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetSample.ts deleted file mode 100644 index ecac737eae71..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets specific run command for a subscription in a location. - * - * @summary Gets specific run command for a subscription in a location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_Get.json - */ -async function virtualMachineRunCommandGet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; - const location = "SoutheastAsia"; - const commandId = "RunPowerShellScript"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.get( - location, - commandId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineRunCommandGet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsUpdateSample.ts deleted file mode 100644 index 6bdc91e388f2..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsUpdateSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineRunCommandUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update the run command. - * - * @summary The operation to update the run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json - */ -async function updateARunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommandUpdate = { - asyncExecution: false, - errorBlobManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - errorBlobUri: - "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - script: "Write-Host Hello World! ; Remove-Item C:\test\testFile.txt", - }, - timeoutInSeconds: 3600, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineRunCommands.beginUpdateAndWait( - resourceGroupName, - vmName, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main(): Promise { - await updateARunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts deleted file mode 100644 index db59e789042b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetExtension} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create or update an extension. - * - * @summary The operation to create or update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaa"; - const extensionParameters: VirtualMachineScaleSetExtension = { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update an extension. - * - * @summary The operation to create or update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaa"; - const extensionParameters: VirtualMachineScaleSetExtension = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen(); - await virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts deleted file mode 100644 index fe41a95ed743..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to delete the extension. - * - * @summary The operation to delete the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetExtensionDeleteMaximumSetGen(); - await virtualMachineScaleSetExtensionDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts deleted file mode 100644 index c6f431946a46..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetExtensionsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionGetMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaa"; - const options: VirtualMachineScaleSetExtensionsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.get( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to get the extension. - * - * @summary The operation to get the extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionGetMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "a"; - const vmssExtensionName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetExtensions.get( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetExtensionGetMaximumSetGen(); - await virtualMachineScaleSetExtensionGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsListSample.ts deleted file mode 100644 index 7a6bf6922e5a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsListSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all extensions in a VM scale set. - * - * @summary Gets a list of all extensions in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetExtensions.list( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all extensions in a VM scale set. - * - * @summary Gets a list of all extensions in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetExtensions.list( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await virtualMachineScaleSetExtensionListMaximumSetGen(); - await virtualMachineScaleSetExtensionListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts deleted file mode 100644 index 7615e783e33f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetExtensionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update an extension. - * - * @summary The operation to update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aaaa"; - const extensionParameters: VirtualMachineScaleSetExtensionUpdate = { - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to update an extension. - * - * @summary The operation to update an extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetExtensionUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmssExtensionName = "aa"; - const extensionParameters: VirtualMachineScaleSetExtensionUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetExtensionUpdateMaximumSetGen(); - await virtualMachineScaleSetExtensionUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts deleted file mode 100644 index e1c15c515cfd..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. - * - * @summary Cancels the current virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Cancels the current virtual machine scale set rolling upgrade. - * - * @summary Cancels the current virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginCancelAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen(); - await virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts deleted file mode 100644 index 054fe8e2afeb..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @summary Gets the status of the latest virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the status of the latest virtual machine scale set rolling upgrade. - * - * @summary Gets the status of the latest virtual machine scale set rolling upgrade. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen(); - await virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts deleted file mode 100644 index 84fc59130382..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMExtension} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create or update the VMSS VM extension. - * - * @summary The operation to create or update the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json - */ -async function createVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineScaleSetVMExtension = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMExtensions.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main(): Promise { - await createVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts deleted file mode 100644 index 5ba88f22ed01..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete the VMSS VM extension. - * - * @summary The operation to delete the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json - */ -async function deleteVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMExtensions.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts deleted file mode 100644 index 1cdea8c026f5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get the VMSS VM extension. - * - * @summary The operation to get the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json - */ -async function getVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMExtensions.get( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - ); - console.log(result); -} - -async function main(): Promise { - await getVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts deleted file mode 100644 index 599c25ae77b8..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMExtensionUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update the VMSS VM extension. - * - * @summary The operation to update the VMSS VM extension. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json - */ -async function updateVirtualMachineScaleSetVMExtension(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const vmExtensionName = "myVMExtension"; - const extensionParameters: VirtualMachineScaleSetVMExtensionUpdate = { - typePropertiesType: "extType", - autoUpgradeMinorVersion: true, - publisher: "extPublisher", - settings: { UserName: "xyz@microsoft.com" }, - typeHandlerVersion: "1.2", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMExtensions.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - ); - console.log(result); -} - -async function main(): Promise { - await updateVirtualMachineScaleSetVMExtension(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts deleted file mode 100644 index 551766cf3bed..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineRunCommand} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to create or update the VMSS VM run command. - * - * @summary The operation to create or update the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json - */ -async function createVirtualMachineScaleSetVMRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommand = { - asyncExecution: false, - errorBlobManagedIdentity: {}, - errorBlobUri: - "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", - location: "West US", - outputBlobManagedIdentity: { - clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a", - }, - outputBlobUri: - "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", - parameters: [ - { name: "param1", value: "value1" }, - { name: "param2", value: "value2" }, - ], - runAsPassword: "", - runAsUser: "user1", - source: { - scriptUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", - scriptUriManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - }, - timeoutInSeconds: 3600, - treatFailureAsDeploymentFailure: true, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMRunCommands.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main(): Promise { - await createVirtualMachineScaleSetVMRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts deleted file mode 100644 index 34ab7f009e36..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete the VMSS VM run command. - * - * @summary The operation to delete the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json - */ -async function deleteVirtualMachineScaleSetVMRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMRunCommands.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - ); - console.log(result); -} - -async function main(): Promise { - await deleteVirtualMachineScaleSetVMRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts deleted file mode 100644 index e40b807342a9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to get the VMSS VM run command. - * - * @summary The operation to get the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json - */ -async function getVirtualMachineScaleSetVMRunCommands(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMRunCommands.get( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - ); - console.log(result); -} - -async function main(): Promise { - await getVirtualMachineScaleSetVMRunCommands(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts deleted file mode 100644 index 81e1e3fc52c4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineRunCommandUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to update the VMSS VM run command. - * - * @summary The operation to update the VMSS VM run command. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json - */ -async function updateVirtualMachineScaleSetVMRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const runCommandName = "myRunCommand"; - const runCommand: VirtualMachineRunCommandUpdate = { - source: { - scriptUri: - "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", - scriptUriManagedIdentity: { - objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072", - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMRunCommands.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - ); - console.log(result); -} - -async function main(): Promise { - await updateVirtualMachineScaleSetVMRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts deleted file mode 100644 index df4d1a8016ad..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * - * @summary Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json - */ -async function virtualMachineScaleSetVMApproveRollingUpgrade(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "vmssToApproveRollingUpgradeOn"; - const instanceId = "0123"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginApproveRollingUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMApproveRollingUpgrade(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts deleted file mode 100644 index 2068ee82d214..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - AttachDetachDataDisksRequest} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Attach and detach data disks to/from a virtual machine in a VM scale set. - * - * @summary Attach and detach data disks to/from a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "azure-vmscaleset"; - const instanceId = "0"; - const parameters: AttachDetachDataDisksRequest = { - dataDisksToAttach: [ - { - caching: "ReadOnly", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - lun: 1, - writeAcceleratorEnabled: true, - }, - { - caching: "ReadWrite", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", - lun: 2, - writeAcceleratorEnabled: false, - }, - ], - dataDisksToDetach: [ - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Attach and detach data disks to/from a virtual machine in a VM scale set. - * - * @summary Attach and detach data disks to/from a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "azure-vmscaleset"; - const instanceId = "0"; - const parameters: AttachDetachDataDisksRequest = { - dataDisksToAttach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - }, - ], - dataDisksToDetach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(); - await virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts deleted file mode 100644 index 200631187f41..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsDeleteOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a virtual machine from a VM scale set. - * - * @summary Deletes a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json - */ -async function forceDeleteAVirtualMachineFromAVMScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const forceDeletion = true; - const options: VirtualMachineScaleSetVMsDeleteOptionalParams = { - forceDeletion, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -async function main(): Promise { - await forceDeleteAVirtualMachineFromAVMScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetSample.ts deleted file mode 100644 index f83f5881b45b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetSample.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json - */ -async function getVMScaleSetVMWithResiliencyView(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "1"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json - */ -async function getVMScaleSetVMWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets a virtual machine from a VM scale set. - * - * @summary Gets a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json - */ -async function getVMScaleSetVMWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const instanceId = "0"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.get( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await getVMScaleSetVMWithResiliencyView(); - await getVMScaleSetVMWithUserData(); - await getVMScaleSetVMWithVMSizeProperties(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSListSample.ts deleted file mode 100644 index 640cbe4104f9..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSListSample.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json - */ -async function listVmssVMSWithResilientVmdeletionStatus(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "resourceGroupname"; - const virtualMachineScaleSetName = "vmssName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const virtualMachineScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; - const filter = "aaaaaaaaaaaaaa"; - const select = "aaaaaaaaaaaaaaaaaaaaa"; - const expand = "aaaaaaaaaaaaa"; - const options: VirtualMachineScaleSetVMsListOptionalParams = { - filter, - select, - expand, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all virtual machines in a VM scale sets. - * - * @summary Gets a list of all virtual machines in a VM scale sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const virtualMachineScaleSetName = "aaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSetVMs.list( - resourceGroupName, - virtualMachineScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listVmssVMSWithResilientVmdeletionStatus(); - await virtualMachineScaleSetVMListMaximumSetGen(); - await virtualMachineScaleSetVMListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts deleted file mode 100644 index 1ac295022346..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. - * - * @summary Performs maintenance on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Performs maintenance on a virtual machine in a VM scale set. - * - * @summary Performs maintenance on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaa"; - const instanceId = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(); - await virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts deleted file mode 100644 index 31f5608124e1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsPowerOffOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMPowerOffMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; - const instanceId = "aaaaaaaaa"; - const skipShutdown = true; - const options: VirtualMachineScaleSetVMsPowerOffOptionalParams = { - skipShutdown, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMPowerOffMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMPowerOffMaximumSetGen(); - await virtualMachineScaleSetVMPowerOffMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts deleted file mode 100644 index e7415fade4ce..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMRedeployMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMRedeployMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMRedeployMaximumSetGen(); - await virtualMachineScaleSetVMRedeployMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts deleted file mode 100644 index cdddec94e7f3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * - * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * - * @summary Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMReimageAllMaximumSetGen(); - await virtualMachineScaleSetVMReimageAllMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageSample.ts deleted file mode 100644 index a7ff01d6ea70..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageSample.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMReimageParameters, - VirtualMachineScaleSetVMsReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmScaleSetVMReimageInput: VirtualMachineScaleSetVMReimageParameters = { - forceUpdateOSDiskForEphemeral: true, - tempDisk: true, - }; - const options: VirtualMachineScaleSetVMsReimageOptionalParams = { - vmScaleSetVMReimageInput, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @summary Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMReimageMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaa"; - const instanceId = "aaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMReimageMaximumSetGen(); - await virtualMachineScaleSetVMReimageMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRestartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRestartSample.ts deleted file mode 100644 index 6774a670b7d4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRestartSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restarts a virtual machine in a VM scale set. - * - * @summary Restarts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMRestartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aa"; - const instanceId = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restarts a virtual machine in a VM scale set. - * - * @summary Restarts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMRestartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const instanceId = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMRestartMaximumSetGen(); - await virtualMachineScaleSetVMRestartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts deleted file mode 100644 index 3ce461aefb82..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * - * @summary The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json - */ -async function retrieveBootDiagnosticsDataOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; - const sasUriExpirationTimeInMinutes = 60; - const options: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams = - { sasUriExpirationTimeInMinutes }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - console.log(result); -} - -async function main(): Promise { - await retrieveBootDiagnosticsDataOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts deleted file mode 100644 index cafc7fc8ae39..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { RunCommandInput} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Run command on a virtual machine in a VM scale set. - * - * @summary Run command on a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json - */ -async function virtualMachineScaleSetVMSRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const instanceId = "0"; - const parameters: RunCommandInput = { - commandId: "RunPowerShellScript", - script: ["Write-Host Hello World!"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginRunCommandAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMSRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts deleted file mode 100644 index 8928e642e4a6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine in a VM scale set. - * - * @summary The operation to simulate the eviction of spot virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json - */ -async function simulateEvictionAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmScaleSetName = "VmScaleSetName"; - const instanceId = "InstanceId"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.simulateEviction( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await simulateEvictionAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSStartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSStartSample.ts deleted file mode 100644 index 7ee09432ff3e..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSStartSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Starts a virtual machine in a VM scale set. - * - * @summary Starts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMStartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Starts a virtual machine in a VM scale set. - * - * @summary Starts a virtual machine in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMStartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMStartMaximumSetGen(); - await virtualMachineScaleSetVMStartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts deleted file mode 100644 index 34bf94737d8f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVM} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Updates a virtual machine of a VM scale set. - * - * @summary Updates a virtual machine of a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetVMUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetVM = { - additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, - availabilitySet: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - diagnosticsProfile: { - bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" }, - }, - hardwareProfile: { - vmSize: "Basic_A0", - vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 }, - }, - instanceView: { - bootDiagnostics: { - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - }, - disks: [ - { - name: "aaaaaaaaaaa", - encryptionSettings: [ - { - diskEncryptionKey: { - secretUrl: "aaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - enabled: true, - keyEncryptionKey: { - keyUrl: "aaaaaaaaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - }, - ], - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - }, - ], - maintenanceRedeployStatus: { - isCustomerInitiatedMaintenanceAllowed: true, - lastOperationMessage: "aaaaaa", - lastOperationResultCode: "None", - maintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), - maintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), - preMaintenanceWindowEndTime: new Date("2021-11-30T12:58:26.531Z"), - preMaintenanceWindowStartTime: new Date("2021-11-30T12:58:26.531Z"), - }, - placementGroupId: "aaa", - platformFaultDomain: 14, - platformUpdateDomain: 23, - rdpThumbPrint: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - vmAgent: { - extensionHandlers: [ - { - type: "aaaaaaaaaaaaa", - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - typeHandlerVersion: "aaaaa", - }, - ], - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - vmAgentVersion: "aaaaaaaaaaaaaaaaaaaaaaa", - }, - vmHealth: { - status: { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - }, - extensions: [ - { - name: "aaaaaaaaaaaaaaaaa", - type: "aaaaaaaaa", - statuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - substatuses: [ - { - code: "aaaaaaaaaaaaaaaaaaaaaaa", - displayStatus: "aaaaaa", - level: "Info", - message: "a", - time: new Date("2021-11-30T12:58:26.522Z"), - }, - ], - typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - }, - ], - }, - licenseType: "aaaaaaaaaa", - location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "aaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { dnsServers: ["aaaaaa"] }, - dscpConfiguration: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - enableAcceleratedNetworking: true, - enableFpga: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "aa", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - applicationSecurityGroups: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 2, - ipTags: [ - { - ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", - tag: "aaaaaaaaaaaaaaaaaaaa", - }, - ], - publicIPAddressVersion: "IPv4", - publicIPAllocationMethod: "Dynamic", - publicIPPrefix: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "Basic", tier: "Regional" }, - }, - subnet: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - ], - networkSecurityGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - primary: true, - }, - ], - networkInterfaces: [ - { - deleteOption: "Delete", - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", - primary: true, - }, - ], - }, - networkProfileConfiguration: { - networkInterfaceConfigurations: [ - { - name: "vmsstestnetconfig5415", - deleteOption: "Delete", - dnsSettings: { dnsServers: [] }, - enableAcceleratedNetworking: true, - enableFpga: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "vmsstestnetconfig9693", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - applicationSecurityGroups: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - loadBalancerInboundNatPools: [ - { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "aaaaaaaaaaaaaaaaaa", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 18, - ipTags: [ - { ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, - ], - publicIPAddressVersion: "IPv4", - publicIPPrefix: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - sku: { name: "Basic", tier: "Regional" }, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503", - }, - }, - ], - networkSecurityGroup: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "aaaaaaaaaaaaaaaa", - adminUsername: "Foo12", - allowExtensionOperations: true, - computerName: "test000000", - customData: "aaaa", - linuxConfiguration: { - disablePasswordAuthentication: true, - patchSettings: { - assessmentMode: "ImageDefault", - patchMode: "ImageDefault", - }, - provisionVMAgent: true, - ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] }, - }, - requireGuestProvisionSignal: true, - secrets: [], - windowsConfiguration: { - additionalUnattendContent: [ - { - componentName: "Microsoft-Windows-Shell-Setup", - content: "aaaaaaaaaaaaaaaaaaaa", - passName: "OobeSystem", - settingName: "AutoLogon", - }, - ], - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "ImageDefault", - enableHotpatching: true, - patchMode: "Manual", - }, - provisionVMAgent: true, - timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - winRM: { - listeners: [ - { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }, - ], - }, - }, - }, - plan: { - name: "aaaaaaaaaa", - product: "aaaaaaaaaaaaaaaaaaaa", - promotionCode: "aaaaaaaaaaaaaaaaaaaa", - publisher: "aaaaaaaaaaaaaaaaaaaaaa", - }, - protectionPolicy: { - protectFromScaleIn: true, - protectFromScaleSetActions: true, - }, - securityProfile: { - encryptionAtHost: true, - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - sku: { name: "Classic", capacity: 29, tier: "aaaaaaaaaaaaaa" }, - storageProfile: { - dataDisks: [ - { - name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - caching: "None", - createOption: "Empty", - deleteOption: "Delete", - detachOption: "ForceDetach", - diskSizeGB: 128, - image: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - lun: 1, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - storageAccountType: "Standard_LRS", - }, - toBeDetached: true, - vhd: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - writeAcceleratorEnabled: true, - }, - ], - imageReference: { - id: "a", - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", - sku: "2012-R2-Datacenter", - version: "4.127.20180315", - }, - osDisk: { - name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", - caching: "None", - createOption: "FromImage", - deleteOption: "Delete", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - diskSizeGB: 127, - encryptionSettings: { - diskEncryptionKey: { - secretUrl: "aaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - enabled: true, - keyEncryptionKey: { - keyUrl: "aaaaaaaaaaaaaa", - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - }, - }, - image: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", - storageAccountType: "Standard_LRS", - }, - osType: "Windows", - vhd: { - uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", - }, - writeAcceleratorEnabled: true, - }, - }, - tags: {}, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates a virtual machine of a VM scale set. - * - * @summary Updates a virtual machine of a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetVMUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetVM = { location: "westus" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetVMUpdateMaximumSetGen(); - await virtualMachineScaleSetVMUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts deleted file mode 100644 index 830c01cff7ee..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * - * @summary Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json - */ -async function virtualMachineScaleSetApproveRollingUpgrade(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "vmssToApproveRollingUpgradeOn"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["0", "1", "2"], - }; - const options: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginApproveRollingUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetApproveRollingUpgrade(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts deleted file mode 100644 index 6d38d182aa3f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VMScaleSetConvertToSinglePlacementGroupInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: VMScaleSetConvertToSinglePlacementGroupInput = { - activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.convertToSinglePlacementGroup( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * - * @summary Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const parameters: VMScaleSetConvertToSinglePlacementGroupInput = {}; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.convertToSinglePlacementGroup( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen(); - await virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts deleted file mode 100644 index 7150b25e58c6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts +++ /dev/null @@ -1,3969 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSet} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json - */ -async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json - */ -async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - protectedSettingsFromKeyVault: { - secretUrl: - "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", - sourceVault: { - id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", - }, - }, - publisher: "{extension-Publisher}", - settings: {}, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json - */ -async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json - */ -async function createAPlatformImageScaleSetWithUnmanagedOSDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - vhdContainers: [ - "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", - "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer", - ], - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json - */ -async function createAScaleSetFromACustomImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json - */ -async function createAScaleSetFromAGeneralizedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json - */ -async function createAScaleSetFromASpecializedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json - */ -async function createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{nicConfig1-name}", - disableTcpStateTracking: true, - enableAcceleratedNetworking: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - { - name: "{nicConfig2-name}", - disableTcpStateTracking: false, - enableAcceleratedNetworking: false, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{nicConfig2-name}", - primary: true, - privateIPAddressVersion: "IPv4", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json - */ -async function createAScaleSetWithApplicationProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - applicationProfile: { - galleryApplications: [ - { - configurationReference: - "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", - enableAutomaticUpgrade: false, - order: 1, - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", - tags: "myTag1", - treatFailureAsDeploymentFailure: true, - }, - { - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticZoneRebalancingPolicy.json - */ -async function createAScaleSetWithAutomaticZoneRebalancingEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { - automaticZoneRebalancingPolicy: { - enabled: true, - rebalanceBehavior: "CreateBeforeDelete", - rebalanceStrategy: "Recreate", - }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json - */ -async function createAScaleSetWithDiskControllerType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - hardwareProfile: { - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - diskControllerType: "NVMe", - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json - */ -async function createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { - caching: "ReadWrite", - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - ], - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json - */ -async function createAScaleSetWithFpgaNetworkInterfaces(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - { - name: "{fpgaNic-Name}", - enableAcceleratedNetworking: false, - enableFpga: true, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{fpgaNic-Name}", - primary: true, - privateIPAddressVersion: "IPv4", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json - */ -async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { encryptionAtHost: true }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxInstancePercentPerZonePolicy.json - */ -async function createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { - zoneAllocationPolicy: { - maxInstancePercentPerZonePolicy: { enabled: true, value: 50 }, - }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json - */ -async function createAScaleSetWithNetworkInterfacesWithPublicIPAddressDnsSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{nicConfig1-name}", - auxiliaryMode: "AcceleratedConnections", - auxiliarySku: "A1", - disableTcpStateTracking: true, - enableAcceleratedNetworking: true, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - tags: { nicTag: "tag" }, - }, - { - name: "{nicConfig2-name}", - disableTcpStateTracking: false, - enableAcceleratedNetworking: false, - enableIPForwarding: false, - ipConfigurations: [ - { - name: "{nicConfig2-name}", - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "publicip", - dnsSettings: { - domainNameLabel: "vmsstestlabel01", - domainNameLabelScope: "NoReuse", - }, - idleTimeoutInMinutes: 10, - tags: { pipTag: "tag" }, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", - }, - }, - ], - primary: false, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json - */ -async function createAScaleSetWithOSImageScheduledEventsEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - scheduledEventsProfile: { - osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json - */ -async function createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - proxyAgentSettings: { - addProxyAgentExtension: true, - enabled: true, - imds: { - inVMAccessControlProfileReferenceId: - "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", - }, - wireServer: { - inVMAccessControlProfileReferenceId: - "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", - }, - }, - }, - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-jammy", - publisher: "Canonical", - sku: "22_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json - */ -async function createAScaleSetWithResilientVMCreationEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { resilientVMCreationPolicy: { enabled: true } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json - */ -async function createAScaleSetWithResilientVMDeletionEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - resiliencyPolicy: { resilientVMDeletionPolicy: { enabled: true } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json - */ -async function createAScaleSetWithSecurityPostureReference(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "eastus2euap", - overprovision: true, - sku: { name: "Standard_A1", capacity: 3, tier: "Standard" }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "Automatic", - }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityPostureReference: { - id: "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2022-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json - */ -async function createAScaleSetWithSecurityTypeAsConfidentialVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DC2as_v5", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2019-datacenter-cvm", - publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, - storageAccountType: "StandardSSD_LRS", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json - */ -async function createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTpmSecurityEncryptionType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DC2es_v5", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2022-datacenter-cvm", - publisher: "UbuntuServer", - sku: "linux-cvm", - version: "17763.2183.2109130127", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "NonPersistedTPM" }, - storageAccountType: "StandardSSD_LRS", - }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json - */ -async function createAScaleSetWithServiceArtifactReference(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "eastus2euap", - overprovision: true, - sku: { name: "Standard_A1", capacity: 3, tier: "Standard" }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "Automatic", - }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - serviceArtifactReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2022-Datacenter", - version: "latest", - }, - osDisk: { - name: "osDisk", - caching: "ReadWrite", - createOption: "FromImage", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json - */ -async function createAScaleSetWithUefiSettingsOfSecureBootAndVTpm(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2s_v3", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - securityProfile: { - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "windowsserver-gen2preview-preview", - publisher: "MicrosoftWindowsServer", - sku: "windows10-tvm", - version: "18363.592.2001092016", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json - */ -async function createAScaleSetWithAMarketplaceImagePlan(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json - */ -async function createAScaleSetWithAnAzureApplicationGateway(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}", - }, - ], - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json - */ -async function createAScaleSetWithAnAzureLoadBalancer(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - loadBalancerBackendAddressPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}", - }, - ], - loadBalancerInboundNatPools: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}", - }, - ], - publicIPAddressConfiguration: { - name: "{vmss-name}", - publicIPAddressVersion: "IPv4", - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json - */ -async function createAScaleSetWithAutomaticRepairsEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json - */ -async function createAScaleSetWithBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json - */ -async function createAScaleSetWithEmptyDataDisksOnEachVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D2_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - diskSizeGB: 512, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json - */ -async function createAScaleSetWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json - */ -async function createAScaleSetWithEphemeralOSDisksUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json - */ -async function createAScaleSetWithEphemeralOSDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local" }, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json - */ -async function createAScaleSetWithExtensionTimeBudget(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionProfile: { - extensionsTimeBudget: "PT1H20M", - extensions: [ - { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: false, - publisher: "{extension-Publisher}", - settings: {}, - typeHandlerVersion: "{handler-version}", - }, - ], - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json - */ -async function createAScaleSetWithManagedBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - diagnosticsProfile: { bootDiagnostics: { enabled: true } }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json - */ -async function createAScaleSetWithPasswordAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPlacement.json - */ -async function createAScaleSetWithPlacementPolicyAuto(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - placement: { includeZones: ["1", "3"], zonePlacementPolicy: "Auto" }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json - */ -async function createAScaleSetWithPremiumStorage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json - */ -async function createAScaleSetWithPriorityMixPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - orchestrationMode: "Flexible", - platformFaultDomainCount: 1, - priorityMixPolicy: { - baseRegularPriorityCount: 10, - regularPriorityPercentageAboveBase: 50, - }, - sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, - virtualMachineProfile: { - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableAcceleratedNetworking: false, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [], - loadBalancerBackendAddressPools: [], - primary: true, - publicIPAddressConfiguration: { - name: "{vmss-name}", - idleTimeoutInMinutes: 15, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json - */ -async function createAScaleSetWithScaleInPolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - scaleInPolicy: { - forceDeletion: true, - prioritizeUnhealthyVMs: true, - rules: ["OldestVM"], - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json - */ -async function createAScaleSetWithSkuProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - orchestrationMode: "Flexible", - priorityMixPolicy: { - baseRegularPriorityCount: 4, - regularPriorityPercentageAboveBase: 50, - }, - singlePlacementGroup: false, - sku: { name: "Mix", capacity: 10 }, - skuProfile: { - allocationStrategy: "CapacityOptimized", - vmSizes: [ - { name: "Standard_D8s_v5" }, - { name: "Standard_E16s_v5" }, - { name: "Standard_D2s_v5" }, - ], - }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile_Prioritized.json - */ -async function createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - orchestrationMode: "Flexible", - priorityMixPolicy: { - baseRegularPriorityCount: 4, - regularPriorityPercentageAboveBase: 50, - }, - singlePlacementGroup: false, - sku: { name: "Mix", capacity: 10 }, - skuProfile: { - allocationStrategy: "Prioritized", - vmSizes: [ - { name: "Standard_D8s_v5", rank: 0 }, - { name: "Standard_E16s_v5", rank: 1 }, - { name: "Standard_D2s_v5", rank: 2 }, - ], - }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json - */ -async function createAScaleSetWithSpotRestorePolicy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_A8m_v2", capacity: 2, tier: "Standard" }, - spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - evictionPolicy: "Deallocate", - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - priority: "Spot", - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json - */ -async function createAScaleSetWithSshAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - linuxConfiguration: { - disablePasswordAuthentication: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json - */ -async function createAScaleSetWithTerminateScheduledEventsEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - scheduledEventsProfile: { - terminateNotificationProfile: { - enable: true, - notBeforeTimeout: "PT5M", - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json - */ -async function createAScaleSetWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json - */ -async function createAScaleSetWithVirtualMachinesInDifferentZones(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "centralus", - overprovision: true, - sku: { name: "Standard_A1_v2", capacity: 2, tier: "Standard" }, - upgradePolicy: { mode: "Automatic" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - diskSizeGB: 512, - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - zones: ["1", "3"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json - */ -async function createAScaleSetWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - hardwareProfile: { - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json - */ -async function createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - scheduledEventsPolicy: { - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { enable: true }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - zonalPlatformFaultDomainAlignMode: "Aligned", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithHighSpeedInterconnectPlacement.json - */ -async function createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - highSpeedInterconnectPlacement: "None", - location: "westus", - orchestrationMode: "Flexible", - platformFaultDomainCount: 1, - sku: { name: "Standard_D1_v2", capacity: 2, tier: "Standard" }, - virtualMachineProfile: { - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableAcceleratedNetworking: false, - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - applicationGatewayBackendAddressPools: [], - loadBalancerBackendAddressPools: [], - primary: true, - publicIPAddressConfiguration: { - name: "{vmss-name}", - idleTimeoutInMinutes: 15, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts-gen2", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxZoneCount.json - */ -async function createAZonesAutoScaleSetWithMaxZoneCount(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: false, - placement: { zonePlacementPolicy: "Auto" }, - resiliencyPolicy: { zoneAllocationPolicy: { maxZoneCount: 2 } }, - sku: { name: "Standard_D1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update a VM scale set. - * - * @summary Create or update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json - */ -async function createOrUpdateAScaleSetWithCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VirtualMachineScaleSet = { - location: "westus", - overprovision: true, - sku: { name: "Standard_DS1_v2", capacity: 3, tier: "Standard" }, - upgradePolicy: { mode: "Manual" }, - virtualMachineProfile: { - capacityReservation: { - capacityReservationGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", - }, - }, - networkProfile: { - networkInterfaceConfigurations: [ - { - name: "{vmss-name}", - enableIPForwarding: true, - ipConfigurations: [ - { - name: "{vmss-name}", - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerNamePrefix: "{vmss-name}", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginCreateOrUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(); - await createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(); - await createACustomImageScaleSetFromAnUnmanagedGeneralizedOSImage(); - await createAPlatformImageScaleSetWithUnmanagedOSDisks(); - await createAScaleSetFromACustomImage(); - await createAScaleSetFromAGeneralizedSharedImage(); - await createAScaleSetFromASpecializedSharedImage(); - await createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(); - await createAScaleSetWithApplicationProfile(); - await createAScaleSetWithAutomaticZoneRebalancingEnabled(); - await createAScaleSetWithDiskControllerType(); - await createAScaleSetWithDiskEncryptionSetResourceInOSDiskAndDataDisk(); - await createAScaleSetWithFpgaNetworkInterfaces(); - await createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(); - await createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(); - await createAScaleSetWithNetworkInterfacesWithPublicIPAddressDnsSettings(); - await createAScaleSetWithOSImageScheduledEventsEnabled(); - await createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(); - await createAScaleSetWithResilientVMCreationEnabled(); - await createAScaleSetWithResilientVMDeletionEnabled(); - await createAScaleSetWithSecurityPostureReference(); - await createAScaleSetWithSecurityTypeAsConfidentialVM(); - await createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTpmSecurityEncryptionType(); - await createAScaleSetWithServiceArtifactReference(); - await createAScaleSetWithUefiSettingsOfSecureBootAndVTpm(); - await createAScaleSetWithAMarketplaceImagePlan(); - await createAScaleSetWithAnAzureApplicationGateway(); - await createAScaleSetWithAnAzureLoadBalancer(); - await createAScaleSetWithAutomaticRepairsEnabled(); - await createAScaleSetWithBootDiagnostics(); - await createAScaleSetWithEmptyDataDisksOnEachVM(); - await createAScaleSetWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(); - await createAScaleSetWithEphemeralOSDisksUsingPlacementProperty(); - await createAScaleSetWithEphemeralOSDisks(); - await createAScaleSetWithExtensionTimeBudget(); - await createAScaleSetWithManagedBootDiagnostics(); - await createAScaleSetWithPasswordAuthentication(); - await createAScaleSetWithPlacementPolicyAuto(); - await createAScaleSetWithPremiumStorage(); - await createAScaleSetWithPriorityMixPolicy(); - await createAScaleSetWithScaleInPolicy(); - await createAScaleSetWithSkuProfile(); - await createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(); - await createAScaleSetWithSpotRestorePolicy(); - await createAScaleSetWithSshAuthentication(); - await createAScaleSetWithTerminateScheduledEventsEnabled(); - await createAScaleSetWithUserData(); - await createAScaleSetWithVirtualMachinesInDifferentZones(); - await createAScaleSetWithVMSizeProperties(); - await createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(); - await createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(); - await createAZonesAutoScaleSetWithMaxZoneCount(); - await createOrUpdateAScaleSetWithCapacityReservation(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeallocateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeallocateSample.ts deleted file mode 100644 index bba73d0f65d0..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeallocateSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsDeallocateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetDeallocateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const hibernate = true; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsDeallocateOptionalParams = { - hibernate, - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @summary Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetDeallocateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetDeallocateMaximumSetGen(); - await virtualMachineScaleSetDeallocateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts deleted file mode 100644 index 817cdb825210..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceRequiredIDs, - VirtualMachineScaleSetsDeleteInstancesOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes virtual machines in a VM scale set. - * - * @summary Deletes virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetDeleteInstancesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaa"; - const forceDeletion = true; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsDeleteInstancesOptionalParams = { - forceDeletion, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Deletes virtual machines in a VM scale set. - * - * @summary Deletes virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetDeleteInstancesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginDeleteInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetDeleteInstancesMaximumSetGen(); - await virtualMachineScaleSetDeleteInstancesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteSample.ts deleted file mode 100644 index bb392b95d386..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetsDeleteOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a VM scale set. - * - * @summary Deletes a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json - */ -async function forceDeleteAVMScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const forceDeletion = true; - const options: VirtualMachineScaleSetsDeleteOptionalParams = { - forceDeletion, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginDeleteAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await forceDeleteAVMScaleSet(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts deleted file mode 100644 index 7f9b09267e9d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the status of a VM scale set instance. - * - * @summary Gets the status of a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetGetInstanceViewMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.getInstanceView( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets the status of a VM scale set instance. - * - * @summary Gets the status of a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetGetInstanceViewMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.getInstanceView( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetGetInstanceViewMaximumSetGen(); - await virtualMachineScaleSetGetInstanceViewMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts deleted file mode 100644 index ab574f0f83a5..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. - * - * @summary Gets list of OS upgrades on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listOSUpgradeHistory( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets list of OS upgrades on a VM scale set instance. - * - * @summary Gets list of OS upgrades on a VM scale set instance. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listOSUpgradeHistory( - resourceGroupName, - vmScaleSetName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen(); - await virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetSample.ts deleted file mode 100644 index 1dda419720ed..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetSample.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetsGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json - */ -async function getVMScaleSetVMWithDiskControllerType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const expand = "userData"; - const options: VirtualMachineScaleSetsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json - */ -async function getAVirtualMachineScaleSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json - */ -async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Display information about a virtual machine scale set. - * - * @summary Display information about a virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json - */ -async function getAVirtualMachineScaleSetWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const expand = "userData"; - const options: VirtualMachineScaleSetsGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.get( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await getVMScaleSetVMWithDiskControllerType(); - await getAVirtualMachineScaleSet(); - await getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(); - await getAVirtualMachineScaleSetWithUserData(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSample.ts deleted file mode 100644 index 186f55722315..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. - * - * @summary Gets a list of all VM scale sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.list( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Gets a list of all VM scale sets under a resource group. - * - * @summary Gets a list of all VM scale sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.list( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await virtualMachineScaleSetListMaximumSetGen(); - await virtualMachineScaleSetListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPowerOffSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPowerOffSample.ts deleted file mode 100644 index b0e4cc205c5d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPowerOffSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsPowerOffOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetPowerOffMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; - const skipShutdown = true; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsPowerOffOptionalParams = { - skipShutdown, - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @summary Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetPowerOffMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPowerOffAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetPowerOffMaximumSetGen(); - await virtualMachineScaleSetPowerOffMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReapplySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReapplySample.ts deleted file mode 100644 index edec0b8b7f0b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReapplySample.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * - * @summary Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetsReapplyMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "b4f1213b-cacc-4816-8bfb-f30f90643de8"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || - "VirtualMachineScaleSetReapplyTestRG"; - const vmScaleSetName = "VMSSReapply-Test-ScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReapplyAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * - * @summary Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetsReapplyMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "b4f1213b-cacc-4816-8bfb-f30f90643de8"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || - "VirtualMachineScaleSetReapplyTestRG"; - const vmScaleSetName = "VMSSReapply-Test-ScaleSet"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReapplyAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetsReapplyMaximumSetGen(); - await virtualMachineScaleSetsReapplyMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRedeploySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRedeploySample.ts deleted file mode 100644 index 9e778e36284f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRedeploySample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsRedeployOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * - * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRedeployMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsRedeployOptionalParams = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * - * @summary Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRedeployMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRedeployAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetRedeployMaximumSetGen(); - await virtualMachineScaleSetRedeployMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageAllSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageAllSample.ts deleted file mode 100644 index 4c3af6f3696a..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageAllSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsReimageAllOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * - * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetReimageAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsReimageAllOptionalParams = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * - * @summary Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetReimageAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAllAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetReimageAllMaximumSetGen(); - await virtualMachineScaleSetReimageAllMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageSample.ts deleted file mode 100644 index 791d8d9717f3..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetReimageParameters, - VirtualMachineScaleSetsReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * - * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetReimageMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmScaleSetReimageInput: VirtualMachineScaleSetReimageParameters = { - forceUpdateOSDiskForEphemeral: true, - instanceIds: ["aaaaaaaaaa"], - tempDisk: true, - }; - const options: VirtualMachineScaleSetsReimageOptionalParams = { - vmScaleSetReimageInput, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * - * @summary Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetReimageMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginReimageAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetReimageMaximumSetGen(); - await virtualMachineScaleSetReimageMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRestartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRestartSample.ts deleted file mode 100644 index 4d788912d3a4..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRestartSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsRestartOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. - * - * @summary Restarts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetRestartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsRestartOptionalParams = { - vmInstanceIDs, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Restarts one or more virtual machines in a VM scale set. - * - * @summary Restarts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetRestartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginRestartAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetRestartMaximumSetGen(); - await virtualMachineScaleSetRestartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsScaleOutSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsScaleOutSample.ts deleted file mode 100644 index 966ee7a2014d..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsScaleOutSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VMScaleSetScaleOutInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Scales out one or more virtual machines in a VM scale set. - * - * @summary Scales out one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json - */ -async function virtualMachineScaleSetScaleOut(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; - const parameters: VMScaleSetScaleOutInput = { - capacity: 5, - properties: { zone: "1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginScaleOutAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetScaleOut(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts deleted file mode 100644 index 8f36df299447..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - OrchestrationServiceStateInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Changes ServiceState property for a given service - * - * @summary Changes ServiceState property for a given service - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetOrchestrationServiceStateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const parameters: OrchestrationServiceStateInput = { - action: "Resume", - serviceName: "AutomaticRepairs", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Changes ServiceState property for a given service - * - * @summary Changes ServiceState property for a given service - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetOrchestrationServiceStateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const parameters: OrchestrationServiceStateInput = { - action: "Resume", - serviceName: "AutomaticRepairs", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginSetOrchestrationServiceStateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetOrchestrationServiceStateMaximumSetGen(); - await virtualMachineScaleSetOrchestrationServiceStateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsStartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsStartSample.ts deleted file mode 100644 index 01e61006fa04..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsStartSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsStartOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. - * - * @summary Starts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetStartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsStartOptionalParams = { vmInstanceIDs }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Starts one or more virtual machines in a VM scale set. - * - * @summary Starts one or more virtual machines in a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetStartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginStartAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetStartMaximumSetGen(); - await virtualMachineScaleSetStartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts deleted file mode 100644 index 86737d4bbaca..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineScaleSetVMInstanceRequiredIDs} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json - */ -async function virtualMachineScaleSetUpdateInstancesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @summary Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json - */ -async function virtualMachineScaleSetUpdateInstancesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginUpdateInstancesAndWait( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineScaleSetUpdateInstancesMaximumSetGen(); - await virtualMachineScaleSetUpdateInstancesMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAssessPatchesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAssessPatchesSample.ts deleted file mode 100644 index 5939d6a3d3c6..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAssessPatchesSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Assess patches on the VM. - * - * @summary Assess patches on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json - */ -async function assessPatchStateOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const vmName = "myVMName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAssessPatchesAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await assessPatchStateOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts deleted file mode 100644 index c93d13174bbe..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - AttachDetachDataDisksRequest} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Attach and detach data disks to/from the virtual machine. - * - * @summary Attach and detach data disks to/from the virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json - */ -async function virtualMachineAttachDetachDataDisksMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: AttachDetachDataDisksRequest = { - dataDisksToAttach: [ - { - caching: "ReadOnly", - deleteOption: "Delete", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - lun: 1, - writeAcceleratorEnabled: true, - }, - { - caching: "ReadWrite", - deleteOption: "Detach", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", - lun: 2, - writeAcceleratorEnabled: false, - }, - ], - dataDisksToDetach: [ - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - { - detachOption: "ForceDetach", - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Attach and detach data disks to/from the virtual machine. - * - * @summary Attach and detach data disks to/from the virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json - */ -async function virtualMachineAttachDetachDataDisksMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "azure-vm"; - const parameters: AttachDetachDataDisksRequest = { - dataDisksToAttach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", - }, - ], - dataDisksToDetach: [ - { - diskId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginAttachDetachDataDisksAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineAttachDetachDataDisksMaximumSetGen(); - await virtualMachineAttachDetachDataDisksMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCaptureSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCaptureSample.ts deleted file mode 100644 index 4c95a02dd37c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCaptureSample.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineCaptureParameters} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * - * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json - */ -async function virtualMachineCaptureMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const parameters: VirtualMachineCaptureParameters = { - destinationContainerName: "aaaaaaa", - overwriteVhds: true, - vhdPrefix: "aaaaaaaaa", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCaptureAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * - * @summary Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json - */ -async function virtualMachineCaptureMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaa"; - const parameters: VirtualMachineCaptureParameters = { - destinationContainerName: "aaaaaaa", - overwriteVhds: true, - vhdPrefix: "aaaaaaaaa", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCaptureAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineCaptureMaximumSetGen(); - await virtualMachineCaptureMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesConvertToManagedDisksSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesConvertToManagedDisksSample.ts deleted file mode 100644 index cf911a08b875..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesConvertToManagedDisksSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * - * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json - */ -async function virtualMachineConvertToManagedDisksMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * - * @summary Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json - */ -async function virtualMachineConvertToManagedDisksMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginConvertToManagedDisksAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineConvertToManagedDisksMaximumSetGen(); - await virtualMachineConvertToManagedDisksMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeallocateSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeallocateSample.ts deleted file mode 100644 index b8920abaa215..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeallocateSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachinesDeallocateOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * - * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json - */ -async function virtualMachineDeallocateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaa"; - const hibernate = true; - const options: VirtualMachinesDeallocateOptionalParams = { hibernate }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeallocateAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * - * @summary Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json - */ -async function virtualMachineDeallocateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeallocateAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineDeallocateMaximumSetGen(); - await virtualMachineDeallocateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeleteSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeleteSample.ts deleted file mode 100644 index 4eb12ed26b32..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachinesDeleteOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to delete a virtual machine. - * - * @summary The operation to delete a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json - */ -async function forceDeleteAVM(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const forceDeletion = true; - const options: VirtualMachinesDeleteOptionalParams = { forceDeletion }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginDeleteAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await forceDeleteAVM(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGetSample.ts deleted file mode 100644 index 8a0858ebbbce..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGetSample.ts +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachinesGetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get.json - */ -async function getAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const expand = "userData"; - const options: VirtualMachinesGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json - */ -async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json - */ -async function getAVirtualMachineWithDiskControllerTypeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const expand = "userData"; - const options: VirtualMachinesGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the model view or the instance view of a virtual machine. - * - * @summary Retrieves information about the model view or the instance view of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json - */ -async function getAVirtualMachineWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.get(resourceGroupName, vmName); - console.log(result); -} - -async function main(): Promise { - await getAVirtualMachine(); - await getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); - await getAVirtualMachineWithDiskControllerTypeProperties(); - await getAVirtualMachineWithVMSizeProperties(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstallPatchesSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstallPatchesSample.ts deleted file mode 100644 index 5d35ab28f294..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstallPatchesSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachineInstallPatchesParameters} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Installs patches on the VM. - * - * @summary Installs patches on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json - */ -async function installPatchStateOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const vmName = "myVMName"; - const installPatchesInput: VirtualMachineInstallPatchesParameters = { - maximumDuration: "PT4H", - rebootSetting: "IfRequired", - windowsParameters: { - classificationsToInclude: ["Critical", "Security"], - maxPatchPublishDate: new Date("2020-11-19T02:36:43.0539904+00:00"), - patchNameMasksToExclude: ["*Windows*"], - patchNameMasksToInclude: ["*SQL*"], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginInstallPatchesAndWait( - resourceGroupName, - vmName, - installPatchesInput, - ); - console.log(result); -} - -async function main(): Promise { - await installPatchStateOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstanceViewSample.ts deleted file mode 100644 index 2347f6f251ef..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstanceViewSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. - * - * @summary Retrieves information about the run-time state of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json - */ -async function getVirtualMachineInstanceView(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.instanceView( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Retrieves information about the run-time state of a virtual machine. - * - * @summary Retrieves information about the run-time state of a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json - */ -async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.instanceView( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await getVirtualMachineInstanceView(); - await getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListSample.ts deleted file mode 100644 index b50c9197a8b7..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachinesListOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * - * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json - */ -async function virtualMachineListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaa"; - const options: VirtualMachinesListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachines.list( - resourceGroupName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * - * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json - */ -async function virtualMachineListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.virtualMachines.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await virtualMachineListMaximumSetGen(); - await virtualMachineListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts deleted file mode 100644 index 640d2060393b..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - MigrateVMToVirtualMachineScaleSetInput, - VirtualMachinesMigrateToVMScaleSetOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * - * @summary Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json - */ -async function migrateAVirtualMachineToFlexibleVirtualMachineScaleSer(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters: MigrateVMToVirtualMachineScaleSetInput = { - targetFaultDomain: 0, - targetVMSize: "Standard_D1_v2", - }; - const options: VirtualMachinesMigrateToVMScaleSetOptionalParams = { - parameters, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginMigrateToVMScaleSetAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await migrateAVirtualMachineToFlexibleVirtualMachineScaleSer(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPerformMaintenanceSample.ts deleted file mode 100644 index 074c07636d0c..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPerformMaintenanceSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to perform maintenance on a virtual machine. - * - * @summary The operation to perform maintenance on a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json - */ -async function virtualMachinePerformMaintenanceMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPerformMaintenanceAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to perform maintenance on a virtual machine. - * - * @summary The operation to perform maintenance on a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json - */ -async function virtualMachinePerformMaintenanceMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPerformMaintenanceAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachinePerformMaintenanceMaximumSetGen(); - await virtualMachinePerformMaintenanceMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPowerOffSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPowerOffSample.ts deleted file mode 100644 index ff011118df49..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPowerOffSample.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachinesPowerOffOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * - * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json - */ -async function virtualMachinePowerOffMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const skipShutdown = true; - const options: VirtualMachinesPowerOffOptionalParams = { skipShutdown }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPowerOffAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * - * @summary The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json - */ -async function virtualMachinePowerOffMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginPowerOffAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachinePowerOffMaximumSetGen(); - await virtualMachinePowerOffMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReapplySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReapplySample.ts deleted file mode 100644 index 96282070d624..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReapplySample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to reapply a virtual machine's state. - * - * @summary The operation to reapply a virtual machine's state. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json - */ -async function reapplyTheStateOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReapplyAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await reapplyTheStateOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRedeploySample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRedeploySample.ts deleted file mode 100644 index e6228fcf3644..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRedeploySample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json - */ -async function virtualMachineRedeployMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "a"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRedeployAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @summary Shuts down the virtual machine, moves it to a new node, and powers it back on. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json - */ -async function virtualMachineRedeployMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRedeployAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineRedeployMaximumSetGen(); - await virtualMachineRedeployMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRestartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRestartSample.ts deleted file mode 100644 index f5b6e20a5389..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRestartSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to restart a virtual machine. - * - * @summary The operation to restart a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json - */ -async function virtualMachineRestartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRestartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to restart a virtual machine. - * - * @summary The operation to restart a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json - */ -async function virtualMachineRestartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRestartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineRestartMaximumSetGen(); - await virtualMachineRestartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts deleted file mode 100644 index 1dafdd404144..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { - VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * - * @summary The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json - */ -async function retrieveBootDiagnosticsDataOfAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; - const sasUriExpirationTimeInMinutes = 60; - const options: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams = { - sasUriExpirationTimeInMinutes, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.retrieveBootDiagnosticsData( - resourceGroupName, - vmName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await retrieveBootDiagnosticsDataOfAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRunCommandSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRunCommandSample.ts deleted file mode 100644 index a67f40e7b0c1..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRunCommandSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { RunCommandInput} from "@azure/arm-compute"; -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Run command on the VM. - * - * @summary Run command on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand.json - */ -async function virtualMachineRunCommand(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "crptestar98131"; - const vmName = "vm3036"; - const parameters: RunCommandInput = { commandId: "RunPowerShellScript" }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginRunCommandAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineRunCommand(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesSimulateEvictionSample.ts deleted file mode 100644 index 5f379d1f3e43..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesSimulateEvictionSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to simulate the eviction of spot virtual machine. - * - * @summary The operation to simulate the eviction of spot virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json - */ -async function simulateEvictionAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.simulateEviction( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await simulateEvictionAVirtualMachine(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesStartSample.ts b/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesStartSample.ts deleted file mode 100644 index 1ded6434779f..000000000000 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesStartSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { ComputeManagementClient } from "@azure/arm-compute"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to The operation to start a virtual machine. - * - * @summary The operation to start a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json - */ -async function virtualMachineStartMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginStartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to start a virtual machine. - * - * @summary The operation to start a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json - */ -async function virtualMachineStartMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmName = "aaaaa"; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginStartAndWait( - resourceGroupName, - vmName, - ); - console.log(result); -} - -async function main(): Promise { - await virtualMachineStartMaximumSetGen(); - await virtualMachineStartMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/README.md b/sdk/compute/arm-compute/samples/v24/javascript/README.md similarity index 58% rename from sdk/compute/arm-compute/samples/v23/javascript/README.md rename to sdk/compute/arm-compute/samples/v24/javascript/README.md index accaacb1d12b..1c22b6a54dda 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/README.md +++ b/sdk/compute/arm-compute/samples/v24/javascript/README.md @@ -1,323 +1,296 @@ -# client library samples for JavaScript +# @azure/arm-compute client library samples for JavaScript -These sample programs show how to use the JavaScript client libraries for in some common scenarios. +These sample programs show how to use the JavaScript client libraries for @azure/arm-compute in some common scenarios. -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js][availabilitysetscancelmigrationtovirtualmachinescalesetsample] | Cancel the migration operation on an Availability Set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json | -| [availabilitySetsConvertToVirtualMachineScaleSetSample.js][availabilitysetsconverttovirtualmachinescalesetsample] | Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json | -| [availabilitySetsCreateOrUpdateSample.js][availabilitysetscreateorupdatesample] | Create or update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json | -| [availabilitySetsDeleteSample.js][availabilitysetsdeletesample] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json | -| [availabilitySetsGetSample.js][availabilitysetsgetsample] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json | -| [availabilitySetsListAvailableSizesSample.js][availabilitysetslistavailablesizessample] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json | -| [availabilitySetsListBySubscriptionSample.js][availabilitysetslistbysubscriptionsample] | Lists all availability sets in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json | -| [availabilitySetsListSample.js][availabilitysetslistsample] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json | -| [availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js][availabilitysetsstartmigrationtovirtualmachinescalesetsample] | Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json | -| [availabilitySetsUpdateSample.js][availabilitysetsupdatesample] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json | -| [availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js][availabilitysetsvalidatemigrationtovirtualmachinescalesetsample] | Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json | -| [capacityReservationGroupsCreateOrUpdateSample.js][capacityreservationgroupscreateorupdatesample] | The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json | -| [capacityReservationGroupsDeleteSample.js][capacityreservationgroupsdeletesample] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json | -| [capacityReservationGroupsGetSample.js][capacityreservationgroupsgetsample] | The operation that retrieves information about a capacity reservation group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_Get.json | -| [capacityReservationGroupsListByResourceGroupSample.js][capacityreservationgroupslistbyresourcegroupsample] | Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json | -| [capacityReservationGroupsListBySubscriptionSample.js][capacityreservationgroupslistbysubscriptionsample] | Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json | -| [capacityReservationGroupsUpdateSample.js][capacityreservationgroupsupdatesample] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json | -| [capacityReservationsCreateOrUpdateSample.js][capacityreservationscreateorupdatesample] | The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json | -| [capacityReservationsDeleteSample.js][capacityreservationsdeletesample] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json | -| [capacityReservationsGetSample.js][capacityreservationsgetsample] | The operation that retrieves information about the capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_Get.json | -| [capacityReservationsListByCapacityReservationGroupSample.js][capacityreservationslistbycapacityreservationgroupsample] | Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json | -| [capacityReservationsUpdateSample.js][capacityreservationsupdatesample] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json | -| [cloudServiceOperatingSystemsGetOSFamilySample.js][cloudserviceoperatingsystemsgetosfamilysample] | Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamily_Get.json | -| [cloudServiceOperatingSystemsGetOSVersionSample.js][cloudserviceoperatingsystemsgetosversionsample] | Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_Get.json | -| [cloudServiceOperatingSystemsListOSFamiliesSample.js][cloudserviceoperatingsystemslistosfamiliessample] | Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamilies_List.json | -| [cloudServiceOperatingSystemsListOSVersionsSample.js][cloudserviceoperatingsystemslistosversionssample] | Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_List.json | -| [cloudServiceRoleInstancesDeleteSample.js][cloudserviceroleinstancesdeletesample] | Deletes a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete.json | -| [cloudServiceRoleInstancesGetInstanceViewSample.js][cloudserviceroleinstancesgetinstanceviewsample] | Retrieves information about the run-time state of a role instance in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_InstanceView.json | -| [cloudServiceRoleInstancesGetRemoteDesktopFileSample.js][cloudserviceroleinstancesgetremotedesktopfilesample] | Gets a remote desktop file for a role instance in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json | -| [cloudServiceRoleInstancesGetSample.js][cloudserviceroleinstancesgetsample] | Gets a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get.json | -| [cloudServiceRoleInstancesListSample.js][cloudserviceroleinstanceslistsample] | Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRolesInstance_List.json | -| [cloudServiceRoleInstancesRebuildSample.js][cloudserviceroleinstancesrebuildsample] | The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild.json | -| [cloudServiceRoleInstancesReimageSample.js][cloudserviceroleinstancesreimagesample] | The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage.json | -| [cloudServiceRoleInstancesRestartSample.js][cloudserviceroleinstancesrestartsample] | The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart.json | -| [cloudServiceRolesGetSample.js][cloudservicerolesgetsample] | Gets a role from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_Get.json | -| [cloudServiceRolesListSample.js][cloudserviceroleslistsample] | Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_List.json | -| [cloudServicesCreateOrUpdateSample.js][cloudservicescreateorupdatesample] | Create or update a cloud service. Please note some properties can be set only during cloud service creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole.json | -| [cloudServicesDeleteInstancesSample.js][cloudservicesdeleteinstancessample] | Deletes role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json | -| [cloudServicesDeleteSample.js][cloudservicesdeletesample] | Deletes a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Delete.json | -| [cloudServicesGetInstanceViewSample.js][cloudservicesgetinstanceviewsample] | Gets the status of a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_InstanceViewWithMultiRole.json | -| [cloudServicesGetSample.js][cloudservicesgetsample] | Display information about a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_WithMultiRoleAndRDP.json | -| [cloudServicesListAllSample.js][cloudserviceslistallsample] | Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_BySubscription.json | -| [cloudServicesListSample.js][cloudserviceslistsample] | Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_ByResourceGroup.json | -| [cloudServicesPowerOffSample.js][cloudservicespoweroffsample] | Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_PowerOff.json | -| [cloudServicesRebuildSample.js][cloudservicesrebuildsample] | Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json | -| [cloudServicesReimageSample.js][cloudservicesreimagesample] | Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json | -| [cloudServicesRestartSample.js][cloudservicesrestartsample] | Restarts one or more role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json | -| [cloudServicesStartSample.js][cloudservicesstartsample] | Starts the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Start.json | -| [cloudServicesUpdateDomainGetUpdateDomainSample.js][cloudservicesupdatedomaingetupdatedomainsample] | Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Get.json | -| [cloudServicesUpdateDomainListUpdateDomainsSample.js][cloudservicesupdatedomainlistupdatedomainssample] | Gets a list of all update domains in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_List.json | -| [cloudServicesUpdateDomainWalkUpdateDomainSample.js][cloudservicesupdatedomainwalkupdatedomainsample] | Updates the role instances in the specified update domain. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Update.json | -| [cloudServicesUpdateSample.js][cloudservicesupdatesample] | Update a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Update_ToIncludeTags.json | -| [communityGalleriesGetSample.js][communitygalleriesgetsample] | Get a community gallery by gallery public name. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json | -| [communityGalleryImageVersionsGetSample.js][communitygalleryimageversionsgetsample] | Get a community gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json | -| [communityGalleryImageVersionsListSample.js][communitygalleryimageversionslistsample] | List community gallery image versions inside an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json | -| [communityGalleryImagesGetSample.js][communitygalleryimagesgetsample] | Get a community gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json | -| [communityGalleryImagesListSample.js][communitygalleryimageslistsample] | List community gallery images inside a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json | -| [dedicatedHostGroupsCreateOrUpdateSample.js][dedicatedhostgroupscreateorupdatesample] | Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json | -| [dedicatedHostGroupsDeleteSample.js][dedicatedhostgroupsdeletesample] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json | -| [dedicatedHostGroupsGetSample.js][dedicatedhostgroupsgetsample] | Retrieves information about a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json | -| [dedicatedHostGroupsListByResourceGroupSample.js][dedicatedhostgroupslistbyresourcegroupsample] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json | -| [dedicatedHostGroupsListBySubscriptionSample.js][dedicatedhostgroupslistbysubscriptionsample] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json | -| [dedicatedHostGroupsUpdateSample.js][dedicatedhostgroupsupdatesample] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json | -| [dedicatedHostsCreateOrUpdateSample.js][dedicatedhostscreateorupdatesample] | Create or update a dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json | -| [dedicatedHostsDeleteSample.js][dedicatedhostsdeletesample] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json | -| [dedicatedHostsGetSample.js][dedicatedhostsgetsample] | Retrieves information about a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Get.json | -| [dedicatedHostsListAvailableSizesSample.js][dedicatedhostslistavailablesizessample] | Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json | -| [dedicatedHostsListByHostGroupSample.js][dedicatedhostslistbyhostgroupsample] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json | -| [dedicatedHostsRedeploySample.js][dedicatedhostsredeploysample] | Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json | -| [dedicatedHostsRestartSample.js][dedicatedhostsrestartsample] | Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json | -| [dedicatedHostsUpdateSample.js][dedicatedhostsupdatesample] | Update a dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json | -| [diskAccessesCreateOrUpdateSample.js][diskaccessescreateorupdatesample] | Creates or updates a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Create.json | -| [diskAccessesDeleteAPrivateEndpointConnectionSample.js][diskaccessesdeleteaprivateendpointconnectionsample] | Deletes a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json | -| [diskAccessesDeleteSample.js][diskaccessesdeletesample] | Deletes a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Delete.json | -| [diskAccessesGetAPrivateEndpointConnectionSample.js][diskaccessesgetaprivateendpointconnectionsample] | Gets information about a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json | -| [diskAccessesGetPrivateLinkResourcesSample.js][diskaccessesgetprivatelinkresourcessample] | Gets the private link resources possible under disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json | -| [diskAccessesGetSample.js][diskaccessesgetsample] | Gets information about a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json | -| [diskAccessesListByResourceGroupSample.js][diskaccesseslistbyresourcegroupsample] | Lists all the disk access resources under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json | -| [diskAccessesListPrivateEndpointConnectionsSample.js][diskaccesseslistprivateendpointconnectionssample] | List information about private endpoint connections under a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json | -| [diskAccessesListSample.js][diskaccesseslistsample] | Lists all the disk access resources under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json | -| [diskAccessesUpdateAPrivateEndpointConnectionSample.js][diskaccessesupdateaprivateendpointconnectionsample] | Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json | -| [diskAccessesUpdateSample.js][diskaccessesupdatesample] | Updates (patches) a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Update.json | -| [diskEncryptionSetsCreateOrUpdateSample.js][diskencryptionsetscreateorupdatesample] | Creates or updates a disk encryption set x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json | -| [diskEncryptionSetsDeleteSample.js][diskencryptionsetsdeletesample] | Deletes a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json | -| [diskEncryptionSetsGetSample.js][diskencryptionsetsgetsample] | Gets information about a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json | -| [diskEncryptionSetsListAssociatedResourcesSample.js][diskencryptionsetslistassociatedresourcessample] | Lists all resources that are encrypted with this disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json | -| [diskEncryptionSetsListByResourceGroupSample.js][diskencryptionsetslistbyresourcegroupsample] | Lists all the disk encryption sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json | -| [diskEncryptionSetsListSample.js][diskencryptionsetslistsample] | Lists all the disk encryption sets under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json | -| [diskEncryptionSetsUpdateSample.js][diskencryptionsetsupdatesample] | Updates (patches) a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json | -| [diskRestorePointGetSample.js][diskrestorepointgetsample] | Get disk restorePoint resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json | -| [diskRestorePointGrantAccessSample.js][diskrestorepointgrantaccesssample] | Grants access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json | -| [diskRestorePointListByRestorePointSample.js][diskrestorepointlistbyrestorepointsample] | Lists diskRestorePoints under a vmRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json | -| [diskRestorePointRevokeAccessSample.js][diskrestorepointrevokeaccesssample] | Revokes access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json | -| [disksCreateOrUpdateSample.js][diskscreateorupdatesample] | Creates or updates a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json | -| [disksDeleteSample.js][disksdeletesample] | Deletes a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Delete.json | -| [disksGetSample.js][disksgetsample] | Gets information about a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Get.json | -| [disksGrantAccessSample.js][disksgrantaccesssample] | Grants access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess.json | -| [disksListByResourceGroupSample.js][diskslistbyresourcegroupsample] | Lists all the disks under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListByResourceGroup.json | -| [disksListSample.js][diskslistsample] | Lists all the disks under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListBySubscription.json | -| [disksRevokeAccessSample.js][disksrevokeaccesssample] | Revokes access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_EndGetAccess.json | -| [disksUpdateSample.js][disksupdatesample] | Updates (patches) a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json | -| [galleriesCreateOrUpdateSample.js][galleriescreateorupdatesample] | Create or update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Create.json | -| [galleriesDeleteSample.js][galleriesdeletesample] | Delete a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Delete.json | -| [galleriesGetSample.js][galleriesgetsample] | Retrieves information about a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Get.json | -| [galleriesListByResourceGroupSample.js][gallerieslistbyresourcegroupsample] | List galleries under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json | -| [galleriesListSample.js][gallerieslistsample] | List galleries under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListBySubscription.json | -| [galleriesUpdateSample.js][galleriesupdatesample] | Update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Update.json | -| [galleryApplicationVersionsCreateOrUpdateSample.js][galleryapplicationversionscreateorupdatesample] | Create or update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json | -| [galleryApplicationVersionsDeleteSample.js][galleryapplicationversionsdeletesample] | Delete a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json | -| [galleryApplicationVersionsGetSample.js][galleryapplicationversionsgetsample] | Retrieves information about a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json | -| [galleryApplicationVersionsListByGalleryApplicationSample.js][galleryapplicationversionslistbygalleryapplicationsample] | List gallery Application Versions in a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json | -| [galleryApplicationVersionsUpdateSample.js][galleryapplicationversionsupdatesample] | Update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json | -| [galleryApplicationsCreateOrUpdateSample.js][galleryapplicationscreateorupdatesample] | Create or update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Create.json | -| [galleryApplicationsDeleteSample.js][galleryapplicationsdeletesample] | Delete a gallery Application. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Delete.json | -| [galleryApplicationsGetSample.js][galleryapplicationsgetsample] | Retrieves information about a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Get.json | -| [galleryApplicationsListByGallerySample.js][galleryapplicationslistbygallerysample] | List gallery Application Definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json | -| [galleryApplicationsUpdateSample.js][galleryapplicationsupdatesample] | Update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Update.json | -| [galleryImageVersionsCreateOrUpdateSample.js][galleryimageversionscreateorupdatesample] | Create or update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json | -| [galleryImageVersionsDeleteSample.js][galleryimageversionsdeletesample] | Delete a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json | -| [galleryImageVersionsGetSample.js][galleryimageversionsgetsample] | Retrieves information about a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json | -| [galleryImageVersionsListByGalleryImageSample.js][galleryimageversionslistbygalleryimagesample] | List gallery image versions in a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json | -| [galleryImageVersionsUpdateSample.js][galleryimageversionsupdatesample] | Update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json | -| [galleryImagesCreateOrUpdateSample.js][galleryimagescreateorupdatesample] | Create or update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Create.json | -| [galleryImagesDeleteSample.js][galleryimagesdeletesample] | Delete a gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Delete.json | -| [galleryImagesGetSample.js][galleryimagesgetsample] | Retrieves information about a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Get.json | -| [galleryImagesListByGallerySample.js][galleryimageslistbygallerysample] | List gallery image definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json | -| [galleryImagesUpdateSample.js][galleryimagesupdatesample] | Update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_UpdateFeatures.json | -| [galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js][galleryinvmaccesscontrolprofileversionscreateorupdatesample] | Create or update a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json | -| [galleryInVMAccessControlProfileVersionsDeleteSample.js][galleryinvmaccesscontrolprofileversionsdeletesample] | Delete a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json | -| [galleryInVMAccessControlProfileVersionsGetSample.js][galleryinvmaccesscontrolprofileversionsgetsample] | Retrieves information about a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json | -| [galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.js][galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample] | List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json | -| [galleryInVMAccessControlProfileVersionsUpdateSample.js][galleryinvmaccesscontrolprofileversionsupdatesample] | Update a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json | -| [galleryInVMAccessControlProfilesCreateOrUpdateSample.js][galleryinvmaccesscontrolprofilescreateorupdatesample] | Create or update a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json | -| [galleryInVMAccessControlProfilesDeleteSample.js][galleryinvmaccesscontrolprofilesdeletesample] | Delete a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json | -| [galleryInVMAccessControlProfilesGetSample.js][galleryinvmaccesscontrolprofilesgetsample] | Retrieves information about a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json | -| [galleryInVMAccessControlProfilesListByGallerySample.js][galleryinvmaccesscontrolprofileslistbygallerysample] | List gallery inVMAccessControlProfiles in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json | -| [galleryInVMAccessControlProfilesUpdateSample.js][galleryinvmaccesscontrolprofilesupdatesample] | Update a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json | -| [galleryScriptVersionsCreateOrUpdateSample.js][galleryscriptversionscreateorupdatesample] | Create or update a gallery Script Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Create.json | -| [galleryScriptVersionsDeleteSample.js][galleryscriptversionsdeletesample] | Delete a gallery Script Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Delete.json | -| [galleryScriptVersionsGetSample.js][galleryscriptversionsgetsample] | Custom ArmResourceRead operation template with CloudError as Error x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json | -| [galleryScriptVersionsListByGalleryScriptSample.js][galleryscriptversionslistbygalleryscriptsample] | List gallery Script Versions in a gallery Script Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json | -| [galleryScriptVersionsUpdateSample.js][galleryscriptversionsupdatesample] | Update a gallery Script Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Update.json | -| [galleryScriptsCreateOrUpdateSample.js][galleryscriptscreateorupdatesample] | Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Create.json | -| [galleryScriptsDeleteSample.js][galleryscriptsdeletesample] | Delete a gallery Script Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Delete.json | -| [galleryScriptsGetSample.js][galleryscriptsgetsample] | Retrieves information about a gallery script definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Get.json | -| [galleryScriptsListByGallerySample.js][galleryscriptslistbygallerysample] | List gallery Script Definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_ListByGallery.json | -| [galleryScriptsUpdateSample.js][galleryscriptsupdatesample] | Update a gallery Script Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Update.json | -| [gallerySharingProfileUpdateSample.js][gallerysharingprofileupdatesample] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json | -| [imagesCreateOrUpdateSample.js][imagescreateorupdatesample] | Create or update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json | -| [imagesDeleteSample.js][imagesdeletesample] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json | -| [imagesGetSample.js][imagesgetsample] | Gets an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Get.json | -| [imagesListByResourceGroupSample.js][imageslistbyresourcegroupsample] | Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListByResourceGroup.json | -| [imagesListSample.js][imageslistsample] | Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListBySubscription.json | -| [imagesUpdateSample.js][imagesupdatesample] | Update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Update.json | -| [logAnalyticsExportRequestRateByIntervalSample.js][loganalyticsexportrequestratebyintervalsample] | Export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json | -| [logAnalyticsExportThrottledRequestsSample.js][loganalyticsexportthrottledrequestssample] | Export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json | -| [proximityPlacementGroupsCreateOrUpdateSample.js][proximityplacementgroupscreateorupdatesample] | Create or update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json | -| [proximityPlacementGroupsDeleteSample.js][proximityplacementgroupsdeletesample] | Delete a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json | -| [proximityPlacementGroupsGetSample.js][proximityplacementgroupsgetsample] | Retrieves information about a proximity placement group . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json | -| [proximityPlacementGroupsListByResourceGroupSample.js][proximityplacementgroupslistbyresourcegroupsample] | Lists all proximity placement groups in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json | -| [proximityPlacementGroupsListBySubscriptionSample.js][proximityplacementgroupslistbysubscriptionsample] | Lists all proximity placement groups in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json | -| [proximityPlacementGroupsUpdateSample.js][proximityplacementgroupsupdatesample] | Update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json | -| [resourceSkusListSample.js][resourceskuslistsample] | Gets the list of Microsoft.Compute SKUs available for your Subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json | -| [restorePointCollectionsCreateOrUpdateSample.js][restorepointcollectionscreateorupdatesample] | The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json | -| [restorePointCollectionsDeleteSample.js][restorepointcollectionsdeletesample] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json | -| [restorePointCollectionsGetSample.js][restorepointcollectionsgetsample] | The operation to get the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get.json | -| [restorePointCollectionsListAllSample.js][restorepointcollectionslistallsample] | Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json | -| [restorePointCollectionsListSample.js][restorepointcollectionslistsample] | Gets the list of restore point collections in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json | -| [restorePointCollectionsUpdateSample.js][restorepointcollectionsupdatesample] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json | -| [restorePointsCreateSample.js][restorepointscreatesample] | The operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json | -| [restorePointsDeleteSample.js][restorepointsdeletesample] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json | -| [restorePointsGetSample.js][restorepointsgetsample] | The operation to get the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get.json | -| [sharedGalleriesGetSample.js][sharedgalleriesgetsample] | Get a shared gallery by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json | -| [sharedGalleriesListSample.js][sharedgallerieslistsample] | List shared galleries by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_List.json | -| [sharedGalleryImageVersionsGetSample.js][sharedgalleryimageversionsgetsample] | Get a shared gallery image version by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json | -| [sharedGalleryImageVersionsListSample.js][sharedgalleryimageversionslistsample] | List shared gallery image versions by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json | -| [sharedGalleryImagesGetSample.js][sharedgalleryimagesgetsample] | Get a shared gallery image by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json | -| [sharedGalleryImagesListSample.js][sharedgalleryimageslistsample] | List shared gallery images by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json | -| [snapshotsCreateOrUpdateSample.js][snapshotscreateorupdatesample] | Creates or updates a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json | -| [snapshotsDeleteSample.js][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Delete.json | -| [snapshotsGetSample.js][snapshotsgetsample] | Gets information about a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Get.json | -| [snapshotsGrantAccessSample.js][snapshotsgrantaccesssample] | Grants access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json | -| [snapshotsListByResourceGroupSample.js][snapshotslistbyresourcegroupsample] | Lists snapshots under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json | -| [snapshotsListSample.js][snapshotslistsample] | Lists snapshots under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListBySubscription.json | -| [snapshotsRevokeAccessSample.js][snapshotsrevokeaccesssample] | Revokes access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_EndGetAccess.json | -| [snapshotsUpdateSample.js][snapshotsupdatesample] | Updates (patches) a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json | -| [softDeletedResourceListByArtifactNameSample.js][softdeletedresourcelistbyartifactnamesample] | List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json | -| [sshPublicKeysCreateSample.js][sshpublickeyscreatesample] | Creates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json | -| [sshPublicKeysDeleteSample.js][sshpublickeysdeletesample] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json | -| [sshPublicKeysGenerateKeyPairSample.js][sshpublickeysgeneratekeypairsample] | Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json | -| [sshPublicKeysGetSample.js][sshpublickeysgetsample] | Retrieves information about an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json | -| [sshPublicKeysListByResourceGroupSample.js][sshpublickeyslistbyresourcegroupsample] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json | -| [sshPublicKeysListBySubscriptionSample.js][sshpublickeyslistbysubscriptionsample] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json | -| [sshPublicKeysUpdateSample.js][sshpublickeysupdatesample] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json | -| [usageListSample.js][usagelistsample] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json | -| [virtualMachineExtensionImagesGetSample.js][virtualmachineextensionimagesgetsample] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json | -| [virtualMachineExtensionImagesListTypesSample.js][virtualmachineextensionimageslisttypessample] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json | -| [virtualMachineExtensionImagesListVersionsSample.js][virtualmachineextensionimageslistversionssample] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json | -| [virtualMachineExtensionsCreateOrUpdateSample.js][virtualmachineextensionscreateorupdatesample] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineExtensionsDeleteSample.js][virtualmachineextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json | -| [virtualMachineExtensionsGetSample.js][virtualmachineextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json | -| [virtualMachineExtensionsListSample.js][virtualmachineextensionslistsample] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json | -| [virtualMachineExtensionsUpdateSample.js][virtualmachineextensionsupdatesample] | The operation to update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json | -| [virtualMachineImagesEdgeZoneGetSample.js][virtualmachineimagesedgezonegetsample] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListOffersSample.js][virtualmachineimagesedgezonelistofferssample] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListPublishersSample.js][virtualmachineimagesedgezonelistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListSample.js][virtualmachineimagesedgezonelistsample] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListSkusSample.js][virtualmachineimagesedgezonelistskussample] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | -| [virtualMachineImagesGetSample.js][virtualmachineimagesgetsample] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json | -| [virtualMachineImagesListByEdgeZoneSample.js][virtualmachineimageslistbyedgezonesample] | Gets a list of all virtual machine image versions for the specified edge zone x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json | -| [virtualMachineImagesListOffersSample.js][virtualmachineimageslistofferssample] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json | -| [virtualMachineImagesListPublishersSample.js][virtualmachineimageslistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json | -| [virtualMachineImagesListSample.js][virtualmachineimageslistsample] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json | -| [virtualMachineImagesListSkusSample.js][virtualmachineimageslistskussample] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json | -| [virtualMachineImagesListWithPropertiesSample.js][virtualmachineimageslistwithpropertiessample] | x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json | -| [virtualMachineRunCommandsCreateOrUpdateSample.js][virtualmachineruncommandscreateorupdatesample] | The operation to create or update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json | -| [virtualMachineRunCommandsDeleteSample.js][virtualmachineruncommandsdeletesample] | The operation to delete the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json | -| [virtualMachineRunCommandsGetByVirtualMachineSample.js][virtualmachineruncommandsgetbyvirtualmachinesample] | The operation to get the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json | -| [virtualMachineRunCommandsGetSample.js][virtualmachineruncommandsgetsample] | Gets specific run command for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_Get.json | -| [virtualMachineRunCommandsListByVirtualMachineSample.js][virtualmachineruncommandslistbyvirtualmachinesample] | The operation to get all run commands of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json | -| [virtualMachineRunCommandsListSample.js][virtualmachineruncommandslistsample] | Lists all available run commands for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_List.json | -| [virtualMachineRunCommandsUpdateSample.js][virtualmachineruncommandsupdatesample] | The operation to update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json | -| [virtualMachineScaleSetExtensionsCreateOrUpdateSample.js][virtualmachinescalesetextensionscreateorupdatesample] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsDeleteSample.js][virtualmachinescalesetextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsGetSample.js][virtualmachinescalesetextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsListSample.js][virtualmachinescalesetextensionslistsample] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsUpdateSample.js][virtualmachinescalesetextensionsupdatesample] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json | -| [virtualMachineScaleSetRollingUpgradesCancelSample.js][virtualmachinescalesetrollingupgradescancelsample] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json | -| [virtualMachineScaleSetRollingUpgradesGetLatestSample.js][virtualmachinescalesetrollingupgradesgetlatestsample] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json | -| [virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js][virtualmachinescalesetrollingupgradesstartextensionupgradesample] | Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json | -| [virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js][virtualmachinescalesetrollingupgradesstartosupgradesample] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js][virtualmachinescalesetvmextensionscreateorupdatesample] | The operation to create or update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json | -| [virtualMachineScaleSetVMExtensionsDeleteSample.js][virtualmachinescalesetvmextensionsdeletesample] | The operation to delete the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json | -| [virtualMachineScaleSetVMExtensionsGetSample.js][virtualmachinescalesetvmextensionsgetsample] | The operation to get the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json | -| [virtualMachineScaleSetVMExtensionsListSample.js][virtualmachinescalesetvmextensionslistsample] | The operation to get all extensions of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json | -| [virtualMachineScaleSetVMExtensionsUpdateSample.js][virtualmachinescalesetvmextensionsupdatesample] | The operation to update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json | -| [virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js][virtualmachinescalesetvmruncommandscreateorupdatesample] | The operation to create or update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json | -| [virtualMachineScaleSetVMRunCommandsDeleteSample.js][virtualmachinescalesetvmruncommandsdeletesample] | The operation to delete the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json | -| [virtualMachineScaleSetVMRunCommandsGetSample.js][virtualmachinescalesetvmruncommandsgetsample] | The operation to get the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json | -| [virtualMachineScaleSetVMRunCommandsListSample.js][virtualmachinescalesetvmruncommandslistsample] | The operation to get all run commands of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json | -| [virtualMachineScaleSetVMRunCommandsUpdateSample.js][virtualmachinescalesetvmruncommandsupdatesample] | The operation to update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json | -| [virtualMachineScaleSetVMSApproveRollingUpgradeSample.js][virtualmachinescalesetvmsapproverollingupgradesample] | Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json | -| [virtualMachineScaleSetVMSAttachDetachDataDisksSample.js][virtualmachinescalesetvmsattachdetachdatadiskssample] | Attach and detach data disks to/from a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSDeallocateSample.js][virtualmachinescalesetvmsdeallocatesample] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSDeleteSample.js][virtualmachinescalesetvmsdeletesample] | Deletes a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json | -| [virtualMachineScaleSetVMSGetInstanceViewSample.js][virtualmachinescalesetvmsgetinstanceviewsample] | Gets the status of a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json | -| [virtualMachineScaleSetVMSGetSample.js][virtualmachinescalesetvmsgetsample] | Gets a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json | -| [virtualMachineScaleSetVMSListSample.js][virtualmachinescalesetvmslistsample] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json | -| [virtualMachineScaleSetVMSPerformMaintenanceSample.js][virtualmachinescalesetvmsperformmaintenancesample] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSPowerOffSample.js][virtualmachinescalesetvmspoweroffsample] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSRedeploySample.js][virtualmachinescalesetvmsredeploysample] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSReimageAllSample.js][virtualmachinescalesetvmsreimageallsample] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSReimageSample.js][virtualmachinescalesetvmsreimagesample] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSRestartSample.js][virtualmachinescalesetvmsrestartsample] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js][virtualmachinescalesetvmsretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json | -| [virtualMachineScaleSetVMSRunCommandSample.js][virtualmachinescalesetvmsruncommandsample] | Run command on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json | -| [virtualMachineScaleSetVMSSimulateEvictionSample.js][virtualmachinescalesetvmssimulateevictionsample] | The operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json | -| [virtualMachineScaleSetVMSStartSample.js][virtualmachinescalesetvmsstartsample] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSUpdateSample.js][virtualmachinescalesetvmsupdatesample] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json | -| [virtualMachineScaleSetsApproveRollingUpgradeSample.js][virtualmachinescalesetsapproverollingupgradesample] | Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json | -| [virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js][virtualmachinescalesetsconverttosingleplacementgroupsample] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | -| [virtualMachineScaleSetsCreateOrUpdateSample.js][virtualmachinescalesetscreateorupdatesample] | Create or update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json | -| [virtualMachineScaleSetsDeallocateSample.js][virtualmachinescalesetsdeallocatesample] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json | -| [virtualMachineScaleSetsDeleteInstancesSample.js][virtualmachinescalesetsdeleteinstancessample] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json | -| [virtualMachineScaleSetsDeleteSample.js][virtualmachinescalesetsdeletesample] | Deletes a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json | -| [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | -| [virtualMachineScaleSetsGetInstanceViewSample.js][virtualmachinescalesetsgetinstanceviewsample] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json | -| [virtualMachineScaleSetsGetOSUpgradeHistorySample.js][virtualmachinescalesetsgetosupgradehistorysample] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json | -| [virtualMachineScaleSetsGetSample.js][virtualmachinescalesetsgetsample] | Display information about a virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json | -| [virtualMachineScaleSetsListAllSample.js][virtualmachinescalesetslistallsample] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json | -| [virtualMachineScaleSetsListByLocationSample.js][virtualmachinescalesetslistbylocationsample] | Gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json | -| [virtualMachineScaleSetsListSample.js][virtualmachinescalesetslistsample] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json | -| [virtualMachineScaleSetsListSkusSample.js][virtualmachinescalesetslistskussample] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json | -| [virtualMachineScaleSetsPerformMaintenanceSample.js][virtualmachinescalesetsperformmaintenancesample] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json | -| [virtualMachineScaleSetsPowerOffSample.js][virtualmachinescalesetspoweroffsample] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json | -| [virtualMachineScaleSetsReapplySample.js][virtualmachinescalesetsreapplysample] | Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json | -| [virtualMachineScaleSetsRedeploySample.js][virtualmachinescalesetsredeploysample] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json | -| [virtualMachineScaleSetsReimageAllSample.js][virtualmachinescalesetsreimageallsample] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json | -| [virtualMachineScaleSetsReimageSample.js][virtualmachinescalesetsreimagesample] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json | -| [virtualMachineScaleSetsRestartSample.js][virtualmachinescalesetsrestartsample] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json | -| [virtualMachineScaleSetsScaleOutSample.js][virtualmachinescalesetsscaleoutsample] | Scales out one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json | -| [virtualMachineScaleSetsSetOrchestrationServiceStateSample.js][virtualmachinescalesetssetorchestrationservicestatesample] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json | -| [virtualMachineScaleSetsStartSample.js][virtualmachinescalesetsstartsample] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json | -| [virtualMachineScaleSetsUpdateInstancesSample.js][virtualmachinescalesetsupdateinstancessample] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json | -| [virtualMachineScaleSetsUpdateSample.js][virtualmachinescalesetsupdatesample] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json | -| [virtualMachineSizesListSample.js][virtualmachinesizeslistsample] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json | -| [virtualMachinesAssessPatchesSample.js][virtualmachinesassesspatchessample] | Assess patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json | -| [virtualMachinesAttachDetachDataDisksSample.js][virtualmachinesattachdetachdatadiskssample] | Attach and detach data disks to/from the virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json | -| [virtualMachinesCaptureSample.js][virtualmachinescapturesample] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json | -| [virtualMachinesConvertToManagedDisksSample.js][virtualmachinesconverttomanageddiskssample] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json | -| [virtualMachinesCreateOrUpdateSample.js][virtualmachinescreateorupdatesample] | The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json | -| [virtualMachinesDeallocateSample.js][virtualmachinesdeallocatesample] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json | -| [virtualMachinesDeleteSample.js][virtualmachinesdeletesample] | The operation to delete a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json | -| [virtualMachinesGeneralizeSample.js][virtualmachinesgeneralizesample] | Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json | -| [virtualMachinesGetSample.js][virtualmachinesgetsample] | Retrieves information about the model view or the instance view of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get.json | -| [virtualMachinesInstallPatchesSample.js][virtualmachinesinstallpatchessample] | Installs patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json | -| [virtualMachinesInstanceViewSample.js][virtualmachinesinstanceviewsample] | Retrieves information about the run-time state of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json | -| [virtualMachinesListAllSample.js][virtualmachineslistallsample] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json | -| [virtualMachinesListAvailableSizesSample.js][virtualmachineslistavailablesizessample] | Lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json | -| [virtualMachinesListByLocationSample.js][virtualmachineslistbylocationsample] | Gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json | -| [virtualMachinesListSample.js][virtualmachineslistsample] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json | -| [virtualMachinesMigrateToVMScaleSetSample.js][virtualmachinesmigratetovmscalesetsample] | Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json | -| [virtualMachinesPerformMaintenanceSample.js][virtualmachinesperformmaintenancesample] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json | -| [virtualMachinesPowerOffSample.js][virtualmachinespoweroffsample] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json | -| [virtualMachinesReapplySample.js][virtualmachinesreapplysample] | The operation to reapply a virtual machine's state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json | -| [virtualMachinesRedeploySample.js][virtualmachinesredeploysample] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json | -| [virtualMachinesReimageSample.js][virtualmachinesreimagesample] | Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json | -| [virtualMachinesRestartSample.js][virtualmachinesrestartsample] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json | -| [virtualMachinesRetrieveBootDiagnosticsDataSample.js][virtualmachinesretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json | -| [virtualMachinesRunCommandSample.js][virtualmachinesruncommandsample] | Run command on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand.json | -| [virtualMachinesSimulateEvictionSample.js][virtualmachinessimulateevictionsample] | The operation to simulate the eviction of spot virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json | -| [virtualMachinesStartSample.js][virtualmachinesstartsample] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json | -| [virtualMachinesUpdateSample.js][virtualmachinesupdatesample] | The operation to update a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json | +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js][availabilitysetscancelmigrationtovirtualmachinescalesetsample] | cancel the migration operation on an Availability Set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json | +| [availabilitySetsConvertToVirtualMachineScaleSetSample.js][availabilitysetsconverttovirtualmachinescalesetsample] | create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json | +| [availabilitySetsCreateOrUpdateSample.js][availabilitysetscreateorupdatesample] | create or update an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create.json | +| [availabilitySetsDeleteSample.js][availabilitysetsdeletesample] | delete an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json | +| [availabilitySetsGetSample.js][availabilitysetsgetsample] | retrieves information about an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json | +| [availabilitySetsListAvailableSizesSample.js][availabilitysetslistavailablesizessample] | lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json | +| [availabilitySetsListBySubscriptionSample.js][availabilitysetslistbysubscriptionsample] | lists all availability sets in a subscription. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListBySubscription.json | +| [availabilitySetsListSample.js][availabilitysetslistsample] | lists all availability sets in a resource group. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json | +| [availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js][availabilitysetsstartmigrationtovirtualmachinescalesetsample] | start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json | +| [availabilitySetsUpdateSample.js][availabilitysetsupdatesample] | update an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json | +| [availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js][availabilitysetsvalidatemigrationtovirtualmachinescalesetsample] | validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json | +| [capacityReservationGroupsCreateOrUpdateSample.js][capacityreservationgroupscreateorupdatesample] | the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json | +| [capacityReservationGroupsDeleteSample.js][capacityreservationgroupsdeletesample] | the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json | +| [capacityReservationGroupsGetSample.js][capacityreservationgroupsgetsample] | the operation that retrieves information about a capacity reservation group. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_Get.json | +| [capacityReservationGroupsListByResourceGroupSample.js][capacityreservationgroupslistbyresourcegroupsample] | lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json | +| [capacityReservationGroupsListBySubscriptionSample.js][capacityreservationgroupslistbysubscriptionsample] | lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json | +| [capacityReservationGroupsUpdateSample.js][capacityreservationgroupsupdatesample] | the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json | +| [capacityReservationsCreateOrUpdateSample.js][capacityreservationscreateorupdatesample] | the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json | +| [capacityReservationsDeleteSample.js][capacityreservationsdeletesample] | the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json | +| [capacityReservationsGetSample.js][capacityreservationsgetsample] | the operation that retrieves information about the capacity reservation. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_Get.json | +| [capacityReservationsListByCapacityReservationGroupSample.js][capacityreservationslistbycapacityreservationgroupsample] | lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json | +| [capacityReservationsUpdateSample.js][capacityreservationsupdatesample] | the operation to update a capacity reservation. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json | +| [communityGalleriesGetSample.js][communitygalleriesgetsample] | get a community gallery by gallery public name. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGallery_Get.json | +| [communityGalleryImageVersionsGetSample.js][communitygalleryimageversionsgetsample] | get a community gallery image version. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_Get.json | +| [communityGalleryImageVersionsListSample.js][communitygalleryimageversionslistsample] | list community gallery image versions inside an image. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_List.json | +| [communityGalleryImagesGetSample.js][communitygalleryimagesgetsample] | get a community gallery image. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_Get.json | +| [communityGalleryImagesListSample.js][communitygalleryimageslistsample] | list community gallery images inside a gallery. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_List.json | +| [dedicatedHostGroupsCreateOrUpdateSample.js][dedicatedhostgroupscreateorupdatesample] | create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json | +| [dedicatedHostGroupsDeleteSample.js][dedicatedhostgroupsdeletesample] | delete a dedicated host group. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json | +| [dedicatedHostGroupsGetSample.js][dedicatedhostgroupsgetsample] | retrieves information about a dedicated host group. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get.json | +| [dedicatedHostGroupsListByResourceGroupSample.js][dedicatedhostgroupslistbyresourcegroupsample] | lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json | +| [dedicatedHostGroupsListBySubscriptionSample.js][dedicatedhostgroupslistbysubscriptionsample] | lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json | +| [dedicatedHostGroupsUpdateSample.js][dedicatedhostgroupsupdatesample] | update an dedicated host group. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json | +| [dedicatedHostsCreateOrUpdateSample.js][dedicatedhostscreateorupdatesample] | create or update a dedicated host . x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json | +| [dedicatedHostsDeleteSample.js][dedicatedhostsdeletesample] | delete a dedicated host. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json | +| [dedicatedHostsGetSample.js][dedicatedhostsgetsample] | retrieves information about a dedicated host. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Get.json | +| [dedicatedHostsListAvailableSizesSample.js][dedicatedhostslistavailablesizessample] | lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json | +| [dedicatedHostsListByHostGroupSample.js][dedicatedhostslistbyhostgroupsample] | lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json | +| [dedicatedHostsRedeploySample.js][dedicatedhostsredeploysample] | redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Redeploy.json | +| [dedicatedHostsRestartSample.js][dedicatedhostsrestartsample] | restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Restart.json | +| [dedicatedHostsUpdateSample.js][dedicatedhostsupdatesample] | update a dedicated host . x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json | +| [diskAccessesCreateOrUpdateSample.js][diskaccessescreateorupdatesample] | creates or updates a disk access resource x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Create.json | +| [diskAccessesDeleteAPrivateEndpointConnectionSample.js][diskaccessesdeleteaprivateendpointconnectionsample] | deletes a private endpoint connection under a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json | +| [diskAccessesDeleteSample.js][diskaccessesdeletesample] | deletes a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Delete.json | +| [diskAccessesGetAPrivateEndpointConnectionSample.js][diskaccessesgetaprivateendpointconnectionsample] | gets information about a private endpoint connection under a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json | +| [diskAccessesGetPrivateLinkResourcesSample.js][diskaccessesgetprivatelinkresourcessample] | gets the private link resources possible under disk access resource x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json | +| [diskAccessesGetSample.js][diskaccessesgetsample] | gets information about a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get.json | +| [diskAccessesListByResourceGroupSample.js][diskaccesseslistbyresourcegroupsample] | lists all the disk access resources under a resource group. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListByResourceGroup.json | +| [diskAccessesListPrivateEndpointConnectionsSample.js][diskaccesseslistprivateendpointconnectionssample] | list information about private endpoint connections under a disk access resource x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json | +| [diskAccessesListSample.js][diskaccesseslistsample] | lists all the disk access resources under a subscription. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListBySubscription.json | +| [diskAccessesUpdateAPrivateEndpointConnectionSample.js][diskaccessesupdateaprivateendpointconnectionsample] | approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json | +| [diskAccessesUpdateSample.js][diskaccessesupdatesample] | updates (patches) a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Update.json | +| [diskEncryptionSetsCreateOrUpdateSample.js][diskencryptionsetscreateorupdatesample] | creates or updates a disk encryption set x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create.json | +| [diskEncryptionSetsDeleteSample.js][diskencryptionsetsdeletesample] | deletes a disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json | +| [diskEncryptionSetsGetSample.js][diskencryptionsetsgetsample] | gets information about a disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get.json | +| [diskEncryptionSetsListAssociatedResourcesSample.js][diskencryptionsetslistassociatedresourcessample] | lists all resources that are encrypted with this disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json | +| [diskEncryptionSetsListByResourceGroupSample.js][diskencryptionsetslistbyresourcegroupsample] | lists all the disk encryption sets under a resource group. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json | +| [diskEncryptionSetsListSample.js][diskencryptionsetslistsample] | lists all the disk encryption sets under a subscription. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json | +| [diskEncryptionSetsUpdateSample.js][diskencryptionsetsupdatesample] | updates (patches) a disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update.json | +| [diskRestorePointGetSample.js][diskrestorepointgetsample] | get disk restorePoint resource x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get.json | +| [diskRestorePointGrantAccessSample.js][diskrestorepointgrantaccesssample] | grants access to a diskRestorePoint. x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json | +| [diskRestorePointListByRestorePointSample.js][diskrestorepointlistbyrestorepointsample] | lists diskRestorePoints under a vmRestorePoint. x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json | +| [diskRestorePointRevokeAccessSample.js][diskrestorepointrevokeaccesssample] | revokes access to a diskRestorePoint. x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json | +| [disksCreateOrUpdateSample.js][diskscreateorupdatesample] | creates or updates a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json | +| [disksDeleteSample.js][disksdeletesample] | deletes a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_Delete.json | +| [disksGetSample.js][disksgetsample] | gets information about a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_Get.json | +| [disksGrantAccessSample.js][disksgrantaccesssample] | grants access to a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess.json | +| [disksListByResourceGroupSample.js][diskslistbyresourcegroupsample] | lists all the disks under a resource group. x-ms-original-file: 2025-01-02/diskExamples/Disk_ListByResourceGroup.json | +| [disksListSample.js][diskslistsample] | lists all the disks under a subscription. x-ms-original-file: 2025-01-02/diskExamples/Disk_ListBySubscription.json | +| [disksRevokeAccessSample.js][disksrevokeaccesssample] | revokes access to a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_EndGetAccess.json | +| [disksUpdateSample.js][disksupdatesample] | updates (patches) a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json | +| [galleriesCreateOrUpdateSample.js][galleriescreateorupdatesample] | create or update a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Create.json | +| [galleriesDeleteSample.js][galleriesdeletesample] | delete a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Delete.json | +| [galleriesGetSample.js][galleriesgetsample] | retrieves information about a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Get.json | +| [galleriesListByResourceGroupSample.js][gallerieslistbyresourcegroupsample] | list galleries under a resource group. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListByResourceGroup.json | +| [galleriesListSample.js][gallerieslistsample] | list galleries under a subscription. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListBySubscription.json | +| [galleriesUpdateSample.js][galleriesupdatesample] | update a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Update.json | +| [galleryApplicationVersionsCreateOrUpdateSample.js][galleryapplicationversionscreateorupdatesample] | create or update a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Create.json | +| [galleryApplicationVersionsDeleteSample.js][galleryapplicationversionsdeletesample] | delete a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Delete.json | +| [galleryApplicationVersionsGetSample.js][galleryapplicationversionsgetsample] | retrieves information about a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get.json | +| [galleryApplicationVersionsListByGalleryApplicationSample.js][galleryapplicationversionslistbygalleryapplicationsample] | list gallery Application Versions in a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json | +| [galleryApplicationVersionsUpdateSample.js][galleryapplicationversionsupdatesample] | update a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Update.json | +| [galleryApplicationsCreateOrUpdateSample.js][galleryapplicationscreateorupdatesample] | create or update a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Create.json | +| [galleryApplicationsDeleteSample.js][galleryapplicationsdeletesample] | delete a gallery Application. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Delete.json | +| [galleryApplicationsGetSample.js][galleryapplicationsgetsample] | retrieves information about a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Get.json | +| [galleryApplicationsListByGallerySample.js][galleryapplicationslistbygallerysample] | list gallery Application Definitions in a gallery. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_ListByGallery.json | +| [galleryApplicationsUpdateSample.js][galleryapplicationsupdatesample] | update a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Update.json | +| [galleryImageVersionsCreateOrUpdateSample.js][galleryimageversionscreateorupdatesample] | create or update a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create.json | +| [galleryImageVersionsDeleteSample.js][galleryimageversionsdeletesample] | delete a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Delete.json | +| [galleryImageVersionsGetSample.js][galleryimageversionsgetsample] | retrieves information about a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get.json | +| [galleryImageVersionsListByGalleryImageSample.js][galleryimageversionslistbygalleryimagesample] | list gallery image versions in a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_ListByGalleryImage.json | +| [galleryImageVersionsUpdateSample.js][galleryimageversionsupdatesample] | update a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update.json | +| [galleryImagesCreateOrUpdateSample.js][galleryimagescreateorupdatesample] | create or update a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Create.json | +| [galleryImagesDeleteSample.js][galleryimagesdeletesample] | delete a gallery image. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Delete.json | +| [galleryImagesGetSample.js][galleryimagesgetsample] | retrieves information about a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Get.json | +| [galleryImagesListByGallerySample.js][galleryimageslistbygallerysample] | list gallery image definitions in a gallery. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_ListByGallery.json | +| [galleryImagesUpdateSample.js][galleryimagesupdatesample] | update a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Update.json | +| [galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js][galleryinvmaccesscontrolprofileversionscreateorupdatesample] | create or update a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json | +| [galleryInVMAccessControlProfileVersionsDeleteSample.js][galleryinvmaccesscontrolprofileversionsdeletesample] | delete a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json | +| [galleryInVMAccessControlProfileVersionsGetSample.js][galleryinvmaccesscontrolprofileversionsgetsample] | retrieves information about a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json | +| [galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.js][galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample] | list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json | +| [galleryInVMAccessControlProfileVersionsUpdateSample.js][galleryinvmaccesscontrolprofileversionsupdatesample] | update a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json | +| [galleryInVMAccessControlProfilesCreateOrUpdateSample.js][galleryinvmaccesscontrolprofilescreateorupdatesample] | create or update a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json | +| [galleryInVMAccessControlProfilesDeleteSample.js][galleryinvmaccesscontrolprofilesdeletesample] | delete a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json | +| [galleryInVMAccessControlProfilesGetSample.js][galleryinvmaccesscontrolprofilesgetsample] | retrieves information about a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json | +| [galleryInVMAccessControlProfilesListByGallerySample.js][galleryinvmaccesscontrolprofileslistbygallerysample] | list gallery inVMAccessControlProfiles in a gallery. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json | +| [galleryInVMAccessControlProfilesUpdateSample.js][galleryinvmaccesscontrolprofilesupdatesample] | update a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json | +| [galleryScriptVersionsCreateOrUpdateSample.js][galleryscriptversionscreateorupdatesample] | create or update a gallery Script Version. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Create.json | +| [galleryScriptVersionsDeleteSample.js][galleryscriptversionsdeletesample] | delete a gallery Script Version. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Delete.json | +| [galleryScriptVersionsGetSample.js][galleryscriptversionsgetsample] | custom ArmResourceRead operation template with CloudError as Error x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get.json | +| [galleryScriptVersionsListByGalleryScriptSample.js][galleryscriptversionslistbygalleryscriptsample] | list gallery Script Versions in a gallery Script Definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json | +| [galleryScriptVersionsUpdateSample.js][galleryscriptversionsupdatesample] | update a gallery Script Version. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Update.json | +| [galleryScriptsCreateOrUpdateSample.js][galleryscriptscreateorupdatesample] | create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Create.json | +| [galleryScriptsDeleteSample.js][galleryscriptsdeletesample] | delete a gallery Script Definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Delete.json | +| [galleryScriptsGetSample.js][galleryscriptsgetsample] | retrieves information about a gallery script definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Get.json | +| [galleryScriptsListByGallerySample.js][galleryscriptslistbygallerysample] | list gallery Script Definitions in a gallery. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_ListByGallery.json | +| [galleryScriptsUpdateSample.js][galleryscriptsupdatesample] | update a gallery Script Definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Update.json | +| [gallerySharingProfileUpdateSample.js][gallerysharingprofileupdatesample] | update sharing profile of a gallery. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_AddToSharingProfile.json | +| [imagesCreateOrUpdateSample.js][imagescreateorupdatesample] | create or update an image. x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlob.json | +| [imagesDeleteSample.js][imagesdeletesample] | deletes an Image. x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MaximumSet_Gen.json | +| [imagesGetSample.js][imagesgetsample] | gets an image. x-ms-original-file: 2025-11-01/imageExamples/Image_Get.json | +| [imagesListByResourceGroupSample.js][imageslistbyresourcegroupsample] | gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: 2025-11-01/imageExamples/Image_ListByResourceGroup.json | +| [imagesListSample.js][imageslistsample] | gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: 2025-11-01/imageExamples/Image_ListBySubscription.json | +| [imagesUpdateSample.js][imagesupdatesample] | update an image. x-ms-original-file: 2025-11-01/imageExamples/Image_Update.json | +| [logAnalyticsExportRequestRateByIntervalSample.js][loganalyticsexportrequestratebyintervalsample] | export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json | +| [logAnalyticsExportThrottledRequestsSample.js][loganalyticsexportthrottledrequestssample] | export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_ThrottledRequests.json | +| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json | +| [proximityPlacementGroupsCreateOrUpdateSample.js][proximityplacementgroupscreateorupdatesample] | create or update a proximity placement group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json | +| [proximityPlacementGroupsDeleteSample.js][proximityplacementgroupsdeletesample] | delete a proximity placement group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json | +| [proximityPlacementGroupsGetSample.js][proximityplacementgroupsgetsample] | retrieves information about a proximity placement group . x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json | +| [proximityPlacementGroupsListByResourceGroupSample.js][proximityplacementgroupslistbyresourcegroupsample] | lists all proximity placement groups in a resource group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json | +| [proximityPlacementGroupsListBySubscriptionSample.js][proximityplacementgroupslistbysubscriptionsample] | lists all proximity placement groups in a subscription. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json | +| [proximityPlacementGroupsUpdateSample.js][proximityplacementgroupsupdatesample] | update a proximity placement group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json | +| [resourceSkusListSample.js][resourceskuslistsample] | gets the list of Microsoft.Compute SKUs available for your Subscription. x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkus.json | +| [restorePointCollectionsCreateOrUpdateSample.js][restorepointcollectionscreateorupdatesample] | the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate.json | +| [restorePointCollectionsDeleteSample.js][restorepointcollectionsdeletesample] | the operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json | +| [restorePointCollectionsGetSample.js][restorepointcollectionsgetsample] | the operation to get the restore point collection. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get.json | +| [restorePointCollectionsListAllSample.js][restorepointcollectionslistallsample] | gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListBySubscription.json | +| [restorePointCollectionsListSample.js][restorepointcollectionslistsample] | gets the list of restore point collections in a resource group. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListByResourceGroup.json | +| [restorePointCollectionsUpdateSample.js][restorepointcollectionsupdatesample] | the operation to update the restore point collection. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json | +| [restorePointsCreateSample.js][restorepointscreatesample] | the operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Copy_BetweenRegions.json | +| [restorePointsDeleteSample.js][restorepointsdeletesample] | the operation to delete the restore point. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json | +| [restorePointsGetSample.js][restorepointsgetsample] | the operation to get the restore point. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get.json | +| [sharedGalleriesGetSample.js][sharedgalleriesgetsample] | get a shared gallery by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_Get.json | +| [sharedGalleriesListSample.js][sharedgallerieslistsample] | list shared galleries by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_List.json | +| [sharedGalleryImageVersionsGetSample.js][sharedgalleryimageversionsgetsample] | get a shared gallery image version by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersion_Get.json | +| [sharedGalleryImageVersionsListSample.js][sharedgalleryimageversionslistsample] | list shared gallery image versions by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersions_List.json | +| [sharedGalleryImagesGetSample.js][sharedgalleryimagesgetsample] | get a shared gallery image by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImage_Get.json | +| [sharedGalleryImagesListSample.js][sharedgalleryimageslistsample] | list shared gallery images by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImages_List.json | +| [snapshotsCreateOrUpdateSample.js][snapshotscreateorupdatesample] | creates or updates a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json | +| [snapshotsDeleteSample.js][snapshotsdeletesample] | deletes a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Delete.json | +| [snapshotsGetSample.js][snapshotsgetsample] | gets information about a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Get.json | +| [snapshotsGrantAccessSample.js][snapshotsgrantaccesssample] | grants access to a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_BeginGetAccess.json | +| [snapshotsListByResourceGroupSample.js][snapshotslistbyresourcegroupsample] | lists snapshots under a resource group. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListByResourceGroup.json | +| [snapshotsListSample.js][snapshotslistsample] | lists snapshots under a subscription. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListBySubscription.json | +| [snapshotsRevokeAccessSample.js][snapshotsrevokeaccesssample] | revokes access to a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_EndGetAccess.json | +| [snapshotsUpdateSample.js][snapshotsupdatesample] | updates (patches) a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update.json | +| [softDeletedResourceListByArtifactNameSample.js][softdeletedresourcelistbyartifactnamesample] | list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. x-ms-original-file: 2025-03-03/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json | +| [sshPublicKeysCreateSample.js][sshpublickeyscreatesample] | creates a new SSH public key resource. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Create.json | +| [sshPublicKeysDeleteSample.js][sshpublickeysdeletesample] | delete an SSH public key. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json | +| [sshPublicKeysGenerateKeyPairSample.js][sshpublickeysgeneratekeypairsample] | generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json | +| [sshPublicKeysGetSample.js][sshpublickeysgetsample] | retrieves information about an SSH public key. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Get.json | +| [sshPublicKeysListByResourceGroupSample.js][sshpublickeyslistbyresourcegroupsample] | lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json | +| [sshPublicKeysListBySubscriptionSample.js][sshpublickeyslistbysubscriptionsample] | lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json | +| [sshPublicKeysUpdateSample.js][sshpublickeysupdatesample] | updates a new SSH public key resource. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json | +| [usageListSample.js][usagelistsample] | gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json | +| [virtualMachineExtensionImagesGetSample.js][virtualmachineextensionimagesgetsample] | gets a virtual machine extension image. x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json | +| [virtualMachineExtensionImagesListTypesSample.js][virtualmachineextensionimageslisttypessample] | gets a list of virtual machine extension image types. x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json | +| [virtualMachineExtensionImagesListVersionsSample.js][virtualmachineextensionimageslistversionssample] | gets a list of virtual machine extension image versions. x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json | +| [virtualMachineExtensionsCreateOrUpdateSample.js][virtualmachineextensionscreateorupdatesample] | the operation to create or update the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json | +| [virtualMachineExtensionsDeleteSample.js][virtualmachineextensionsdeletesample] | the operation to delete the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json | +| [virtualMachineExtensionsGetSample.js][virtualmachineextensionsgetsample] | the operation to get the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json | +| [virtualMachineExtensionsListSample.js][virtualmachineextensionslistsample] | the operation to get all extensions of a Virtual Machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json | +| [virtualMachineExtensionsUpdateSample.js][virtualmachineextensionsupdatesample] | the operation to update the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Update.json | +| [virtualMachineImagesEdgeZoneGetSample.js][virtualmachineimagesedgezonegetsample] | gets a virtual machine image in an edge zone. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListOffersSample.js][virtualmachineimagesedgezonelistofferssample] | gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListPublishersSample.js][virtualmachineimagesedgezonelistpublisherssample] | gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSample.js][virtualmachineimagesedgezonelistsample] | gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSkusSample.js][virtualmachineimagesedgezonelistskussample] | gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | +| [virtualMachineImagesGetSample.js][virtualmachineimagesgetsample] | gets a virtual machine image. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json | +| [virtualMachineImagesListByEdgeZoneSample.js][virtualmachineimageslistbyedgezonesample] | gets a list of all virtual machine image versions for the specified edge zone x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json | +| [virtualMachineImagesListOffersSample.js][virtualmachineimageslistofferssample] | gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json | +| [virtualMachineImagesListPublishersSample.js][virtualmachineimageslistpublisherssample] | gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesListSample.js][virtualmachineimageslistsample] | gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json | +| [virtualMachineImagesListSkusSample.js][virtualmachineimageslistskussample] | gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json | +| [virtualMachineImagesListWithPropertiesSample.js][virtualmachineimageslistwithpropertiessample] | execute listWithProperties x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json | +| [virtualMachineRunCommandsCreateOrUpdateSample.js][virtualmachineruncommandscreateorupdatesample] | the operation to create or update the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json | +| [virtualMachineRunCommandsDeleteSample.js][virtualmachineruncommandsdeletesample] | the operation to delete the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Delete.json | +| [virtualMachineRunCommandsGetByVirtualMachineSample.js][virtualmachineruncommandsgetbyvirtualmachinesample] | the operation to get the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Get.json | +| [virtualMachineRunCommandsGetSample.js][virtualmachineruncommandsgetsample] | gets specific run command for a subscription in a location. x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_Get.json | +| [virtualMachineRunCommandsListByVirtualMachineSample.js][virtualmachineruncommandslistbyvirtualmachinesample] | the operation to get all run commands of a Virtual Machine. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_List.json | +| [virtualMachineRunCommandsListSample.js][virtualmachineruncommandslistsample] | lists all available run commands for a subscription in a location. x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_List.json | +| [virtualMachineRunCommandsUpdateSample.js][virtualmachineruncommandsupdatesample] | the operation to update the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Update.json | +| [virtualMachineScaleSetExtensionsCreateOrUpdateSample.js][virtualmachinescalesetextensionscreateorupdatesample] | the operation to create or update an extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsDeleteSample.js][virtualmachinescalesetextensionsdeletesample] | the operation to delete the extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsGetSample.js][virtualmachinescalesetextensionsgetsample] | the operation to get the extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsListSample.js][virtualmachinescalesetextensionslistsample] | gets a list of all extensions in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsUpdateSample.js][virtualmachinescalesetextensionsupdatesample] | the operation to update an extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json | +| [virtualMachineScaleSetLifeCycleHookEventsGetSample.js][virtualmachinescalesetlifecyclehookeventsgetsample] | gets a virtual machine scale set lifecycle hook event. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Get.json | +| [virtualMachineScaleSetLifeCycleHookEventsListSample.js][virtualmachinescalesetlifecyclehookeventslistsample] | gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_List.json | +| [virtualMachineScaleSetLifeCycleHookEventsUpdateSample.js][virtualmachinescalesetlifecyclehookeventsupdatesample] | the operation to update a virtual machine scale set lifecycle hook event. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Update.json | +| [virtualMachineScaleSetRollingUpgradesCancelSample.js][virtualmachinescalesetrollingupgradescancelsample] | cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesGetLatestSample.js][virtualmachinescalesetrollingupgradesgetlatestsample] | gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js][virtualmachinescalesetrollingupgradesstartextensionupgradesample] | starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json | +| [virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js][virtualmachinescalesetrollingupgradesstartosupgradesample] | starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js][virtualmachinescalesetvmextensionscreateorupdatesample] | the operation to create or update the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json | +| [virtualMachineScaleSetVMExtensionsDeleteSample.js][virtualmachinescalesetvmextensionsdeletesample] | the operation to delete the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json | +| [virtualMachineScaleSetVMExtensionsGetSample.js][virtualmachinescalesetvmextensionsgetsample] | the operation to get the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json | +| [virtualMachineScaleSetVMExtensionsListSample.js][virtualmachinescalesetvmextensionslistsample] | the operation to get all extensions of an instance in Virtual Machine Scaleset. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json | +| [virtualMachineScaleSetVMExtensionsUpdateSample.js][virtualmachinescalesetvmextensionsupdatesample] | the operation to update the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json | +| [virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js][virtualmachinescalesetvmruncommandscreateorupdatesample] | the operation to create or update the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json | +| [virtualMachineScaleSetVMRunCommandsDeleteSample.js][virtualmachinescalesetvmruncommandsdeletesample] | the operation to delete the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json | +| [virtualMachineScaleSetVMRunCommandsGetSample.js][virtualmachinescalesetvmruncommandsgetsample] | the operation to get the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json | +| [virtualMachineScaleSetVMRunCommandsListSample.js][virtualmachinescalesetvmruncommandslistsample] | the operation to get all run commands of an instance in Virtual Machine Scaleset. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json | +| [virtualMachineScaleSetVMRunCommandsUpdateSample.js][virtualmachinescalesetvmruncommandsupdatesample] | the operation to update the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json | +| [virtualMachineScaleSetVMsApproveRollingUpgradeSample.js][virtualmachinescalesetvmsapproverollingupgradesample] | approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json | +| [virtualMachineScaleSetVMsAttachDetachDataDisksSample.js][virtualmachinescalesetvmsattachdetachdatadiskssample] | attach and detach data disks to/from a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsDeallocateSample.js][virtualmachinescalesetvmsdeallocatesample] | deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsDeleteSample.js][virtualmachinescalesetvmsdeletesample] | deletes a virtual machine from a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json | +| [virtualMachineScaleSetVMsGetInstanceViewSample.js][virtualmachinescalesetvmsgetinstanceviewsample] | gets the status of a virtual machine from a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json | +| [virtualMachineScaleSetVMsGetSample.js][virtualmachinescalesetvmsgetsample] | gets a virtual machine from a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json | +| [virtualMachineScaleSetVMsListSample.js][virtualmachinescalesetvmslistsample] | gets a list of all virtual machines in a VM scale sets. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsPerformMaintenanceSample.js][virtualmachinescalesetvmsperformmaintenancesample] | performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsPowerOffSample.js][virtualmachinescalesetvmspoweroffsample] | power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsRedeploySample.js][virtualmachinescalesetvmsredeploysample] | shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsReimageAllSample.js][virtualmachinescalesetvmsreimageallsample] | allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsReimageSample.js][virtualmachinescalesetvmsreimagesample] | reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsRestartSample.js][virtualmachinescalesetvmsrestartsample] | restarts a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.js][virtualmachinescalesetvmsretrievebootdiagnosticsdatasample] | the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json | +| [virtualMachineScaleSetVMsRunCommandSample.js][virtualmachinescalesetvmsruncommandsample] | run command on a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json | +| [virtualMachineScaleSetVMsSimulateEvictionSample.js][virtualmachinescalesetvmssimulateevictionsample] | the operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json | +| [virtualMachineScaleSetVMsStartSample.js][virtualmachinescalesetvmsstartsample] | starts a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsUpdateSample.js][virtualmachinescalesetvmsupdatesample] | updates a virtual machine of a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json | +| [virtualMachineScaleSetsApproveRollingUpgradeSample.js][virtualmachinescalesetsapproverollingupgradesample] | approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json | +| [virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js][virtualmachinescalesetsconverttosingleplacementgroupsample] | converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | +| [virtualMachineScaleSetsCreateOrUpdateSample.js][virtualmachinescalesetscreateorupdatesample] | create or update a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json | +| [virtualMachineScaleSetsDeallocateSample.js][virtualmachinescalesetsdeallocatesample] | deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json | +| [virtualMachineScaleSetsDeleteInstancesSample.js][virtualmachinescalesetsdeleteinstancessample] | deletes virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json | +| [virtualMachineScaleSetsDeleteSample.js][virtualmachinescalesetsdeletesample] | deletes a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json | +| [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample] | manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetInstanceViewSample.js][virtualmachinescalesetsgetinstanceviewsample] | gets the status of a VM scale set instance. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetOSUpgradeHistorySample.js][virtualmachinescalesetsgetosupgradehistorysample] | gets list of OS upgrades on a VM scale set instance. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetSample.js][virtualmachinescalesetsgetsample] | display information about a virtual machine scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json | +| [virtualMachineScaleSetsListAllSample.js][virtualmachinescalesetslistallsample] | gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetsListByLocationSample.js][virtualmachinescalesetslistbylocationsample] | gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json | +| [virtualMachineScaleSetsListSample.js][virtualmachinescalesetslistsample] | gets a list of all VM scale sets under a resource group. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json | +| [virtualMachineScaleSetsListSkusSample.js][virtualmachinescalesetslistskussample] | gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json | +| [virtualMachineScaleSetsPerformMaintenanceSample.js][virtualmachinescalesetsperformmaintenancesample] | perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json | +| [virtualMachineScaleSetsPowerOffSample.js][virtualmachinescalesetspoweroffsample] | power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json | +| [virtualMachineScaleSetsReapplySample.js][virtualmachinescalesetsreapplysample] | reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json | +| [virtualMachineScaleSetsRedeploySample.js][virtualmachinescalesetsredeploysample] | shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json | +| [virtualMachineScaleSetsReimageAllSample.js][virtualmachinescalesetsreimageallsample] | reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetsReimageSample.js][virtualmachinescalesetsreimagesample] | reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json | +| [virtualMachineScaleSetsRestartSample.js][virtualmachinescalesetsrestartsample] | restarts one or more virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json | +| [virtualMachineScaleSetsScaleOutSample.js][virtualmachinescalesetsscaleoutsample] | scales out one or more virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json | +| [virtualMachineScaleSetsSetOrchestrationServiceStateSample.js][virtualmachinescalesetssetorchestrationservicestatesample] | changes ServiceState property for a given service x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json | +| [virtualMachineScaleSetsStartSample.js][virtualmachinescalesetsstartsample] | starts one or more virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json | +| [virtualMachineScaleSetsUpdateInstancesSample.js][virtualmachinescalesetsupdateinstancessample] | upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json | +| [virtualMachineScaleSetsUpdateSample.js][virtualmachinescalesetsupdatesample] | update a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json | +| [virtualMachineSizesListSample.js][virtualmachinesizeslistsample] | this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json | +| [virtualMachinesAssessPatchesSample.js][virtualmachinesassesspatchessample] | assess patches on the VM. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AssessPatches.json | +| [virtualMachinesAttachDetachDataDisksSample.js][virtualmachinesattachdetachdatadiskssample] | attach and detach data disks to/from the virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json | +| [virtualMachinesCaptureSample.js][virtualmachinescapturesample] | captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json | +| [virtualMachinesConvertToManagedDisksSample.js][virtualmachinesconverttomanageddiskssample] | converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json | +| [virtualMachinesCreateOrUpdateSample.js][virtualmachinescreateorupdatesample] | the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json | +| [virtualMachinesDeallocateSample.js][virtualmachinesdeallocatesample] | shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json | +| [virtualMachinesDeleteSample.js][virtualmachinesdeletesample] | the operation to delete a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Delete_Force.json | +| [virtualMachinesGeneralizeSample.js][virtualmachinesgeneralizesample] | sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Generalize.json | +| [virtualMachinesGetSample.js][virtualmachinesgetsample] | retrieves information about the model view or the instance view of a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get.json | +| [virtualMachinesInstallPatchesSample.js][virtualmachinesinstallpatchessample] | installs patches on the VM. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_InstallPatches.json | +| [virtualMachinesInstanceViewSample.js][virtualmachinesinstanceviewsample] | retrieves information about the run-time state of a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceView.json | +| [virtualMachinesListAllSample.js][virtualmachineslistallsample] | lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json | +| [virtualMachinesListAvailableSizesSample.js][virtualmachineslistavailablesizessample] | lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json | +| [virtualMachinesListByLocationSample.js][virtualmachineslistbylocationsample] | gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json | +| [virtualMachinesListSample.js][virtualmachineslistsample] | lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json | +| [virtualMachinesMigrateToVMScaleSetSample.js][virtualmachinesmigratetovmscalesetsample] | migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json | +| [virtualMachinesPerformMaintenanceSample.js][virtualmachinesperformmaintenancesample] | the operation to perform maintenance on a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json | +| [virtualMachinesPowerOffSample.js][virtualmachinespoweroffsample] | the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json | +| [virtualMachinesReapplySample.js][virtualmachinesreapplysample] | the operation to reapply a virtual machine's state. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reapply.json | +| [virtualMachinesRedeploySample.js][virtualmachinesredeploysample] | shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json | +| [virtualMachinesReimageSample.js][virtualmachinesreimagesample] | reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage.json | +| [virtualMachinesRestartSample.js][virtualmachinesrestartsample] | the operation to restart a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json | +| [virtualMachinesRetrieveBootDiagnosticsDataSample.js][virtualmachinesretrievebootdiagnosticsdatasample] | the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json | +| [virtualMachinesRunCommandSample.js][virtualmachinesruncommandsample] | run command on the VM. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand.json | +| [virtualMachinesSimulateEvictionSample.js][virtualmachinessimulateevictionsample] | the operation to simulate the eviction of spot virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_SimulateEviction.json | +| [virtualMachinesStartSample.js][virtualmachinesstartsample] | the operation to start a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json | +| [virtualMachinesUpdateSample.js][virtualmachinesupdatesample] | the operation to update a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json | ## Prerequisites @@ -350,327 +323,300 @@ node availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env COMPUTE_SUBSCRIPTION_ID="" COMPUTE_RESOURCE_GROUP="" node availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js +node availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[availabilitysetscancelmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js -[availabilitysetsconverttovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js -[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsCreateOrUpdateSample.js -[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsDeleteSample.js -[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsGetSample.js -[availabilitysetslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListAvailableSizesSample.js -[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListBySubscriptionSample.js -[availabilitysetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListSample.js -[availabilitysetsstartmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js -[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsUpdateSample.js -[availabilitysetsvalidatemigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js -[capacityreservationgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsCreateOrUpdateSample.js -[capacityreservationgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsDeleteSample.js -[capacityreservationgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsGetSample.js -[capacityreservationgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListByResourceGroupSample.js -[capacityreservationgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListBySubscriptionSample.js -[capacityreservationgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsUpdateSample.js -[capacityreservationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsCreateOrUpdateSample.js -[capacityreservationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsDeleteSample.js -[capacityreservationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsGetSample.js -[capacityreservationslistbycapacityreservationgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsListByCapacityReservationGroupSample.js -[capacityreservationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsUpdateSample.js -[cloudserviceoperatingsystemsgetosfamilysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSFamilySample.js -[cloudserviceoperatingsystemsgetosversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsGetOSVersionSample.js -[cloudserviceoperatingsystemslistosfamiliessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSFamiliesSample.js -[cloudserviceoperatingsystemslistosversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceOperatingSystemsListOSVersionsSample.js -[cloudserviceroleinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesDeleteSample.js -[cloudserviceroleinstancesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetInstanceViewSample.js -[cloudserviceroleinstancesgetremotedesktopfilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetRemoteDesktopFileSample.js -[cloudserviceroleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesGetSample.js -[cloudserviceroleinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesListSample.js -[cloudserviceroleinstancesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRebuildSample.js -[cloudserviceroleinstancesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesReimageSample.js -[cloudserviceroleinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRoleInstancesRestartSample.js -[cloudservicerolesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesGetSample.js -[cloudserviceroleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServiceRolesListSample.js -[cloudservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesCreateOrUpdateSample.js -[cloudservicesdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteInstancesSample.js -[cloudservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesDeleteSample.js -[cloudservicesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetInstanceViewSample.js -[cloudservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesGetSample.js -[cloudserviceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListAllSample.js -[cloudserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesListSample.js -[cloudservicespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesPowerOffSample.js -[cloudservicesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRebuildSample.js -[cloudservicesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesReimageSample.js -[cloudservicesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesRestartSample.js -[cloudservicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesStartSample.js -[cloudservicesupdatedomaingetupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainGetUpdateDomainSample.js -[cloudservicesupdatedomainlistupdatedomainssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainListUpdateDomainsSample.js -[cloudservicesupdatedomainwalkupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateDomainWalkUpdateDomainSample.js -[cloudservicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/cloudServicesUpdateSample.js -[communitygalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/communityGalleriesGetSample.js -[communitygalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsGetSample.js -[communitygalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsListSample.js -[communitygalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesGetSample.js -[communitygalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesListSample.js -[dedicatedhostgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsCreateOrUpdateSample.js -[dedicatedhostgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsDeleteSample.js -[dedicatedhostgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsGetSample.js -[dedicatedhostgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListByResourceGroupSample.js -[dedicatedhostgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListBySubscriptionSample.js -[dedicatedhostgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsUpdateSample.js -[dedicatedhostscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsCreateOrUpdateSample.js -[dedicatedhostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsDeleteSample.js -[dedicatedhostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsGetSample.js -[dedicatedhostslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListAvailableSizesSample.js -[dedicatedhostslistbyhostgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListByHostGroupSample.js -[dedicatedhostsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRedeploySample.js -[dedicatedhostsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRestartSample.js -[dedicatedhostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsUpdateSample.js -[diskaccessescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesCreateOrUpdateSample.js -[diskaccessesdeleteaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js -[diskaccessesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesDeleteSample.js -[diskaccessesgetaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js -[diskaccessesgetprivatelinkresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetPrivateLinkResourcesSample.js -[diskaccessesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetSample.js -[diskaccesseslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListByResourceGroupSample.js -[diskaccesseslistprivateendpointconnectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListPrivateEndpointConnectionsSample.js -[diskaccesseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListSample.js -[diskaccessesupdateaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js -[diskaccessesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesUpdateSample.js -[diskencryptionsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsCreateOrUpdateSample.js -[diskencryptionsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsDeleteSample.js -[diskencryptionsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsGetSample.js -[diskencryptionsetslistassociatedresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListAssociatedResourcesSample.js -[diskencryptionsetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListByResourceGroupSample.js -[diskencryptionsetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListSample.js -[diskencryptionsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsUpdateSample.js -[diskrestorepointgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGetSample.js -[diskrestorepointgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointGrantAccessSample.js -[diskrestorepointlistbyrestorepointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointListByRestorePointSample.js -[diskrestorepointrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/diskRestorePointRevokeAccessSample.js -[diskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksCreateOrUpdateSample.js -[disksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksDeleteSample.js -[disksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksGetSample.js -[disksgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksGrantAccessSample.js -[diskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksListByResourceGroupSample.js -[diskslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksListSample.js -[disksrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksRevokeAccessSample.js -[disksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/disksUpdateSample.js -[galleriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleriesCreateOrUpdateSample.js -[galleriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleriesDeleteSample.js -[galleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleriesGetSample.js -[gallerieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleriesListByResourceGroupSample.js -[gallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleriesListSample.js -[galleriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleriesUpdateSample.js -[galleryapplicationversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsCreateOrUpdateSample.js -[galleryapplicationversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsDeleteSample.js -[galleryapplicationversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsGetSample.js -[galleryapplicationversionslistbygalleryapplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js -[galleryapplicationversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsUpdateSample.js -[galleryapplicationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsCreateOrUpdateSample.js -[galleryapplicationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsDeleteSample.js -[galleryapplicationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsGetSample.js -[galleryapplicationslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsListByGallerySample.js -[galleryapplicationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsUpdateSample.js -[galleryimageversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsCreateOrUpdateSample.js -[galleryimageversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsDeleteSample.js -[galleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsGetSample.js -[galleryimageversionslistbygalleryimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsListByGalleryImageSample.js -[galleryimageversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsUpdateSample.js -[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesCreateOrUpdateSample.js -[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesDeleteSample.js -[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesGetSample.js -[galleryimageslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesListByGallerySample.js -[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryImagesUpdateSample.js -[galleryinvmaccesscontrolprofileversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js -[galleryinvmaccesscontrolprofileversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js -[galleryinvmaccesscontrolprofileversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsGetSample.js -[galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.js -[galleryinvmaccesscontrolprofileversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js -[galleryinvmaccesscontrolprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js -[galleryinvmaccesscontrolprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesDeleteSample.js -[galleryinvmaccesscontrolprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesGetSample.js -[galleryinvmaccesscontrolprofileslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesListByGallerySample.js -[galleryinvmaccesscontrolprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesUpdateSample.js -[galleryscriptversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsCreateOrUpdateSample.js -[galleryscriptversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsDeleteSample.js -[galleryscriptversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsGetSample.js -[galleryscriptversionslistbygalleryscriptsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsListByGalleryScriptSample.js -[galleryscriptversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsUpdateSample.js -[galleryscriptscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsCreateOrUpdateSample.js -[galleryscriptsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsDeleteSample.js -[galleryscriptsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsGetSample.js -[galleryscriptslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsListByGallerySample.js -[galleryscriptsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptsUpdateSample.js -[gallerysharingprofileupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/gallerySharingProfileUpdateSample.js -[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/imagesCreateOrUpdateSample.js -[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/imagesDeleteSample.js -[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/imagesGetSample.js -[imageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/imagesListByResourceGroupSample.js -[imageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/imagesListSample.js -[imagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/imagesUpdateSample.js -[loganalyticsexportrequestratebyintervalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportRequestRateByIntervalSample.js -[loganalyticsexportthrottledrequestssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportThrottledRequestsSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/operationsListSample.js -[proximityplacementgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsCreateOrUpdateSample.js -[proximityplacementgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsDeleteSample.js -[proximityplacementgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsGetSample.js -[proximityplacementgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListByResourceGroupSample.js -[proximityplacementgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListBySubscriptionSample.js -[proximityplacementgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsUpdateSample.js -[resourceskuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/resourceSkusListSample.js -[restorepointcollectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsCreateOrUpdateSample.js -[restorepointcollectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsDeleteSample.js -[restorepointcollectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsGetSample.js -[restorepointcollectionslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListAllSample.js -[restorepointcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListSample.js -[restorepointcollectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsUpdateSample.js -[restorepointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointsCreateSample.js -[restorepointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointsDeleteSample.js -[restorepointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/restorePointsGetSample.js -[sharedgalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesGetSample.js -[sharedgallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesListSample.js -[sharedgalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsGetSample.js -[sharedgalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsListSample.js -[sharedgalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesGetSample.js -[sharedgalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesListSample.js -[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsCreateOrUpdateSample.js -[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsDeleteSample.js -[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGetSample.js -[snapshotsgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsGrantAccessSample.js -[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsListByResourceGroupSample.js -[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsListSample.js -[snapshotsrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsRevokeAccessSample.js -[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/snapshotsUpdateSample.js -[softdeletedresourcelistbyartifactnamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/softDeletedResourceListByArtifactNameSample.js -[sshpublickeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysCreateSample.js -[sshpublickeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysDeleteSample.js -[sshpublickeysgeneratekeypairsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGenerateKeyPairSample.js -[sshpublickeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysGetSample.js -[sshpublickeyslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListByResourceGroupSample.js -[sshpublickeyslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListBySubscriptionSample.js -[sshpublickeysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysUpdateSample.js -[usagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/usageListSample.js -[virtualmachineextensionimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesGetSample.js -[virtualmachineextensionimageslisttypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListTypesSample.js -[virtualmachineextensionimageslistversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionImagesListVersionsSample.js -[virtualmachineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsCreateOrUpdateSample.js -[virtualmachineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsDeleteSample.js -[virtualmachineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsGetSample.js -[virtualmachineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsListSample.js -[virtualmachineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineExtensionsUpdateSample.js -[virtualmachineimagesedgezonegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneGetSample.js -[virtualmachineimagesedgezonelistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListOffersSample.js -[virtualmachineimagesedgezonelistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js -[virtualmachineimagesedgezonelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSample.js -[virtualmachineimagesedgezonelistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListSkusSample.js -[virtualmachineimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesGetSample.js -[virtualmachineimageslistbyedgezonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListByEdgeZoneSample.js -[virtualmachineimageslistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListOffersSample.js -[virtualmachineimageslistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListPublishersSample.js -[virtualmachineimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSample.js -[virtualmachineimageslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListSkusSample.js -[virtualmachineimageslistwithpropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListWithPropertiesSample.js -[virtualmachineruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js -[virtualmachineruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsDeleteSample.js -[virtualmachineruncommandsgetbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js -[virtualmachineruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsGetSample.js -[virtualmachineruncommandslistbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js -[virtualmachineruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListSample.js -[virtualmachineruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsUpdateSample.js -[virtualmachinescalesetextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js -[virtualmachinescalesetextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsDeleteSample.js -[virtualmachinescalesetextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsGetSample.js -[virtualmachinescalesetextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsListSample.js -[virtualmachinescalesetextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetExtensionsUpdateSample.js -[virtualmachinescalesetrollingupgradescancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js -[virtualmachinescalesetrollingupgradesgetlatestsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js -[virtualmachinescalesetrollingupgradesstartextensionupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js -[virtualmachinescalesetrollingupgradesstartosupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js -[virtualmachinescalesetvmextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js -[virtualmachinescalesetvmextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js -[virtualmachinescalesetvmextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsGetSample.js -[virtualmachinescalesetvmextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsListSample.js -[virtualmachinescalesetvmextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js -[virtualmachinescalesetvmruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js -[virtualmachinescalesetvmruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js -[virtualmachinescalesetvmruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js -[virtualmachinescalesetvmruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsListSample.js -[virtualmachinescalesetvmruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js -[virtualmachinescalesetvmsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSApproveRollingUpgradeSample.js -[virtualmachinescalesetvmsattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSAttachDetachDataDisksSample.js -[virtualmachinescalesetvmsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeallocateSample.js -[virtualmachinescalesetvmsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeleteSample.js -[virtualmachinescalesetvmsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js -[virtualmachinescalesetvmsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetSample.js -[virtualmachinescalesetvmslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSListSample.js -[virtualmachinescalesetvmsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPerformMaintenanceSample.js -[virtualmachinescalesetvmspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSPowerOffSample.js -[virtualmachinescalesetvmsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRedeploySample.js -[virtualmachinescalesetvmsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageAllSample.js -[virtualmachinescalesetvmsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSReimageSample.js -[virtualmachinescalesetvmsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRestartSample.js -[virtualmachinescalesetvmsretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.js -[virtualmachinescalesetvmsruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSRunCommandSample.js -[virtualmachinescalesetvmssimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSSimulateEvictionSample.js -[virtualmachinescalesetvmsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSStartSample.js -[virtualmachinescalesetvmsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSUpdateSample.js -[virtualmachinescalesetsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js -[virtualmachinescalesetsconverttosingleplacementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js -[virtualmachinescalesetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js -[virtualmachinescalesetsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeallocateSample.js -[virtualmachinescalesetsdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteInstancesSample.js -[virtualmachinescalesetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsDeleteSample.js -[virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js -[virtualmachinescalesetsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetInstanceViewSample.js -[virtualmachinescalesetsgetosupgradehistorysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js -[virtualmachinescalesetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsGetSample.js -[virtualmachinescalesetslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListAllSample.js -[virtualmachinescalesetslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListByLocationSample.js -[virtualmachinescalesetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSample.js -[virtualmachinescalesetslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSkusSample.js -[virtualmachinescalesetsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js -[virtualmachinescalesetspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPowerOffSample.js -[virtualmachinescalesetsreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReapplySample.js -[virtualmachinescalesetsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRedeploySample.js -[virtualmachinescalesetsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageAllSample.js -[virtualmachinescalesetsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsReimageSample.js -[virtualmachinescalesetsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsRestartSample.js -[virtualmachinescalesetsscaleoutsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsScaleOutSample.js -[virtualmachinescalesetssetorchestrationservicestatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js -[virtualmachinescalesetsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsStartSample.js -[virtualmachinescalesetsupdateinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateInstancesSample.js -[virtualmachinescalesetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateSample.js -[virtualmachinesizeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineSizesListSample.js -[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAssessPatchesSample.js -[virtualmachinesattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesAttachDetachDataDisksSample.js -[virtualmachinescapturesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCaptureSample.js -[virtualmachinesconverttomanageddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesConvertToManagedDisksSample.js -[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCreateOrUpdateSample.js -[virtualmachinesdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeallocateSample.js -[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesDeleteSample.js -[virtualmachinesgeneralizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGeneralizeSample.js -[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGetSample.js -[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstallPatchesSample.js -[virtualmachinesinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstanceViewSample.js -[virtualmachineslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAllSample.js -[virtualmachineslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAvailableSizesSample.js -[virtualmachineslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListByLocationSample.js -[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListSample.js -[virtualmachinesmigratetovmscalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesMigrateToVMScaleSetSample.js -[virtualmachinesperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPerformMaintenanceSample.js -[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesPowerOffSample.js -[virtualmachinesreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReapplySample.js -[virtualmachinesredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRedeploySample.js -[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReimageSample.js -[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRestartSample.js -[virtualmachinesretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js -[virtualmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRunCommandSample.js -[virtualmachinessimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesSimulateEvictionSample.js -[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesStartSample.js -[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesUpdateSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview +[availabilitysetscancelmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js +[availabilitysetsconverttovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js +[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCreateOrUpdateSample.js +[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsDeleteSample.js +[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsGetSample.js +[availabilitysetslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListAvailableSizesSample.js +[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListBySubscriptionSample.js +[availabilitysetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListSample.js +[availabilitysetsstartmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js +[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsUpdateSample.js +[availabilitysetsvalidatemigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js +[capacityreservationgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsCreateOrUpdateSample.js +[capacityreservationgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsDeleteSample.js +[capacityreservationgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsGetSample.js +[capacityreservationgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListByResourceGroupSample.js +[capacityreservationgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListBySubscriptionSample.js +[capacityreservationgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsUpdateSample.js +[capacityreservationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsCreateOrUpdateSample.js +[capacityreservationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsDeleteSample.js +[capacityreservationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsGetSample.js +[capacityreservationslistbycapacityreservationgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsListByCapacityReservationGroupSample.js +[capacityreservationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsUpdateSample.js +[communitygalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/communityGalleriesGetSample.js +[communitygalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsGetSample.js +[communitygalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsListSample.js +[communitygalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesGetSample.js +[communitygalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesListSample.js +[dedicatedhostgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsCreateOrUpdateSample.js +[dedicatedhostgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsDeleteSample.js +[dedicatedhostgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsGetSample.js +[dedicatedhostgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListByResourceGroupSample.js +[dedicatedhostgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListBySubscriptionSample.js +[dedicatedhostgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsUpdateSample.js +[dedicatedhostscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsCreateOrUpdateSample.js +[dedicatedhostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsDeleteSample.js +[dedicatedhostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsGetSample.js +[dedicatedhostslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListAvailableSizesSample.js +[dedicatedhostslistbyhostgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListByHostGroupSample.js +[dedicatedhostsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRedeploySample.js +[dedicatedhostsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRestartSample.js +[dedicatedhostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsUpdateSample.js +[diskaccessescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesCreateOrUpdateSample.js +[diskaccessesdeleteaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js +[diskaccessesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteSample.js +[diskaccessesgetaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js +[diskaccessesgetprivatelinkresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetPrivateLinkResourcesSample.js +[diskaccessesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetSample.js +[diskaccesseslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListByResourceGroupSample.js +[diskaccesseslistprivateendpointconnectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListPrivateEndpointConnectionsSample.js +[diskaccesseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListSample.js +[diskaccessesupdateaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js +[diskaccessesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateSample.js +[diskencryptionsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsCreateOrUpdateSample.js +[diskencryptionsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsDeleteSample.js +[diskencryptionsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsGetSample.js +[diskencryptionsetslistassociatedresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListAssociatedResourcesSample.js +[diskencryptionsetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListByResourceGroupSample.js +[diskencryptionsetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListSample.js +[diskencryptionsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsUpdateSample.js +[diskrestorepointgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGetSample.js +[diskrestorepointgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGrantAccessSample.js +[diskrestorepointlistbyrestorepointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointListByRestorePointSample.js +[diskrestorepointrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointRevokeAccessSample.js +[diskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksCreateOrUpdateSample.js +[disksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksDeleteSample.js +[disksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksGetSample.js +[disksgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksGrantAccessSample.js +[diskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksListByResourceGroupSample.js +[diskslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksListSample.js +[disksrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksRevokeAccessSample.js +[disksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/disksUpdateSample.js +[galleriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleriesCreateOrUpdateSample.js +[galleriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleriesDeleteSample.js +[galleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleriesGetSample.js +[gallerieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleriesListByResourceGroupSample.js +[gallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleriesListSample.js +[galleriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleriesUpdateSample.js +[galleryapplicationversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsCreateOrUpdateSample.js +[galleryapplicationversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsDeleteSample.js +[galleryapplicationversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsGetSample.js +[galleryapplicationversionslistbygalleryapplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js +[galleryapplicationversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsUpdateSample.js +[galleryapplicationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsCreateOrUpdateSample.js +[galleryapplicationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsDeleteSample.js +[galleryapplicationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsGetSample.js +[galleryapplicationslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsListByGallerySample.js +[galleryapplicationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsUpdateSample.js +[galleryimageversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsCreateOrUpdateSample.js +[galleryimageversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsDeleteSample.js +[galleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsGetSample.js +[galleryimageversionslistbygalleryimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsListByGalleryImageSample.js +[galleryimageversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsUpdateSample.js +[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesCreateOrUpdateSample.js +[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesDeleteSample.js +[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesGetSample.js +[galleryimageslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesListByGallerySample.js +[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesUpdateSample.js +[galleryinvmaccesscontrolprofileversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js +[galleryinvmaccesscontrolprofileversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js +[galleryinvmaccesscontrolprofileversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsGetSample.js +[galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.js +[galleryinvmaccesscontrolprofileversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js +[galleryinvmaccesscontrolprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js +[galleryinvmaccesscontrolprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesDeleteSample.js +[galleryinvmaccesscontrolprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesGetSample.js +[galleryinvmaccesscontrolprofileslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesListByGallerySample.js +[galleryinvmaccesscontrolprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesUpdateSample.js +[galleryscriptversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsCreateOrUpdateSample.js +[galleryscriptversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsDeleteSample.js +[galleryscriptversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsGetSample.js +[galleryscriptversionslistbygalleryscriptsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsListByGalleryScriptSample.js +[galleryscriptversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsUpdateSample.js +[galleryscriptscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsCreateOrUpdateSample.js +[galleryscriptsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsDeleteSample.js +[galleryscriptsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsGetSample.js +[galleryscriptslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsListByGallerySample.js +[galleryscriptsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsUpdateSample.js +[gallerysharingprofileupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/gallerySharingProfileUpdateSample.js +[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/imagesCreateOrUpdateSample.js +[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/imagesDeleteSample.js +[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/imagesGetSample.js +[imageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/imagesListByResourceGroupSample.js +[imageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/imagesListSample.js +[imagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/imagesUpdateSample.js +[loganalyticsexportrequestratebyintervalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportRequestRateByIntervalSample.js +[loganalyticsexportthrottledrequestssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportThrottledRequestsSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/operationsListSample.js +[proximityplacementgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsCreateOrUpdateSample.js +[proximityplacementgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsDeleteSample.js +[proximityplacementgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsGetSample.js +[proximityplacementgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListByResourceGroupSample.js +[proximityplacementgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListBySubscriptionSample.js +[proximityplacementgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsUpdateSample.js +[resourceskuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/resourceSkusListSample.js +[restorepointcollectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsCreateOrUpdateSample.js +[restorepointcollectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsDeleteSample.js +[restorepointcollectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsGetSample.js +[restorepointcollectionslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListAllSample.js +[restorepointcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListSample.js +[restorepointcollectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsUpdateSample.js +[restorepointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointsCreateSample.js +[restorepointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointsDeleteSample.js +[restorepointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/restorePointsGetSample.js +[sharedgalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesGetSample.js +[sharedgallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesListSample.js +[sharedgalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsGetSample.js +[sharedgalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsListSample.js +[sharedgalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesGetSample.js +[sharedgalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesListSample.js +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsCreateOrUpdateSample.js +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsDeleteSample.js +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGetSample.js +[snapshotsgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGrantAccessSample.js +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsListByResourceGroupSample.js +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsListSample.js +[snapshotsrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsRevokeAccessSample.js +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/snapshotsUpdateSample.js +[softdeletedresourcelistbyartifactnamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/softDeletedResourceListByArtifactNameSample.js +[sshpublickeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysCreateSample.js +[sshpublickeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysDeleteSample.js +[sshpublickeysgeneratekeypairsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGenerateKeyPairSample.js +[sshpublickeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGetSample.js +[sshpublickeyslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListByResourceGroupSample.js +[sshpublickeyslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListBySubscriptionSample.js +[sshpublickeysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysUpdateSample.js +[usagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/usageListSample.js +[virtualmachineextensionimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesGetSample.js +[virtualmachineextensionimageslisttypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListTypesSample.js +[virtualmachineextensionimageslistversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListVersionsSample.js +[virtualmachineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsCreateOrUpdateSample.js +[virtualmachineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsDeleteSample.js +[virtualmachineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsGetSample.js +[virtualmachineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsListSample.js +[virtualmachineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsUpdateSample.js +[virtualmachineimagesedgezonegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneGetSample.js +[virtualmachineimagesedgezonelistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListOffersSample.js +[virtualmachineimagesedgezonelistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js +[virtualmachineimagesedgezonelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSample.js +[virtualmachineimagesedgezonelistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSkusSample.js +[virtualmachineimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesGetSample.js +[virtualmachineimageslistbyedgezonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListByEdgeZoneSample.js +[virtualmachineimageslistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListOffersSample.js +[virtualmachineimageslistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListPublishersSample.js +[virtualmachineimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSample.js +[virtualmachineimageslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSkusSample.js +[virtualmachineimageslistwithpropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListWithPropertiesSample.js +[virtualmachineruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js +[virtualmachineruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsDeleteSample.js +[virtualmachineruncommandsgetbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js +[virtualmachineruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetSample.js +[virtualmachineruncommandslistbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js +[virtualmachineruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListSample.js +[virtualmachineruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsUpdateSample.js +[virtualmachinescalesetextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js +[virtualmachinescalesetextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsDeleteSample.js +[virtualmachinescalesetextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsGetSample.js +[virtualmachinescalesetextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsListSample.js +[virtualmachinescalesetextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsUpdateSample.js +[virtualmachinescalesetlifecyclehookeventsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsGetSample.js +[virtualmachinescalesetlifecyclehookeventslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsListSample.js +[virtualmachinescalesetlifecyclehookeventsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.js +[virtualmachinescalesetrollingupgradescancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js +[virtualmachinescalesetrollingupgradesgetlatestsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js +[virtualmachinescalesetrollingupgradesstartextensionupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js +[virtualmachinescalesetrollingupgradesstartosupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js +[virtualmachinescalesetvmextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js +[virtualmachinescalesetvmextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js +[virtualmachinescalesetvmextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsGetSample.js +[virtualmachinescalesetvmextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsListSample.js +[virtualmachinescalesetvmextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js +[virtualmachinescalesetvmruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js +[virtualmachinescalesetvmruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js +[virtualmachinescalesetvmruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js +[virtualmachinescalesetvmruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsListSample.js +[virtualmachinescalesetvmruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js +[virtualmachinescalesetvmsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsApproveRollingUpgradeSample.js +[virtualmachinescalesetvmsattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsAttachDetachDataDisksSample.js +[virtualmachinescalesetvmsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeallocateSample.js +[virtualmachinescalesetvmsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeleteSample.js +[virtualmachinescalesetvmsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetInstanceViewSample.js +[virtualmachinescalesetvmsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetSample.js +[virtualmachinescalesetvmslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsListSample.js +[virtualmachinescalesetvmsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPerformMaintenanceSample.js +[virtualmachinescalesetvmspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPowerOffSample.js +[virtualmachinescalesetvmsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRedeploySample.js +[virtualmachinescalesetvmsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageAllSample.js +[virtualmachinescalesetvmsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageSample.js +[virtualmachinescalesetvmsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRestartSample.js +[virtualmachinescalesetvmsretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.js +[virtualmachinescalesetvmsruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRunCommandSample.js +[virtualmachinescalesetvmssimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsSimulateEvictionSample.js +[virtualmachinescalesetvmsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsStartSample.js +[virtualmachinescalesetvmsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsUpdateSample.js +[virtualmachinescalesetsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js +[virtualmachinescalesetsconverttosingleplacementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js +[virtualmachinescalesetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js +[virtualmachinescalesetsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeallocateSample.js +[virtualmachinescalesetsdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteInstancesSample.js +[virtualmachinescalesetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteSample.js +[virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js +[virtualmachinescalesetsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetInstanceViewSample.js +[virtualmachinescalesetsgetosupgradehistorysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js +[virtualmachinescalesetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetSample.js +[virtualmachinescalesetslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListAllSample.js +[virtualmachinescalesetslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListByLocationSample.js +[virtualmachinescalesetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSample.js +[virtualmachinescalesetslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSkusSample.js +[virtualmachinescalesetsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js +[virtualmachinescalesetspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPowerOffSample.js +[virtualmachinescalesetsreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReapplySample.js +[virtualmachinescalesetsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRedeploySample.js +[virtualmachinescalesetsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageAllSample.js +[virtualmachinescalesetsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageSample.js +[virtualmachinescalesetsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRestartSample.js +[virtualmachinescalesetsscaleoutsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsScaleOutSample.js +[virtualmachinescalesetssetorchestrationservicestatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js +[virtualmachinescalesetsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsStartSample.js +[virtualmachinescalesetsupdateinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateInstancesSample.js +[virtualmachinescalesetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateSample.js +[virtualmachinesizeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineSizesListSample.js +[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAssessPatchesSample.js +[virtualmachinesattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAttachDetachDataDisksSample.js +[virtualmachinescapturesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCaptureSample.js +[virtualmachinesconverttomanageddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesConvertToManagedDisksSample.js +[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCreateOrUpdateSample.js +[virtualmachinesdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeallocateSample.js +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeleteSample.js +[virtualmachinesgeneralizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGeneralizeSample.js +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGetSample.js +[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstallPatchesSample.js +[virtualmachinesinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstanceViewSample.js +[virtualmachineslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAllSample.js +[virtualmachineslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAvailableSizesSample.js +[virtualmachineslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListByLocationSample.js +[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListSample.js +[virtualmachinesmigratetovmscalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesMigrateToVMScaleSetSample.js +[virtualmachinesperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPerformMaintenanceSample.js +[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPowerOffSample.js +[virtualmachinesreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReapplySample.js +[virtualmachinesredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRedeploySample.js +[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReimageSample.js +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRestartSample.js +[virtualmachinesretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js +[virtualmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRunCommandSample.js +[virtualmachinessimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesSimulateEvictionSample.js +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesStartSample.js +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesUpdateSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-compute [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute/README.md diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js new file mode 100644 index 000000000000..68e64625fac5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to cancel the migration operation on an Availability Set. + * + * @summary cancel the migration operation on an Availability Set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json + */ +async function availabilitySetCancelMigrationToVirtualMachineScaleSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.cancelMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + ); +} + +async function main() { + await availabilitySetCancelMigrationToVirtualMachineScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js new file mode 100644 index 000000000000..1c4994cf6f72 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsConvertToVirtualMachineScaleSetSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. + * + * @summary create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json + */ +async function availabilitySetConvertToVirtualMachineScaleSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.convertToVirtualMachineScaleSet("rgcompute", "myAvailabilitySet", { + parameters: { virtualMachineScaleSetName: "{vmss-name}" }, + }); +} + +async function main() { + await availabilitySetConvertToVirtualMachineScaleSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..407b80afd165 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsCreateOrUpdateSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update an availability set. + * + * @summary create or update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create.json + */ +async function createAnAvailabilitySet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.createOrUpdate( + "myResourceGroup", + "myAvailabilitySet", + { location: "westus", platformFaultDomainCount: 2, platformUpdateDomainCount: 20 }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update an availability set. + * + * @summary create or update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json + */ +async function createAnAvailabilitySetWithScheduledEventPolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.createOrUpdate( + "myResourceGroup", + "myAvailabilitySet", + { location: "westus", platformFaultDomainCount: 2, platformUpdateDomainCount: 20 }, + ); + console.log(result); +} + +async function main() { + await createAnAvailabilitySet(); + await createAnAvailabilitySetWithScheduledEventPolicy(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsDeleteSample.js new file mode 100644 index 000000000000..a17770f51b37 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete an availability set. + * + * @summary delete an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json + */ +async function availabilitySetDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to delete an availability set. + * + * @summary delete an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json + */ +async function availabilitySetDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.delete("rgcompute", "aaaaaaaaaaa"); +} + +async function main() { + await availabilitySetDeleteMaximumSetGen(); + await availabilitySetDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsGetSample.js new file mode 100644 index 000000000000..3c79a0c5fbaa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about an availability set. + * + * @summary retrieves information about an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + */ +async function availabilitySetGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get("rgcompute", "aaaaaaaaaaaa"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about an availability set. + * + * @summary retrieves information about an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + */ +async function availabilitySetGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); + console.log(result); +} + +async function main() { + await availabilitySetGetMaximumSetGen(); + await availabilitySetGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListAvailableSizesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListAvailableSizesSample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListAvailableSizesSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListAvailableSizesSample.js index d8908a631870..c9f894f2d0b4 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListAvailableSizesSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListAvailableSizesSample.js @@ -3,49 +3,43 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * This sample demonstrates how to lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. * - * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json + * @summary lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json */ async function availabilitySetListAvailableSizesMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.availabilitySets.listAvailableSizes( - resourceGroupName, - availabilitySetName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * This sample demonstrates how to lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. * - * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json + * @summary lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json */ async function availabilitySetListAvailableSizesMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.availabilitySets.listAvailableSizes( - resourceGroupName, - availabilitySetName, - )) { + for await (const item of client.availabilitySets.listAvailableSizes("rgcompute", "aa")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListBySubscriptionSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListBySubscriptionSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListBySubscriptionSample.js index 170aaf2e6f69..8f74b39517c0 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/availabilitySetsListBySubscriptionSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListBySubscriptionSample.js @@ -3,24 +3,24 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all availability sets in a subscription. + * This sample demonstrates how to lists all availability sets in a subscription. * - * @summary Lists all availability sets in a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json + * @summary lists all availability sets in a subscription. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListBySubscription.json */ async function listAvailabilitySetsInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const expand = "virtualMachines\\$ref"; - const options = { expand }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.availabilitySets.listBySubscription(options)) { + for await (const item of client.availabilitySets.listBySubscription({ + expand: "virtualMachines\\$ref", + })) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListSample.js new file mode 100644 index 000000000000..af7cbab1f6ec --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsListSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all availability sets in a resource group. + * + * @summary lists all availability sets in a resource group. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json + */ +async function availabilitySetListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.availabilitySets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to lists all availability sets in a resource group. + * + * @summary lists all availability sets in a resource group. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json + */ +async function availabilitySetListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.availabilitySets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await availabilitySetListMaximumSetGen(); + await availabilitySetListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js new file mode 100644 index 000000000000..df86e43696d1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. + * + * @summary start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json + */ +async function availabilitySetStartMigrationToVirtualMachineScaleSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.startMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + { + virtualMachineScaleSetFlexible: { + id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", + }, + }, + ); +} + +async function main() { + await availabilitySetStartMigrationToVirtualMachineScaleSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsUpdateSample.js new file mode 100644 index 000000000000..59b75ee376da --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsUpdateSample.js @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update an availability set. + * + * @summary update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json + */ +async function availabilitySetUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update("rgcompute", "aaaaaaaaaaaaaaaaaaa", { + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20, + virtualMachines: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + proximityPlacementGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + sku: { name: "DSv3-Type1", tier: "aaa", capacity: 7 }, + tags: { key2574: "aaaaaaaa" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update an availability set. + * + * @summary update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json + */ +async function availabilitySetUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update("rgcompute", "aaaaaaaaaaaaaaaaaaaa", {}); + console.log(result); +} + +async function main() { + await availabilitySetUpdateMaximumSetGen(); + await availabilitySetUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js new file mode 100644 index 000000000000..0bf00a490213 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. + * + * @summary validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json + */ +async function availabilitySetValidateMigrationToVirtualMachineScaleSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.validateMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + { + virtualMachineScaleSetFlexible: { + id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", + }, + }, + ); +} + +async function main() { + await availabilitySetValidateMigrationToVirtualMachineScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..3fc485e59b20 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsCreateOrUpdateSample.js @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json + */ +async function createOrUpdateABlockCapacityReservationGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + "myResourceGroup", + "blockCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + reservationType: "Block", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json + */ +async function createOrUpdateACapacityReservationGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + "myResourceGroup", + "myCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + sharingProfile: { + subscriptionIds: [ + { id: "/subscriptions/{subscription-id1}" }, + { id: "/subscriptions/{subscription-id2}" }, + ], + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservationGroup_CreateOrUpdate.json + */ +async function createOrUpdateATargetedCapacityReservationGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + "myResourceGroup", + "targetedCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + sharingProfile: { + subscriptionIds: [ + { id: "/subscriptions/{subscription-id1}" }, + { id: "/subscriptions/{subscription-id2}" }, + ], + }, + reservationType: "Targeted", + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateABlockCapacityReservationGroup(); + await createOrUpdateACapacityReservationGroup(); + await createOrUpdateATargetedCapacityReservationGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsDeleteSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsDeleteSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsDeleteSample.js index f69923c8ff88..6e4201e56e27 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsDeleteSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsDeleteSample.js @@ -3,44 +3,31 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json + * @summary the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json */ async function capacityReservationGroupDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "a"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.delete( - resourceGroupName, - capacityReservationGroupName, - ); - console.log(result); + await client.capacityReservationGroups.delete("rgcompute", "a"); } /** - * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json + * @summary the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json */ async function capacityReservationGroupDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.delete( - resourceGroupName, - capacityReservationGroupName, - ); - console.log(result); + await client.capacityReservationGroups.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa"); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsGetSample.js new file mode 100644 index 000000000000..d204e8923b3d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsGetSample.js @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. + * + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_Get.json + */ +async function getABlockCapacityReservationGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + "myResourceGroup", + "blockCapacityReservationGroup", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. + * + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Get.json + */ +async function getACapacityReservationGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + "myResourceGroup", + "myCapacityReservationGroup", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. + * + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservationGroup_Get.json + */ +async function getATargetedCapacityReservationGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + "myResourceGroup", + "targetedCapacityReservationGroup", + { expand: "instanceView" }, + ); + console.log(result); +} + +async function main() { + await getABlockCapacityReservationGroup(); + await getACapacityReservationGroup(); + await getATargetedCapacityReservationGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListByResourceGroupSample.js similarity index 58% rename from sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListByResourceGroupSample.js index 4664d3964d2c..181a6f3776be 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListByResourceGroupSample.js @@ -3,30 +3,24 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json + * @summary lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json */ async function listCapacityReservationGroupsInResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const expand = "virtualMachines/$ref"; - const options = { - expand, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listByResourceGroup( - resourceGroupName, - options, - )) { + for await (const item of client.capacityReservationGroups.listByResourceGroup("myResourceGroup", { + expand: "virtualMachines/$ref", + })) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListBySubscriptionSample.js similarity index 59% rename from sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListBySubscriptionSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListBySubscriptionSample.js index 830d5ecd5de0..cedfe8afed0b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationGroupsListBySubscriptionSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsListBySubscriptionSample.js @@ -3,47 +3,44 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json + * @summary lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json */ async function listCapacityReservationGroupsInSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const expand = "virtualMachines/$ref"; - const options = { - expand, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listBySubscription(options)) { + for await (const item of client.capacityReservationGroups.listBySubscription({ + expand: "virtualMachines/$ref", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json + * @summary lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json */ async function listCapacityReservationGroupsWithResourceIdsOnlyInSubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceIdsOnly = "All"; - const options = { - resourceIdsOnly, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listBySubscription(options)) { + for await (const item of client.capacityReservationGroups.listBySubscription({ + resourceIdsOnly: "All", + })) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsUpdateSample.js new file mode 100644 index 000000000000..ad02a9b2ac3f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationGroupsUpdateSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * + * @summary the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json + */ +async function capacityReservationGroupUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + { tags: { key5355: "aaa" } }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * + * @summary the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json + */ +async function capacityReservationGroupUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + {}, + ); + console.log(result); +} + +async function main() { + await capacityReservationGroupUpdateMaximumSetGen(); + await capacityReservationGroupUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..eca90a0d5565 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsCreateOrUpdateSample.js @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json + */ +async function createOrUpdateABlockCapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "blockCapacityReservationGroup", + "blockCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_ND96isr_H100_v5", capacity: 1 }, + scheduleProfile: { start: "2025-08-01", end: "2025-08-02" }, + zones: ["1"], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json + */ +async function createOrUpdateACapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_DS1_v2", capacity: 4 }, + zones: ["1"], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_CreateOrUpdate.json + */ +async function createOrUpdateATargetedCapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "targetedCapacityReservationGroup", + "targetedCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_DS1_v2", capacity: 4 }, + zones: ["1"], + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateABlockCapacityReservation(); + await createOrUpdateACapacityReservation(); + await createOrUpdateATargetedCapacityReservation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsDeleteSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsDeleteSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsDeleteSample.js index 0ac687c564bd..720ac0487313 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsDeleteSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsDeleteSample.js @@ -3,48 +3,35 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * This sample demonstrates how to the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. * - * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json + * @summary the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json */ async function capacityReservationDeleteMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaa"; - const capacityReservationName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginDeleteAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, + await client.capacityReservations.delete( + "rgcompute", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); - console.log(result); } /** - * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * This sample demonstrates how to the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. * - * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json + * @summary the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json */ async function capacityReservationDeleteMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaa"; - const capacityReservationName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginDeleteAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - ); - console.log(result); + await client.capacityReservations.delete("rgcompute", "aaa", "aaaaaa"); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsGetSample.js new file mode 100644 index 000000000000..c3a9deedd758 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsGetSample.js @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. + * + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_Get.json + */ +async function getABlockCapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + "myResourceGroup", + "blockCapacityReservationGroup", + "blockCapacityReservation", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. + * + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Get.json + */ +async function getACapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. + * + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_Get.json + */ +async function getATargetedCapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + "myResourceGroup", + "targetedCapacityReservationGroup", + "targetedCapacityReservation", + { expand: "instanceView" }, + ); + console.log(result); +} + +async function main() { + await getABlockCapacityReservation(); + await getACapacityReservation(); + await getATargetedCapacityReservation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsListByCapacityReservationGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsListByCapacityReservationGroupSample.js similarity index 55% rename from sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsListByCapacityReservationGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsListByCapacityReservationGroupSample.js index 45ebf21ae828..23a3aa6bb5e2 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/capacityReservationsListByCapacityReservationGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsListByCapacityReservationGroupSample.js @@ -3,71 +3,70 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json */ async function listBlockCapacityReservationsInReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "blockCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json */ async function listCapacityReservationsInReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "myCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_ListByReservationGroup.json */ async function listCapacityReservationsInTargetedReservationGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "targetedCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsUpdateSample.js new file mode 100644 index 000000000000..d352f03dcbfb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/capacityReservationsUpdateSample.js @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a capacity reservation. + * + * @summary the operation to update a capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json + */ +async function capacityReservationUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.update( + "rgcompute", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + { + sku: { name: "Standard_DS1_v2", tier: "aaa", capacity: 7 }, + tags: { key4974: "aaaaaaaaaaaaaaaa" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update a capacity reservation. + * + * @summary the operation to update a capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json + */ +async function capacityReservationUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaa", + {}, + ); + console.log(result); +} + +async function main() { + await capacityReservationUpdateMaximumSetGen(); + await capacityReservationUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/communityGalleriesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleriesGetSample.js new file mode 100644 index 000000000000..4dd0ad5ab704 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleriesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a community gallery by gallery public name. + * + * @summary get a community gallery by gallery public name. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGallery_Get.json + */ +async function getACommunityGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleries.get("myLocation", "publicGalleryName"); + console.log(result); +} + +async function main() { + await getACommunityGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsGetSample.js new file mode 100644 index 000000000000..87a2e0634a5c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsGetSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a community gallery image version. + * + * @summary get a community gallery image version. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_Get.json + */ +async function getACommunityGalleryImageVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImageVersions.get( + "myLocation", + "publicGalleryName", + "myGalleryImageName", + "myGalleryImageVersionName", + ); + console.log(result); +} + +async function main() { + await getACommunityGalleryImageVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsListSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsListSample.js index cbe3945f6318..799d9392eba7 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImageVersionsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImageVersionsListSample.js @@ -3,29 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List community gallery image versions inside an image. + * This sample demonstrates how to list community gallery image versions inside an image. * - * @summary List community gallery image versions inside an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json + * @summary list community gallery image versions inside an image. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_List.json */ async function listCommunityGalleryImageVersions() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.communityGalleryImageVersions.list( - location, - publicGalleryName, - galleryImageName, + "myLocation", + "publicGalleryName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesGetSample.js new file mode 100644 index 000000000000..35e3d9f02000 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a community gallery image. + * + * @summary get a community gallery image. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_Get.json + */ +async function getACommunityGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImages.get( + "myLocation", + "publicGalleryName", + "myGalleryImageName", + ); + console.log(result); +} + +async function main() { + await getACommunityGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesListSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesListSample.js index 914b24900804..ca7d0f47ac34 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/communityGalleryImagesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/communityGalleryImagesListSample.js @@ -3,24 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List community gallery images inside a gallery. + * This sample demonstrates how to list community gallery images inside a gallery. * - * @summary List community gallery images inside a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json + * @summary list community gallery images inside a gallery. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_List.json */ async function listCommunityGalleryImages() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.communityGalleryImages.list(location, publicGalleryName)) { + for await (const item of client.communityGalleryImages.list("myLocation", "publicGalleryName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..992b5a448d27 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsCreateOrUpdateSample.js @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * + * @summary create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json + */ +async function createOrUpdateADedicatedHostGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.createOrUpdate( + "myResourceGroup", + "myDedicatedHostGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1"], + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * + * @summary create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json + */ +async function createOrUpdateADedicatedHostGroupWithUltraSSDSupport() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.createOrUpdate( + "myResourceGroup", + "myDedicatedHostGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1"], + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + additionalCapabilities: { ultraSSDEnabled: true }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateADedicatedHostGroup(); + await createOrUpdateADedicatedHostGroupWithUltraSSDSupport(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsDeleteSample.js new file mode 100644 index 000000000000..2c7db4c0805d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a dedicated host group. + * + * @summary delete a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostGroupDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHostGroups.delete("rgcompute", "a"); +} + +/** + * This sample demonstrates how to delete a dedicated host group. + * + * @summary delete a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostGroupDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHostGroups.delete("rgcompute", "aaaa"); +} + +async function main() { + await dedicatedHostGroupDeleteMaximumSetGen(); + await dedicatedHostGroupDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsGetSample.js new file mode 100644 index 000000000000..b148f54c16df --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a dedicated host group. + * + * @summary retrieves information about a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get.json + */ +async function createADedicatedHostGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.get("myResourceGroup", "myDedicatedHostGroup"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a dedicated host group. + * + * @summary retrieves information about a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + */ +async function createAnUltraSSDEnabledDedicatedHostGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.get("myResourceGroup", "myDedicatedHostGroup"); + console.log(result); +} + +async function main() { + await createADedicatedHostGroup(); + await createAnUltraSSDEnabledDedicatedHostGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListByResourceGroupSample.js similarity index 59% rename from sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListByResourceGroupSample.js index fd0732b966be..765b62d38183 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListByResourceGroupSample.js @@ -3,41 +3,40 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json + * @summary lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json */ async function dedicatedHostGroupListByResourceGroupMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHostGroups.listByResourceGroup(resourceGroupName)) { + for await (const item of client.dedicatedHostGroups.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json + * @summary lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json */ async function dedicatedHostGroupListByResourceGroupMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHostGroups.listByResourceGroup(resourceGroupName)) { + for await (const item of client.dedicatedHostGroups.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListBySubscriptionSample.js similarity index 64% rename from sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListBySubscriptionSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListBySubscriptionSample.js index 26aa5cd14bbb..080e713f1c9b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostGroupsListBySubscriptionSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsListBySubscriptionSample.js @@ -3,39 +3,40 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json + * @summary lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json */ async function dedicatedHostGroupListBySubscriptionMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHostGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json + * @summary lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json */ async function dedicatedHostGroupListBySubscriptionMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHostGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsUpdateSample.js new file mode 100644 index 000000000000..ff82000c8342 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostGroupsUpdateSample.js @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update an dedicated host group. + * + * @summary update an dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json + */ +async function dedicatedHostGroupUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update("rgcompute", "aaaa", { + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"], + tags: { key9921: "aaaaaaaaaa" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update an dedicated host group. + * + * @summary update an dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json + */ +async function dedicatedHostGroupUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update("rgcompute", "aaaaaaaaaaa", {}); + console.log(result); +} + +async function main() { + await dedicatedHostGroupUpdateMaximumSetGen(); + await dedicatedHostGroupUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsCreateOrUpdateSample.js new file mode 100644 index 000000000000..f97be892b7ee --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsCreateOrUpdateSample.js @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a dedicated host . + * + * @summary create or update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json + */ +async function createOrUpdateADedicatedHost() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.createOrUpdate( + "myResourceGroup", + "myDedicatedHostGroup", + "myDedicatedHost", + { + location: "westus", + tags: { department: "HR" }, + platformFaultDomain: 1, + sku: { name: "DSv3-Type1" }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateADedicatedHost(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsDeleteSample.js new file mode 100644 index 000000000000..b05aaa1f5579 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a dedicated host. + * + * @summary delete a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHosts.delete("rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to delete a dedicated host. + * + * @summary delete a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHosts.delete("rgcompute", "aaaaaaaaaaaaaaa", "aaaaa"); +} + +async function main() { + await dedicatedHostDeleteMaximumSetGen(); + await dedicatedHostDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsGetSample.js new file mode 100644 index 000000000000..e5491dee6914 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsGetSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a dedicated host. + * + * @summary retrieves information about a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Get.json + */ +async function getADedicatedHost() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.get( + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", + { expand: "instanceView" }, + ); + console.log(result); +} + +async function main() { + await getADedicatedHost(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListAvailableSizesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListAvailableSizesSample.js similarity index 60% rename from sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListAvailableSizesSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListAvailableSizesSample.js index e9f1b6770c73..7bb71ec13ce8 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListAvailableSizesSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListAvailableSizesSample.js @@ -3,29 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. + * This sample demonstrates how to lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. * - * @summary Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json + * @summary lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json */ async function getAvailableDedicatedHostSizes() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHosts.listAvailableSizes( - resourceGroupName, - hostGroupName, - hostName, + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListByHostGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListByHostGroupSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListByHostGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListByHostGroupSample.js index f21b722416ed..6867f7c1f13f 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsListByHostGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsListByHostGroupSample.js @@ -3,49 +3,43 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * This sample demonstrates how to lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. * - * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json + * @summary lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json */ async function dedicatedHostListByHostGroupMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHosts.listByHostGroup( - resourceGroupName, - hostGroupName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * This sample demonstrates how to lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. * - * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json + * @summary lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json */ async function dedicatedHostListByHostGroupMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHosts.listByHostGroup( - resourceGroupName, - hostGroupName, - )) { + for await (const item of client.dedicatedHosts.listByHostGroup("rgcompute", "aaaa")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRedeploySample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRedeploySample.js similarity index 61% rename from sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRedeploySample.js rename to sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRedeploySample.js index a4fc4367b3c2..6b56d9dc0f8a 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRedeploySample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRedeploySample.js @@ -3,27 +3,18 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * This sample demonstrates how to redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. * - * @summary Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json + * @summary redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Redeploy.json */ async function redeployDedicatedHost() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginRedeployAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.redeploy("myResourceGroup", "myDedicatedHostGroup", "myHost"); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRestartSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRestartSample.js similarity index 60% rename from sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRestartSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRestartSample.js index 786756912e18..5f779ed877eb 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/dedicatedHostsRestartSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsRestartSample.js @@ -3,27 +3,18 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * This sample demonstrates how to restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. * - * @summary Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json + * @summary restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Restart.json */ async function restartDedicatedHost() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginRestartAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.restart("myResourceGroup", "myDedicatedHostGroup", "myHost"); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsUpdateSample.js new file mode 100644 index 000000000000..8bc94b3db9da --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/dedicatedHostsUpdateSample.js @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a dedicated host . + * + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json + */ +async function dedicatedHostUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.update( + "rgcompute", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { + platformFaultDomain: 1, + autoReplaceOnFailure: true, + licenseType: "Windows_Server_Hybrid", + tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a dedicated host . + * + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json + */ +async function dedicatedHostUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.update( + "rgcompute", + "aa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + {}, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a dedicated host . + * + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_Resize.json + */ +async function dedicatedHostUpdateResize() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.update( + "rgcompute", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { sku: { name: "DSv3-Type1" } }, + ); + console.log(result); +} + +async function main() { + await dedicatedHostUpdateMaximumSetGen(); + await dedicatedHostUpdateMinimumSetGen(); + await dedicatedHostUpdateResize(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesCreateOrUpdateSample.js new file mode 100644 index 000000000000..fffe94cb7b56 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesCreateOrUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a disk access resource + * + * @summary creates or updates a disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Create.json + */ +async function createADiskAccessResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.createOrUpdate("myResourceGroup", "myDiskAccess", { + location: "West US", + }); + console.log(result); +} + +async function main() { + await createADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js new file mode 100644 index 000000000000..f2dc89539536 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteAPrivateEndpointConnectionSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a private endpoint connection under a disk access resource. + * + * @summary deletes a private endpoint connection under a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json + */ +async function deleteAPrivateEndpointConnectionUnderADiskAccessResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskAccesses.deleteAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + ); +} + +async function main() { + await deleteAPrivateEndpointConnectionUnderADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteSample.js new file mode 100644 index 000000000000..3af41592a4a2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a disk access resource. + * + * @summary deletes a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Delete.json + */ +async function deleteADiskAccessResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskAccesses.delete("myResourceGroup", "myDiskAccess"); +} + +async function main() { + await deleteADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js similarity index 52% rename from sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js index 1cbc058f5c3b..e1a866568806 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetAPrivateEndpointConnectionSample.js @@ -3,25 +3,21 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets information about a private endpoint connection under a disk access resource. + * This sample demonstrates how to gets information about a private endpoint connection under a disk access resource. * - * @summary Gets information about a private endpoint connection under a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + * @summary gets information about a private endpoint connection under a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json */ async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.diskAccesses.getAPrivateEndpointConnection( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetPrivateLinkResourcesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetPrivateLinkResourcesSample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetPrivateLinkResourcesSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetPrivateLinkResourcesSample.js index e4e9511c92a9..3119c6430d42 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesGetPrivateLinkResourcesSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetPrivateLinkResourcesSample.js @@ -3,23 +3,20 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets the private link resources possible under disk access resource + * This sample demonstrates how to gets the private link resources possible under disk access resource * - * @summary Gets the private link resources possible under disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json + * @summary gets the private link resources possible under disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json */ async function listAllPossiblePrivateLinkResourcesUnderDiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.diskAccesses.getPrivateLinkResources( - resourceGroupName, - diskAccessName, + "myResourceGroup", + "myDiskAccess", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetSample.js new file mode 100644 index 000000000000..e82c9de0e508 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets information about a disk access resource. + * + * @summary gets information about a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get.json + */ +async function getInformationAboutADiskAccessResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get("myResourceGroup", "myDiskAccess"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a disk access resource. + * + * @summary gets information about a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + */ +async function getInformationAboutADiskAccessResourceWithPrivateEndpoints() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get("myResourceGroup", "myDiskAccess"); + console.log(result); +} + +async function main() { + await getInformationAboutADiskAccessResource(); + await getInformationAboutADiskAccessResourceWithPrivateEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListByResourceGroupSample.js similarity index 57% rename from sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListByResourceGroupSample.js index 1c7e639d3c55..22329cad06cf 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListByResourceGroupSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all the disk access resources under a resource group. + * This sample demonstrates how to lists all the disk access resources under a resource group. * - * @summary Lists all the disk access resources under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json + * @summary lists all the disk access resources under a resource group. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListByResourceGroup.json */ async function listAllDiskAccessResourcesInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.diskAccesses.listByResourceGroup(resourceGroupName)) { + for await (const item of client.diskAccesses.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListPrivateEndpointConnectionsSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListPrivateEndpointConnectionsSample.js similarity index 57% rename from sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListPrivateEndpointConnectionsSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListPrivateEndpointConnectionsSample.js index 332b086a8561..2a884177759d 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListPrivateEndpointConnectionsSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListPrivateEndpointConnectionsSample.js @@ -3,27 +3,25 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List information about private endpoint connections under a disk access resource + * This sample demonstrates how to list information about private endpoint connections under a disk access resource * - * @summary List information about private endpoint connections under a disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json + * @summary list information about private endpoint connections under a disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json */ async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskAccesses.listPrivateEndpointConnections( - resourceGroupName, - diskAccessName, + "myResourceGroup", + "myDiskAccess", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListSample.js similarity index 62% rename from sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListSample.js index 9c58ee7ba580..264e5d26523f 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskAccessesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesListSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all the disk access resources under a subscription. + * This sample demonstrates how to lists all the disk access resources under a subscription. * - * @summary Lists all the disk access resources under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json + * @summary lists all the disk access resources under a subscription. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListBySubscription.json */ async function listAllDiskAccessResourcesInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskAccesses.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js new file mode 100644 index 000000000000..ed003797e1b3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateAPrivateEndpointConnectionSample.js @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * + * @summary approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + */ +async function approveAPrivateEndpointConnectionUnderADiskAccessResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.updateAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + { + privateLinkServiceConnectionState: { + status: "Approved", + description: "Approving myPrivateEndpointConnection", + }, + }, + ); + console.log(result); +} + +async function main() { + await approveAPrivateEndpointConnectionUnderADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateSample.js new file mode 100644 index 000000000000..31c8049e6aa3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskAccessesUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates (patches) a disk access resource. + * + * @summary updates (patches) a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Update.json + */ +async function updateADiskAccessResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.update("myResourceGroup", "myDiskAccess", { + tags: { department: "Development", project: "PrivateEndpoints" }, + }); + console.log(result); +} + +async function main() { + await updateADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..cd76f14a1f42 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsCreateOrUpdateSample.js @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a disk encryption set + * + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create.json + */ +async function createADiskEncryptionSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { type: "SystemAssigned" }, + activeKey: { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk encryption set + * + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json + */ +async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { type: "SystemAssigned" }, + activeKey: { keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}" }, + encryptionType: "EncryptionAtRestWithCustomerKey", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk encryption set + * + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json + */ +async function createADiskEncryptionSetWithKeyVaultFromADifferentTenant() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": + {}, + }, + }, + activeKey: { keyUrl: "https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}" }, + encryptionType: "EncryptionAtRestWithCustomerKey", + federatedClientId: "00000000-0000-0000-0000-000000000000", + }, + ); + console.log(result); +} + +async function main() { + await createADiskEncryptionSet(); + await createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(); + await createADiskEncryptionSetWithKeyVaultFromADifferentTenant(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsDeleteSample.js new file mode 100644 index 000000000000..49bd9a88d8e3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a disk encryption set. + * + * @summary deletes a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json + */ +async function deleteADiskEncryptionSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskEncryptionSets.delete("myResourceGroup", "myDiskEncryptionSet"); +} + +async function main() { + await deleteADiskEncryptionSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsGetSample.js new file mode 100644 index 000000000000..b8bb8b8a046d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets information about a disk encryption set. + * + * @summary gets information about a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + */ +async function getInformationAboutADiskEncryptionSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get("myResourceGroup", "myDiskEncryptionSet"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a disk encryption set. + * + * @summary gets information about a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + */ +async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get("myResourceGroup", "myDiskEncryptionSet"); + console.log(result); +} + +async function main() { + await getInformationAboutADiskEncryptionSet(); + await getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListAssociatedResourcesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListAssociatedResourcesSample.js similarity index 55% rename from sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListAssociatedResourcesSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListAssociatedResourcesSample.js index e9abb64486d7..14ad4c6866ff 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListAssociatedResourcesSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListAssociatedResourcesSample.js @@ -3,27 +3,25 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all resources that are encrypted with this disk encryption set. + * This sample demonstrates how to lists all resources that are encrypted with this disk encryption set. * - * @summary Lists all resources that are encrypted with this disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json + * @summary lists all resources that are encrypted with this disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json */ async function listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskEncryptionSets.listAssociatedResources( - resourceGroupName, - diskEncryptionSetName, + "myResourceGroup", + "myDiskEncryptionSet", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListByResourceGroupSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListByResourceGroupSample.js index 2820e922d4b5..a9b83f8b89e3 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListByResourceGroupSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all the disk encryption sets under a resource group. + * This sample demonstrates how to lists all the disk encryption sets under a resource group. * - * @summary Lists all the disk encryption sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json + * @summary lists all the disk encryption sets under a resource group. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json */ async function listAllDiskEncryptionSetsInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.diskEncryptionSets.listByResourceGroup(resourceGroupName)) { + for await (const item of client.diskEncryptionSets.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListSample.js similarity index 62% rename from sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListSample.js index 80a97859f0c0..2edbbf5b2dea 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/diskEncryptionSetsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsListSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all the disk encryption sets under a subscription. + * This sample demonstrates how to lists all the disk encryption sets under a subscription. * - * @summary Lists all the disk encryption sets under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json + * @summary lists all the disk encryption sets under a subscription. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json */ async function listAllDiskEncryptionSetsInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskEncryptionSets.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsUpdateSample.js new file mode 100644 index 000000000000..c3fbe36581b4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskEncryptionSetsUpdateSample.js @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates (patches) a disk encryption set. + * + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update.json + */ +async function updateADiskEncryptionSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + activeKey: { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + tags: { department: "Development", project: "Encryption" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk encryption set. + * + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + identity: { type: "SystemAssigned" }, + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + rotationToLatestKeyVersionEnabled: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk encryption set. + * + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + identity: { type: "SystemAssigned" }, + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + rotationToLatestKeyVersionEnabled: true, + }); + console.log(result); +} + +async function main() { + await updateADiskEncryptionSet(); + await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(); + await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGetSample.js new file mode 100644 index 000000000000..e859b3b387c8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGetSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get disk restorePoint resource + * + * @summary get disk restorePoint resource + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePoint.get( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get disk restorePoint resource + * + * @summary get disk restorePoint resource + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + */ +async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePoint.get( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + ); + console.log(result); +} + +async function main() { + await getAnIncrementalDiskRestorePointResource(); + await getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGrantAccessSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGrantAccessSample.js new file mode 100644 index 000000000000..c9ee4dd2223b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointGrantAccessSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to grants access to a diskRestorePoint. + * + * @summary grants access to a diskRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json + */ +async function grantsAccessToADiskRestorePoint() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePoint.grantAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + { access: "Read", durationInSeconds: 300, fileFormat: "VHDX" }, + ); + console.log(result); +} + +async function main() { + await grantsAccessToADiskRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointListByRestorePointSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointListByRestorePointSample.js new file mode 100644 index 000000000000..9078af0877ac --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointListByRestorePointSample.js @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists diskRestorePoints under a vmRestorePoint. + * + * @summary lists diskRestorePoints under a vmRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json + */ +async function getAnIncrementalDiskRestorePointResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.diskRestorePoint.listByRestorePoint( + "myResourceGroup", + "rpc", + "vmrp", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await getAnIncrementalDiskRestorePointResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointRevokeAccessSample.js new file mode 100644 index 000000000000..95665987b324 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/diskRestorePointRevokeAccessSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to revokes access to a diskRestorePoint. + * + * @summary revokes access to a diskRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json + */ +async function revokesAccessToADiskRestorePoint() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskRestorePoint.revokeAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + ); +} + +async function main() { + await revokesAccessToADiskRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/disksCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksCreateOrUpdateSample.js new file mode 100644 index 000000000000..5ff86b418f78 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksCreateOrUpdateSample.js @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json + */ +async function createAManagedDiskWithAvailabilityPolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 1024, + availabilityPolicy: { actionOnDiskDelay: "AutomaticReattach" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByCopyingASnapshot.json + */ +async function createAManagedDiskByCopyingASnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "Import", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json + */ +async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { + securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey", + secureVMDiskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + }, + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_Empty.json + */ +async function createAnEmptyManagedDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAPlatformImage.json + */ +async function createAManagedDiskFromAPlatformImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json + */ +async function createAManagedDiskFromAnAzureComputeGalleryCommunityImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + galleryImageReference: { + communityGalleryImageId: + "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json + */ +async function createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + galleryImageReference: { + sharedGalleryImageId: + "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json + */ +async function createAManagedDiskFromAnAzureComputeGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + galleryImageReference: { + id: "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json + */ +async function createAManagedDiskFromElasticSanVolumeSnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "CopyFromSanSnapshot", + elasticSanResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnExistingManagedDisk.json + */ +async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk2", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromImportSecure.json + */ +async function createAManagedDiskFromImportSecureCreateOption() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" }, + creationData: { + createOption: "ImportSecure", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromImportSecure_WithVMMetadata.json + */ +async function createAManagedDiskFromImportSecureCreateOptionWithMetadataURIForConfidentialVM() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" }, + creationData: { + createOption: "ImportSecure", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + securityMetadataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromUploadPreparedSecure.json + */ +async function createAManagedDiskFromUploadPreparedSecureCreateOption() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + creationData: { createOption: "UploadPreparedSecure", uploadSizeBytes: 10737418752 }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_InExtendedLocation.json + */ +async function createAnEmptyManagedDiskInExtendedLocation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + extendedLocation: { type: "EdgeZone", name: "{edge-zone-id}" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_PerformancePlus.json + */ +async function createAManagedDiskWithPerformancePlus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Upload", performancePlus: true }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_UploadDisk.json + */ +async function createAManagedUploadDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDataAccessAuthMode.json + */ +async function createAManagedDiskWithDataAccessAuthMode() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + dataAccessAuthMode: "AzureActiveDirectory", + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDiskAccess.json + */ +async function createAManagedDiskAndAssociateWithDiskAccessResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + networkAccessPolicy: "AllowPrivate", + diskAccessId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDiskEncryptionSet.json + */ +async function createAManagedDiskAndAssociateWithDiskEncryptionSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + encryption: { + diskEncryptionSetId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithLogicalSectorSize.json + */ +async function createAnUltraManagedDiskWithLogicalSectorSize512E() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + sku: { name: "UltraSSD_LRS" }, + creationData: { createOption: "Empty", logicalSectorSize: 512 }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json + */ +async function createAManagedDiskWithOptimizedForFrequentAttach() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + optimizedForFrequentAttach: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + */ +async function createAManagedDiskWithPremiumV2AccountType() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myPremiumV2Disk", { + location: "West US", + sku: { name: "PremiumV2_LRS" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + diskIopsReadWrite: 125, + diskMBpsReadWrite: 3000, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithSSDZRSAccountType.json + */ +async function createAManagedDiskWithSsdZrsAccountType() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + sku: { name: "Premium_ZRS" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithSecurityProfile.json + */ +async function createAManagedDiskWithSecurityProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "North Central US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json + */ +async function createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myUltraReadOnlyDisk", { + location: "West US", + sku: { name: "UltraSSD_LRS" }, + creationData: { createOption: "Empty", logicalSectorSize: 4096 }, + diskSizeGB: 200, + diskIopsReadWrite: 125, + diskMBpsReadWrite: 3000, + encryption: { type: "EncryptionAtRestWithPlatformKey" }, + }); + console.log(result); +} + +async function main() { + await createAManagedDiskWithAvailabilityPolicy(); + await createAManagedDiskByCopyingASnapshot(); + await createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(); + await createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(); + await createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(); + await createAnEmptyManagedDisk(); + await createAManagedDiskFromAPlatformImage(); + await createAManagedDiskFromAnAzureComputeGalleryCommunityImage(); + await createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(); + await createAManagedDiskFromAnAzureComputeGalleryImage(); + await createAManagedDiskFromElasticSanVolumeSnapshot(); + await createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(); + await createAManagedDiskFromImportSecureCreateOption(); + await createAManagedDiskFromImportSecureCreateOptionWithMetadataURIForConfidentialVM(); + await createAManagedDiskFromUploadPreparedSecureCreateOption(); + await createAnEmptyManagedDiskInExtendedLocation(); + await createAManagedDiskWithPerformancePlus(); + await createAManagedUploadDisk(); + await createAManagedDiskWithDataAccessAuthMode(); + await createAManagedDiskAndAssociateWithDiskAccessResource(); + await createAManagedDiskAndAssociateWithDiskEncryptionSet(); + await createAnUltraManagedDiskWithLogicalSectorSize512E(); + await createAManagedDiskWithOptimizedForFrequentAttach(); + await createAManagedDiskWithPremiumV2AccountType(); + await createAManagedDiskWithSsdZrsAccountType(); + await createAManagedDiskWithSecurityProfile(); + await createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/disksDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksDeleteSample.js new file mode 100644 index 000000000000..0136767b5ecf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a disk. + * + * @summary deletes a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Delete.json + */ +async function deleteAManagedDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.disks.delete("myResourceGroup", "myDisk"); +} + +async function main() { + await deleteAManagedDisk(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/disksGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksGetSample.js new file mode 100644 index 000000000000..4277a43aa566 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets information about a disk. + * + * @summary gets information about a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Get.json + */ +async function getInformationAboutAManagedDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.get("myResourceGroup", "myManagedDisk"); + console.log(result); +} + +async function main() { + await getInformationAboutAManagedDisk(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/disksGrantAccessSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksGrantAccessSample.js new file mode 100644 index 000000000000..ea98915747a5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksGrantAccessSample.js @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to grants access to a disk. + * + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess.json + */ +async function getASasOnAManagedDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { + access: "Read", + durationInSeconds: 300, + fileFormat: "VHD", + }); + console.log(result); +} + +/** + * This sample demonstrates how to grants access to a disk. + * + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json + */ +async function getSasOnManagedDiskAndVMGuestState() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { + access: "Read", + durationInSeconds: 300, + getSecureVMGuestStateSAS: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to grants access to a disk. + * + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess_WithVMGuestStateAndVMMetadata.json + */ +async function getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { + access: "Read", + durationInSeconds: 300, + getSecureVMGuestStateSAS: true, + }); + console.log(result); +} + +async function main() { + await getASasOnAManagedDisk(); + await getSasOnManagedDiskAndVMGuestState(); + await getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksListByResourceGroupSample.js similarity index 51% rename from sdk/compute/arm-compute/samples/v23/javascript/disksListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/disksListByResourceGroupSample.js index 51b40adec2d3..c5894d09238f 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksListByResourceGroupSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all the disks under a resource group. + * This sample demonstrates how to lists all the disks under a resource group. * - * @summary Lists all the disks under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListByResourceGroup.json + * @summary lists all the disks under a resource group. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_ListByResourceGroup.json */ async function listAllManagedDisksInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.disks.listByResourceGroup(resourceGroupName)) { + for await (const item of client.disks.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/disksListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksListSample.js similarity index 62% rename from sdk/compute/arm-compute/samples/v23/javascript/disksListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/disksListSample.js index 29f21e9bf51a..ca4ee16bee1c 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/disksListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksListSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all the disks under a subscription. + * This sample demonstrates how to lists all the disks under a subscription. * - * @summary Lists all the disks under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListBySubscription.json + * @summary lists all the disks under a subscription. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_ListBySubscription.json */ async function listAllManagedDisksInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.disks.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/disksRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksRevokeAccessSample.js new file mode 100644 index 000000000000..b92a959bf8b4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksRevokeAccessSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to revokes access to a disk. + * + * @summary revokes access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_EndGetAccess.json + */ +async function revokeAccessToAManagedDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.disks.revokeAccess("myResourceGroup", "myDisk"); +} + +async function main() { + await revokeAccessToAManagedDisk(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/disksUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/disksUpdateSample.js new file mode 100644 index 000000000000..8c868411e81e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/disksUpdateSample.js @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json + */ +async function createOrUpdateABurstingEnabledManagedDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + diskSizeGB: 1024, + burstingEnabled: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddAcceleratedNetworking.json + */ +async function updateAManagedDiskToAddAcceleratedNetworking() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { acceleratedNetwork: false }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddDiskControllerTypes.json + */ +async function updateAManagedDiskWithDiskControllerTypes() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { diskControllerTypes: "SCSI" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddPurchasePlan.json + */ +async function updateAManagedDiskToAddPurchasePlan() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + purchasePlan: { + name: "myPurchasePlanName", + publisher: "myPurchasePlanPublisher", + product: "myPurchasePlanProduct", + promotionCode: "myPurchasePlanPromotionCode", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddSupportsHibernation.json + */ +async function updateAManagedDiskToAddSupportsHibernation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportsHibernation: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_ChangeTier.json + */ +async function updateAManagedDiskToChangeTier() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { tier: "P30" }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_DisableBursting.json + */ +async function updateAManagedDiskToDisableBursting() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { burstingEnabled: false }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json + */ +async function updateAManagedDiskToDisableOptimizedForFrequentAttach() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + optimizedForFrequentAttach: false, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_RemoveDiskAccess.json + */ +async function updateManagedDiskToRemoveDiskAccessResourceAssociation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + networkAccessPolicy: "AllowAll", + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_ToAddArchitecture.json + */ +async function updateAManagedDiskToAddArchitecture() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { architecture: "Arm64" }, + }); + console.log(result); +} + +async function main() { + await createOrUpdateABurstingEnabledManagedDisk(); + await updateAManagedDiskToAddAcceleratedNetworking(); + await updateAManagedDiskWithDiskControllerTypes(); + await updateAManagedDiskToAddPurchasePlan(); + await updateAManagedDiskToAddSupportsHibernation(); + await updateAManagedDiskToChangeTier(); + await updateAManagedDiskToDisableBursting(); + await updateAManagedDiskToDisableOptimizedForFrequentAttach(); + await updateManagedDiskToRemoveDiskAccessResourceAssociation(); + await updateAManagedDiskToAddArchitecture(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleriesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleriesCreateOrUpdateSample.js new file mode 100644 index 000000000000..f9ee96305436 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleriesCreateOrUpdateSample.js @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Create.json + */ +async function createACommunityGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + sharingProfile: { + permissions: "Community", + communityGalleryInfo: { + publisherUri: "uri", + publisherContact: "pir@microsoft.com", + eula: "eula", + publicNamePrefix: "PirPublic", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create.json + */ +async function createOrUpdateASimpleGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_SoftDeletionEnabled.json + */ +async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + softDeletePolicy: { isSoftDeleteEnabled: true }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_WithManagedIdentity.json + */ +async function createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + identity: { + type: "SystemAssigned, UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": + {}, + }, + }, + description: "This is the gallery description.", + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_WithSharingProfile.json + */ +async function createOrUpdateASimpleGalleryWithSharingProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + sharingProfile: { permissions: "Groups" }, + }); + console.log(result); +} + +async function main() { + await createACommunityGallery(); + await createOrUpdateASimpleGallery(); + await createOrUpdateASimpleGalleryWithSoftDeletionEnabled(); + await createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); + await createOrUpdateASimpleGalleryWithSharingProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleriesDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleriesDeleteSample.js new file mode 100644 index 000000000000..78cd2e5162cb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleriesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a Shared Image Gallery. + * + * @summary delete a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Delete.json + */ +async function deleteAGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleries.delete("myResourceGroup", "myGalleryName"); +} + +async function main() { + await deleteAGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleriesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleriesGetSample.js new file mode 100644 index 000000000000..1c5ea020dc48 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleriesGetSample.js @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Get.json + */ +async function getACommunityGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get.json + */ +async function getAGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json + */ +async function getAGalleryWithExpandSharingProfileGroups() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName", { + expand: "SharingProfile/Groups", + }); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithManagedIdentity.json + */ +async function getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithSelectPermissions.json + */ +async function getAGalleryWithSelectPermissions() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName", { + select: "Permissions", + }); + console.log(result); +} + +async function main() { + await getACommunityGallery(); + await getAGallery(); + await getAGalleryWithExpandSharingProfileGroups(); + await getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); + await getAGalleryWithSelectPermissions(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleriesListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleriesListByResourceGroupSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/galleriesListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleriesListByResourceGroupSample.js index 46c39d3bb3c3..0dc1dc84e320 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleriesListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleriesListByResourceGroupSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List galleries under a resource group. + * This sample demonstrates how to list galleries under a resource group. * - * @summary List galleries under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json + * @summary list galleries under a resource group. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListByResourceGroup.json */ async function listGalleriesInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.galleries.listByResourceGroup(resourceGroupName)) { + for await (const item of client.galleries.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleriesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleriesListSample.js similarity index 61% rename from sdk/compute/arm-compute/samples/v23/javascript/galleriesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleriesListSample.js index 0e3e5f7d32c6..b509405937b2 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleriesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleriesListSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List galleries under a subscription. + * This sample demonstrates how to list galleries under a subscription. * - * @summary List galleries under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListBySubscription.json + * @summary list galleries under a subscription. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListBySubscription.json */ async function listGalleriesInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleries.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleriesUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleriesUpdateSample.js new file mode 100644 index 000000000000..c8ab6a631bcb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleriesUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a Shared Image Gallery. + * + * @summary update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Update.json + */ +async function updateASimpleGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.update("myResourceGroup", "myGalleryName", { + description: "This is the gallery description.", + }); + console.log(result); +} + +async function main() { + await updateASimpleGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..7bef39f2d0a1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsCreateOrUpdateSample.js @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a gallery Application Version. + * + * @summary create or update a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Create.json + */ +async function createOrUpdateASimpleGalleryApplicationVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { + location: "West US", + publishingProfile: { + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", + }, + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', + remove: "del C:\\package ", + }, + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 1, + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASimpleGalleryApplicationVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsDeleteSample.js new file mode 100644 index 000000000000..d7c4e3ab71c8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsDeleteSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery Application Version. + * + * @summary delete a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Delete.json + */ +async function deleteAGalleryApplicationVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryApplicationVersions.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + ); +} + +async function main() { + await deleteAGalleryApplicationVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsGetSample.js new file mode 100644 index 000000000000..e5f446967ed1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsGetSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a gallery Application Version. + * + * @summary retrieves information about a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get.json + */ +async function getAGalleryApplicationVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery Application Version. + * + * @summary retrieves information about a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json + */ +async function getAGalleryApplicationVersionWithReplicationStatus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { expand: "ReplicationStatus" }, + ); + console.log(result); +} + +async function main() { + await getAGalleryApplicationVersion(); + await getAGalleryApplicationVersionWithReplicationStatus(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js index 6551095ee042..8ff4a22dcfdc 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsListByGalleryApplicationSample.js @@ -3,29 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List gallery Application Versions in a gallery Application Definition. + * This sample demonstrates how to list gallery Application Versions in a gallery Application Definition. * - * @summary List gallery Application Versions in a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json + * @summary list gallery Application Versions in a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json */ async function listGalleryApplicationVersionsInAGalleryApplicationDefinition() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryApplicationVersions.listByGalleryApplication( - resourceGroupName, - galleryName, - galleryApplicationName, + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsUpdateSample.js new file mode 100644 index 000000000000..4c0291e21b2c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationVersionsUpdateSample.js @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a gallery Application Version. + * + * @summary update a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Update.json + */ +async function updateASimpleGalleryApplicationVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { + publishingProfile: { + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", + }, + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', + remove: "del C:\\package ", + }, + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 1, + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + ); + console.log(result); +} + +async function main() { + await updateASimpleGalleryApplicationVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d21d08dce8d1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsCreateOrUpdateSample.js @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a gallery Application Definition. + * + * @summary create or update a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Create.json + */ +async function createOrUpdateASimpleGalleryApplication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + { + location: "West US", + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASimpleGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsDeleteSample.js new file mode 100644 index 000000000000..638f01679128 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsDeleteSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery Application. + * + * @summary delete a gallery Application. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Delete.json + */ +async function deleteAGalleryApplication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryApplications.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + ); +} + +async function main() { + await deleteAGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsGetSample.js new file mode 100644 index 000000000000..593201d31716 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a gallery Application Definition. + * + * @summary retrieves information about a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Get.json + */ +async function getAGalleryApplication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.get( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + ); + console.log(result); +} + +async function main() { + await getAGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsListByGallerySample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsListByGallerySample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsListByGallerySample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsListByGallerySample.js index b89f8a212966..874c3c648d6a 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryApplicationsListByGallerySample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsListByGallerySample.js @@ -3,27 +3,25 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List gallery Application Definitions in a gallery. + * This sample demonstrates how to list gallery Application Definitions in a gallery. * - * @summary List gallery Application Definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json + * @summary list gallery Application Definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_ListByGallery.json */ async function listGalleryApplicationsInAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryApplications.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsUpdateSample.js new file mode 100644 index 000000000000..29e728a15427 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryApplicationsUpdateSample.js @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a gallery Application Definition. + * + * @summary update a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Update.json + */ +async function updateASimpleGalleryApplication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.update( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, + ); + console.log(result); +} + +async function main() { + await updateASimpleGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..87e624ccbb20 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsCreateOrUpdateSample.js @@ -0,0 +1,830 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithAdditionalReplicaSets.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + additionalReplicaSets: [ + { storageAccountType: "PreviumV2_LRS", regionalReplicaCount: 1 }, + ], + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + communityGalleryImageId: + "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [{ name: "West US", regionalReplicaCount: 1, excludeFromLatest: false }], + replicationMode: "Shallow", + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + osDiskImage: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", + }, + hostCaching: "ReadOnly", + }, + dataDiskImages: [ + { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithStorageAccountStrategy.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { name: "West US" }, + { name: "East US" }, + { name: "East US 2", storageAccountType: "Premium_LRS" }, + ], + storageAccountStrategy: "PreferStandard_ZRS", + }, + storageProfile: { + source: { + virtualMachineId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVHD.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", + }, + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1, + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + osDiskImage: { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + hostCaching: "ReadOnly", + }, + dataDiskImages: [ + { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", + }, + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1, + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + osDiskImage: { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + hostCaching: "ReadOnly", + }, + dataDiskImages: [ + { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + securityProfile: { + uefiSettings: { + signatureTemplateNames: ["MicrosoftUefiCertificateAuthorityTemplate"], + additionalSignatures: { + kek: [{ type: "sha256", value: [""] }], + db: [{ type: "x509", value: [""] }], + dbx: [{ type: "x509", value: [""] }], + }, + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 2, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + virtualMachineId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(); + await createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(); + await createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(); + await createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(); + await createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(); + await createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(); + await createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(); + await createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(); + await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(); + await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(); + await createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsDeleteSample.js new file mode 100644 index 000000000000..548a3810e0df --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsDeleteSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery image version. + * + * @summary delete a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Delete.json + */ +async function deleteAGalleryImageVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryImageVersions.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); +} + +async function main() { + await deleteAGalleryImageVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsGetSample.js new file mode 100644 index 000000000000..73c81cbe74d1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsGetSample.js @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get.json + */ +async function getAGalleryImageVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json + */ +async function getAGalleryImageVersionWithReplicationStatus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ReplicationStatus" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json + */ +async function getAGalleryImageVersionWithSnapshotsAsASource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithValidationProfile.json + */ +async function getAGalleryImageVersionWithValidationProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ValidationProfile" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json + */ +async function getAGalleryImageVersionWithValidationProfileAndReplicationStatus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ValidationProfile,ReplicationStatus" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json + */ +async function getAGalleryImageVersionWithVhdAsASource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); + console.log(result); +} + +async function main() { + await getAGalleryImageVersion(); + await getAGalleryImageVersionWithReplicationStatus(); + await getAGalleryImageVersionWithSnapshotsAsASource(); + await getAGalleryImageVersionWithValidationProfile(); + await getAGalleryImageVersionWithValidationProfileAndReplicationStatus(); + await getAGalleryImageVersionWithVhdAsASource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsListByGalleryImageSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsListByGalleryImageSample.js similarity index 52% rename from sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsListByGalleryImageSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsListByGalleryImageSample.js index e48a12b3c7a4..bc29f3189073 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryImageVersionsListByGalleryImageSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsListByGalleryImageSample.js @@ -3,29 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List gallery image versions in a gallery image definition. + * This sample demonstrates how to list gallery image versions in a gallery image definition. * - * @summary List gallery image versions in a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json + * @summary list gallery image versions in a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_ListByGalleryImage.json */ async function listGalleryImageVersionsInAGalleryImageDefinition() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryImageVersions.listByGalleryImage( - resourceGroupName, - galleryName, - galleryImageName, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsUpdateSample.js new file mode 100644 index 000000000000..8f9e5ff2e8b1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImageVersionsUpdateSample.js @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a gallery image version. + * + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update.json + */ +async function updateASimpleGalleryImageVersionManagedImageAsSource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { name: "East US", regionalReplicaCount: 2, storageAccountType: "Standard_ZRS" }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a gallery image version. + * + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json + */ +async function restoreASoftDeletedGalleryImageVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { restore: true, storageProfile: {} }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a gallery image version. + * + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json + */ +async function updateASimpleGalleryImageVersionWithoutSourceId() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { name: "East US", regionalReplicaCount: 2, storageAccountType: "Standard_ZRS" }, + ], + }, + storageProfile: {}, + }, + ); + console.log(result); +} + +async function main() { + await updateASimpleGalleryImageVersionManagedImageAsSource(); + await restoreASoftDeletedGalleryImageVersion(); + await updateASimpleGalleryImageVersionWithoutSourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesCreateOrUpdateSample.js new file mode 100644 index 000000000000..2387a0f4fb30 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesCreateOrUpdateSample.js @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a gallery image definition. + * + * @summary create or update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Create.json + */ +async function createOrUpdateASimpleGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + location: "West US", + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V1", + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASimpleGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesDeleteSample.js new file mode 100644 index 000000000000..ba62a1a1330c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery image. + * + * @summary delete a gallery image. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Delete.json + */ +async function deleteAGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryImages.delete("myResourceGroup", "myGalleryName", "myGalleryImageName"); +} + +async function main() { + await deleteAGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesGetSample.js new file mode 100644 index 000000000000..7ad9d6f76ce6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a gallery image definition. + * + * @summary retrieves information about a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Get.json + */ +async function getAGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + ); + console.log(result); +} + +async function main() { + await getAGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesListByGallerySample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesListByGallerySample.js new file mode 100644 index 000000000000..d7d704c47fdd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesListByGallerySample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list gallery image definitions in a gallery. + * + * @summary list gallery image definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_ListByGallery.json + */ +async function listGalleryImagesInAGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listByGallery("myResourceGroup", "myGalleryName")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listGalleryImagesInAGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesUpdateSample.js new file mode 100644 index 000000000000..90e9de931509 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryImagesUpdateSample.js @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a gallery image definition. + * + * @summary update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Update.json + */ +async function updateASimpleGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V1", + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a gallery image definition. + * + * @summary update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_UpdateFeatures.json + */ +async function updateAGalleryImageFeature() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V2", + allowUpdateImage: true, + features: [{ name: "SecurityType", value: "TrustedLaunch", startsAtVersion: "2.0.0" }], + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, + ); + console.log(result); +} + +async function main() { + await updateASimpleGalleryImage(); + await updateAGalleryImageFeature(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..decdb87eac6d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.js @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a gallery inVMAccessControlProfile version. + * + * @summary create or update a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json + */ +async function createOrUpdateAGalleryInVMAccessControlProfileVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + { + location: "West US", + mode: "Audit", + defaultAccess: "Allow", + rules: { + privileges: [ + { name: "GoalState", path: "/machine", queryParameters: { comp: "goalstate" } }, + ], + roles: [{ name: "Provisioning", privileges: ["GoalState"] }], + identities: [ + { + name: "WinPA", + userName: "SYSTEM", + groupName: "Administrators", + exePath: "C:\\Windows\\System32\\cscript.exe", + processName: "cscript", + }, + ], + roleAssignments: [{ role: "Provisioning", identities: ["WinPA"] }], + }, + targetLocations: [{ name: "West US" }, { name: "South Central US" }], + excludeFromLatest: false, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js new file mode 100644 index 000000000000..05e0fddb87a8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsDeleteSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery inVMAccessControlProfile version. + * + * @summary delete a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json + */ +async function deleteAGalleryInVMAccessControlProfileVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryInVMAccessControlProfileVersions.delete( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + ); +} + +async function main() { + await deleteAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsGetSample.js new file mode 100644 index 000000000000..7bac420d8190 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsGetSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a gallery inVMAccessControlProfile version. + * + * @summary retrieves information about a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json + */ +async function getAGalleryInVMAccessControlProfileVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.get( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + ); + console.log(result); +} + +async function main() { + await getAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.js index c7aa7620ecf0..e0373ab1bf59 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.js @@ -3,34 +3,31 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * This sample demonstrates how to list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile * - * @summary List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json + * @summary list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json */ -async function listGalleryInVMAccessControlProfileVersionsInAGalleryInVmaccessControlProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; +async function listGalleryInVMAccessControlProfileVersionsInAGalleryInVMAccessControlProfile() { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryInVMAccessControlProfileVersions.listByGalleryInVMAccessControlProfile( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", )) { resArray.push(item); } + console.log(resArray); } async function main() { - await listGalleryInVMAccessControlProfileVersionsInAGalleryInVmaccessControlProfile(); + await listGalleryInVMAccessControlProfileVersionsInAGalleryInVMAccessControlProfile(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js new file mode 100644 index 000000000000..4767d5e45c4a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfileVersionsUpdateSample.js @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a gallery inVMAccessControlProfile version. + * + * @summary update a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json + */ +async function updateAGalleryInVMAccessControlProfileVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.update( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + { + mode: "Audit", + defaultAccess: "Allow", + targetLocations: [{ name: "West US" }, { name: "South Central US" }, { name: "East US" }], + excludeFromLatest: false, + }, + ); + console.log(result); +} + +async function main() { + await updateAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js new file mode 100644 index 000000000000..ceb15a8e530c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesCreateOrUpdateSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a gallery inVMAccessControlProfile. + * + * @summary create or update a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json + */ +async function createOrUpdateAGalleryInVMAccessControlProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfiles.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + { location: "West US", properties: { osType: "Linux", applicableHostEndpoint: "WireServer" } }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesDeleteSample.js new file mode 100644 index 000000000000..3d94d85de14f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesDeleteSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery inVMAccessControlProfile. + * + * @summary delete a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json + */ +async function deleteAGalleryInVMAccessControlProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryInVMAccessControlProfiles.delete( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + ); +} + +async function main() { + await deleteAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesGetSample.js new file mode 100644 index 000000000000..920e029f38e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a gallery inVMAccessControlProfile. + * + * @summary retrieves information about a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json + */ +async function getAGalleryInVMAccessControlProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfiles.get( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + ); + console.log(result); +} + +async function main() { + await getAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesListByGallerySample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesListByGallerySample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesListByGallerySample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesListByGallerySample.js index 899f847a7b53..a5644c30a93e 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryInVMAccessControlProfilesListByGallerySample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesListByGallerySample.js @@ -3,27 +3,25 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List gallery inVMAccessControlProfiles in a gallery. + * This sample demonstrates how to list gallery inVMAccessControlProfiles in a gallery. * - * @summary List gallery inVMAccessControlProfiles in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json + * @summary list gallery inVMAccessControlProfiles in a gallery. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json */ async function listGalleryInVMAccessControlProfilesInAGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryInVMAccessControlProfiles.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesUpdateSample.js new file mode 100644 index 000000000000..8802dd01eb9a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryInVMAccessControlProfilesUpdateSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a gallery inVMAccessControlProfile. + * + * @summary update a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json + */ +async function updateAGalleryInVMAccessControlProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfiles.update( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + { properties: { osType: "Linux", applicableHostEndpoint: "WireServer" } }, + ); + console.log(result); +} + +async function main() { + await updateAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..f7cbaa02cfec --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsCreateOrUpdateSample.js @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a gallery Script Version. + * + * @summary create or update a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Create.json + */ +async function createOrUpdateASimpleGalleryScriptVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + { + location: "West US", + properties: { + publishingProfile: { + source: { + scriptLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", + parameters: [ + { name: "location", required: true, defaultValue: "westus", type: "String" }, + { + name: "myGalleryScriptParameter1", + required: true, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "myGalleryScriptParameter2", + required: false, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "numberOfUnits", + required: true, + type: "Int", + defaultValue: "3", + description: "description of the parameter", + minValue: "1", + maxValue: "5", + }, + { + name: "weightOfUnit", + required: true, + type: "Double", + defaultValue: "0.6", + description: "description of the parameter", + minValue: "0.1", + maxValue: "2", + }, + { + name: "typeOfProduct", + required: false, + type: "Enum", + defaultValue: "Fruit", + description: "description of the parameter", + enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], + }, + ], + }, + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 2, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 2, + endOfLifeDate: new Date("2027-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASimpleGalleryScriptVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsDeleteSample.js new file mode 100644 index 000000000000..6140e9b84cfb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsDeleteSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery Script Version. + * + * @summary delete a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Delete.json + */ +async function deleteAGalleryScriptVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryScriptVersions.delete( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + ); +} + +async function main() { + await deleteAGalleryScriptVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsGetSample.js new file mode 100644 index 000000000000..53c38ec96189 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsGetSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to custom ArmResourceRead operation template with CloudError as Error + * + * @summary custom ArmResourceRead operation template with CloudError as Error + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get.json + */ +async function getAGalleryScriptVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.get( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to custom ArmResourceRead operation template with CloudError as Error + * + * @summary custom ArmResourceRead operation template with CloudError as Error + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json + */ +async function getAGalleryScriptVersionWithReplicationStatus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.get( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + ); + console.log(result); +} + +async function main() { + await getAGalleryScriptVersion(); + await getAGalleryScriptVersionWithReplicationStatus(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsListByGalleryScriptSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsListByGalleryScriptSample.js similarity index 52% rename from sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsListByGalleryScriptSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsListByGalleryScriptSample.js index d25c36968229..a453b4b6294b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsListByGalleryScriptSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsListByGalleryScriptSample.js @@ -3,29 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List gallery Script Versions in a gallery Script Definition. + * This sample demonstrates how to list gallery Script Versions in a gallery Script Definition. * - * @summary List gallery Script Versions in a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json + * @summary list gallery Script Versions in a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json */ async function listGalleryScriptVersionsInAGalleryScriptDefinition() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryScriptVersions.listByGalleryScript( - resourceGroupName, - galleryName, - galleryScriptName, + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsUpdateSample.js similarity index 66% rename from sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsCreateOrUpdateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsUpdateSample.js index c83cf8ab9556..9c3fb2b2e0ed 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/galleryScriptVersionsCreateOrUpdateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptVersionsUpdateSample.js @@ -3,105 +3,91 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Create or update a gallery Script Version. + * This sample demonstrates how to update a gallery Script Version. * - * @summary Create or update a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Create.json + * @summary update a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Update.json */ -async function createOrUpdateASimpleGalleryScriptVersion() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const galleryScriptVersion = { - location: "West US", - properties: { +async function updateASimpleGalleryScriptVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.update( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + { publishingProfile: { - endOfLifeDate: new Date("2027-07-01T07:00:00Z"), - replicaCount: 2, source: { + scriptLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", parameters: [ - { - name: "location", - type: "String", - defaultValue: "westus", - required: true, - }, + { name: "location", required: true, defaultValue: "westus", type: "String" }, { name: "myGalleryScriptParameter1", + required: true, type: "String", - description: "description of the parameter", defaultValue: "default value of parameter", - required: true, + description: "description of the parameter", }, { name: "myGalleryScriptParameter2", + required: false, type: "String", - description: "description of the parameter", defaultValue: "default value of parameter", - required: false, + description: "description of the parameter", }, { name: "numberOfUnits", + required: true, type: "Int", - description: "description of the parameter", defaultValue: "3", - maxValue: "5", + description: "description of the parameter", minValue: "1", - required: true, + maxValue: "5", }, { name: "weightOfUnit", + required: true, type: "Double", - description: "description of the parameter", defaultValue: "0.6", - maxValue: "2", + description: "description of the parameter", minValue: "0.1", - required: true, + maxValue: "2", }, { name: "typeOfProduct", + required: false, type: "Enum", - description: "description of the parameter", defaultValue: "Fruit", + description: "description of the parameter", enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], - required: false, }, ], - scriptLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", }, - storageAccountType: "Standard_LRS", targetRegions: [ { name: "West US", - excludeFromLatest: false, regionalReplicaCount: 2, storageAccountType: "Standard_LRS", + excludeFromLatest: false, }, ], + replicaCount: 2, + endOfLifeDate: new Date("2027-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", }, safetyProfile: { allowDeletionOfReplicatedLocations: false }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, ); console.log(result); } async function main() { - await createOrUpdateASimpleGalleryScriptVersion(); + await updateASimpleGalleryScriptVersion(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d238e0496aee --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsCreateOrUpdateSample.js @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts + * + * @summary create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Create.json + */ +async function createOrUpdateASimpleGalleryScript() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScripts.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + { + location: "West US", + properties: { + description: "This is the gallery script description.", + eula: "This is the gallery script EULA.", + privacyStatementUri: "{myPrivacyStatementUri}", + releaseNoteUri: "{myReleaseNoteUri}", + supportedOSType: "Windows", + }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateASimpleGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsDeleteSample.js new file mode 100644 index 000000000000..05fb23ca5c41 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a gallery Script Definition. + * + * @summary delete a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Delete.json + */ +async function deleteAGalleryScript() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryScripts.delete("myResourceGroup", "myGalleryName", "myGalleryScriptName"); +} + +async function main() { + await deleteAGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsGetSample.js new file mode 100644 index 000000000000..b1f845690913 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a gallery script definition. + * + * @summary retrieves information about a gallery script definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Get.json + */ +async function getAGalleryScript() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScripts.get( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + ); + console.log(result); +} + +async function main() { + await getAGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsListByGallerySample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsListByGallerySample.js new file mode 100644 index 000000000000..c28f3fb8d442 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsListByGallerySample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list gallery Script Definitions in a gallery. + * + * @summary list gallery Script Definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_ListByGallery.json + */ +async function listGalleryScriptsInAGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryScripts.listByGallery( + "myResourceGroup", + "myGalleryName", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listGalleryScriptsInAGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsUpdateSample.js new file mode 100644 index 000000000000..040e883c4347 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/galleryScriptsUpdateSample.js @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a gallery Script Definition. + * + * @summary update a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Update.json + */ +async function updateASimpleGalleryScript() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScripts.update( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + { + description: "This is the gallery script description.", + eula: "This is the gallery script EULA.", + privacyStatementUri: "{myPrivacyStatementUri}", + releaseNoteUri: "{myReleaseNoteUri}", + supportedOSType: "Windows", + }, + ); + console.log(result); +} + +async function main() { + await updateASimpleGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/gallerySharingProfileUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/gallerySharingProfileUpdateSample.js new file mode 100644 index 000000000000..e5ca8124b3c9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/gallerySharingProfileUpdateSample.js @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update sharing profile of a gallery. + * + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_AddToSharingProfile.json + */ +async function addSharingIdToTheSharingProfileOfAGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "Add", + groups: [ + { + type: "Subscriptions", + ids: ["34a4ab42-0d72-47d9-bd1a-aed207386dac", "380fd389-260b-41aa-bad9-0a83108c370b"], + }, + { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] }, + ], + }); + console.log(result); +} + +/** + * This sample demonstrates how to update sharing profile of a gallery. + * + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_EnableCommunityGallery.json + */ +async function shareAGalleryToCommunity() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "EnableCommunity", + }); + console.log(result); +} + +/** + * This sample demonstrates how to update sharing profile of a gallery. + * + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ResetSharingProfile.json + */ +async function resetSharingProfileOfAGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "Reset", + }); + console.log(result); +} + +async function main() { + await addSharingIdToTheSharingProfileOfAGallery(); + await shareAGalleryToCommunity(); + await resetSharingProfileOfAGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/imagesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/imagesCreateOrUpdateSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/imagesCreateOrUpdateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/imagesCreateOrUpdateSample.js index 10d4c8b4d466..0d0c7308a5b1 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/imagesCreateOrUpdateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/imagesCreateOrUpdateSample.js @@ -3,284 +3,234 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlob.json */ -async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { - location: "West US", - storageProfile: { - osDisk: { - blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - osState: "Generalized", - osType: "Linux", - }, - }, - }; +async function createAVirtualMachineImageFromABlob() { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an image. - * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlob.json - */ -async function createAVirtualMachineImageFromABlob() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", osState: "Generalized", - osType: "Linux", }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json */ -async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { +async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", diskEncryptionSet: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", }, osState: "Generalized", - osType: "Linux", - snapshot: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAManagedDisk.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAManagedDisk.json */ async function createAVirtualMachineImageFromAManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", managedDisk: { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", }, osState: "Generalized", - osType: "Linux", }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json */ -async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { +async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, diskEncryptionSet: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", }, - managedDisk: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", - }, osState: "Generalized", - osType: "Linux", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromASnapshot.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromASnapshot.json */ async function createAVirtualMachineImageFromASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { - osState: "Generalized", osType: "Linux", snapshot: { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", }, + osState: "Generalized", }, zoneResilient: false, }, - }; + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update an image. + * + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { + location: "West US", + storageProfile: { + osDisk: { + osType: "Linux", + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + osState: "Generalized", + }, + }, + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAVM.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAVM.json */ async function createAVirtualMachineImageFromAnExistingVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", sourceVirtualMachine: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromABlobIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromABlob() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + }, dataDisks: [ { - blobUri: "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", lun: 1, + blobUri: "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", }, ], - osDisk: { - blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - osState: "Generalized", - osType: "Linux", - }, zoneResilient: false, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + osState: "Generalized", + }, dataDisks: [ { lun: 1, @@ -289,39 +239,32 @@ async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() }, }, ], - osDisk: { - managedDisk: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", - }, - osState: "Generalized", - osType: "Linux", - }, zoneResilient: false, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + osState: "Generalized", + }, dataDisks: [ { lun: 1, @@ -330,33 +273,19 @@ async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { }, }, ], - osDisk: { - osState: "Generalized", - osType: "Linux", - snapshot: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } async function main() { - await createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromABlob(); - await createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(); + await createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromAManagedDisk(); - await createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(); + await createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromASnapshot(); + await createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromAnExistingVirtualMachine(); await createAVirtualMachineImageThatIncludesADataDiskFromABlob(); await createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk(); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/imagesDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/imagesDeleteSample.js new file mode 100644 index 000000000000..da0b815333e2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/imagesDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes an Image. + * + * @summary deletes an Image. + * x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MaximumSet_Gen.json + */ +async function imageDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.images.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to deletes an Image. + * + * @summary deletes an Image. + * x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MinimumSet_Gen.json + */ +async function imageDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.images.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await imageDeleteMaximumSetGen(); + await imageDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/imagesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/imagesGetSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/imagesGetSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/imagesGetSample.js index 6de999f04f10..fc5910120acc 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/imagesGetSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/imagesGetSample.js @@ -3,21 +3,18 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets an image. + * This sample demonstrates how to gets an image. * - * @summary Gets an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Get.json + * @summary gets an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Get.json */ async function getInformationAboutAVirtualMachineImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.get(resourceGroupName, imageName); + const result = await client.images.get("myResourceGroup", "myImage"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/imagesListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/imagesListByResourceGroupSample.js similarity index 60% rename from sdk/compute/arm-compute/samples/v23/javascript/imagesListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/imagesListByResourceGroupSample.js index fc0b10c56733..a2edc9c65cca 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/imagesListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/imagesListByResourceGroupSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * This sample demonstrates how to gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. * - * @summary Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListByResourceGroup.json + * @summary gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: 2025-11-01/imageExamples/Image_ListByResourceGroup.json */ async function listAllVirtualMachineImagesInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.images.listByResourceGroup(resourceGroupName)) { + for await (const item of client.images.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/imagesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/imagesListSample.js similarity index 69% rename from sdk/compute/arm-compute/samples/v23/javascript/imagesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/imagesListSample.js index 0b1034b132c5..bcb902e6f092 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/imagesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/imagesListSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * This sample demonstrates how to gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. * - * @summary Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListBySubscription.json + * @summary gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: 2025-11-01/imageExamples/Image_ListBySubscription.json */ async function listAllVirtualMachineImagesInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.images.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/imagesUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/imagesUpdateSample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/imagesUpdateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/imagesUpdateSample.js index 9cecc9bc3705..4963c4f16e30 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/imagesUpdateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/imagesUpdateSample.js @@ -3,28 +3,24 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Update an image. + * This sample demonstrates how to update an image. * - * @summary Update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Update.json + * @summary update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Update.json */ async function updatesTagsOfAnImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters = { - hyperVGeneration: "V1", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.update("myResourceGroup", "myImage", { sourceVirtualMachine: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, + hyperVGeneration: "V1", tags: { department: "HR" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginUpdateAndWait(resourceGroupName, imageName, parameters); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportRequestRateByIntervalSample.js b/sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportRequestRateByIntervalSample.js similarity index 63% rename from sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportRequestRateByIntervalSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportRequestRateByIntervalSample.js index 0063b8076735..3b20dcb6817f 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportRequestRateByIntervalSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportRequestRateByIntervalSample.js @@ -3,30 +3,24 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * This sample demonstrates how to export logs that show Api requests made by this subscription in the given time window to show throttling activities. * - * @summary Export logs that show Api requests made by this subscription in the given time window to show throttling activities. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json + * @summary export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json */ async function exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.exportRequestRateByInterval("westus", { + intervalLength: "FiveMins", blobContainerSasUri: "https://somesasuri", fromTime: new Date("2018-01-21T01:54:06.862601Z"), - groupByResourceName: true, - intervalLength: "FiveMins", toTime: new Date("2018-01-23T01:54:06.862601Z"), - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.logAnalytics.beginExportRequestRateByIntervalAndWait( - location, - parameters, - ); + groupByResourceName: true, + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportThrottledRequestsSample.js b/sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportThrottledRequestsSample.js similarity index 64% rename from sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportThrottledRequestsSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportThrottledRequestsSample.js index 9be0e8d4c2ab..6a0b90975fe5 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/logAnalyticsExportThrottledRequestsSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/logAnalyticsExportThrottledRequestsSample.js @@ -3,32 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Export logs that show total throttled Api requests for this subscription in the given time window. + * This sample demonstrates how to export logs that show total throttled Api requests for this subscription in the given time window. * - * @summary Export logs that show total throttled Api requests for this subscription in the given time window. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json + * @summary export logs that show total throttled Api requests for this subscription in the given time window. + * x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_ThrottledRequests.json */ async function exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.exportThrottledRequests("westus", { blobContainerSasUri: "https://somesasuri", fromTime: new Date("2018-01-21T01:54:06.862601Z"), - groupByClientApplicationId: false, + toTime: new Date("2018-01-23T01:54:06.862601Z"), groupByOperationName: true, groupByResourceName: false, + groupByClientApplicationId: false, groupByUserAgent: false, - toTime: new Date("2018-01-23T01:54:06.862601Z"), - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.logAnalytics.beginExportThrottledRequestsAndWait( - location, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/operationsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/operationsListSample.js new file mode 100644 index 000000000000..29d989847617 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/operationsListSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await operationsListMaximumSetGen(); + await operationsListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/package.json b/sdk/compute/arm-compute/samples/v24/javascript/package.json similarity index 87% rename from sdk/compute/arm-compute/samples/v23/javascript/package.json rename to sdk/compute/arm-compute/samples/v24/javascript/package.json index 587c021461b3..a31714a0b340 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/package.json +++ b/sdk/compute/arm-compute/samples/v24/javascript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-compute-js", "private": true, "version": "1.0.0", - "description": " client library samples for JavaScript", + "description": "@azure/arm-compute client library samples for JavaScript", "engines": { "node": ">=20.0.0" }, @@ -14,10 +14,10 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "author": "Microsoft Corporation", "license": "MIT", diff --git a/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsCreateOrUpdateSample.js new file mode 100644 index 000000000000..f3fb5a2418ce --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsCreateOrUpdateSample.js @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a proximity placement group. + * + * @summary create or update a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json + */ +async function createOrUpdateAProximityPlacementGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.createOrUpdate( + "myResourceGroup", + "myProximityPlacementGroup", + { + location: "westus", + zones: ["1"], + proximityPlacementGroupType: "Standard", + intent: { vmSizes: ["Basic_A0", "Basic_A2"] }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateAProximityPlacementGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsDeleteSample.js new file mode 100644 index 000000000000..a22e8e5c4370 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a proximity placement group. + * + * @summary delete a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json + */ +async function deleteAProximityPlacementGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.proximityPlacementGroups.delete("myResourceGroup", "myProximityPlacementGroup"); +} + +async function main() { + await deleteAProximityPlacementGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsGetSample.js new file mode 100644 index 000000000000..cbaf3bb595d9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsGetSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about a proximity placement group . + * + * @summary retrieves information about a proximity placement group . + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + */ +async function getProximityPlacementGroups() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.get( + "myResourceGroup", + "myProximityPlacementGroup", + ); + console.log(result); +} + +async function main() { + await getProximityPlacementGroups(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListByResourceGroupSample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListByResourceGroupSample.js index acd9990aab2f..47324cdea803 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListByResourceGroupSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all proximity placement groups in a resource group. + * This sample demonstrates how to lists all proximity placement groups in a resource group. * - * @summary Lists all proximity placement groups in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json + * @summary lists all proximity placement groups in a resource group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json */ async function listProximityPlacementGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.proximityPlacementGroups.listByResourceGroup(resourceGroupName)) { + for await (const item of client.proximityPlacementGroups.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListBySubscriptionSample.js similarity index 61% rename from sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListBySubscriptionSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListBySubscriptionSample.js index 38a84bf7bad2..1a307908e2e6 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/proximityPlacementGroupsListBySubscriptionSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsListBySubscriptionSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all proximity placement groups in a subscription. + * This sample demonstrates how to lists all proximity placement groups in a subscription. * - * @summary Lists all proximity placement groups in a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json + * @summary lists all proximity placement groups in a subscription. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json */ async function listProximityPlacementGroups() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.proximityPlacementGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsUpdateSample.js new file mode 100644 index 000000000000..35ed4b942a27 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/proximityPlacementGroupsUpdateSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a proximity placement group. + * + * @summary update a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json + */ +async function updateAProximityPlacementGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.update( + "myResourceGroup", + "myProximityPlacementGroup", + { tags: { additionalProp1: "string" } }, + ); + console.log(result); +} + +async function main() { + await updateAProximityPlacementGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/resourceSkusListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/resourceSkusListSample.js new file mode 100644 index 000000000000..68a5e48337e1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/resourceSkusListSample.js @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkus.json + */ +async function listsAllAvailableResourceSKUs() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.resourceSkus.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkusForARegion.json + */ +async function listsAllAvailableResourceSKUsForTheSpecifiedRegion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.resourceSkus.list({ filter: "location eq 'westus'" })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkusWithExtendedLocations.json + */ +async function listsAllAvailableResourceSKUsWithExtendedLocationInformation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.resourceSkus.list({ includeExtendedLocations: "true" })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await listsAllAvailableResourceSKUs(); + await listsAllAvailableResourceSKUsForTheSpecifiedRegion(); + await listsAllAvailableResourceSKUsWithExtendedLocationInformation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsCreateOrUpdateSample.js similarity index 60% rename from sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsCreateOrUpdateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsCreateOrUpdateSample.js index d24464c1e794..8e89a004e762 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsCreateOrUpdateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsCreateOrUpdateSample.js @@ -3,66 +3,51 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * This sample demonstrates how to the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. * - * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json + * @summary the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate.json */ -async function createOrUpdateARestorePointCollectionForCrossRegionCopy() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const parameters = { +async function createOrUpdateARestorePointCollection() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate("myResourceGroup", "myRpc", { location: "norwayeast", source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, + instantAccess: true, tags: { myTag1: "tagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.createOrUpdate( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * This sample demonstrates how to the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. * - * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json + * @summary the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json */ -async function createOrUpdateARestorePointCollection() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const parameters = { - instantAccess: true, +async function createOrUpdateARestorePointCollectionForCrossRegionCopy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate("myResourceGroup", "myRpc", { location: "norwayeast", source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName", }, tags: { myTag1: "tagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.createOrUpdate( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + }); console.log(result); } async function main() { - await createOrUpdateARestorePointCollectionForCrossRegionCopy(); await createOrUpdateARestorePointCollection(); + await createOrUpdateARestorePointCollectionForCrossRegionCopy(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsDeleteSample.js new file mode 100644 index 000000000000..c6ad8654c97a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json + */ +async function restorePointCollectionDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePointCollections.delete("rgcompute", "aaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json + */ +async function restorePointCollectionDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePointCollections.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await restorePointCollectionDeleteMaximumSetGen(); + await restorePointCollectionDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsGetSample.js new file mode 100644 index 000000000000..d47748f5972e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get the restore point collection. + * + * @summary the operation to get the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get.json + */ +async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get("myResourceGroup", "myRpc"); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the restore point collection. + * + * @summary the operation to get the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + */ +async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get("myResourceGroup", "rpcName"); + console.log(result); +} + +async function main() { + await getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(); + await getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListAllSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListAllSample.js similarity index 71% rename from sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListAllSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListAllSample.js index 902ddfaaf3d0..63cc1dabc9bd 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListAllSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListAllSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * This sample demonstrates how to gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. * - * @summary Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json + * @summary gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListBySubscription.json */ async function getsTheListOfRestorePointCollectionsInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.restorePointCollections.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListSample.js similarity index 52% rename from sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListSample.js index d1eec2acfab6..f09c3c7057cf 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/restorePointCollectionsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsListSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets the list of restore point collections in a resource group. + * This sample demonstrates how to gets the list of restore point collections in a resource group. * - * @summary Gets the list of restore point collections in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json + * @summary gets the list of restore point collections in a resource group. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListByResourceGroup.json */ async function getsTheListOfRestorePointCollectionsInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.restorePointCollections.list(resourceGroupName)) { + for await (const item of client.restorePointCollections.list("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsUpdateSample.js new file mode 100644 index 000000000000..4f3e25e02450 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointCollectionsUpdateSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update the restore point collection. + * + * @summary the operation to update the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json + */ +async function restorePointCollectionUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update("rgcompute", "aaaaaaaaaaaaaaaaaaaa", { + source: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + }, + instantAccess: true, + tags: { key8536: "aaaaaaaaaaaaaaaaaaa" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update the restore point collection. + * + * @summary the operation to update the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json + */ +async function restorePointCollectionUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update("rgcompute", "aaaaaaaaaaaaaaaaaa", {}); + console.log(result); +} + +async function main() { + await restorePointCollectionUpdateMaximumSetGen(); + await restorePointCollectionUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/restorePointsCreateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointsCreateSample.js new file mode 100644 index 000000000000..97c266a40394 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointsCreateSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary the operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + */ +async function copyARestorePointToADifferentRegion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.create("myResourceGroup", "rpcName", "rpName", { + sourceRestorePoint: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary the operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Create.json + */ +async function createARestorePoint() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.create("myResourceGroup", "rpcName", "rpName", { + excludeDisks: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + ], + instantAccessDurationMinutes: 120, + }); + console.log(result); +} + +async function main() { + await copyARestorePointToADifferentRegion(); + await createARestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/restorePointsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointsDeleteSample.js new file mode 100644 index 000000000000..a9090b70821d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointsDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete the restore point. + * + * @summary the operation to delete the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json + */ +async function restorePointDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePoints.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", "a"); +} + +/** + * This sample demonstrates how to the operation to delete the restore point. + * + * @summary the operation to delete the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json + */ +async function restorePointDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePoints.delete("rgcompute", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await restorePointDeleteMaximumSetGen(); + await restorePointDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/restorePointsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/restorePointsGetSample.js new file mode 100644 index 000000000000..600db8fba3b8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/restorePointsGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get the restore point. + * + * @summary the operation to get the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get.json + */ +async function getARestorePoint() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get("myResourceGroup", "rpcName", "rpName"); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the restore point. + * + * @summary the operation to get the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get_WithInstanceView.json + */ +async function getRestorePointWithInstanceView() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get("myResourceGroup", "rpcName", "rpName"); + console.log(result); +} + +async function main() { + await getARestorePoint(); + await getRestorePointWithInstanceView(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sample.env b/sdk/compute/arm-compute/samples/v24/javascript/sample.env similarity index 100% rename from sdk/compute/arm-compute/samples/v23/javascript/sample.env rename to sdk/compute/arm-compute/samples/v24/javascript/sample.env diff --git a/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesGetSample.js new file mode 100644 index 000000000000..2c8fd361daa3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a shared gallery by subscription id or tenant id. + * + * @summary get a shared gallery by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_Get.json + */ +async function getASharedGallery() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleries.get("myLocation", "galleryUniqueName"); + console.log(result); +} + +async function main() { + await getASharedGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesListSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesListSample.js index 84b3aed25e8a..cdfcb4d556b2 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleriesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleriesListSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List shared galleries by subscription id or tenant id. + * This sample demonstrates how to list shared galleries by subscription id or tenant id. * - * @summary List shared galleries by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_List.json + * @summary list shared galleries by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_List.json */ async function listSharedGalleries() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sharedGalleries.list(location)) { + for await (const item of client.sharedGalleries.list("myLocation")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsGetSample.js new file mode 100644 index 000000000000..754a828fa7f3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsGetSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a shared gallery image version by subscription id or tenant id. + * + * @summary get a shared gallery image version by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersion_Get.json + */ +async function getASharedGalleryImageVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImageVersions.get( + "myLocation", + "galleryUniqueName", + "myGalleryImageName", + "myGalleryImageVersionName", + ); + console.log(result); +} + +async function main() { + await getASharedGalleryImageVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsListSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsListSample.js index c7769f091418..5cabfc2a51ed 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImageVersionsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImageVersionsListSample.js @@ -3,29 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List shared gallery image versions by subscription id or tenant id. + * This sample demonstrates how to list shared gallery image versions by subscription id or tenant id. * - * @summary List shared gallery image versions by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json + * @summary list shared gallery image versions by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersions_List.json */ async function listSharedGalleryImageVersions() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sharedGalleryImageVersions.list( - location, - galleryUniqueName, - galleryImageName, + "myLocation", + "galleryUniqueName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesGetSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesGetSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesGetSample.js index 9c72b3ec32e9..3a58d1dafe71 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesGetSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesGetSample.js @@ -3,25 +3,21 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Get a shared gallery image by subscription id or tenant id. + * This sample demonstrates how to get a shared gallery image by subscription id or tenant id. * - * @summary Get a shared gallery image by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json + * @summary get a shared gallery image by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImage_Get.json */ async function getASharedGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.sharedGalleryImages.get( - location, - galleryUniqueName, - galleryImageName, + "myLocation", + "galleryUniqueName", + "myGalleryImageName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesListSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesListSample.js index 6c3bf5692566..3d6790e0e40f 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/sharedGalleryImagesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/sharedGalleryImagesListSample.js @@ -3,24 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List shared gallery images by subscription id or tenant id. + * This sample demonstrates how to list shared gallery images by subscription id or tenant id. * - * @summary List shared gallery images by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json + * @summary list shared gallery images by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImages_List.json */ async function listSharedGalleryImages() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sharedGalleryImages.list(location, galleryUniqueName)) { + for await (const item of client.sharedGalleryImages.list("myLocation", "galleryUniqueName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/snapshotsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d3acd1fe0a13 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsCreateOrUpdateSample.js @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot1", { + location: "West US", + creationData: { + createOption: "Import", + storageAccountId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot1", { + location: "West US", + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + provisionedBandwidthCopySpeed: "Enhanced", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json + */ +async function createASnapshotFromAnElasticSanVolumeSnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot", { + location: "West US", + creationData: { + createOption: "CopyFromSanSnapshot", + elasticSanResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_InstantAccessSnapshot.json + */ +async function createASnapshotWhichCanBeInstantlyAccessable() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", + instantAccessDurationMinutes: 120, + }, + }); + console.log(result); +} + +async function main() { + await createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(); + await createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(); + await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(); + await createASnapshotFromAnElasticSanVolumeSnapshot(); + await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(); + await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(); + await createASnapshotWhichCanBeInstantlyAccessable(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/snapshotsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsDeleteSample.js new file mode 100644 index 000000000000..5db733ec05d3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a snapshot. + * + * @summary deletes a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Delete.json + */ +async function deleteASnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.snapshots.delete("myResourceGroup", "mySnapshot"); +} + +async function main() { + await deleteASnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGetSample.js new file mode 100644 index 000000000000..e273ce3af568 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGetSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets information about a snapshot. + * + * @summary gets information about a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Get.json + */ +async function getInformationAboutASnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.get("myResourceGroup", "mySnapshot"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a snapshot. + * + * @summary gets information about a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + */ +async function getInformationAboutAnIncrementalSnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.get("myResourceGroup", "myIncrementalSnapshot"); + console.log(result); +} + +async function main() { + await getInformationAboutASnapshot(); + await getInformationAboutAnIncrementalSnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGrantAccessSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGrantAccessSample.js new file mode 100644 index 000000000000..db532dab2870 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsGrantAccessSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to grants access to a snapshot. + * + * @summary grants access to a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_BeginGetAccess.json + */ +async function getASasOnASnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.grantAccess("myResourceGroup", "mySnapshot", { + access: "Read", + durationInSeconds: 300, + fileFormat: "VHDX", + }); + console.log(result); +} + +async function main() { + await getASasOnASnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsListByResourceGroupSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/snapshotsListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/snapshotsListByResourceGroupSample.js index ab250164d75e..e31be4468f52 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsListByResourceGroupSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists snapshots under a resource group. + * This sample demonstrates how to lists snapshots under a resource group. * - * @summary Lists snapshots under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json + * @summary lists snapshots under a resource group. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListByResourceGroup.json */ async function listAllSnapshotsInAResourceGroup() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.snapshots.listByResourceGroup(resourceGroupName)) { + for await (const item of client.snapshots.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsListSample.js similarity index 62% rename from sdk/compute/arm-compute/samples/v23/javascript/snapshotsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/snapshotsListSample.js index 74df8b5260b3..bb3fb27a6cb3 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/snapshotsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsListSample.js @@ -3,22 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists snapshots under a subscription. + * This sample demonstrates how to lists snapshots under a subscription. * - * @summary Lists snapshots under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListBySubscription.json + * @summary lists snapshots under a subscription. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListBySubscription.json */ async function listAllSnapshotsInASubscription() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.snapshots.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/snapshotsRevokeAccessSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsRevokeAccessSample.js new file mode 100644 index 000000000000..73129fa5bb70 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsRevokeAccessSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to revokes access to a snapshot. + * + * @summary revokes access to a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_EndGetAccess.json + */ +async function revokeAccessToASnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.snapshots.revokeAccess("myResourceGroup", "mySnapshot"); +} + +async function main() { + await revokeAccessToASnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/snapshotsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsUpdateSample.js new file mode 100644 index 000000000000..8cb99308268a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/snapshotsUpdateSample.js @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates (patches) a snapshot. + * + * @summary updates (patches) a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update.json + */ +async function updateASnapshot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.update("myResourceGroup", "mySnapshot", { + diskSizeGB: 20, + tags: { department: "Development", project: "UpdateSnapshots" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a snapshot. + * + * @summary updates (patches) a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json + */ +async function updateASnapshotWithAcceleratedNetworking() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.update("myResourceGroup", "mySnapshot", { + diskSizeGB: 20, + supportedCapabilities: { acceleratedNetwork: false }, + tags: { department: "Development", project: "UpdateSnapshots" }, + }); + console.log(result); +} + +async function main() { + await updateASnapshot(); + await updateASnapshotWithAcceleratedNetworking(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/softDeletedResourceListByArtifactNameSample.js b/sdk/compute/arm-compute/samples/v24/javascript/softDeletedResourceListByArtifactNameSample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/softDeletedResourceListByArtifactNameSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/softDeletedResourceListByArtifactNameSample.js index 47416df64d4c..25fb67375720 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/softDeletedResourceListByArtifactNameSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/softDeletedResourceListByArtifactNameSample.js @@ -3,31 +3,27 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. + * This sample demonstrates how to list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. * - * @summary List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json + * @summary list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. + * x-ms-original-file: 2025-03-03/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json */ async function listSoftDeletedResourcesOfAnArtifactInTheGallery() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const artifactType = "images"; - const artifactName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.softDeletedResource.listByArtifactName( - resourceGroupName, - galleryName, - artifactType, - artifactName, + "myResourceGroup", + "myGalleryName", + "images", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysCreateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysCreateSample.js new file mode 100644 index 000000000000..3e6b986e7980 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysCreateSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to creates a new SSH public key resource. + * + * @summary creates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Create.json + */ +async function createANewSSHPublicKeyResource() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.create("myResourceGroup", "mySshPublicKeyName", { + location: "westus", + publicKey: "{ssh-rsa public key}", + }); + console.log(result); +} + +async function main() { + await createANewSSHPublicKeyResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysDeleteSample.js new file mode 100644 index 000000000000..7e4891710765 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysDeleteSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete an SSH public key. + * + * @summary delete an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json + */ +async function sshPublicKeyDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.sshPublicKeys.delete("rgcompute", "aaaaaaaaaa"); +} + +/** + * This sample demonstrates how to delete an SSH public key. + * + * @summary delete an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json + */ +async function sshPublicKeyDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.sshPublicKeys.delete("rgcompute", "aaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await sshPublicKeyDeleteMaximumSetGen(); + await sshPublicKeyDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGenerateKeyPairSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGenerateKeyPairSample.js new file mode 100644 index 000000000000..cb5c3d7638e7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGenerateKeyPairSample.js @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json + */ +async function generateAnSSHKeyPair() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + "myResourceGroup", + "mySshPublicKeyName", + ); + console.log(result); +} + +/** + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json + */ +async function generateAnSSHKeyPairWithEd25519Encryption() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + "myResourceGroup", + "mySshPublicKeyName", + { parameters: { encryptionType: "Ed25519" } }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json + */ +async function generateAnSSHKeyPairWithRSAEncryption() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + "myResourceGroup", + "mySshPublicKeyName", + { parameters: { encryptionType: "RSA" } }, + ); + console.log(result); +} + +async function main() { + await generateAnSSHKeyPair(); + await generateAnSSHKeyPairWithEd25519Encryption(); + await generateAnSSHKeyPairWithRSAEncryption(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGetSample.js new file mode 100644 index 000000000000..30d3cec55246 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about an SSH public key. + * + * @summary retrieves information about an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Get.json + */ +async function getAnSshPublicKey() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.get("myResourceGroup", "mySshPublicKeyName"); + console.log(result); +} + +async function main() { + await getAnSshPublicKey(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListByResourceGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListByResourceGroupSample.js similarity index 58% rename from sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListByResourceGroupSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListByResourceGroupSample.js index 481ce6e3e148..292b6f58b4fe 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListByResourceGroupSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListByResourceGroupSample.js @@ -3,41 +3,40 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json + * @summary lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json */ async function sshPublicKeyListByResourceGroupMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sshPublicKeys.listByResourceGroup(resourceGroupName)) { + for await (const item of client.sshPublicKeys.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json + * @summary lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json */ async function sshPublicKeyListByResourceGroupMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sshPublicKeys.listByResourceGroup(resourceGroupName)) { + for await (const item of client.sshPublicKeys.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListBySubscriptionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListBySubscriptionSample.js similarity index 63% rename from sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListBySubscriptionSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListBySubscriptionSample.js index b25ae525afc1..13b591f0af49 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/sshPublicKeysListBySubscriptionSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysListBySubscriptionSample.js @@ -3,39 +3,40 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json + * @summary lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json */ async function sshPublicKeyListBySubscriptionMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sshPublicKeys.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json + * @summary lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json */ async function sshPublicKeyListBySubscriptionMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sshPublicKeys.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysUpdateSample.js new file mode 100644 index 000000000000..f0ebe9a984cf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/sshPublicKeysUpdateSample.js @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates a new SSH public key resource. + * + * @summary updates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json + */ +async function sshPublicKeyUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update("rgcompute", "aaaaaaaaaaaa", { + publicKey: "{ssh-rsa public key}", + tags: { key2854: "a" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates a new SSH public key resource. + * + * @summary updates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json + */ +async function sshPublicKeyUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update("rgcompute", "aaaaaaaaaaa", {}); + console.log(result); +} + +async function main() { + await sshPublicKeyUpdateMaximumSetGen(); + await sshPublicKeyUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/usageListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/usageListSample.js similarity index 56% rename from sdk/compute/arm-compute/samples/v23/javascript/usageListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/usageListSample.js index a3e504e5f6d7..999cc975a161 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/usageListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/usageListSample.js @@ -3,41 +3,40 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * This sample demonstrates how to gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. * - * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json + * @summary gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json */ async function usageListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "4_."; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.usageOperations.list(location)) { + for await (const item of client.usage.list("4_.")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * This sample demonstrates how to gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. * - * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json + * @summary gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json */ async function usageListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "_--"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.usageOperations.list(location)) { + for await (const item of client.usage.list("_--")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesGetSample.js new file mode 100644 index 000000000000..011284b6f278 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesGetSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a virtual machine extension image. + * + * @summary gets a virtual machine extension image. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImageGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine extension image. + * + * @summary gets a virtual machine extension image. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImageGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aa", + "aaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineExtensionImageGetMaximumSetGen(); + await virtualMachineExtensionImageGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListTypesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListTypesSample.js new file mode 100644 index 000000000000..c1de34a19ef5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListTypesSample.js @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of virtual machine extension image types. + * + * @summary gets a list of virtual machine extension image types. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImageListTypesMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine extension image types. + * + * @summary gets a list of virtual machine extension image types. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImageListTypesMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes("aaaa", "aa"); + console.log(result); +} + +async function main() { + await virtualMachineExtensionImageListTypesMaximumSetGen(); + await virtualMachineExtensionImageListTypesMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListVersionsSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListVersionsSample.js new file mode 100644 index 000000000000..44b0ec07ff29 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionImagesListVersionsSample.js @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of virtual machine extension image versions. + * + * @summary gets a list of virtual machine extension image versions. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImageListVersionsMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + { filter: "aaaaaaaaaaaaaaaaaaaaaaaaa", top: 22, orderby: "a" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine extension image versions. + * + * @summary gets a list of virtual machine extension image versions. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImageListVersionsMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineExtensionImageListVersionsMaximumSetGen(); + await virtualMachineExtensionImageListVersionsMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..9540a8176b90 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsCreateOrUpdateSample.js @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update the extension. + * + * @summary the operation to create or update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineExtensionCreateOrUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.createOrUpdate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", + { + location: "westus", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + suppressFailures: true, + settings: {}, + forceUpdateTag: "a", + enableAutomaticUpgrade: true, + protectedSettings: {}, + instanceView: { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + level: "Info", + displayStatus: "aaaaaa", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + level: "Info", + displayStatus: "aaaaaa", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + }, + tags: { key9183: "aa" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update the extension. + * + * @summary the operation to create or update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineExtensionCreateOrUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.createOrUpdate( + "rgcompute", + "myVM", + "myVMExtension", + { location: "westus" }, + ); + console.log(result); +} + +async function main() { + await virtualMachineExtensionCreateOrUpdateMaximumSetGen(); + await virtualMachineExtensionCreateOrUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsDeleteSample.js new file mode 100644 index 000000000000..10ab17d59a4b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsDeleteSample.js @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json + */ +async function virtualMachineExtensionDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineExtensions.delete( + "rgcompute", + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json + */ +async function virtualMachineExtensionDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineExtensions.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa"); +} + +async function main() { + await virtualMachineExtensionDeleteMaximumSetGen(); + await virtualMachineExtensionDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsGetSample.js new file mode 100644 index 000000000000..10f4f8d9c8b7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsGetSample.js @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", + { expand: "aaaaaa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get("rgcompute", "myVM", "myVMExtension"); + console.log(result); +} + +async function main() { + await virtualMachineExtensionGetMaximumSetGen(); + await virtualMachineExtensionGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsListSample.js new file mode 100644 index 000000000000..4db1e0b799c7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsListSample.js @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get all extensions of a Virtual Machine. + * + * @summary the operation to get all extensions of a Virtual Machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json + */ +async function virtualMachineExtensionListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list("rgcompute", "aaaaaaaaaaaaa", { + expand: "aaaaaaaaaaaaaaaaa", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get all extensions of a Virtual Machine. + * + * @summary the operation to get all extensions of a Virtual Machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json + */ +async function virtualMachineExtensionListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineExtensionListMaximumSetGen(); + await virtualMachineExtensionListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsUpdateSample.js new file mode 100644 index 000000000000..3fd6f69e27ba --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineExtensionsUpdateSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update the extension. + * + * @summary the operation to update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Update.json + */ +async function updateVMExtension() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.update( + "myResourceGroup", + "myVM", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + type: "extType", + typeHandlerVersion: "1.2", + suppressFailures: true, + settings: { UserName: "xyz@microsoft.com" }, + protectedSettingsFromKeyVault: { + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", + }, + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + }, + }, + ); + console.log(result); +} + +async function main() { + await updateVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneGetSample.js new file mode 100644 index 000000000000..5c9f44a99772 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneGetSample.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a virtual machine image in an edge zone. + * + * @summary gets a virtual machine image in an edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine image in an edge zone. + * + * @summary gets a virtual machine image in an edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aa", + ); + console.log(result); +} + +async function main() { + await virtualMachineImagesEdgeZoneGetMaximumSetGen(); + await virtualMachineImagesEdgeZoneGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListOffersSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListOffersSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListOffersSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListOffersSample.js index 0f1a82f87078..57ce49863fca 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListOffersSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListOffersSample.js @@ -3,46 +3,39 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location, edge zone and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListOffersMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listOffers( - location, - edgeZone, - publisherName, + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location, edge zone and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListOffersMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listOffers( - location, - edgeZone, - publisherName, + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js similarity index 52% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js index 30a98ead9612..f22bdd363502 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListPublishersSample.js @@ -3,37 +3,38 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location and edge zone. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListPublishersMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.listPublishers(location, edgeZone); + const result = await client.virtualMachineImagesEdgeZone.listPublishers( + "aaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location and edge zone. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListPublishersMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImagesEdgeZone.listPublishers(location, edgeZone); + const result = await client.virtualMachineImagesEdgeZone.listPublishers( + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSample.js new file mode 100644 index 000000000000..2107468c0570 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSample.js @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + "aaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaaaaaaaaaaaaaaaaaaa", top: 12, orderby: "aaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineImagesEdgeZoneListMaximumSetGen(); + await virtualMachineImagesEdgeZoneListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSkusSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSkusSample.js new file mode 100644 index 000000000000..33e63e1b66cc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesEdgeZoneListSkusSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + "aaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaa", + "aaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaa", + "aaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineImagesEdgeZoneListSkusMaximumSetGen(); + await virtualMachineImagesEdgeZoneListSkusMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesGetSample.js new file mode 100644 index 000000000000..e5e49987812d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesGetSample.js @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a virtual machine image. + * + * @summary gets a virtual machine image. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json + */ +async function virtualMachineImageGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + "aaaaaa", + "aaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine image. + * + * @summary gets a virtual machine image. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json + */ +async function virtualMachineImageGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + "aaaaaaaaaaaa", + "aaaaaaaaaaa", + "aa", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineImageGetMaximumSetGen(); + await virtualMachineImageGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListByEdgeZoneSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListByEdgeZoneSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListByEdgeZoneSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListByEdgeZoneSample.js index 0598e7da1c44..43f12b2287ba 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListByEdgeZoneSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListByEdgeZoneSample.js @@ -3,39 +3,32 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified edge zone + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified edge zone * - * @summary Gets a list of all virtual machine image versions for the specified edge zone - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified edge zone + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; - const location = "WestUS"; - const edgeZone = "microsoftlosangeles1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listByEdgeZone(location, edgeZone); + const result = await client.virtualMachineImages.listByEdgeZone("WestUS", "microsoftlosangeles1"); console.log(result); } /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified edge zone + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified edge zone * - * @summary Gets a list of all virtual machine image versions for the specified edge zone - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified edge zone + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen() { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; - const location = "WestUS"; - const edgeZone = "microsoftlosangeles1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listByEdgeZone(location, edgeZone); + const result = await client.virtualMachineImages.listByEdgeZone("WestUS", "microsoftlosangeles1"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListOffersSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListOffersSample.js new file mode 100644 index 000000000000..77b116c22079 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListOffersSample.js @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImageListOffersMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers("aaaaaaa", "aaaaaaaa"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImageListOffersMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers( + "aaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineImageListOffersMaximumSetGen(); + await virtualMachineImageListOffersMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListPublishersSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListPublishersSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListPublishersSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListPublishersSample.js index 8d1d0237003d..268b0ce6a65b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineImagesListPublishersSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListPublishersSample.js @@ -3,35 +3,32 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json */ async function virtualMachineImageListPublishersMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listPublishers(location); + const result = await client.virtualMachineImages.listPublishers("aaaaa"); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json */ async function virtualMachineImageListPublishersMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listPublishers(location); + const result = await client.virtualMachineImages.listPublishers("aaaaaaaaaaaaaaaaaaaaaaaaaaa"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSample.js new file mode 100644 index 000000000000..838e51d69a64 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json + */ +async function virtualMachineImageListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + "aaaaaaaaaaaaaaa", + "aaaaaa", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaaaaaaaaaaaaaaaaaaa", top: 18, orderby: "aa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json + */ +async function virtualMachineImageListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + "aaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineImageListMaximumSetGen(); + await virtualMachineImageListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSkusSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSkusSample.js new file mode 100644 index 000000000000..7b82ab56bf64 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListSkusSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImageListSkusMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus( + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImageListSkusMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus("aaaa", "aaaaaaaaaaaaa", "aaaaaaa"); + console.log(result); +} + +async function main() { + await virtualMachineImageListSkusMaximumSetGen(); + await virtualMachineImageListSkusMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListWithPropertiesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListWithPropertiesSample.js new file mode 100644 index 000000000000..d2ddc0dc1555 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineImagesListWithPropertiesSample.js @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to execute listWithProperties + * + * @summary execute listWithProperties + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json + */ +async function virtualMachineImagesListWithPropertiesMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listWithProperties( + "eastus", + "MicrosoftWindowsServer", + "WindowsServer", + "2022-datacenter-azure-edition", + "Properties", + { top: 4, orderby: "aa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to execute listWithProperties + * + * @summary execute listWithProperties + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MinimumSet_Gen.json + */ +async function virtualMachineImagesListWithPropertiesMinimumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listWithProperties( + "eastus", + "MicrosoftWindowsServer", + "WindowsServer", + "2022-datacenter-azure-edition", + "Properties", + ); + console.log(result); +} + +async function main() { + await virtualMachineImagesListWithPropertiesMaximumSet(); + await virtualMachineImagesListWithPropertiesMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js new file mode 100644 index 000000000000..6b509ad12d00 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsCreateOrUpdateSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update the run command. + * + * @summary the operation to create or update the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json + */ +async function createOrUpdateARunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.createOrUpdate( + "myResourceGroup", + "myVM", + "myRunCommand", + { + location: "West US", + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", + }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + treatFailureAsDeploymentFailure: false, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", + outputBlobManagedIdentity: { clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a" }, + }, + ); + console.log(result); +} + +async function main() { + await createOrUpdateARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsDeleteSample.js new file mode 100644 index 000000000000..d46e95ce0bd5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete the run command. + * + * @summary the operation to delete the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Delete.json + */ +async function deleteARunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineRunCommands.delete("myResourceGroup", "myVM", "myRunCommand"); +} + +async function main() { + await deleteARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js new file mode 100644 index 000000000000..9cd260ca304e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetByVirtualMachineSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get the run command. + * + * @summary the operation to get the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Get.json + */ +async function getARunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.getByVirtualMachine( + "myResourceGroup", + "myVM", + "myRunCommand", + ); + console.log(result); +} + +async function main() { + await getARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetSample.js new file mode 100644 index 000000000000..9b730e50f40a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets specific run command for a subscription in a location. + * + * @summary gets specific run command for a subscription in a location. + * x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_Get.json + */ +async function virtualMachineRunCommandGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.get("SoutheastAsia", "RunPowerShellScript"); + console.log(result); +} + +async function main() { + await virtualMachineRunCommandGet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js similarity index 55% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js index 5934481ca1f1..c4d24bf82a1c 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListByVirtualMachineSample.js @@ -3,27 +3,25 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to get all run commands of a Virtual Machine. + * This sample demonstrates how to the operation to get all run commands of a Virtual Machine. * - * @summary The operation to get all run commands of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json + * @summary the operation to get all run commands of a Virtual Machine. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_List.json */ async function listRunCommandsInAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineRunCommands.listByVirtualMachine( - resourceGroupName, - vmName, + "myResourceGroup", + "myVM", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListSample.js similarity index 61% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListSample.js index 2c93795b6838..c61a6e4a31c2 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineRunCommandsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsListSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all available run commands for a subscription in a location. + * This sample demonstrates how to lists all available run commands for a subscription in a location. * - * @summary Lists all available run commands for a subscription in a location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_List.json + * @summary lists all available run commands for a subscription in a location. + * x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_List.json */ async function virtualMachineRunCommandList() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "subid"; - const location = "SoutheastAsia"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineRunCommands.list(location)) { + for await (const item of client.virtualMachineRunCommands.list("SoutheastAsia")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsUpdateSample.js new file mode 100644 index 000000000000..4c98f5694644 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineRunCommandsUpdateSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update the run command. + * + * @summary the operation to update the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Update.json + */ +async function updateARunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.update( + "myResourceGroup", + "myVM", + "myRunCommand", + { + source: { script: "Write-Host Hello World! ; Remove-Item C:\test\testFile.txt" }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", + errorBlobManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + ); + console.log(result); +} + +async function main() { + await updateARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d1a4212f06d3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsCreateOrUpdateSample.js @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update an extension. + * + * @summary the operation to create or update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.createOrUpdate( + "rgcompute", + "aaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { + name: "{extension-name}", + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update an extension. + * + * @summary the operation to create or update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.createOrUpdate( + "rgcompute", + "aaaaaaaaaaa", + "aaaaaaaaaaa", + {}, + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen(); + await virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsDeleteSample.js new file mode 100644 index 000000000000..6069e9c29d0c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsDeleteSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionDeleteMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetExtensions.delete( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionDeleteMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetExtensions.delete( + "rgcompute", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main() { + await virtualMachineScaleSetExtensionDeleteMaximumSetGen(); + await virtualMachineScaleSetExtensionDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsGetSample.js new file mode 100644 index 000000000000..dba850a34900 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsGetSample.js @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionGetMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionGetMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + "rgcompute", + "a", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetExtensionGetMaximumSetGen(); + await virtualMachineScaleSetExtensionGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsListSample.js new file mode 100644 index 000000000000..914e623feeac --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsListSample.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of all extensions in a VM scale set. + * + * @summary gets a list of all extensions in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetExtensions.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all extensions in a VM scale set. + * + * @summary gets a list of all extensions in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetExtensions.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await virtualMachineScaleSetExtensionListMaximumSetGen(); + await virtualMachineScaleSetExtensionListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsUpdateSample.js new file mode 100644 index 000000000000..d39da3482c00 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetExtensionsUpdateSample.js @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update an extension. + * + * @summary the operation to update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + { + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update an extension. + * + * @summary the operation to update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aa", + {}, + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetExtensionUpdateMaximumSetGen(); + await virtualMachineScaleSetExtensionUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsGetSample.js new file mode 100644 index 000000000000..bc5f20725208 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a virtual machine scale set lifecycle hook event. + * + * @summary gets a virtual machine scale set lifecycle hook event. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Get.json + */ +async function getAVirtualMachineScaleSetLifecycleHookEvent() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2167b012-c9f9-4b04-83b2-0ff304e7d51d"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetLifeCycleHookEvents.get( + "RG01", + "VMSS01", + "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717", + ); + console.log(result); +} + +async function main() { + await getAVirtualMachineScaleSetLifecycleHookEvent(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsListSample.js new file mode 100644 index 000000000000..b01ffc09995b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsListSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. + * + * @summary gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_List.json + */ +async function getsAListOfAllLifecycleHookEventsInAVirtualMachineScaleSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetLifeCycleHookEvents.list( + "RG01", + "VMSS01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await getsAListOfAllLifecycleHookEventsInAVirtualMachineScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.js new file mode 100644 index 000000000000..6fec12d97cbb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update a virtual machine scale set lifecycle hook event. + * + * @summary the operation to update a virtual machine scale set lifecycle hook event. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Update.json + */ +async function theOperationToUpdateTheVirtualMachineScaleSetLifecycleHookEvent() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2167b012-c9f9-4b04-83b2-0ff304e7d51d"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetLifeCycleHookEvents.update( + "RG01", + "VMSS01", + "445c0a08-cfc5-4ef6-bb89-fe77c5178628", + { + waitUntil: "2025-05-08T11:17:55.6844555+00:00", + targetResources: [ + { + resource: { + id: "/subscriptions/2167b012-c9f9-4b04-83b2-0ff304e7d51d/resourceGroups/RG01/providers/Microsoft.Compute/virtualMachineScaleSets/VMSS01/virtualMachines/2", + }, + actionState: "Approved", + }, + ], + }, + ); + console.log(result); +} + +async function main() { + await theOperationToUpdateTheVirtualMachineScaleSetLifecycleHookEvent(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js new file mode 100644 index 000000000000..31d948d42fd3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesCancelSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to cancels the current virtual machine scale set rolling upgrade. + * + * @summary cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetRollingUpgrades.cancel("rgcompute", "aaaaa"); +} + +/** + * This sample demonstrates how to cancels the current virtual machine scale set rolling upgrade. + * + * @summary cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetRollingUpgrades.cancel("rgcompute", "aaaaaa"); +} + +async function main() { + await virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen(); + await virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js new file mode 100644 index 000000000000..ee3cbaad3f27 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesGetLatestSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + "rgcompute", + "aaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen(); + await virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js index 2a8a88b96cfc..ca239eb6eb6b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.js @@ -3,26 +3,21 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. * - * @summary Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json + * @summary starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json */ async function startAnExtensionRollingUpgrade() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginStartExtensionUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startExtensionUpgrade( + "myResourceGroup", + "{vmss-name}", + ); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js similarity index 51% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js index 723d74aab8aa..efd8f34a6106 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.js @@ -3,44 +3,34 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. * - * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json + * @summary starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeStartOSUpgradeMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startOSUpgrade("rgcompute", "aaaa"); } /** - * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. * - * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json + * @summary starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeStartOSUpgradeMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( - resourceGroupName, - vmScaleSetName, + await client.virtualMachineScaleSetRollingUpgrades.startOSUpgrade( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", ); - console.log(result); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js new file mode 100644 index 000000000000..2cc405f72941 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.js @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update the VMSS VM extension. + * + * @summary the operation to create or update the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json + */ +async function createVirtualMachineScaleSetVMExtension() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + settings: { UserName: "xyz@microsoft.com" }, + }, + ); + console.log(result); +} + +async function main() { + await createVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js new file mode 100644 index 000000000000..ca770dacb44d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsDeleteSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete the VMSS VM extension. + * + * @summary the operation to delete the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json + */ +async function deleteVirtualMachineScaleSetVMExtension() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMExtensions.delete( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + ); +} + +async function main() { + await deleteVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsGetSample.js new file mode 100644 index 000000000000..8404fc958de4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsGetSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get the VMSS VM extension. + * + * @summary the operation to get the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + */ +async function getVirtualMachineScaleSetVMExtension() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.get( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + ); + console.log(result); +} + +async function main() { + await getVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsListSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsListSample.js index 11d3a283753a..24728ae385f7 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMExtensionsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsListSample.js @@ -3,25 +3,21 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to get all extensions of an instance in Virtual Machine Scaleset. + * This sample demonstrates how to the operation to get all extensions of an instance in Virtual Machine Scaleset. * - * @summary The operation to get all extensions of an instance in Virtual Machine Scaleset. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json + * @summary the operation to get all extensions of an instance in Virtual Machine Scaleset. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json */ async function listExtensionsInVmssInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMExtensions.list( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myvmScaleSet", + "0", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js new file mode 100644 index 000000000000..dccef3d5217d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMExtensionsUpdateSample.js @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update the VMSS VM extension. + * + * @summary the operation to update the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json + */ +async function updateVirtualMachineScaleSetVMExtension() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + settings: { UserName: "xyz@microsoft.com" }, + }, + ); + console.log(result); +} + +async function main() { + await updateVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js new file mode 100644 index 000000000000..f018dfa620aa --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to create or update the VMSS VM run command. + * + * @summary the operation to create or update the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json + */ +async function createVirtualMachineScaleSetVMRunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + { + location: "West US", + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", + scriptUriManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + treatFailureAsDeploymentFailure: true, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", + outputBlobManagedIdentity: { clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a" }, + errorBlobManagedIdentity: {}, + }, + ); + console.log(result); +} + +async function main() { + await createVirtualMachineScaleSetVMRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js new file mode 100644 index 000000000000..b5d75c802852 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsDeleteSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete the VMSS VM run command. + * + * @summary the operation to delete the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json + */ +async function deleteVirtualMachineScaleSetVMRunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMRunCommands.delete( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + ); +} + +async function main() { + await deleteVirtualMachineScaleSetVMRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js new file mode 100644 index 000000000000..bc25f38fb0b0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsGetSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to get the VMSS VM run command. + * + * @summary the operation to get the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + */ +async function getVirtualMachineScaleSetVMRunCommands() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.get( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + ); + console.log(result); +} + +async function main() { + await getVirtualMachineScaleSetVMRunCommands(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsListSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsListSample.js index 1f01f86d099a..10d42fca8797 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMRunCommandsListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsListSample.js @@ -3,29 +3,26 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to get all run commands of an instance in Virtual Machine Scaleset. + * This sample demonstrates how to the operation to get all run commands of an instance in Virtual Machine Scaleset. * - * @summary The operation to get all run commands of an instance in Virtual Machine Scaleset. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json + * @summary the operation to get all run commands of an instance in Virtual Machine Scaleset. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json */ async function listRunCommandsInVmssInstance() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSetVMRunCommands.list( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myvmScaleSet", + "0", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js new file mode 100644 index 000000000000..ab0617c63e3e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMRunCommandsUpdateSample.js @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to update the VMSS VM run command. + * + * @summary the operation to update the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json + */ +async function updateVirtualMachineScaleSetVMRunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + { + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", + scriptUriManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + }, + ); + console.log(result); +} + +async function main() { + await updateVirtualMachineScaleSetVMRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsApproveRollingUpgradeSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsApproveRollingUpgradeSample.js new file mode 100644 index 000000000000..dc6e23d065b5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsApproveRollingUpgradeSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. + * + * @summary approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json + */ +async function virtualMachineScaleSetVMApproveRollingUpgrade() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.approveRollingUpgrade( + "rgcompute", + "vmssToApproveRollingUpgradeOn", + "0123", + ); +} + +async function main() { + await virtualMachineScaleSetVMApproveRollingUpgrade(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsAttachDetachDataDisksSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsAttachDetachDataDisksSample.js new file mode 100644 index 000000000000..53602ded4b14 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsAttachDetachDataDisksSample.js @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to attach and detach data disks to/from a virtual machine in a VM scale set. + * + * @summary attach and detach data disks to/from a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.attachDetachDataDisks( + "rgcompute", + "azure-vmscaleset", + "0", + { + dataDisksToAttach: [ + { + lun: 1, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadOnly", + writeAcceleratorEnabled: true, + }, + { + lun: 2, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadWrite", + writeAcceleratorEnabled: false, + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + detachOption: "ForceDetach", + }, + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", + detachOption: "ForceDetach", + }, + ], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to attach and detach data disks to/from a virtual machine in a VM scale set. + * + * @summary attach and detach data disks to/from a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.attachDetachDataDisks( + "rgcompute", + "azure-vmscaleset", + "0", + { + dataDisksToAttach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + }, + ], + }, + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(); + await virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeallocateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeallocateSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeallocateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeallocateSample.js index 78ca70fa2765..0c55af92850b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSDeallocateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeallocateSample.js @@ -3,48 +3,39 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * This sample demonstrates how to deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * - * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json + * @summary deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json */ async function virtualMachineScaleSetVMDeallocateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, + await client.virtualMachineScaleSetVMs.deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", ); - console.log(result); } /** - * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * This sample demonstrates how to deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * - * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json + * @summary deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json */ async function virtualMachineScaleSetVMDeallocateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, + await client.virtualMachineScaleSetVMs.deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaa", ); - console.log(result); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeleteSample.js new file mode 100644 index 000000000000..ae70b362c049 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsDeleteSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a virtual machine from a VM scale set. + * + * @summary deletes a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json + */ +async function forceDeleteAVirtualMachineFromAVMScaleSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.delete("myResourceGroup", "myvmScaleSet", "0", { + forceDeletion: true, + }); +} + +async function main() { + await forceDeleteAVirtualMachineFromAVMScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetInstanceViewSample.js similarity index 52% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetInstanceViewSample.js index e944fd62204d..7efa22872e0a 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetVMSGetInstanceViewSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetInstanceViewSample.js @@ -3,25 +3,21 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets the status of a virtual machine from a VM scale set. + * This sample demonstrates how to gets the status of a virtual machine from a VM scale set. * - * @summary Gets the status of a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + * @summary gets the status of a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json */ async function getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMs.getInstanceView( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetSample.js new file mode 100644 index 000000000000..5f8242f0bac5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsGetSample.js @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json + */ +async function getVMScaleSetVMWithResiliencyView() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "1"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + */ +async function getVMScaleSetVMWithUserData() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "0"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + */ +async function getVMScaleSetVMWithVMSizeProperties() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "0"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVirtualMachineResourceId.json + */ +async function getVMScaleSetFlexVMWithVirtualMachineResourceId() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + "myResourceGroup", + "{vmss-flex-name}", + "{vmss-flex-vm-name}", + ); + console.log(result); +} + +async function main() { + await getVMScaleSetVMWithResiliencyView(); + await getVMScaleSetVMWithUserData(); + await getVMScaleSetVMWithVMSizeProperties(); + await getVMScaleSetFlexVMWithVirtualMachineResourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsListSample.js new file mode 100644 index 000000000000..2217ac928a10 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsListSample.js @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + { filter: "aaaaaaaaaaaaaa", select: "aaaaaaaaaaaaaaaaaaaaa", expand: "aaaaaaaaaaaaa" }, + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("rgcompute", "aaaaaaaaaaaaaa")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json + */ +async function listVmssVMsWithResilientVMDeletionStatus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("resourceGroupname", "vmssName")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithVirtualMachineResourceId.json + */ +async function listVmssVMsWithVirtualMachineResourceId() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("resourceGroupname", "vmssName")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await virtualMachineScaleSetVMListMaximumSetGen(); + await virtualMachineScaleSetVMListMinimumSetGen(); + await listVmssVMsWithResilientVMDeletionStatus(); + await listVmssVMsWithVirtualMachineResourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPerformMaintenanceSample.js new file mode 100644 index 000000000000..dac1880213c0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPerformMaintenanceSample.js @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to performs maintenance on a virtual machine in a VM scale set. + * + * @summary performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.performMaintenance( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to performs maintenance on a virtual machine in a VM scale set. + * + * @summary performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.performMaintenance("rgcompute", "aaaaaaaaaa", "aaaa"); +} + +async function main() { + await virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(); + await virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPowerOffSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPowerOffSample.js new file mode 100644 index 000000000000..8b4c9ae8c98b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsPowerOffSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMPowerOffMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.powerOff("rgcompute", "aaaaaa", "aaaaaaaaa", { + skipShutdown: true, + }); +} + +/** + * This sample demonstrates how to power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMPowerOffMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.powerOff( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main() { + await virtualMachineScaleSetVMPowerOffMaximumSetGen(); + await virtualMachineScaleSetVMPowerOffMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRedeploySample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRedeploySample.js new file mode 100644 index 000000000000..7daed6149ec3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRedeploySample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMRedeployMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.redeploy( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMRedeployMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.redeploy( + "rgcompute", + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main() { + await virtualMachineScaleSetVMRedeployMaximumSetGen(); + await virtualMachineScaleSetVMRedeployMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageAllSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageAllSample.js new file mode 100644 index 000000000000..8a7ffc5eda66 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageAllSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageAllMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageAllMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main() { + await virtualMachineScaleSetVMReimageAllMaximumSetGen(); + await virtualMachineScaleSetVMReimageAllMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageSample.js new file mode 100644 index 000000000000..cf0ec5a48cb4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsReimageSample.js @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimage( + "rgcompute", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { vmScaleSetVMReimageInput: { forceUpdateOSDiskForEphemeral: true, tempDisk: true } }, + ); +} + +/** + * This sample demonstrates how to reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimage("rgcompute", "aaaaaaa", "aaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachineScaleSetVMReimageMaximumSetGen(); + await virtualMachineScaleSetVMReimageMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRestartSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRestartSample.js new file mode 100644 index 000000000000..b1fb7d11d0c2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRestartSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to restarts a virtual machine in a VM scale set. + * + * @summary restarts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMRestartMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.restart("rgcompute", "aa", "aaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to restarts a virtual machine in a VM scale set. + * + * @summary restarts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMRestartMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.restart("rgcompute", "aaaaaaaaaaaa", "aaaaaa"); +} + +async function main() { + await virtualMachineScaleSetVMRestartMaximumSetGen(); + await virtualMachineScaleSetVMRestartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.js new file mode 100644 index 000000000000..d75d113f2c7b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @summary the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( + "ResourceGroup", + "myvmScaleSet", + "0", + { sasUriExpirationTimeInMinutes: 60 }, + ); + console.log(result); +} + +async function main() { + await retrieveBootDiagnosticsDataOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRunCommandSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRunCommandSample.js new file mode 100644 index 000000000000..0cf1c087f714 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsRunCommandSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to run command on a virtual machine in a VM scale set. + * + * @summary run command on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json + */ +async function virtualMachineScaleSetVMsRunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.runCommand( + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", + { commandId: "RunPowerShellScript", script: ["Write-Host Hello World!"] }, + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetVMsRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsSimulateEvictionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsSimulateEvictionSample.js new file mode 100644 index 000000000000..76ba10744b55 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsSimulateEvictionSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @summary the operation to simulate the eviction of spot virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json + */ +async function simulateEvictionAVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.simulateEviction( + "ResourceGroup", + "VmScaleSetName", + "InstanceId", + ); +} + +async function main() { + await simulateEvictionAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsStartSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsStartSample.js new file mode 100644 index 000000000000..c742e5b51714 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsStartSample.js @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to starts a virtual machine in a VM scale set. + * + * @summary starts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMStartMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.start("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to starts a virtual machine in a VM scale set. + * + * @summary starts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMStartMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.start( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaa", + ); +} + +async function main() { + await virtualMachineScaleSetVMStartMaximumSetGen(); + await virtualMachineScaleSetVMStartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsUpdateSample.js new file mode 100644 index 000000000000..3047ef682938 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetVMsUpdateSample.js @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to updates a virtual machine of a VM scale set. + * + * @summary updates a virtual machine of a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMUpdateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.update( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { + location: "westus", + tags: {}, + networkProfileConfiguration: { + networkInterfaceConfigurations: [ + { + name: "vmsstestnetconfig5415", + primary: true, + enableAcceleratedNetworking: true, + dnsSettings: { dnsServers: [] }, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "vmsstestnetconfig9693", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503", + }, + privateIPAddressVersion: "IPv4", + primary: true, + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaa", + idleTimeoutInMinutes: 18, + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + ipTags: [{ ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }], + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + publicIPAddressVersion: "IPv4", + deleteOption: "Delete", + sku: { name: "Basic", tier: "Regional" }, + }, + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + }, + ], + enableFpga: true, + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + deleteOption: "Delete", + }, + ], + }, + hardwareProfile: { + vmSize: "Basic_A0", + vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 }, + }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2012-R2-Datacenter", + version: "4.127.20180315", + sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", + id: "a", + }, + osDisk: { + osType: "Windows", + name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + createOption: "FromImage", + caching: "None", + managedDisk: { + storageAccountType: "Standard_LRS", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskSizeGB: 127, + encryptionSettings: { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + enabled: true, + }, + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + deleteOption: "Delete", + }, + dataDisks: [ + { + lun: 1, + name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + createOption: "Empty", + caching: "None", + managedDisk: { + storageAccountType: "Standard_LRS", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskSizeGB: 128, + toBeDetached: true, + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + detachOption: "ForceDetach", + deleteOption: "Delete", + }, + ], + }, + osProfile: { + computerName: "test000000", + adminUsername: "Foo12", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + additionalUnattendContent: [ + { + passName: "OobeSystem", + componentName: "Microsoft-Windows-Shell-Setup", + settingName: "AutoLogon", + content: "aaaaaaaaaaaaaaaaaaaa", + }, + ], + patchSettings: { + patchMode: "Manual", + enableHotpatching: true, + assessmentMode: "ImageDefault", + }, + winRM: { listeners: [{ protocol: "Http", certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa" }] }, + }, + secrets: [], + allowExtensionOperations: true, + requireGuestProvisionSignal: true, + adminPassword: "aaaaaaaaaaaaaaaa", + customData: "aaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] }, + provisionVMAgent: true, + patchSettings: { patchMode: "ImageDefault", assessmentMode: "ImageDefault" }, + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", + primary: true, + deleteOption: "Delete", + }, + ], + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaaaaa", + primary: true, + deleteOption: "Delete", + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + dnsSettings: { dnsServers: ["aaaaaa"] }, + ipConfigurations: [ + { + name: "aa", + subnet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + primary: true, + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + idleTimeoutInMinutes: 2, + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + ipTags: [{ ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaa" }], + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + publicIPAddressVersion: "IPv4", + publicIPAllocationMethod: "Dynamic", + sku: { name: "Basic", tier: "Regional" }, + }, + privateIPAddressVersion: "IPv4", + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + }, + ], + dscpConfiguration: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + ], + }, + diagnosticsProfile: { bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" } }, + additionalCapabilities: { ultraSSDEnabled: true, hibernationEnabled: true }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + encryptionAtHost: true, + securityType: "TrustedLaunch", + }, + availabilitySet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + licenseType: "aaaaaaaaaa", + protectionPolicy: { protectFromScaleIn: true, protectFromScaleSetActions: true }, + plan: { + name: "aaaaaaaaaa", + publisher: "aaaaaaaaaaaaaaaaaaaaaa", + product: "aaaaaaaaaaaaaaaaaaaa", + promotionCode: "aaaaaaaaaaaaaaaaaaaa", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to updates a virtual machine of a VM scale set. + * + * @summary updates a virtual machine of a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMUpdateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + { location: "westus" }, + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetVMUpdateMaximumSetGen(); + await virtualMachineScaleSetVMUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js new file mode 100644 index 000000000000..e307d47a16f9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsApproveRollingUpgradeSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. + * + * @summary approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json + */ +async function virtualMachineScaleSetApproveRollingUpgrade() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.approveRollingUpgrade( + "rgcompute", + "vmssToApproveRollingUpgradeOn", + { vmInstanceIDs: { instanceIds: ["0", "1", "2"] } }, + ); +} + +async function main() { + await virtualMachineScaleSetApproveRollingUpgrade(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js new file mode 100644 index 000000000000..9b7acdb2a899 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + ); +} + +/** + * This sample demonstrates how to converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + "rgcompute", + "aaaaaaaaaaaaa", + {}, + ); +} + +async function main() { + await virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen(); + await virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d4e2e856b353 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsCreateOrUpdateSample.js @@ -0,0 +1,3913 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json + */ +async function createAScaleSetWithEphemeralOsDisksUsingPlacementProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAndFullCachingEnabled.json + */ +async function createAScaleSetWithEphemeralOsDisksUsingPlacementPropertyAndEnableFullCachingSetToTrue() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { + option: "Local", + placement: "ResourceDisk", + enableFullCaching: true, + }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + */ +async function createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + osDisk: { + caching: "ReadWrite", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + createOption: "FromImage", + name: "osDisk", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json + */ +async function createAScaleSetFromACustomImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json + */ +async function createAScaleSetFromAGeneralizedSharedImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json + */ +async function createAScaleSetFromASpecializedSharedImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json + */ +async function createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{nicConfig1-name}", + primary: true, + enableIPForwarding: true, + disableTcpStateTracking: true, + enableAcceleratedNetworking: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + { + name: "{nicConfig2-name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + disableTcpStateTracking: false, + ipConfigurations: [ + { + name: "{nicConfig2-name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", + }, + privateIPAddressVersion: "IPv4", + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json + */ +async function createAScaleSetWithFpgaNetworkInterfaces() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + { + name: "{fpgaNic-Name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + enableFpga: true, + ipConfigurations: [ + { + name: "{fpgaNic-Name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}", + }, + privateIPAddressVersion: "IPv4", + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json + */ +async function createAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{nicConfig1-name}", + tags: { nicTag: "tag" }, + primary: true, + enableIPForwarding: true, + disableTcpStateTracking: true, + enableAcceleratedNetworking: true, + auxiliaryMode: "AcceleratedConnections", + auxiliarySku: "A1", + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + { + name: "{nicConfig2-name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + disableTcpStateTracking: false, + ipConfigurations: [ + { + name: "{nicConfig2-name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", + }, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "publicip", + tags: { pipTag: "tag" }, + idleTimeoutInMinutes: 10, + dnsSettings: { + domainNameLabel: "vmsstestlabel01", + domainNameLabelScope: "NoReuse", + }, + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json + */ +async function createAPlatformImageScaleSetWithUnmanagedOsDisks() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + name: "osDisk", + vhdContainers: [ + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer", + ], + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json + */ +async function createAScaleSetWithAMarketplaceImagePlan() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json + */ +async function createAScaleSetWithApplicationProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + applicationProfile: { + galleryApplications: [ + { + tags: "myTag1", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + treatFailureAsDeploymentFailure: true, + enableAutomaticUpgrade: false, + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json + */ +async function createAScaleSetWithAutomaticRepairsEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, + }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticZoneRebalancingPolicy.json + */ +async function createAScaleSetWithAutomaticZoneRebalancingEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + automaticZoneRebalancingPolicy: { + enabled: true, + rebalanceStrategy: "Recreate", + rebalanceBehavior: "CreateBeforeDelete", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json + */ +async function createAScaleSetWithAnAzureApplicationGateway() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json + */ +async function createAScaleSetWithAnAzureLoadBalancer() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + publicIPAddressConfiguration: { + name: "{vmss-name}", + publicIPAddressVersion: "IPv4", + }, + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json + */ +async function createAScaleSetWithBootDiagnostics() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json + */ +async function createOrUpdateAScaleSetWithCapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + capacityReservation: { + capacityReservationGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json + */ +async function createAScaleSetWithEphemeralOsDisks() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json + */ +async function createAScaleSetWithDiskControllerType() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, + }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + diskControllerType: "NVMe", + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + hardwareProfile: { vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json + */ +async function createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + createOption: "FromImage", + }, + dataDisks: [ + { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json + */ +async function createAScaleSetWithEmptyDataDisksOnEachVm() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + diskSizeGB: 512, + }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json + */ +async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { encryptionAtHost: true }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + */ +async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + suppressFailures: true, + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + */ +async function createAScaleSetWithExtensionTimeBudget() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + }, + ], + extensionsTimeBudget: "PT1H20M", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExternalHealthPolicy.json + */ +async function createAScaleSetWithExternalHealthPolicyEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, + }, + externalHealthPolicy: { enabled: true, expiryDuration: "PT10M", gracePeriod: "PT4H" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithHighSpeedInterconnectPlacement.json + */ +async function createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_D1_v2" }, + location: "westus", + orchestrationMode: "Flexible", + highSpeedInterconnectPlacement: "None", + platformFaultDomainCount: 1, + virtualMachineProfile: { + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-focal", + sku: "20_04-lts-gen2", + version: "latest", + }, + osDisk: { + createOption: "FromImage", + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + enableAcceleratedNetworking: false, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + primary: true, + applicationGatewayBackendAddressPools: [], + loadBalancerBackendAddressPools: [], + publicIPAddressConfiguration: { name: "{vmss-name}", idleTimeoutInMinutes: 15 }, + }, + ], + }, + ], + networkApiVersion: "2020-11-01", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithLifecycleHooksProfile.json + */ +async function createAVirtualMachineScaleSetWithLifecycleHooksProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 4, name: "Standard_D1_v2" }, + location: "westus", + lifecycleHooksProfile: { + lifecycleHooks: [ + { + type: "UpgradeAutoOSRollingBatchStarting", + waitDuration: "PT20M", + defaultAction: "Approve", + }, + ], + }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json + */ +async function createAScaleSetWithManagedBootDiagnostics() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxInstancePercentPerZonePolicy.json + */ +async function createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + zoneAllocationPolicy: { maxInstancePercentPerZonePolicy: { enabled: true, value: 50 } }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxZoneCount.json + */ +async function createAZonesAutoScaleSetWithMaxZoneCount() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { zoneAllocationPolicy: { maxZoneCount: 2 } }, + placement: { zonePlacementPolicy: "Auto" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json + */ +async function createAScaleSetWithOSImageScheduledEventsEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + scheduledEventsProfile: { + osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOperationRecoverySettings.json + */ +async function createAScaleSetWithOperationRecoverySettingsEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + operationRecoverySettings: { + restartRecoveryPolicy: { enabled: true }, + startRecoveryPolicy: { enabled: true }, + reimageRecoveryPolicy: { enabled: true }, + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json + */ +async function createAScaleSetWithPasswordAuthentication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPlacement.json + */ +async function createAScaleSetWithPlacementPolicyAuto() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + placement: { zonePlacementPolicy: "Auto", includeZones: ["1", "3"] }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json + */ +async function createAScaleSetWithPremiumStorage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json + */ +async function createAScaleSetWithPriorityMixPolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A8m_v2" }, + location: "westus", + orchestrationMode: "Flexible", + platformFaultDomainCount: 1, + priorityMixPolicy: { baseRegularPriorityCount: 10, regularPriorityPercentageAboveBase: 50 }, + virtualMachineProfile: { + priority: "Spot", + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-focal", + sku: "20_04-lts-gen2", + version: "latest", + }, + osDisk: { + createOption: "FromImage", + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + osProfile: { computerNamePrefix: "{vmss-name}", adminUsername: "{your-username}" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + enableAcceleratedNetworking: false, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + primary: true, + applicationGatewayBackendAddressPools: [], + loadBalancerBackendAddressPools: [], + publicIPAddressConfiguration: { name: "{vmss-name}", idleTimeoutInMinutes: 15 }, + }, + ], + }, + ], + networkApiVersion: "2020-11-01", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json + */ +async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + protectedSettingsFromKeyVault: { + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", + }, + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + }, + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json + */ +async function createAScaleSetWithProxyAgentSettingsOfEnabledAndMode() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2s_v3" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-jammy", + sku: "22_04-lts-gen2", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { + proxyAgentSettings: { + enabled: true, + addProxyAgentExtension: true, + wireServer: { + inVMAccessControlProfileReferenceId: + "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", + }, + imds: { + inVMAccessControlProfileReferenceId: + "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", + }, + }, + }, + osProfile: { computerNamePrefix: "{vmss-name}", adminUsername: "{your-username}" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json + */ +async function createAScaleSetWithResilientVMCreationEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { resilientVMCreationPolicy: { enabled: true } }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json + */ +async function createAScaleSetWithResilientVMDeletionEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { resilientVMDeletionPolicy: { enabled: true } }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json + */ +async function createAScaleSetWithScaleInPolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scaleInPolicy: { rules: ["OldestVM"], prioritizeUnhealthyVMs: true, forceDeletion: true }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json + */ +async function createAScaleSetWithSecurityPostureReference() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_A1" }, + location: "eastus2euap", + overprovision: true, + virtualMachineProfile: { + securityPostureReference: { + id: "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", + }, + storageProfile: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { caching: "ReadWrite", createOption: "FromImage", name: "osDisk" }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { + mode: "Automatic", + automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVM() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DC2as_v5" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, + }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DC2es_v5" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "linux-cvm", + publisher: "UbuntuServer", + version: "17763.2183.2109130127", + offer: "2022-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "NonPersistedTPM" }, + }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json + */ +async function createAScaleSetWithServiceArtifactReference() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_A1" }, + location: "eastus2euap", + overprovision: true, + virtualMachineProfile: { + serviceArtifactReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName", + }, + storageProfile: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { caching: "ReadWrite", createOption: "FromImage", name: "osDisk" }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { + mode: "Automatic", + automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json + */ +async function createAScaleSetWithSkuProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { capacity: 10, name: "Mix" }, + location: "westus", + singlePlacementGroup: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + orchestrationMode: "Flexible", + priorityMixPolicy: { baseRegularPriorityCount: 4, regularPriorityPercentageAboveBase: 50 }, + skuProfile: { + vmSizes: [ + { name: "Standard_D8s_v5" }, + { name: "Standard_E16s_v5" }, + { name: "Standard_D2s_v5" }, + ], + allocationStrategy: "CapacityOptimized", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile_Prioritized.json + */ +async function createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { capacity: 10, name: "Mix" }, + location: "westus", + singlePlacementGroup: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + orchestrationMode: "Flexible", + priorityMixPolicy: { baseRegularPriorityCount: 4, regularPriorityPercentageAboveBase: 50 }, + skuProfile: { + vmSizes: [ + { name: "Standard_D8s_v5", rank: 0 }, + { name: "Standard_E16s_v5", rank: 1 }, + { name: "Standard_D2s_v5", rank: 2 }, + ], + allocationStrategy: "Prioritized", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json + */ +async function createAScaleSetWithSpotRestorePolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A8m_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + upgradePolicy: { mode: "Manual" }, + spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json + */ +async function createAScaleSetWithSshAuthentication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithStorageFaultDomainAlignment.json + */ +async function createAScaleSetContainingDisksWithStorageFaultDomainAlignment() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + storageFaultDomainAlignment: "BestEffortAligned", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { eventGridAndResourceGraph: { enable: true } }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + }, + zonalPlatformFaultDomainAlignMode: "Aligned", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json + */ +async function createAScaleSetWithTerminateScheduledEventsEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT5M" }, + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json + */ +async function createAScaleSetWithUefiSettingsOfSecureBootAndVTPM() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2s_v3" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows10-tvm", + publisher: "MicrosoftWindowsServer", + version: "18363.592.2001092016", + offer: "windowsserver-gen2preview-preview", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json + */ +async function createAScaleSetWithUserData() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json + */ +async function createAScaleSetWithVmSizeProperties() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + hardwareProfile: { vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json + */ +async function createAScaleSetWithVirtualMachinesInDifferentZones() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A1_v2" }, + location: "centralus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + diskSizeGB: 512, + }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Automatic" }, + zones: ["1", "3"], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json + */ +async function createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { eventGridAndResourceGraph: { enable: true } }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + }, + zonalPlatformFaultDomainAlignMode: "Aligned", + }, + ); + console.log(result); +} + +async function main() { + await createAScaleSetWithEphemeralOsDisksUsingPlacementProperty(); + await createAScaleSetWithEphemeralOsDisksUsingPlacementPropertyAndEnableFullCachingSetToTrue(); + await createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(); + await createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage(); + await createAScaleSetFromACustomImage(); + await createAScaleSetFromAGeneralizedSharedImage(); + await createAScaleSetFromASpecializedSharedImage(); + await createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(); + await createAScaleSetWithFpgaNetworkInterfaces(); + await createAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings(); + await createAPlatformImageScaleSetWithUnmanagedOsDisks(); + await createAScaleSetWithAMarketplaceImagePlan(); + await createAScaleSetWithApplicationProfile(); + await createAScaleSetWithAutomaticRepairsEnabled(); + await createAScaleSetWithAutomaticZoneRebalancingEnabled(); + await createAScaleSetWithAnAzureApplicationGateway(); + await createAScaleSetWithAnAzureLoadBalancer(); + await createAScaleSetWithBootDiagnostics(); + await createOrUpdateAScaleSetWithCapacityReservation(); + await createAScaleSetWithEphemeralOsDisks(); + await createAScaleSetWithDiskControllerType(); + await createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk(); + await createAScaleSetWithEmptyDataDisksOnEachVm(); + await createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(); + await createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(); + await createAScaleSetWithExtensionTimeBudget(); + await createAScaleSetWithExternalHealthPolicyEnabled(); + await createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(); + await createAVirtualMachineScaleSetWithLifecycleHooksProfile(); + await createAScaleSetWithManagedBootDiagnostics(); + await createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(); + await createAZonesAutoScaleSetWithMaxZoneCount(); + await createAScaleSetWithOSImageScheduledEventsEnabled(); + await createAScaleSetWithOperationRecoverySettingsEnabled(); + await createAScaleSetWithPasswordAuthentication(); + await createAScaleSetWithPlacementPolicyAuto(); + await createAScaleSetWithPremiumStorage(); + await createAScaleSetWithPriorityMixPolicy(); + await createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(); + await createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(); + await createAScaleSetWithResilientVMCreationEnabled(); + await createAScaleSetWithResilientVMDeletionEnabled(); + await createAScaleSetWithScaleInPolicy(); + await createAScaleSetWithSecurityPostureReference(); + await createAScaleSetWithSecurityTypeAsConfidentialVM(); + await createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType(); + await createAScaleSetWithServiceArtifactReference(); + await createAScaleSetWithSkuProfile(); + await createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(); + await createAScaleSetWithSpotRestorePolicy(); + await createAScaleSetWithSshAuthentication(); + await createAScaleSetContainingDisksWithStorageFaultDomainAlignment(); + await createAScaleSetWithTerminateScheduledEventsEnabled(); + await createAScaleSetWithUefiSettingsOfSecureBootAndVTPM(); + await createAScaleSetWithUserData(); + await createAScaleSetWithVmSizeProperties(); + await createAScaleSetWithVirtualMachinesInDifferentZones(); + await createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeallocateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeallocateSample.js new file mode 100644 index 000000000000..80ddf6730020 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeallocateSample.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetDeallocateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + hibernate: true, + }); +} + +/** + * This sample demonstrates how to deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetDeallocateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachineScaleSetDeallocateMaximumSetGen(); + await virtualMachineScaleSetDeallocateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteInstancesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteInstancesSample.js new file mode 100644 index 000000000000..54520bcb5dc5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteInstancesSample.js @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes virtual machines in a VM scale set. + * + * @summary deletes virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetDeleteInstancesMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deleteInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + { instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] }, + { forceDeletion: true }, + ); +} + +/** + * This sample demonstrates how to deletes virtual machines in a VM scale set. + * + * @summary deletes virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetDeleteInstancesMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deleteInstances("rgcompute", "aaaaaaaaaaaaaaa", { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }); +} + +async function main() { + await virtualMachineScaleSetDeleteInstancesMaximumSetGen(); + await virtualMachineScaleSetDeleteInstancesMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteSample.js new file mode 100644 index 000000000000..23e02cc6ac34 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsDeleteSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a VM scale set. + * + * @summary deletes a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json + */ +async function forceDeleteAVMScaleSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.delete("myResourceGroup", "myvmScaleSet", { + forceDeletion: true, + }); +} + +async function main() { + await forceDeleteAVMScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js similarity index 51% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js index a8afd71cf65c..61c077a0d0af 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.js @@ -3,48 +3,41 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * This sample demonstrates how to manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. * - * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + * @summary manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json */ async function virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const platformUpdateDomain = 30; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName, - vmScaleSetName, - platformUpdateDomain, + "rgcompute", + "aaaaaaaaaaaaaaaa", + 30, ); console.log(result); } /** - * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * This sample demonstrates how to manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. * - * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + * @summary manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json */ async function virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const platformUpdateDomain = 9; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName, - vmScaleSetName, - platformUpdateDomain, + "rgcompute", + "aaaaaaaaaaaa", + 9, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetInstanceViewSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetInstanceViewSample.js new file mode 100644 index 000000000000..2556de9deca1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetInstanceViewSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the status of a VM scale set instance. + * + * @summary gets the status of a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetGetInstanceViewMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + "rgcompute", + "aaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the status of a VM scale set instance. + * + * @summary gets the status of a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetGetInstanceViewMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + "rgcompute", + "aaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main() { + await virtualMachineScaleSetGetInstanceViewMaximumSetGen(); + await virtualMachineScaleSetGetInstanceViewMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js new file mode 100644 index 000000000000..e7d2863092dd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetOSUpgradeHistorySample.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets list of OS upgrades on a VM scale set instance. + * + * @summary gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.getOSUpgradeHistory( + "rgcompute", + "aaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets list of OS upgrades on a VM scale set instance. + * + * @summary gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.getOSUpgradeHistory( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen(); + await virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetSample.js new file mode 100644 index 000000000000..c2f634308edd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsGetSample.js @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + */ +async function getAVirtualMachineScaleSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + ); + console.log(result); +} + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + ); + console.log(result); +} + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + */ +async function getVMScaleSetVMWithDiskControllerType() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + { expand: "userData" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + */ +async function getAVirtualMachineScaleSetWithUserData() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + { expand: "userData" }, + ); + console.log(result); +} + +async function main() { + await getAVirtualMachineScaleSet(); + await getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(); + await getVMScaleSetVMWithDiskControllerType(); + await getAVirtualMachineScaleSetWithUserData(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListAllSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListAllSample.js similarity index 68% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListAllSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListAllSample.js index f0427c9fba30..7cb6574c3aae 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListAllSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListAllSample.js @@ -3,39 +3,40 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * This sample demonstrates how to gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. * - * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json + * @summary gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json */ async function virtualMachineScaleSetListAllMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listAll()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * This sample demonstrates how to gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. * - * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json + * @summary gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json */ async function virtualMachineScaleSetListAllMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListByLocationSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListByLocationSample.js similarity index 62% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListByLocationSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListByLocationSample.js index 83ef91856360..5a3637a219f7 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListByLocationSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListByLocationSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets all the VM scale sets under the specified subscription for the specified location. + * This sample demonstrates how to gets all the VM scale sets under the specified subscription for the specified location. * - * @summary Gets all the VM scale sets under the specified subscription for the specified location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json + * @summary gets all the VM scale sets under the specified subscription for the specified location. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json */ async function listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listByLocation(location)) { + for await (const item of client.virtualMachineScaleSets.listByLocation("eastus")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSample.js new file mode 100644 index 000000000000..53222e22f1ba --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a list of all VM scale sets under a resource group. + * + * @summary gets a list of all VM scale sets under a resource group. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetListMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all VM scale sets under a resource group. + * + * @summary gets a list of all VM scale sets under a resource group. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetListMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await virtualMachineScaleSetListMaximumSetGen(); + await virtualMachineScaleSetListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSkusSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSkusSample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSkusSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSkusSample.js index 1bbef1c2e4c9..467cbd33968b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsListSkusSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsListSkusSample.js @@ -3,49 +3,43 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * This sample demonstrates how to gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. * - * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json + * @summary gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json */ async function virtualMachineScaleSetListSkusMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listSkus( - resourceGroupName, - vmScaleSetName, - )) { + for await (const item of client.virtualMachineScaleSets.listSkus("rgcompute", "aaaaaa")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * This sample demonstrates how to gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. * - * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json + * @summary gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json */ async function virtualMachineScaleSetListSkusMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listSkus( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js similarity index 55% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js index cfd40f31df34..cb0ff3f12554 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPerformMaintenanceSample.js @@ -3,51 +3,33 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * This sample demonstrates how to perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * - * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json + * @summary perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json */ async function virtualMachineScaleSetPerformMaintenanceMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaa"; - const vmInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options = { - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.performMaintenance("rgcompute", "aaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); } /** - * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * This sample demonstrates how to perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * - * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json + * @summary perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json */ async function virtualMachineScaleSetPerformMaintenanceMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.performMaintenance("rgcompute", "aa"); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPowerOffSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPowerOffSample.js new file mode 100644 index 000000000000..c543fe62e48e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsPowerOffSample.js @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetPowerOffMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + skipShutdown: true, + }); +} + +/** + * This sample demonstrates how to power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetPowerOffMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.powerOff("rgcompute", "a"); +} + +async function main() { + await virtualMachineScaleSetPowerOffMaximumSetGen(); + await virtualMachineScaleSetPowerOffMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReapplySample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReapplySample.js new file mode 100644 index 000000000000..7442490a12fe --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReapplySample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * + * @summary reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReapplyMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "b4f1213b-cacc-4816-8bfb-f30f90643de8"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reapply( + "VirtualMachineScaleSetReapplyTestRG", + "VMSSReapply-Test-ScaleSet", + ); +} + +/** + * This sample demonstrates how to reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * + * @summary reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReapplyMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "b4f1213b-cacc-4816-8bfb-f30f90643de8"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reapply( + "VirtualMachineScaleSetReapplyTestRG", + "VMSSReapply-Test-ScaleSet", + ); +} + +async function main() { + await virtualMachineScaleSetsReapplyMaximumSetGen(); + await virtualMachineScaleSetsReapplyMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRedeploySample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRedeploySample.js new file mode 100644 index 000000000000..f1c7d2dd56f2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRedeploySample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRedeployMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRedeployMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachineScaleSetRedeployMaximumSetGen(); + await virtualMachineScaleSetRedeployMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageAllSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageAllSample.js new file mode 100644 index 000000000000..51affb2a82d2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageAllSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetReimageAllMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimageAll("rgcompute", "aaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetReimageAllMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachineScaleSetReimageAllMaximumSetGen(); + await virtualMachineScaleSetReimageAllMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageSample.js new file mode 100644 index 000000000000..21c8cc94dad5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsReimageSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetReimageMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmScaleSetReimageInput: { + instanceIds: ["aaaaaaaaaa"], + forceUpdateOSDiskForEphemeral: true, + tempDisk: true, + }, + }); +} + +/** + * This sample demonstrates how to reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetReimageMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachineScaleSetReimageMaximumSetGen(); + await virtualMachineScaleSetReimageMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRestartSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRestartSample.js new file mode 100644 index 000000000000..6403799a89c5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsRestartSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to restarts one or more virtual machines in a VM scale set. + * + * @summary restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRestartMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.restart("rgcompute", "aaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to restarts one or more virtual machines in a VM scale set. + * + * @summary restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRestartMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.restart("rgcompute", "aaaa"); +} + +async function main() { + await virtualMachineScaleSetRestartMaximumSetGen(); + await virtualMachineScaleSetRestartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsScaleOutSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsScaleOutSample.js new file mode 100644 index 000000000000..7c575ae47850 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsScaleOutSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to scales out one or more virtual machines in a VM scale set. + * + * @summary scales out one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json + */ +async function virtualMachineScaleSetScaleOut() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.scaleOut("myResourceGroup", "{vmss-name}", { + capacity: 5, + properties: { zone: "1" }, + }); +} + +async function main() { + await virtualMachineScaleSetScaleOut(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js new file mode 100644 index 000000000000..0cc0586f7c5d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsSetOrchestrationServiceStateSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to changes ServiceState property for a given service + * + * @summary changes ServiceState property for a given service + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaa", + { serviceName: "AutomaticRepairs", action: "Resume" }, + ); +} + +/** + * This sample demonstrates how to changes ServiceState property for a given service + * + * @summary changes ServiceState property for a given service + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + { serviceName: "AutomaticRepairs", action: "Resume" }, + ); +} + +async function main() { + await virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen(); + await virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsStartSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsStartSample.js new file mode 100644 index 000000000000..7aba6944d4bd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsStartSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to starts one or more virtual machines in a VM scale set. + * + * @summary starts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetStartMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.start("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to starts one or more virtual machines in a VM scale set. + * + * @summary starts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetStartMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.start("rgcompute", "aaaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachineScaleSetStartMaximumSetGen(); + await virtualMachineScaleSetStartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateInstancesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateInstancesSample.js new file mode 100644 index 000000000000..3c603d0fb901 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateInstancesSample.js @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetUpdateInstancesMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.updateInstances("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }); +} + +/** + * This sample demonstrates how to upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetUpdateInstancesMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.updateInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] }, + ); +} + +async function main() { + await virtualMachineScaleSetUpdateInstancesMaximumSetGen(); + await virtualMachineScaleSetUpdateInstancesMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateSample.js similarity index 80% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateSample.js index 1e1b7ba889c9..06aac6cd5846 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineScaleSetsUpdateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineScaleSetsUpdateSample.js @@ -3,101 +3,160 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Update a VM scale set. + * This sample demonstrates how to update a VM scale set. * - * @summary Update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json + * @summary update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json */ async function virtualMachineScaleSetUpdateMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const parameters = { - additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, - automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, - doNotRunExtensionsOnOverprovisionedVMs: true, - identity: { - type: "SystemAssigned", - userAssignedIdentities: { key3951: {} }, - }, - overprovision: true, + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.update("rgcompute", "aaaaaaaaaaaaa", { + sku: { name: "DSv3-Type1", tier: "aaa", capacity: 7 }, plan: { - name: "windows2016", + publisher: "microsoft-ads", product: "windows-data-science-vm", + name: "windows2016", promotionCode: "aaaaaaaaaa", - publisher: "microsoft-ads", }, - proximityPlacementGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, - singlePlacementGroup: true, - sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, - tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, upgradePolicy: { - automaticOSUpgradePolicy: { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - osRollingUpgradeDeferral: true, - }, mode: "Manual", rollingUpgradePolicy: { - enableCrossZoneUpgrade: true, maxBatchInstancePercent: 49, - maxSurge: true, maxUnhealthyInstancePercent: 81, maxUnhealthyUpgradedInstancePercent: 98, pauseTimeBetweenBatches: "aaaaaaaaaaaaaaa", + enableCrossZoneUpgrade: true, prioritizeUnhealthyInstances: true, rollbackFailedInstancesOnPolicyBreach: true, + maxSurge: true, + }, + automaticOSUpgradePolicy: { + enableAutomaticOSUpgrade: true, + disableAutomaticRollback: true, + osRollingUpgradeDeferral: true, }, }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + enableHotpatching: true, + assessmentMode: "ImageDefault", + automaticByPlatformSettings: { rebootSetting: "Never" }, + }, + timeZone: "aaaaaaaaaaaaaaaa", + additionalUnattendContent: [ + { + passName: "OobeSystem", + componentName: "Microsoft-Windows-Shell-Setup", + settingName: "AutoLogon", + content: "aaaaaaaaaaaaaaaaaaaa", + }, + ], + winRM: { listeners: [{ protocol: "Http", certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa" }] }, + }, + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + provisionVMAgent: true, + patchSettings: { patchMode: "ImageDefault", assessmentMode: "ImageDefault" }, }, + secrets: [ + { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + vaultCertificates: [ + { certificateUrl: "aaaaaaa", certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + ], + }, + ], }, - extensionProfile: { - extensionsTimeBudget: "PT1H20M", - extensions: [ + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + sharedGalleryImageId: "aaaaaa", + id: "aaaaaaaaaaaaaaaaaaa", + }, + osDisk: { + caching: "ReadWrite", + writeAcceleratorEnabled: true, + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + diskSizeGB: 6, + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + vhdContainers: ["aa"], + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + }, + dataDisks: [ { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", + diskSizeGB: 1023, + createOption: "Empty", + lun: 26, + name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + caching: "None", + writeAcceleratorEnabled: true, + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskIopsReadWrite: 28, + diskMBpsReadWrite: 15, }, ], }, - licenseType: "aaaaaaaaaaaa", networkProfile: { healthProbe: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", }, - networkApiVersion: "2020-11-01", networkInterfaceConfigurations: [ { name: "aaaaaaaa", - deleteOption: "Delete", - dnsSettings: { dnsServers: [] }, + primary: true, enableAcceleratedNetworking: true, enableFpga: true, - enableIPForwarding: true, + networkSecurityGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + dnsSettings: { dnsServers: [] }, ipConfigurations: [ { name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + primary: true, + publicIPAddressConfiguration: { + name: "a", + idleTimeoutInMinutes: 3, + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + deleteOption: "Delete", + }, + privateIPAddressVersion: "IPv4", applicationGatewayBackendAddressPools: [ { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", @@ -118,164 +177,76 @@ async function virtualMachineScaleSetUpdateMaximumSetGen() { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", }, ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "a", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 3, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", - }, - }, - ], - networkSecurityGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - primary: true, - }, - ], - }, - osProfile: { - customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - linuxConfiguration: { - disablePasswordAuthentication: true, - patchSettings: { - assessmentMode: "ImageDefault", - patchMode: "ImageDefault", - }, - provisionVMAgent: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, - }, - secrets: [ - { - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - vaultCertificates: [ - { - certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa", - certificateUrl: "aaaaaaa", }, ], + enableIPForwarding: true, + deleteOption: "Delete", }, ], - windowsConfiguration: { - additionalUnattendContent: [ - { - componentName: "Microsoft-Windows-Shell-Setup", - content: "aaaaaaaaaaaaaaaaaaaa", - passName: "OobeSystem", - settingName: "AutoLogon", - }, - ], - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "ImageDefault", - automaticByPlatformSettings: { rebootSetting: "Never" }, - enableHotpatching: true, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - timeZone: "aaaaaaaaaaaaaaaa", - winRM: { - listeners: [{ certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }], - }, - }, - }, - scheduledEventsProfile: { - terminateNotificationProfile: { - enable: true, - notBeforeTimeout: "PT10M", - }, + networkApiVersion: "2020-11-01", }, securityProfile: { encryptionAtHost: true, - securityType: "TrustedLaunch", uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", }, - storageProfile: { - dataDisks: [ + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + extensionProfile: { + extensions: [ { - name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - caching: "None", - createOption: "Empty", - diskIopsReadWrite: 28, - diskMBpsReadWrite: 15, - diskSizeGB: 1023, - lun: 26, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - storageAccountType: "Standard_LRS", - }, - writeAcceleratorEnabled: true, + name: "{extension-name}", + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, }, ], - imageReference: { - id: "aaaaaaaaaaaaaaaaaaa", - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sharedGalleryImageId: "aaaaaa", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - diskSizeGB: 6, - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - storageAccountType: "Standard_LRS", - }, - vhdContainers: ["aa"], - writeAcceleratorEnabled: true, - }, + extensionsTimeBudget: "PT1H20M", + }, + licenseType: "aaaaaaaaaaaa", + billingProfile: { maxPrice: -1 }, + scheduledEventsProfile: { + terminateNotificationProfile: { notBeforeTimeout: "PT10M", enable: true }, }, userData: "aaaaaaaaaaaaa", }, + overprovision: true, + doNotRunExtensionsOnOverprovisionedVMs: true, + singlePlacementGroup: true, + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + scaleInPolicy: { rules: ["OldestVM"], forceDeletion: true }, + proximityPlacementGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + identity: { type: "SystemAssigned", userAssignedIdentities: { key3951: {} } }, zones: ["1", "2", "3"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, + }); console.log(result); } /** - * This sample demonstrates how to Update a VM scale set. + * This sample demonstrates how to update a VM scale set. * - * @summary Update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json + * @summary update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json */ async function virtualMachineScaleSetUpdateMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const parameters = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + const result = await client.virtualMachineScaleSets.update("rgcompute", "aaaaaaaaaaaaaa", {}); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineSizesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineSizesListSample.js similarity index 53% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachineSizesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachineSizesListSample.js index a0f493e77be9..7421f7022c68 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachineSizesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachineSizesListSample.js @@ -3,41 +3,40 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * This sample demonstrates how to this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) * - * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json + * @summary this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json */ async function virtualMachineSizesListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "-e"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineSizes.list(location)) { + for await (const item of client.virtualMachineSizes.list("-e")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * This sample demonstrates how to this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) * - * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json + * @summary this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json */ async function virtualMachineSizesListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "._.."; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineSizes.list(location)) { + for await (const item of client.virtualMachineSizes.list("._..")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAssessPatchesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAssessPatchesSample.js new file mode 100644 index 000000000000..f8c5785c03df --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAssessPatchesSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to assess patches on the VM. + * + * @summary assess patches on the VM. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AssessPatches.json + */ +async function assessPatchStateOfAVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.assessPatches("myResourceGroupName", "myVMName"); + console.log(result); +} + +async function main() { + await assessPatchStateOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAttachDetachDataDisksSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAttachDetachDataDisksSample.js new file mode 100644 index 000000000000..e370b8c08222 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesAttachDetachDataDisksSample.js @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to attach and detach data disks to/from the virtual machine. + * + * @summary attach and detach data disks to/from the virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json + */ +async function virtualMachineAttachDetachDataDisksMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.attachDetachDataDisks( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + { + dataDisksToAttach: [ + { + lun: 1, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadOnly", + deleteOption: "Delete", + writeAcceleratorEnabled: true, + }, + { + lun: 2, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadWrite", + deleteOption: "Detach", + writeAcceleratorEnabled: false, + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + detachOption: "ForceDetach", + }, + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", + detachOption: "ForceDetach", + }, + ], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to attach and detach data disks to/from the virtual machine. + * + * @summary attach and detach data disks to/from the virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json + */ +async function virtualMachineAttachDetachDataDisksMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.attachDetachDataDisks("rgcompute", "azure-vm", { + dataDisksToAttach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + }, + ], + }); + console.log(result); +} + +async function main() { + await virtualMachineAttachDetachDataDisksMaximumSetGen(); + await virtualMachineAttachDetachDataDisksMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCaptureSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCaptureSample.js new file mode 100644 index 000000000000..162801872d0d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCaptureSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json + */ +async function virtualMachineCaptureMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.capture("rgcompute", "aaaaaaaaaaaaaaaaaaaa", { + vhdPrefix: "aaaaaaaaa", + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json + */ +async function virtualMachineCaptureMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.capture("rgcompute", "aaaaaaaaaaaaa", { + vhdPrefix: "aaaaaaaaa", + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + }); + console.log(result); +} + +async function main() { + await virtualMachineCaptureMaximumSetGen(); + await virtualMachineCaptureMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesConvertToManagedDisksSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesConvertToManagedDisksSample.js new file mode 100644 index 000000000000..9c8bdc0edb92 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesConvertToManagedDisksSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json + */ +async function virtualMachineConvertToManagedDisksMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.convertToManagedDisks("rgcompute", "aaaaaaa"); +} + +/** + * This sample demonstrates how to converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json + */ +async function virtualMachineConvertToManagedDisksMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.convertToManagedDisks("rgcompute", "aaaaaaaaaaa"); +} + +async function main() { + await virtualMachineConvertToManagedDisksMaximumSetGen(); + await virtualMachineConvertToManagedDisksMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCreateOrUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCreateOrUpdateSample.js similarity index 64% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCreateOrUpdateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCreateOrUpdateSample.js index 718a8eafe619..d2875a8d9a41 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesCreateOrUpdateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesCreateOrUpdateSample.js @@ -3,21 +3,39 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json */ -async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createACustomImageVmFromAnUnmanagedGeneralizedOsImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + osDisk: { + name: "myVMosdisk", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + osType: "Windows", + createOption: "FromImage", + caching: "ReadWrite", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -26,53 +44,40 @@ async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { assessmentMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json + */ +async function createAVMFromACommunityGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + communityGalleryImageId: + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json - */ -async function createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -81,60 +86,80 @@ async function createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndA }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { - assessmentMode: "AutomaticByPlatform", - automaticByPlatformSettings: { - bypassPlatformSafetyChecksOnUserSchedule: true, - rebootSetting: "Never", - }, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json + */ +async function createAVmFromACustomImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json */ -async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createAVmFromAGeneralizedSharedImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -143,53 +168,76 @@ async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { patchMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json + */ +async function createAVMFromASharedGalleryImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + sharedGalleryImageId: + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json */ -async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createAVmFromASpecializedSharedImage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, networkProfile: { networkInterfaces: [ { @@ -198,56 +246,37 @@ async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAu }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { - assessmentMode: "AutomaticByPlatform", - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + */ +async function createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json - */ -async function createAVMFromACommunityGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -257,46 +286,45 @@ async function createAVMFromACommunityGalleryImage() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", + }, + virtualMachineScaleSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}", }, + platformFaultDomain: 1, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json + */ +async function createAVmInAnAvailabilitySet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - communityGalleryImageId: - "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json - */ -async function createAVMFromASharedGalleryImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -306,123 +334,60 @@ async function createAVMFromASharedGalleryImage() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - sharedGalleryImageId: - "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, + availabilitySet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json */ -async function createAVMWithDiskControllerType() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - hardwareProfile: { vmSize: "Standard_D4_v3" }, +async function createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { - diskControllerType: "NVMe", imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "U29tZSBDdXN0b20gRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithFips1403Enabled.json - */ -async function createAVMWithFips1403Enabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters = { - additionalCapabilities: { enableFips1403Encryption: true }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + assessmentMode: "AutomaticByPlatform", + automaticByPlatformSettings: { + rebootSetting: "Never", + bypassPlatformSafetyChecksOnUserSchedule: true, + }, + }, }, }, - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "eastus2euap", networkProfile: { networkInterfaces: [ { @@ -431,56 +396,46 @@ async function createAVMWithFips1403Enabled() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json - */ -async function createAVMWithHibernationEnabled() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters = { - additionalCapabilities: { hibernationEnabled: true }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { assessmentMode: "ImageDefault" }, }, }, - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "eastus2euap", networkProfile: { networkInterfaces: [ { @@ -489,49 +444,43 @@ async function createAVMWithHibernationEnabled() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + */ +async function createALinuxVmWithAPatchSettingPatchModeOfImageDefault() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json - */ -async function createAVMWithProxyAgentSettingsOfEnabledAndMode() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { provisionVMAgent: true, patchSettings: { patchMode: "ImageDefault" } }, + }, networkProfile: { networkInterfaces: [ { @@ -540,56 +489,46 @@ async function createAVMWithProxyAgentSettingsOfEnabledAndMode() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - proxyAgentSettings: { - enabled: true, - imds: { mode: "Audit" }, - wireServer: { mode: "Audit" }, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json - */ -async function createAVMWithUefiSettingsOfSecureBootAndVTpm() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { patchMode: "AutomaticByPlatform", assessmentMode: "AutomaticByPlatform" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -598,59 +537,62 @@ async function createAVMWithUefiSettingsOfSecureBootAndVTpm() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + */ +async function createAPlatformImageVmWithUnmanagedOsAndDataDisks() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, storageProfile: { imageReference: { - offer: "windowsserver-gen2preview-preview", + sku: "2016-Datacenter", publisher: "MicrosoftWindowsServer", - sku: "windows10-tvm", - version: "18363.592.2001092016", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", + caching: "ReadWrite", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, + name: "myVMosdisk", }, + dataDisks: [ + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd", + }, + }, + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 1, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd", + }, + }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json - */ -async function createAVMWithUserData() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", - }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -659,59 +601,54 @@ async function createAVMWithUserData() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json - */ -async function createAVMWithVMSizeProperties() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + assessmentMode: "AutomaticByPlatform", + automaticByPlatformSettings: { + rebootSetting: "Never", + bypassPlatformSafetyChecksOnUserSchedule: false, + }, + }, }, }, - hardwareProfile: { - vmSize: "Standard_D4_v3", - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -720,50 +657,47 @@ async function createAVMWithVMSizeProperties() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "U29tZSBDdXN0b20gRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPlacement.json - */ -async function createAVMWithAutomaticZonePlacement() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus2", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { assessmentMode: "ImageDefault" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -772,255 +706,194 @@ async function createAVMWithAutomaticZonePlacement() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - placement: { includeZones: ["1", "3"], zonePlacementPolicy: "Any" }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json - */ -async function createAVMWithEncryptionIdentity() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/myIdentity": - {}, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByOS" }, }, }, - location: "westus", networkProfile: { networkInterfaces: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", primary: true, }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - encryptionIdentity: { - userAssignedIdentityResourceId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity", - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", + sku: "2016-Datacenter", publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json - */ -async function createAVMWithNetworkInterfaceConfiguration() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByPlatform", enableHotpatching: true }, + }, + }, networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ + networkInterfaces: [ { - name: "{nic-config-name}", - deleteOption: "Delete", - ipConfigurations: [ - { - name: "{ip-config-name}", - primary: true, - publicIPAddressConfiguration: { - name: "{publicIP-config-name}", - deleteOption: "Detach", - publicIPAllocationMethod: "Static", - sku: { name: "Basic", tier: "Global" }, - tags: { pipTag: "tag" }, - }, - }, - ], + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", primary: true, - tags: { nicTag: "tag" }, }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfManual() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "Manual" }, + }, + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json */ -async function createAVMWithNetworkInterfaceConfigurationWithPublicIPAddressDnsSettings() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{nic-config-name}", - deleteOption: "Delete", - ipConfigurations: [ - { - name: "{ip-config-name}", - primary: true, - publicIPAddressConfiguration: { - name: "{publicIP-config-name}", - deleteOption: "Detach", - dnsSettings: { - domainNameLabel: "aaaaa", - domainNameLabelScope: "TenantReuse", - }, - publicIPAllocationMethod: "Static", - sku: { name: "Basic", tier: "Global" }, - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json - */ -async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DC2as_v5" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByPlatform", assessmentMode: "AutomaticByPlatform" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -1029,61 +902,44 @@ async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json + */ +async function createAVmWithEphemeralOsDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "2019-datacenter-cvm", - publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { - securityProfile: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - securityEncryptionType: "DiskWithVMGuestState", - }, - storageAccountType: "StandardSSD_LRS", - }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json - */ -async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurityEncryptionType() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DC2es_v5" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1092,56 +948,44 @@ async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurit }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskAndFullCachingEnabled.json + */ +async function createAVmWithEphemeralOsDiskAndEnableFullCachingSetToTrue() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "2022-datacenter-cvm", - publisher: "UbuntuServer", - sku: "linux-cvm", - version: "17763.2183.2109130127", + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "TempDisk", enableFullCaching: true }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "NonPersistedTPM" }, - storageAccountType: "StandardSSD_LRS", - }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json - */ -async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DC2as_v5" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1150,56 +994,44 @@ async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ +async function createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "2019-datacenter-cvm", - publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, - storageAccountType: "StandardSSD_LRS", - }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json - */ -async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1208,110 +1040,135 @@ async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { assessmentMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + */ +async function createAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", - primary: true, - }, - ], + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { patchMode: "AutomaticByOS" }, - provisionVMAgent: true, - }, + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json + */ +async function createAVmWithAMarketplaceImagePlan() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1320,120 +1177,99 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAn }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "AutomaticByPlatform", - automaticByPlatformSettings: { - bypassPlatformSafetyChecksOnUserSchedule: false, - rebootSetting: "Never", - }, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json + */ +async function createAVmWithApplicationProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "{image_sku}", + publisher: "{image_publisher}", version: "latest", + offer: "{image_offer}", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", - networkProfile: { - networkInterfaces: [ + applicationProfile: { + galleryApplications: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, + tags: "myTag1", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + treatFailureAsDeploymentFailure: false, + enableAutomaticUpgrade: false, + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - enableHotpatching: true, - patchMode: "AutomaticByPlatform", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, - provisionVMAgent: true, - }, + ], }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + */ +async function createAVmWithBootDiagnostics() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfManual() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1443,112 +1279,176 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfManual() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { patchMode: "Manual" }, - provisionVMAgent: true, + adminPassword: "{your-password}", + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json + */ +async function createOrUpdateAVMWithCapacityReservation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + capacityReservation: { + capacityReservationGroup: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json */ -async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVmWithDataDisksUsingCopyAndRestoreOptions() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ + hardwareProfile: { vmSize: "Standard_D2_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + dataDisks: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, + diskSizeGB: 1023, + createOption: "Copy", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}", + }, + lun: 0, + }, + { + diskSizeGB: 1023, + createOption: "Copy", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}", + }, + lun: 1, + }, + { + diskSizeGB: 1023, + createOption: "Restore", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}", + }, + lun: 2, }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "AutomaticByPlatform", - patchMode: "AutomaticByPlatform", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, - provisionVMAgent: true, + ], + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + */ +async function createAVMWithDiskControllerType() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D4_v3" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, + diskControllerType: "NVMe", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json - */ -async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1558,119 +1458,82 @@ async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", - }, - osType: "Windows", - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + userData: "U29tZSBDdXN0b20gRGF0YQ==", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json */ -async function createAPlatformImageVMWithUnmanagedOSAndDataDisks() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, +async function createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + name: "myVMosdisk", + createOption: "FromImage", + }, dataDisks: [ { - createOption: "Empty", + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, diskSizeGB: 1023, + createOption: "Empty", lun: 0, - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd", - }, }, { - createOption: "Empty", + caching: "ReadWrite", + managedDisk: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, diskSizeGB: 1023, + createOption: "Attach", lun: 1, - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd", - }, }, ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, - }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json - */ -async function createAVMFromACustomImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1679,46 +1542,46 @@ async function createAVMFromACustomImage() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + */ +async function createAVmWithEmptyDataDisks() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, storageProfile: { imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json - */ -async function createAVMFromAGeneralizedSharedImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1727,46 +1590,101 @@ async function createAVMFromAGeneralizedSharedImage() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json + */ +async function createAVmWithHostEncryptionUsingEncryptionAtHostProperty() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + securityProfile: { encryptionAtHost: true }, storageProfile: { imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", + caching: "ReadOnly", managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json */ -async function createAVMFromASpecializedSharedImage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVMWithEncryptionIdentity() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": + {}, + }, + }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + encryptionIdentity: { + userAssignedIdentityResourceId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity", + }, + }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1775,99 +1693,37 @@ async function createAVMFromASpecializedSharedImage() { }, ], }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json */ -async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVmWithAnExtensionsTimeBudget() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - platformFaultDomain: 1, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - virtualMachineScaleSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json - */ -async function createAVMInAnAvailabilitySet() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - availabilitySet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}", - }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1877,66 +1733,49 @@ async function createAVMInAnAvailabilitySet() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + extensionsTimeBudget: "PT30M", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithFips1403Enabled.json + */ +async function createAVMWithFips1403Enabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "eastus2euap", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + additionalCapabilities: { enableFips1403Encryption: true }, storageProfile: { imageReference: { - offer: "WindowsServer", publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + offer: "WindowsServer", + sku: "2019-Datacenter", version: "latest", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json - */ -async function createAVMWithApplicationProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - applicationProfile: { - galleryApplications: [ - { - configurationReference: - "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", - enableAutomaticUpgrade: false, - order: 1, - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", - tags: "myTag1", - treatFailureAsDeploymentFailure: false, - }, - { - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", - }, - ], - }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1946,128 +1785,48 @@ async function createAVMWithApplicationProfile() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "{image_offer}", - publisher: "{image_publisher}", - sku: "{image_sku}", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json */ -async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, +async function createAVMWithHibernationEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "eastus2euap", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + additionalCapabilities: { hibernationEnabled: true }, storageProfile: { - dataDisks: [ - { - caching: "ReadWrite", - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - { - caching: "ReadWrite", - createOption: "Attach", - diskSizeGB: 1023, - lun: 1, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", - storageAccountType: "Standard_LRS", - }, - }, - ], imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", createOption: "FromImage", - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json - */ -async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2077,60 +1836,47 @@ async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - securityProfile: { encryptionAtHost: true }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json */ -async function createAVMWithScheduledEventsProfile() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVmWithManagedBootDiagnostics() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2140,183 +1886,211 @@ async function createAVMWithScheduledEventsProfile() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - scheduledEventsProfile: { - osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, - terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT10M" }, - }, + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json + */ +async function createAVMWithNetworkInterfaceConfiguration() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json - */ -async function createAVMWithAMarketplaceImagePlan() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { - networkInterfaces: [ + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + name: "{nic-config-name}", + tags: { nicTag: "tag" }, primary: true, + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + tags: { pipTag: "tag" }, + sku: { name: "Basic", tier: "Global" }, + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + }, + }, + ], }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json + */ +async function createAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json - */ -async function createAVMWithAnExtensionsTimeBudget() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - extensionsTimeBudget: "PT30M", - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { - networkInterfaces: [ + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + name: "{nic-config-name}", primary: true, + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + sku: { name: "Basic", tier: "Global" }, + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + dnsSettings: { domainNameLabel: "aaaaa", domainNameLabelScope: "TenantReuse" }, + }, + }, + ], }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json + */ +async function createAVmWithPasswordAuthentication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPlacement.json */ -async function createAVMWithBootDiagnostics() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVMWithAutomaticZonePlacement() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus2", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", }, }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2325,126 +2099,90 @@ async function createAVMWithBootDiagnostics() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + placement: { zonePlacementPolicy: "Any", includeZones: ["1", "3"] }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + */ +async function createAVmWithPremiumStorage() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json - */ -async function createAVMWithDataDisksUsingCopyAndRestoreOptions() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, - location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - dataDisks: [ - { - createOption: "Copy", - diskSizeGB: 1023, - lun: 0, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}", - }, - }, - { - createOption: "Copy", - diskSizeGB: 1023, - lun: 1, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}", - }, - }, + networkProfile: { + networkInterfaces: [ { - createOption: "Restore", - diskSizeGB: 1023, - lun: 2, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}", - }, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json */ -async function createAVMWithEmptyDataDisks() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, +async function createAVMWithProxyAgentSettingsOfEnabledAndMode() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + proxyAgentSettings: { enabled: true, wireServer: { mode: "Audit" }, imds: { mode: "Audit" } }, + }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2453,53 +2191,45 @@ async function createAVMWithEmptyDataDisks() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + */ +async function createAVmWithScheduledEventsProfile() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json - */ -async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2509,54 +2239,63 @@ async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacement ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + scheduledEventsProfile: { + terminateNotificationProfile: { notBeforeTimeout: "PT10M", enable: true }, + osImageNotificationProfile: { notBeforeTimeout: "PT15M", enable: true }, + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json */ -async function createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + storageProfile: { + imageReference: { + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, + }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2565,55 +2304,105 @@ async function createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementP }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { + securityEncryptionType: "DiskWithVMGuestState", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + }, createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json */ -async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_DC2es_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + storageProfile: { + imageReference: { + sku: "linux-cvm", + publisher: "UbuntuServer", + version: "17763.2183.2109130127", + offer: "2022-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "NonPersistedTPM" }, + }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2622,55 +2411,53 @@ async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacem }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json + */ +async function createAVmWithSshAuthentication() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", + sku: "{image_sku}", + publisher: "{image_publisher}", version: "latest", + offer: "{image_offer}", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json - */ -async function createAVMWithEphemeralOSDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + }, + }, networkProfile: { networkInterfaces: [ { @@ -2679,56 +2466,46 @@ async function createAVMWithEphemeralOSDisk() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json + */ +async function createAVMWithUefiSettingsOfSecureBootAndVTPM() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", + sku: "windows10-tvm", + publisher: "MicrosoftWindowsServer", + version: "18363.592.2001092016", + offer: "windowsserver-gen2preview-preview", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, createOption: "FromImage", - diffDiskSettings: { option: "Local" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json - */ -async function createAVMWithManagedBootDiagnostics() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - diagnosticsProfile: { bootDiagnostics: { enabled: true } }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2737,49 +2514,37 @@ async function createAVMWithManagedBootDiagnostics() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + */ +async function createAVMWithUserData() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json - */ -async function createAVMWithPasswordAuthentication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2789,99 +2554,51 @@ async function createAVMWithPasswordAuthentication() { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json */ -async function createAVMWithPremiumStorage() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVMWithVMSizeProperties() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + hardwareProfile: { + vmSize: "Standard_D4_v3", + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json - */ -async function createAVMWithSshAuthentication() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2893,62 +2610,61 @@ async function createAVMWithSshAuthentication() { osProfile: { adminUsername: "{your-username}", computerName: "myVM", - linuxConfiguration: { - disablePasswordAuthentication: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, + adminPassword: "{your-password}", + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, + userData: "U29tZSBDdXN0b20gRGF0YQ==", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithZoneMovementEnabled.json + */ +async function createAVmWithResiliencyProfileAndZoneMovementEnabled() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "{image_offer}", - publisher: "{image_publisher}", - sku: "{image_sku}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_ZRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, + dataDisks: [ + { + diskSizeGB: 128, + lun: 0, + createOption: "Empty", + managedDisk: { storageAccountType: "Premium_ZRS" }, + name: "myVMdatadisk1", + caching: "ReadWrite", + }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json - */ -async function createOrUpdateAVMWithCapacityReservation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { - capacityReservation: { - capacityReservationGroup: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", - }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2957,93 +2673,65 @@ async function createOrUpdateAVMWithCapacityReservation() { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + resiliencyProfile: { zoneMovement: { isEnabled: true } }, + }); console.log(result); } async function main() { - await createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault(); - await createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); - await createALinuxVMWithAPatchSettingPatchModeOfImageDefault(); - await createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createACustomImageVmFromAnUnmanagedGeneralizedOsImage(); await createAVMFromACommunityGalleryImage(); + await createAVmFromACustomImage(); + await createAVmFromAGeneralizedSharedImage(); await createAVMFromASharedGalleryImage(); + await createAVmFromASpecializedSharedImage(); + await createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(); + await createAVmInAnAvailabilitySet(); + await createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); + await createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault(); + await createALinuxVmWithAPatchSettingPatchModeOfImageDefault(); + await createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createAPlatformImageVmWithUnmanagedOsAndDataDisks(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); + await createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(); + await createAWindowsVmWithAPatchSettingPatchModeOfManual(); + await createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createAVmWithEphemeralOsDisk(); + await createAVmWithEphemeralOsDiskAndEnableFullCachingSetToTrue(); + await createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty(); + await createAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(); + await createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty(); + await createAVmWithAMarketplaceImagePlan(); + await createAVmWithApplicationProfile(); + await createAVmWithBootDiagnostics(); + await createOrUpdateAVMWithCapacityReservation(); + await createAVmWithDataDisksUsingCopyAndRestoreOptions(); await createAVMWithDiskControllerType(); + await createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk(); + await createAVmWithEmptyDataDisks(); + await createAVmWithHostEncryptionUsingEncryptionAtHostProperty(); + await createAVMWithEncryptionIdentity(); + await createAVmWithAnExtensionsTimeBudget(); await createAVMWithFips1403Enabled(); await createAVMWithHibernationEnabled(); + await createAVmWithManagedBootDiagnostics(); + await createAVMWithNetworkInterfaceConfiguration(); + await createAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings(); + await createAVmWithPasswordAuthentication(); + await createAVMWithAutomaticZonePlacement(); + await createAVmWithPremiumStorage(); await createAVMWithProxyAgentSettingsOfEnabledAndMode(); - await createAVMWithUefiSettingsOfSecureBootAndVTpm(); + await createAVmWithScheduledEventsProfile(); + await createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(); + await createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(); + await createAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType(); + await createAVmWithSshAuthentication(); + await createAVMWithUefiSettingsOfSecureBootAndVTPM(); await createAVMWithUserData(); await createAVMWithVMSizeProperties(); - await createAVMWithAutomaticZonePlacement(); - await createAVMWithEncryptionIdentity(); - await createAVMWithNetworkInterfaceConfiguration(); - await createAVMWithNetworkInterfaceConfigurationWithPublicIPAddressDnsSettings(); - await createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(); - await createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurityEncryptionType(); - await createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(); - await createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(); - await createAWindowsVMWithAPatchSettingPatchModeOfManual(); - await createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); - await createACustomImageVMFromAnUnmanagedGeneralizedOSImage(); - await createAPlatformImageVMWithUnmanagedOSAndDataDisks(); - await createAVMFromACustomImage(); - await createAVMFromAGeneralizedSharedImage(); - await createAVMFromASpecializedSharedImage(); - await createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(); - await createAVMInAnAvailabilitySet(); - await createAVMWithApplicationProfile(); - await createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk(); - await createAVMWithHostEncryptionUsingEncryptionAtHostProperty(); - await createAVMWithScheduledEventsProfile(); - await createAVMWithAMarketplaceImagePlan(); - await createAVMWithAnExtensionsTimeBudget(); - await createAVMWithBootDiagnostics(); - await createAVMWithDataDisksUsingCopyAndRestoreOptions(); - await createAVMWithEmptyDataDisks(); - await createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDisk(); - await createAVMWithManagedBootDiagnostics(); - await createAVMWithPasswordAuthentication(); - await createAVMWithPremiumStorage(); - await createAVMWithSshAuthentication(); - await createOrUpdateAVMWithCapacityReservation(); + await createAVmWithResiliencyProfileAndZoneMovementEnabled(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeallocateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeallocateSample.js new file mode 100644 index 000000000000..144d1c39f3c7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeallocateSample.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineDeallocateMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_WithForceDeallocate.json + */ +async function virtualMachineDeallocateWithForceDeallocate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa", { + forceDeallocate: true, + }); +} + +/** + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_WithHibernation.json + */ +async function virtualMachineDeallocateWithHibernation() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa", { hibernate: true }); +} + +async function main() { + await virtualMachineDeallocateMinimumSetGen(); + await virtualMachineDeallocateWithForceDeallocate(); + await virtualMachineDeallocateWithHibernation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeleteSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeleteSample.js new file mode 100644 index 000000000000..d395a15e2ac7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to delete a virtual machine. + * + * @summary the operation to delete a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Delete_Force.json + */ +async function forceDeleteAVM() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.delete("myResourceGroup", "myVM", { forceDeletion: true }); +} + +async function main() { + await forceDeleteAVM(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGeneralizeSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGeneralizeSample.js similarity index 67% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGeneralizeSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGeneralizeSample.js index f8e107057d1c..e2642d23cbdc 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesGeneralizeSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGeneralizeSample.js @@ -3,22 +3,18 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * This sample demonstrates how to sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). * - * @summary Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json + * @summary sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Generalize.json */ async function generalizeAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.generalize(resourceGroupName, vmName); - console.log(result); + await client.virtualMachines.generalize("myResourceGroup", "myVMName"); } async function main() { diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGetSample.js new file mode 100644 index 000000000000..ee658963e4d1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesGetSample.js @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get.json + */ +async function getAVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM", { + expand: "userData", + }); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + */ +async function getAVirtualMachineWithDiskControllerTypeProperties() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM", { + expand: "userData", + }); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + */ +async function getAVirtualMachineWithVMSizeProperties() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM"); + console.log(result); +} + +async function main() { + await getAVirtualMachine(); + await getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); + await getAVirtualMachineWithDiskControllerTypeProperties(); + await getAVirtualMachineWithVMSizeProperties(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstallPatchesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstallPatchesSample.js similarity index 54% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstallPatchesSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstallPatchesSample.js index 27a7c17eedd5..d29e35a16500 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesInstallPatchesSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstallPatchesSample.js @@ -3,35 +3,27 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Installs patches on the VM. + * This sample demonstrates how to installs patches on the VM. * - * @summary Installs patches on the VM. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json + * @summary installs patches on the VM. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_InstallPatches.json */ async function installPatchStateOfAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const vmName = "myVMName"; - const installPatchesInput = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.installPatches("myResourceGroupName", "myVMName", { maximumDuration: "PT4H", rebootSetting: "IfRequired", windowsParameters: { classificationsToInclude: ["Critical", "Security"], maxPatchPublishDate: new Date("2020-11-19T02:36:43.0539904+00:00"), - patchNameMasksToExclude: ["*Windows*"], patchNameMasksToInclude: ["*SQL*"], + patchNameMasksToExclude: ["*Windows*"], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginInstallPatchesAndWait( - resourceGroupName, - vmName, - installPatchesInput, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstanceViewSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstanceViewSample.js new file mode 100644 index 000000000000..23c39a431c8e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesInstanceViewSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieves information about the run-time state of a virtual machine. + * + * @summary retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceView.json + */ +async function getVirtualMachineInstanceView() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView("myResourceGroup", "myVM"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the run-time state of a virtual machine. + * + * @summary retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView("myResourceGroup", "myVM"); + console.log(result); +} + +async function main() { + await getVirtualMachineInstanceView(); + await getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAllSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAllSample.js similarity index 58% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAllSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAllSample.js index 7858e2065d80..569539dc791e 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAllSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAllSample.js @@ -3,42 +3,43 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json + * @summary lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json */ async function virtualMachineListAllMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const statusOnly = "aaaaaa"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const options = { statusOnly, filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.listAll(options)) { + for await (const item of client.virtualMachines.listAll({ + statusOnly: "aaaaaa", + filter: "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json + * @summary lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json */ async function virtualMachineListAllMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachines.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAvailableSizesSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAvailableSizesSample.js similarity index 59% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAvailableSizesSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAvailableSizesSample.js index 8eda445456fc..f842362670c2 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListAvailableSizesSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListAvailableSizesSample.js @@ -3,24 +3,25 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * This sample demonstrates how to lists all available virtual machine sizes to which the specified virtual machine can be resized. * - * @summary Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json + * @summary lists all available virtual machine sizes to which the specified virtual machine can be resized. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json */ async function listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVmName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.listAvailableSizes(resourceGroupName, vmName)) { + for await (const item of client.virtualMachines.listAvailableSizes( + "myResourceGroup", + "myVmName", + )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListByLocationSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListByLocationSample.js similarity index 63% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListByLocationSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListByLocationSample.js index 65c7ffb16e3e..7ce157a288f0 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListByLocationSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListByLocationSample.js @@ -3,23 +3,22 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Gets all the virtual machines under the specified subscription for the specified location. + * This sample demonstrates how to gets all the virtual machines under the specified subscription for the specified location. * - * @summary Gets all the virtual machines under the specified subscription for the specified location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json + * @summary gets all the virtual machines under the specified subscription for the specified location. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json */ async function listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const location = "eastus"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.listByLocation(location)) { + for await (const item of client.virtualMachines.listByLocation("eastus")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListSample.js similarity index 52% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListSample.js index ccbf7779c0a9..598f8834ead8 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesListSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesListSample.js @@ -3,43 +3,42 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json + * @summary lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json */ async function virtualMachineListMaximumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaa"; - const options = { filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.list(resourceGroupName, options)) { + for await (const item of client.virtualMachines.list("rgcompute", { + filter: "aaaaaaaaaaaaaaaaaaaaaaa", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json + * @summary lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json */ async function virtualMachineListMinimumSetGen() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.list(resourceGroupName)) { + for await (const item of client.virtualMachines.list("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesMigrateToVMScaleSetSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesMigrateToVMScaleSetSample.js new file mode 100644 index 000000000000..15af49e3fb06 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesMigrateToVMScaleSetSample.js @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. + * + * @summary migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json + */ +async function migrateAVirtualMachineToFlexibleVirtualMachineScaleSer() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.migrateToVMScaleSet("myResourceGroup", "myVMName", { + parameters: { targetFaultDomain: 0, targetVMSize: "Standard_D1_v2" }, + }); +} + +async function main() { + await migrateAVirtualMachineToFlexibleVirtualMachineScaleSer(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPerformMaintenanceSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPerformMaintenanceSample.js new file mode 100644 index 000000000000..45992d2f2ec5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPerformMaintenanceSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to perform maintenance on a virtual machine. + * + * @summary the operation to perform maintenance on a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachinePerformMaintenanceMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.performMaintenance("rgcompute", "aaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to perform maintenance on a virtual machine. + * + * @summary the operation to perform maintenance on a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachinePerformMaintenanceMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.performMaintenance("rgcompute", "aaaaaaaaaa"); +} + +async function main() { + await virtualMachinePerformMaintenanceMaximumSetGen(); + await virtualMachinePerformMaintenanceMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPowerOffSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPowerOffSample.js new file mode 100644 index 000000000000..4a6a0e69b0c0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesPowerOffSample.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachinePowerOffMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", { + skipShutdown: true, + }); +} + +/** + * This sample demonstrates how to the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachinePowerOffMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachinePowerOffMaximumSetGen(); + await virtualMachinePowerOffMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReapplySample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReapplySample.js new file mode 100644 index 000000000000..4a0cdfad3c33 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReapplySample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to reapply a virtual machine's state. + * + * @summary the operation to reapply a virtual machine's state. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reapply.json + */ +async function reapplyTheStateOfAVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.reapply("ResourceGroup", "VMName"); +} + +async function main() { + await reapplyTheStateOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRedeploySample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRedeploySample.js new file mode 100644 index 000000000000..2d2f30da7b94 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRedeploySample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineRedeployMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.redeploy("rgcompute", "a"); +} + +/** + * This sample demonstrates how to shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineRedeployMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.redeploy("rgcompute", "aaaaaaaaaaaaaaa"); +} + +async function main() { + await virtualMachineRedeployMaximumSetGen(); + await virtualMachineRedeployMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReimageSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReimageSample.js similarity index 62% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReimageSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReimageSample.js index 9ea79607a0f5..e5f0d5d00c8b 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesReimageSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesReimageSample.js @@ -3,62 +3,44 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * This sample demonstrates how to reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. * - * @summary Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json + * @summary reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage.json */ -async function reimageANonEphemeralVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters = { - exactVersion: "aaaaaa", - osProfile: { - adminPassword: "{your-password}", - customData: "{your-custom-data}", - }, - tempDisk: true, - }; - const options = { parameters }; +async function reimageAVirtualMachine() { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReimageAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.reimage("myResourceGroup", "myVMName", { + parameters: { tempDisk: true }, + }); } /** - * This sample demonstrates how to Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * This sample demonstrates how to reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. * - * @summary Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json + * @summary reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json */ -async function reimageAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters = { tempDisk: true }; - const options = { parameters }; +async function reimageANonEphemeralVirtualMachine() { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReimageAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.reimage("myResourceGroup", "myVMName", { + parameters: { + tempDisk: true, + exactVersion: "aaaaaa", + osProfile: { adminPassword: "{your-password}", customData: "{your-custom-data}" }, + }, + }); } async function main() { - await reimageANonEphemeralVirtualMachine(); await reimageAVirtualMachine(); + await reimageANonEphemeralVirtualMachine(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRestartSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRestartSample.js new file mode 100644 index 000000000000..3dad7f8ed5be --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRestartSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to restart a virtual machine. + * + * @summary the operation to restart a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json + */ +async function virtualMachineRestartMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.restart("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to restart a virtual machine. + * + * @summary the operation to restart a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json + */ +async function virtualMachineRestartMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.restart("rgcompute", "aaa"); +} + +async function main() { + await virtualMachineRestartMaximumSetGen(); + await virtualMachineRestartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js similarity index 50% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js index 9cb3a2e37b41..8d2877e320a5 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRetrieveBootDiagnosticsDataSample.js @@ -3,28 +3,21 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * This sample demonstrates how to the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. * - * @summary The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json + * @summary the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json */ async function retrieveBootDiagnosticsDataOfAVirtualMachine() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "ResourceGroup"; - const vmName = "VMName"; - const sasUriExpirationTimeInMinutes = 60; - const options = { - sasUriExpirationTimeInMinutes, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachines.retrieveBootDiagnosticsData( - resourceGroupName, - vmName, - options, + "ResourceGroup", + "VMName", + { sasUriExpirationTimeInMinutes: 60 }, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRunCommandSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRunCommandSample.js new file mode 100644 index 000000000000..4d5779f4f0b6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesRunCommandSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to run command on the VM. + * + * @summary run command on the VM. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand.json + */ +async function virtualMachineRunCommand() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.runCommand("crptestar98131", "vm3036", { + commandId: "RunPowerShellScript", + }); + console.log(result); +} + +async function main() { + await virtualMachineRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesSimulateEvictionSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesSimulateEvictionSample.js new file mode 100644 index 000000000000..c1d4162aa398 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesSimulateEvictionSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to simulate the eviction of spot virtual machine. + * + * @summary the operation to simulate the eviction of spot virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_SimulateEviction.json + */ +async function simulateEvictionAVirtualMachine() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.simulateEviction("ResourceGroup", "VMName"); +} + +async function main() { + await simulateEvictionAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesStartSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesStartSample.js new file mode 100644 index 000000000000..e3e4e05e8349 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesStartSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { ComputeManagementClient } = require("@azure/arm-compute"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to the operation to start a virtual machine. + * + * @summary the operation to start a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json + */ +async function virtualMachineStartMaximumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.start("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to start a virtual machine. + * + * @summary the operation to start a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json + */ +async function virtualMachineStartMinimumSetGen() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.start("rgcompute", "aaaaa"); +} + +async function main() { + await virtualMachineStartMaximumSetGen(); + await virtualMachineStartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesUpdateSample.js b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesUpdateSample.js similarity index 61% rename from sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesUpdateSample.js rename to sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesUpdateSample.js index 8475dcf1d8e9..25696f25267f 100644 --- a/sdk/compute/arm-compute/samples/v23/javascript/virtualMachinesUpdateSample.js +++ b/sdk/compute/arm-compute/samples/v24/javascript/virtualMachinesUpdateSample.js @@ -3,129 +3,104 @@ const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); /** - * This sample demonstrates how to The operation to update a virtual machine. + * This sample demonstrates how to the operation to update a virtual machine. * - * @summary The operation to update a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json + * @summary the operation to update a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json */ async function updateAVMByDetachingDataDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.update("myResourceGroup", "myVM", { hardwareProfile: { vmSize: "Standard_D2_v2" }, - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0, toBeDetached: true }, - { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - toBeDetached: false, - }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0, toBeDetached: true }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1, toBeDetached: false }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to update a virtual machine. + * This sample demonstrates how to the operation to update a virtual machine. * - * @summary The operation to update a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json + * @summary the operation to update a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json */ async function updateAVMByForceDetachingDataDisk() { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.update("myResourceGroup", "myVM", { hardwareProfile: { vmSize: "Standard_D2_v2" }, - networkProfile: { - networkInterfaces: [ + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + dataDisks: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + toBeDetached: true, + detachOption: "ForceDetach", }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1, toBeDetached: false }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - dataDisks: [ - { - createOption: "Empty", - detachOption: "ForceDetach", - diskSizeGB: 1023, - lun: 0, - toBeDetached: true, - }, + networkProfile: { + networkInterfaces: [ { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - toBeDetached: false, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/README.md b/sdk/compute/arm-compute/samples/v24/typescript/README.md similarity index 58% rename from sdk/compute/arm-compute/samples/v23/typescript/README.md rename to sdk/compute/arm-compute/samples/v24/typescript/README.md index b1befbc3c635..9c9f02d7f5ea 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/README.md +++ b/sdk/compute/arm-compute/samples/v24/typescript/README.md @@ -1,323 +1,296 @@ -# client library samples for TypeScript +# @azure/arm-compute client library samples for TypeScript -These sample programs show how to use the TypeScript client libraries for in some common scenarios. +These sample programs show how to use the TypeScript client libraries for @azure/arm-compute in some common scenarios. -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts][availabilitysetscancelmigrationtovirtualmachinescalesetsample] | Cancel the migration operation on an Availability Set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json | -| [availabilitySetsConvertToVirtualMachineScaleSetSample.ts][availabilitysetsconverttovirtualmachinescalesetsample] | Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json | -| [availabilitySetsCreateOrUpdateSample.ts][availabilitysetscreateorupdatesample] | Create or update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json | -| [availabilitySetsDeleteSample.ts][availabilitysetsdeletesample] | Delete an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json | -| [availabilitySetsGetSample.ts][availabilitysetsgetsample] | Retrieves information about an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json | -| [availabilitySetsListAvailableSizesSample.ts][availabilitysetslistavailablesizessample] | Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json | -| [availabilitySetsListBySubscriptionSample.ts][availabilitysetslistbysubscriptionsample] | Lists all availability sets in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json | -| [availabilitySetsListSample.ts][availabilitysetslistsample] | Lists all availability sets in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json | -| [availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts][availabilitysetsstartmigrationtovirtualmachinescalesetsample] | Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json | -| [availabilitySetsUpdateSample.ts][availabilitysetsupdatesample] | Update an availability set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json | -| [availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts][availabilitysetsvalidatemigrationtovirtualmachinescalesetsample] | Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json | -| [capacityReservationGroupsCreateOrUpdateSample.ts][capacityreservationgroupscreateorupdatesample] | The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json | -| [capacityReservationGroupsDeleteSample.ts][capacityreservationgroupsdeletesample] | The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json | -| [capacityReservationGroupsGetSample.ts][capacityreservationgroupsgetsample] | The operation that retrieves information about a capacity reservation group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservationGroup_Get.json | -| [capacityReservationGroupsListByResourceGroupSample.ts][capacityreservationgroupslistbyresourcegroupsample] | Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json | -| [capacityReservationGroupsListBySubscriptionSample.ts][capacityreservationgroupslistbysubscriptionsample] | Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json | -| [capacityReservationGroupsUpdateSample.ts][capacityreservationgroupsupdatesample] | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json | -| [capacityReservationsCreateOrUpdateSample.ts][capacityreservationscreateorupdatesample] | The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json | -| [capacityReservationsDeleteSample.ts][capacityreservationsdeletesample] | The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json | -| [capacityReservationsGetSample.ts][capacityreservationsgetsample] | The operation that retrieves information about the capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_Get.json | -| [capacityReservationsListByCapacityReservationGroupSample.ts][capacityreservationslistbycapacityreservationgroupsample] | Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json | -| [capacityReservationsUpdateSample.ts][capacityreservationsupdatesample] | The operation to update a capacity reservation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json | -| [cloudServiceOperatingSystemsGetOSFamilySample.ts][cloudserviceoperatingsystemsgetosfamilysample] | Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamily_Get.json | -| [cloudServiceOperatingSystemsGetOSVersionSample.ts][cloudserviceoperatingsystemsgetosversionsample] | Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_Get.json | -| [cloudServiceOperatingSystemsListOSFamiliesSample.ts][cloudserviceoperatingsystemslistosfamiliessample] | Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamilies_List.json | -| [cloudServiceOperatingSystemsListOSVersionsSample.ts][cloudserviceoperatingsystemslistosversionssample] | Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_List.json | -| [cloudServiceRoleInstancesDeleteSample.ts][cloudserviceroleinstancesdeletesample] | Deletes a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete.json | -| [cloudServiceRoleInstancesGetInstanceViewSample.ts][cloudserviceroleinstancesgetinstanceviewsample] | Retrieves information about the run-time state of a role instance in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_InstanceView.json | -| [cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts][cloudserviceroleinstancesgetremotedesktopfilesample] | Gets a remote desktop file for a role instance in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json | -| [cloudServiceRoleInstancesGetSample.ts][cloudserviceroleinstancesgetsample] | Gets a role instance from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get.json | -| [cloudServiceRoleInstancesListSample.ts][cloudserviceroleinstanceslistsample] | Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRolesInstance_List.json | -| [cloudServiceRoleInstancesRebuildSample.ts][cloudserviceroleinstancesrebuildsample] | The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild.json | -| [cloudServiceRoleInstancesReimageSample.ts][cloudserviceroleinstancesreimagesample] | The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage.json | -| [cloudServiceRoleInstancesRestartSample.ts][cloudserviceroleinstancesrestartsample] | The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart.json | -| [cloudServiceRolesGetSample.ts][cloudservicerolesgetsample] | Gets a role from a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_Get.json | -| [cloudServiceRolesListSample.ts][cloudserviceroleslistsample] | Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_List.json | -| [cloudServicesCreateOrUpdateSample.ts][cloudservicescreateorupdatesample] | Create or update a cloud service. Please note some properties can be set only during cloud service creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole.json | -| [cloudServicesDeleteInstancesSample.ts][cloudservicesdeleteinstancessample] | Deletes role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json | -| [cloudServicesDeleteSample.ts][cloudservicesdeletesample] | Deletes a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Delete.json | -| [cloudServicesGetInstanceViewSample.ts][cloudservicesgetinstanceviewsample] | Gets the status of a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_InstanceViewWithMultiRole.json | -| [cloudServicesGetSample.ts][cloudservicesgetsample] | Display information about a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_WithMultiRoleAndRDP.json | -| [cloudServicesListAllSample.ts][cloudserviceslistallsample] | Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_BySubscription.json | -| [cloudServicesListSample.ts][cloudserviceslistsample] | Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_ByResourceGroup.json | -| [cloudServicesPowerOffSample.ts][cloudservicespoweroffsample] | Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_PowerOff.json | -| [cloudServicesRebuildSample.ts][cloudservicesrebuildsample] | Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json | -| [cloudServicesReimageSample.ts][cloudservicesreimagesample] | Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json | -| [cloudServicesRestartSample.ts][cloudservicesrestartsample] | Restarts one or more role instances in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json | -| [cloudServicesStartSample.ts][cloudservicesstartsample] | Starts the cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Start.json | -| [cloudServicesUpdateDomainGetUpdateDomainSample.ts][cloudservicesupdatedomaingetupdatedomainsample] | Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Get.json | -| [cloudServicesUpdateDomainListUpdateDomainsSample.ts][cloudservicesupdatedomainlistupdatedomainssample] | Gets a list of all update domains in a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_List.json | -| [cloudServicesUpdateDomainWalkUpdateDomainSample.ts][cloudservicesupdatedomainwalkupdatedomainsample] | Updates the role instances in the specified update domain. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Update.json | -| [cloudServicesUpdateSample.ts][cloudservicesupdatesample] | Update a cloud service. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Update_ToIncludeTags.json | -| [communityGalleriesGetSample.ts][communitygalleriesgetsample] | Get a community gallery by gallery public name. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json | -| [communityGalleryImageVersionsGetSample.ts][communitygalleryimageversionsgetsample] | Get a community gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json | -| [communityGalleryImageVersionsListSample.ts][communitygalleryimageversionslistsample] | List community gallery image versions inside an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json | -| [communityGalleryImagesGetSample.ts][communitygalleryimagesgetsample] | Get a community gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json | -| [communityGalleryImagesListSample.ts][communitygalleryimageslistsample] | List community gallery images inside a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json | -| [dedicatedHostGroupsCreateOrUpdateSample.ts][dedicatedhostgroupscreateorupdatesample] | Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json | -| [dedicatedHostGroupsDeleteSample.ts][dedicatedhostgroupsdeletesample] | Delete a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json | -| [dedicatedHostGroupsGetSample.ts][dedicatedhostgroupsgetsample] | Retrieves information about a dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json | -| [dedicatedHostGroupsListByResourceGroupSample.ts][dedicatedhostgroupslistbyresourcegroupsample] | Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json | -| [dedicatedHostGroupsListBySubscriptionSample.ts][dedicatedhostgroupslistbysubscriptionsample] | Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json | -| [dedicatedHostGroupsUpdateSample.ts][dedicatedhostgroupsupdatesample] | Update an dedicated host group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json | -| [dedicatedHostsCreateOrUpdateSample.ts][dedicatedhostscreateorupdatesample] | Create or update a dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json | -| [dedicatedHostsDeleteSample.ts][dedicatedhostsdeletesample] | Delete a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json | -| [dedicatedHostsGetSample.ts][dedicatedhostsgetsample] | Retrieves information about a dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Get.json | -| [dedicatedHostsListAvailableSizesSample.ts][dedicatedhostslistavailablesizessample] | Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json | -| [dedicatedHostsListByHostGroupSample.ts][dedicatedhostslistbyhostgroupsample] | Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json | -| [dedicatedHostsRedeploySample.ts][dedicatedhostsredeploysample] | Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json | -| [dedicatedHostsRestartSample.ts][dedicatedhostsrestartsample] | Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json | -| [dedicatedHostsUpdateSample.ts][dedicatedhostsupdatesample] | Update a dedicated host . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json | -| [diskAccessesCreateOrUpdateSample.ts][diskaccessescreateorupdatesample] | Creates or updates a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Create.json | -| [diskAccessesDeleteAPrivateEndpointConnectionSample.ts][diskaccessesdeleteaprivateendpointconnectionsample] | Deletes a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json | -| [diskAccessesDeleteSample.ts][diskaccessesdeletesample] | Deletes a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Delete.json | -| [diskAccessesGetAPrivateEndpointConnectionSample.ts][diskaccessesgetaprivateendpointconnectionsample] | Gets information about a private endpoint connection under a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json | -| [diskAccessesGetPrivateLinkResourcesSample.ts][diskaccessesgetprivatelinkresourcessample] | Gets the private link resources possible under disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json | -| [diskAccessesGetSample.ts][diskaccessesgetsample] | Gets information about a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json | -| [diskAccessesListByResourceGroupSample.ts][diskaccesseslistbyresourcegroupsample] | Lists all the disk access resources under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json | -| [diskAccessesListPrivateEndpointConnectionsSample.ts][diskaccesseslistprivateendpointconnectionssample] | List information about private endpoint connections under a disk access resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json | -| [diskAccessesListSample.ts][diskaccesseslistsample] | Lists all the disk access resources under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json | -| [diskAccessesUpdateAPrivateEndpointConnectionSample.ts][diskaccessesupdateaprivateendpointconnectionsample] | Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json | -| [diskAccessesUpdateSample.ts][diskaccessesupdatesample] | Updates (patches) a disk access resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_Update.json | -| [diskEncryptionSetsCreateOrUpdateSample.ts][diskencryptionsetscreateorupdatesample] | Creates or updates a disk encryption set x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json | -| [diskEncryptionSetsDeleteSample.ts][diskencryptionsetsdeletesample] | Deletes a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json | -| [diskEncryptionSetsGetSample.ts][diskencryptionsetsgetsample] | Gets information about a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json | -| [diskEncryptionSetsListAssociatedResourcesSample.ts][diskencryptionsetslistassociatedresourcessample] | Lists all resources that are encrypted with this disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json | -| [diskEncryptionSetsListByResourceGroupSample.ts][diskencryptionsetslistbyresourcegroupsample] | Lists all the disk encryption sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json | -| [diskEncryptionSetsListSample.ts][diskencryptionsetslistsample] | Lists all the disk encryption sets under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json | -| [diskEncryptionSetsUpdateSample.ts][diskencryptionsetsupdatesample] | Updates (patches) a disk encryption set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json | -| [diskRestorePointGetSample.ts][diskrestorepointgetsample] | Get disk restorePoint resource x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json | -| [diskRestorePointGrantAccessSample.ts][diskrestorepointgrantaccesssample] | Grants access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json | -| [diskRestorePointListByRestorePointSample.ts][diskrestorepointlistbyrestorepointsample] | Lists diskRestorePoints under a vmRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json | -| [diskRestorePointRevokeAccessSample.ts][diskrestorepointrevokeaccesssample] | Revokes access to a diskRestorePoint. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json | -| [disksCreateOrUpdateSample.ts][diskscreateorupdatesample] | Creates or updates a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json | -| [disksDeleteSample.ts][disksdeletesample] | Deletes a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Delete.json | -| [disksGetSample.ts][disksgetsample] | Gets information about a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_Get.json | -| [disksGrantAccessSample.ts][disksgrantaccesssample] | Grants access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_BeginGetAccess.json | -| [disksListByResourceGroupSample.ts][diskslistbyresourcegroupsample] | Lists all the disks under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListByResourceGroup.json | -| [disksListSample.ts][diskslistsample] | Lists all the disks under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListBySubscription.json | -| [disksRevokeAccessSample.ts][disksrevokeaccesssample] | Revokes access to a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_EndGetAccess.json | -| [disksUpdateSample.ts][disksupdatesample] | Updates (patches) a disk. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json | -| [galleriesCreateOrUpdateSample.ts][galleriescreateorupdatesample] | Create or update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Create.json | -| [galleriesDeleteSample.ts][galleriesdeletesample] | Delete a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Delete.json | -| [galleriesGetSample.ts][galleriesgetsample] | Retrieves information about a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/CommunityGallery_Get.json | -| [galleriesListByResourceGroupSample.ts][gallerieslistbyresourcegroupsample] | List galleries under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json | -| [galleriesListSample.ts][gallerieslistsample] | List galleries under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListBySubscription.json | -| [galleriesUpdateSample.ts][galleriesupdatesample] | Update a Shared Image Gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_Update.json | -| [galleryApplicationVersionsCreateOrUpdateSample.ts][galleryapplicationversionscreateorupdatesample] | Create or update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json | -| [galleryApplicationVersionsDeleteSample.ts][galleryapplicationversionsdeletesample] | Delete a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json | -| [galleryApplicationVersionsGetSample.ts][galleryapplicationversionsgetsample] | Retrieves information about a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json | -| [galleryApplicationVersionsListByGalleryApplicationSample.ts][galleryapplicationversionslistbygalleryapplicationsample] | List gallery Application Versions in a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json | -| [galleryApplicationVersionsUpdateSample.ts][galleryapplicationversionsupdatesample] | Update a gallery Application Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json | -| [galleryApplicationsCreateOrUpdateSample.ts][galleryapplicationscreateorupdatesample] | Create or update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Create.json | -| [galleryApplicationsDeleteSample.ts][galleryapplicationsdeletesample] | Delete a gallery Application. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Delete.json | -| [galleryApplicationsGetSample.ts][galleryapplicationsgetsample] | Retrieves information about a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Get.json | -| [galleryApplicationsListByGallerySample.ts][galleryapplicationslistbygallerysample] | List gallery Application Definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json | -| [galleryApplicationsUpdateSample.ts][galleryapplicationsupdatesample] | Update a gallery Application Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_Update.json | -| [galleryImageVersionsCreateOrUpdateSample.ts][galleryimageversionscreateorupdatesample] | Create or update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json | -| [galleryImageVersionsDeleteSample.ts][galleryimageversionsdeletesample] | Delete a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json | -| [galleryImageVersionsGetSample.ts][galleryimageversionsgetsample] | Retrieves information about a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json | -| [galleryImageVersionsListByGalleryImageSample.ts][galleryimageversionslistbygalleryimagesample] | List gallery image versions in a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json | -| [galleryImageVersionsUpdateSample.ts][galleryimageversionsupdatesample] | Update a gallery image version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json | -| [galleryImagesCreateOrUpdateSample.ts][galleryimagescreateorupdatesample] | Create or update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Create.json | -| [galleryImagesDeleteSample.ts][galleryimagesdeletesample] | Delete a gallery image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Delete.json | -| [galleryImagesGetSample.ts][galleryimagesgetsample] | Retrieves information about a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_Get.json | -| [galleryImagesListByGallerySample.ts][galleryimageslistbygallerysample] | List gallery image definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json | -| [galleryImagesUpdateSample.ts][galleryimagesupdatesample] | Update a gallery image definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImage_UpdateFeatures.json | -| [galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts][galleryinvmaccesscontrolprofileversionscreateorupdatesample] | Create or update a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json | -| [galleryInVMAccessControlProfileVersionsDeleteSample.ts][galleryinvmaccesscontrolprofileversionsdeletesample] | Delete a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json | -| [galleryInVMAccessControlProfileVersionsGetSample.ts][galleryinvmaccesscontrolprofileversionsgetsample] | Retrieves information about a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json | -| [galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts][galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample] | List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json | -| [galleryInVMAccessControlProfileVersionsUpdateSample.ts][galleryinvmaccesscontrolprofileversionsupdatesample] | Update a gallery inVMAccessControlProfile version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json | -| [galleryInVMAccessControlProfilesCreateOrUpdateSample.ts][galleryinvmaccesscontrolprofilescreateorupdatesample] | Create or update a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json | -| [galleryInVMAccessControlProfilesDeleteSample.ts][galleryinvmaccesscontrolprofilesdeletesample] | Delete a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json | -| [galleryInVMAccessControlProfilesGetSample.ts][galleryinvmaccesscontrolprofilesgetsample] | Retrieves information about a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json | -| [galleryInVMAccessControlProfilesListByGallerySample.ts][galleryinvmaccesscontrolprofileslistbygallerysample] | List gallery inVMAccessControlProfiles in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json | -| [galleryInVMAccessControlProfilesUpdateSample.ts][galleryinvmaccesscontrolprofilesupdatesample] | Update a gallery inVMAccessControlProfile. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json | -| [galleryScriptVersionsCreateOrUpdateSample.ts][galleryscriptversionscreateorupdatesample] | Create or update a gallery Script Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Create.json | -| [galleryScriptVersionsDeleteSample.ts][galleryscriptversionsdeletesample] | Delete a gallery Script Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Delete.json | -| [galleryScriptVersionsGetSample.ts][galleryscriptversionsgetsample] | Custom ArmResourceRead operation template with CloudError as Error x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json | -| [galleryScriptVersionsListByGalleryScriptSample.ts][galleryscriptversionslistbygalleryscriptsample] | List gallery Script Versions in a gallery Script Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json | -| [galleryScriptVersionsUpdateSample.ts][galleryscriptversionsupdatesample] | Update a gallery Script Version. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Update.json | -| [galleryScriptsCreateOrUpdateSample.ts][galleryscriptscreateorupdatesample] | Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Create.json | -| [galleryScriptsDeleteSample.ts][galleryscriptsdeletesample] | Delete a gallery Script Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Delete.json | -| [galleryScriptsGetSample.ts][galleryscriptsgetsample] | Retrieves information about a gallery script definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Get.json | -| [galleryScriptsListByGallerySample.ts][galleryscriptslistbygallerysample] | List gallery Script Definitions in a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_ListByGallery.json | -| [galleryScriptsUpdateSample.ts][galleryscriptsupdatesample] | Update a gallery Script Definition. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_Update.json | -| [gallerySharingProfileUpdateSample.ts][gallerysharingprofileupdatesample] | Update sharing profile of a gallery. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json | -| [imagesCreateOrUpdateSample.ts][imagescreateorupdatesample] | Create or update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json | -| [imagesDeleteSample.ts][imagesdeletesample] | Deletes an Image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json | -| [imagesGetSample.ts][imagesgetsample] | Gets an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Get.json | -| [imagesListByResourceGroupSample.ts][imageslistbyresourcegroupsample] | Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListByResourceGroup.json | -| [imagesListSample.ts][imageslistsample] | Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListBySubscription.json | -| [imagesUpdateSample.ts][imagesupdatesample] | Update an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Update.json | -| [logAnalyticsExportRequestRateByIntervalSample.ts][loganalyticsexportrequestratebyintervalsample] | Export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json | -| [logAnalyticsExportThrottledRequestsSample.ts][loganalyticsexportthrottledrequestssample] | Export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json | -| [proximityPlacementGroupsCreateOrUpdateSample.ts][proximityplacementgroupscreateorupdatesample] | Create or update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json | -| [proximityPlacementGroupsDeleteSample.ts][proximityplacementgroupsdeletesample] | Delete a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json | -| [proximityPlacementGroupsGetSample.ts][proximityplacementgroupsgetsample] | Retrieves information about a proximity placement group . x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json | -| [proximityPlacementGroupsListByResourceGroupSample.ts][proximityplacementgroupslistbyresourcegroupsample] | Lists all proximity placement groups in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json | -| [proximityPlacementGroupsListBySubscriptionSample.ts][proximityplacementgroupslistbysubscriptionsample] | Lists all proximity placement groups in a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json | -| [proximityPlacementGroupsUpdateSample.ts][proximityplacementgroupsupdatesample] | Update a proximity placement group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json | -| [resourceSkusListSample.ts][resourceskuslistsample] | Gets the list of Microsoft.Compute SKUs available for your Subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json | -| [restorePointCollectionsCreateOrUpdateSample.ts][restorepointcollectionscreateorupdatesample] | The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json | -| [restorePointCollectionsDeleteSample.ts][restorepointcollectionsdeletesample] | The operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json | -| [restorePointCollectionsGetSample.ts][restorepointcollectionsgetsample] | The operation to get the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Get.json | -| [restorePointCollectionsListAllSample.ts][restorepointcollectionslistallsample] | Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json | -| [restorePointCollectionsListSample.ts][restorepointcollectionslistsample] | Gets the list of restore point collections in a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json | -| [restorePointCollectionsUpdateSample.ts][restorepointcollectionsupdatesample] | The operation to update the restore point collection. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json | -| [restorePointsCreateSample.ts][restorepointscreatesample] | The operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json | -| [restorePointsDeleteSample.ts][restorepointsdeletesample] | The operation to delete the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json | -| [restorePointsGetSample.ts][restorepointsgetsample] | The operation to get the restore point. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePoint_Get.json | -| [sharedGalleriesGetSample.ts][sharedgalleriesgetsample] | Get a shared gallery by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json | -| [sharedGalleriesListSample.ts][sharedgallerieslistsample] | List shared galleries by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_List.json | -| [sharedGalleryImageVersionsGetSample.ts][sharedgalleryimageversionsgetsample] | Get a shared gallery image version by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json | -| [sharedGalleryImageVersionsListSample.ts][sharedgalleryimageversionslistsample] | List shared gallery image versions by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json | -| [sharedGalleryImagesGetSample.ts][sharedgalleryimagesgetsample] | Get a shared gallery image by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json | -| [sharedGalleryImagesListSample.ts][sharedgalleryimageslistsample] | List shared gallery images by subscription id or tenant id. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json | -| [snapshotsCreateOrUpdateSample.ts][snapshotscreateorupdatesample] | Creates or updates a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json | -| [snapshotsDeleteSample.ts][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Delete.json | -| [snapshotsGetSample.ts][snapshotsgetsample] | Gets information about a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Get.json | -| [snapshotsGrantAccessSample.ts][snapshotsgrantaccesssample] | Grants access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json | -| [snapshotsListByResourceGroupSample.ts][snapshotslistbyresourcegroupsample] | Lists snapshots under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json | -| [snapshotsListSample.ts][snapshotslistsample] | Lists snapshots under a subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListBySubscription.json | -| [snapshotsRevokeAccessSample.ts][snapshotsrevokeaccesssample] | Revokes access to a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_EndGetAccess.json | -| [snapshotsUpdateSample.ts][snapshotsupdatesample] | Updates (patches) a snapshot. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json | -| [softDeletedResourceListByArtifactNameSample.ts][softdeletedresourcelistbyartifactnamesample] | List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json | -| [sshPublicKeysCreateSample.ts][sshpublickeyscreatesample] | Creates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json | -| [sshPublicKeysDeleteSample.ts][sshpublickeysdeletesample] | Delete an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json | -| [sshPublicKeysGenerateKeyPairSample.ts][sshpublickeysgeneratekeypairsample] | Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json | -| [sshPublicKeysGetSample.ts][sshpublickeysgetsample] | Retrieves information about an SSH public key. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json | -| [sshPublicKeysListByResourceGroupSample.ts][sshpublickeyslistbyresourcegroupsample] | Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json | -| [sshPublicKeysListBySubscriptionSample.ts][sshpublickeyslistbysubscriptionsample] | Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json | -| [sshPublicKeysUpdateSample.ts][sshpublickeysupdatesample] | Updates a new SSH public key resource. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json | -| [usageListSample.ts][usagelistsample] | Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json | -| [virtualMachineExtensionImagesGetSample.ts][virtualmachineextensionimagesgetsample] | Gets a virtual machine extension image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json | -| [virtualMachineExtensionImagesListTypesSample.ts][virtualmachineextensionimageslisttypessample] | Gets a list of virtual machine extension image types. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json | -| [virtualMachineExtensionImagesListVersionsSample.ts][virtualmachineextensionimageslistversionssample] | Gets a list of virtual machine extension image versions. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json | -| [virtualMachineExtensionsCreateOrUpdateSample.ts][virtualmachineextensionscreateorupdatesample] | The operation to create or update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineExtensionsDeleteSample.ts][virtualmachineextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json | -| [virtualMachineExtensionsGetSample.ts][virtualmachineextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json | -| [virtualMachineExtensionsListSample.ts][virtualmachineextensionslistsample] | The operation to get all extensions of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json | -| [virtualMachineExtensionsUpdateSample.ts][virtualmachineextensionsupdatesample] | The operation to update the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json | -| [virtualMachineImagesEdgeZoneGetSample.ts][virtualmachineimagesedgezonegetsample] | Gets a virtual machine image in an edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListOffersSample.ts][virtualmachineimagesedgezonelistofferssample] | Gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListPublishersSample.ts][virtualmachineimagesedgezonelistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListSample.ts][virtualmachineimagesedgezonelistsample] | Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | -| [virtualMachineImagesEdgeZoneListSkusSample.ts][virtualmachineimagesedgezonelistskussample] | Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | -| [virtualMachineImagesGetSample.ts][virtualmachineimagesgetsample] | Gets a virtual machine image. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json | -| [virtualMachineImagesListByEdgeZoneSample.ts][virtualmachineimageslistbyedgezonesample] | Gets a list of all virtual machine image versions for the specified edge zone x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json | -| [virtualMachineImagesListOffersSample.ts][virtualmachineimageslistofferssample] | Gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json | -| [virtualMachineImagesListPublishersSample.ts][virtualmachineimageslistpublisherssample] | Gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json | -| [virtualMachineImagesListSample.ts][virtualmachineimageslistsample] | Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json | -| [virtualMachineImagesListSkusSample.ts][virtualmachineimageslistskussample] | Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json | -| [virtualMachineImagesListWithPropertiesSample.ts][virtualmachineimageslistwithpropertiessample] | x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json | -| [virtualMachineRunCommandsCreateOrUpdateSample.ts][virtualmachineruncommandscreateorupdatesample] | The operation to create or update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json | -| [virtualMachineRunCommandsDeleteSample.ts][virtualmachineruncommandsdeletesample] | The operation to delete the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json | -| [virtualMachineRunCommandsGetByVirtualMachineSample.ts][virtualmachineruncommandsgetbyvirtualmachinesample] | The operation to get the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json | -| [virtualMachineRunCommandsGetSample.ts][virtualmachineruncommandsgetsample] | Gets specific run command for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_Get.json | -| [virtualMachineRunCommandsListByVirtualMachineSample.ts][virtualmachineruncommandslistbyvirtualmachinesample] | The operation to get all run commands of a Virtual Machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json | -| [virtualMachineRunCommandsListSample.ts][virtualmachineruncommandslistsample] | Lists all available run commands for a subscription in a location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_List.json | -| [virtualMachineRunCommandsUpdateSample.ts][virtualmachineruncommandsupdatesample] | The operation to update the run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json | -| [virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts][virtualmachinescalesetextensionscreateorupdatesample] | The operation to create or update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsDeleteSample.ts][virtualmachinescalesetextensionsdeletesample] | The operation to delete the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsGetSample.ts][virtualmachinescalesetextensionsgetsample] | The operation to get the extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsListSample.ts][virtualmachinescalesetextensionslistsample] | Gets a list of all extensions in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json | -| [virtualMachineScaleSetExtensionsUpdateSample.ts][virtualmachinescalesetextensionsupdatesample] | The operation to update an extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json | -| [virtualMachineScaleSetRollingUpgradesCancelSample.ts][virtualmachinescalesetrollingupgradescancelsample] | Cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json | -| [virtualMachineScaleSetRollingUpgradesGetLatestSample.ts][virtualmachinescalesetrollingupgradesgetlatestsample] | Gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json | -| [virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts][virtualmachinescalesetrollingupgradesstartextensionupgradesample] | Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json | -| [virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts][virtualmachinescalesetrollingupgradesstartosupgradesample] | Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts][virtualmachinescalesetvmextensionscreateorupdatesample] | The operation to create or update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json | -| [virtualMachineScaleSetVMExtensionsDeleteSample.ts][virtualmachinescalesetvmextensionsdeletesample] | The operation to delete the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json | -| [virtualMachineScaleSetVMExtensionsGetSample.ts][virtualmachinescalesetvmextensionsgetsample] | The operation to get the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json | -| [virtualMachineScaleSetVMExtensionsListSample.ts][virtualmachinescalesetvmextensionslistsample] | The operation to get all extensions of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json | -| [virtualMachineScaleSetVMExtensionsUpdateSample.ts][virtualmachinescalesetvmextensionsupdatesample] | The operation to update the VMSS VM extension. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json | -| [virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts][virtualmachinescalesetvmruncommandscreateorupdatesample] | The operation to create or update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json | -| [virtualMachineScaleSetVMRunCommandsDeleteSample.ts][virtualmachinescalesetvmruncommandsdeletesample] | The operation to delete the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json | -| [virtualMachineScaleSetVMRunCommandsGetSample.ts][virtualmachinescalesetvmruncommandsgetsample] | The operation to get the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json | -| [virtualMachineScaleSetVMRunCommandsListSample.ts][virtualmachinescalesetvmruncommandslistsample] | The operation to get all run commands of an instance in Virtual Machine Scaleset. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json | -| [virtualMachineScaleSetVMRunCommandsUpdateSample.ts][virtualmachinescalesetvmruncommandsupdatesample] | The operation to update the VMSS VM run command. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json | -| [virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts][virtualmachinescalesetvmsapproverollingupgradesample] | Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json | -| [virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts][virtualmachinescalesetvmsattachdetachdatadiskssample] | Attach and detach data disks to/from a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSDeallocateSample.ts][virtualmachinescalesetvmsdeallocatesample] | Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSDeleteSample.ts][virtualmachinescalesetvmsdeletesample] | Deletes a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json | -| [virtualMachineScaleSetVMSGetInstanceViewSample.ts][virtualmachinescalesetvmsgetinstanceviewsample] | Gets the status of a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json | -| [virtualMachineScaleSetVMSGetSample.ts][virtualmachinescalesetvmsgetsample] | Gets a virtual machine from a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json | -| [virtualMachineScaleSetVMSListSample.ts][virtualmachinescalesetvmslistsample] | Gets a list of all virtual machines in a VM scale sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json | -| [virtualMachineScaleSetVMSPerformMaintenanceSample.ts][virtualmachinescalesetvmsperformmaintenancesample] | Performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSPowerOffSample.ts][virtualmachinescalesetvmspoweroffsample] | Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSRedeploySample.ts][virtualmachinescalesetvmsredeploysample] | Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSReimageAllSample.ts][virtualmachinescalesetvmsreimageallsample] | Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSReimageSample.ts][virtualmachinescalesetvmsreimagesample] | Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSRestartSample.ts][virtualmachinescalesetvmsrestartsample] | Restarts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts][virtualmachinescalesetvmsretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json | -| [virtualMachineScaleSetVMSRunCommandSample.ts][virtualmachinescalesetvmsruncommandsample] | Run command on a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json | -| [virtualMachineScaleSetVMSSimulateEvictionSample.ts][virtualmachinescalesetvmssimulateevictionsample] | The operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json | -| [virtualMachineScaleSetVMSStartSample.ts][virtualmachinescalesetvmsstartsample] | Starts a virtual machine in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json | -| [virtualMachineScaleSetVMSUpdateSample.ts][virtualmachinescalesetvmsupdatesample] | Updates a virtual machine of a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json | -| [virtualMachineScaleSetsApproveRollingUpgradeSample.ts][virtualmachinescalesetsapproverollingupgradesample] | Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json | -| [virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts][virtualmachinescalesetsconverttosingleplacementgroupsample] | Converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | -| [virtualMachineScaleSetsCreateOrUpdateSample.ts][virtualmachinescalesetscreateorupdatesample] | Create or update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json | -| [virtualMachineScaleSetsDeallocateSample.ts][virtualmachinescalesetsdeallocatesample] | Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json | -| [virtualMachineScaleSetsDeleteInstancesSample.ts][virtualmachinescalesetsdeleteinstancessample] | Deletes virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json | -| [virtualMachineScaleSetsDeleteSample.ts][virtualmachinescalesetsdeletesample] | Deletes a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json | -| [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample] | Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | -| [virtualMachineScaleSetsGetInstanceViewSample.ts][virtualmachinescalesetsgetinstanceviewsample] | Gets the status of a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json | -| [virtualMachineScaleSetsGetOSUpgradeHistorySample.ts][virtualmachinescalesetsgetosupgradehistorysample] | Gets list of OS upgrades on a VM scale set instance. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json | -| [virtualMachineScaleSetsGetSample.ts][virtualmachinescalesetsgetsample] | Display information about a virtual machine scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json | -| [virtualMachineScaleSetsListAllSample.ts][virtualmachinescalesetslistallsample] | Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json | -| [virtualMachineScaleSetsListByLocationSample.ts][virtualmachinescalesetslistbylocationsample] | Gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json | -| [virtualMachineScaleSetsListSample.ts][virtualmachinescalesetslistsample] | Gets a list of all VM scale sets under a resource group. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json | -| [virtualMachineScaleSetsListSkusSample.ts][virtualmachinescalesetslistskussample] | Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json | -| [virtualMachineScaleSetsPerformMaintenanceSample.ts][virtualmachinescalesetsperformmaintenancesample] | Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json | -| [virtualMachineScaleSetsPowerOffSample.ts][virtualmachinescalesetspoweroffsample] | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json | -| [virtualMachineScaleSetsReapplySample.ts][virtualmachinescalesetsreapplysample] | Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json | -| [virtualMachineScaleSetsRedeploySample.ts][virtualmachinescalesetsredeploysample] | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json | -| [virtualMachineScaleSetsReimageAllSample.ts][virtualmachinescalesetsreimageallsample] | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json | -| [virtualMachineScaleSetsReimageSample.ts][virtualmachinescalesetsreimagesample] | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json | -| [virtualMachineScaleSetsRestartSample.ts][virtualmachinescalesetsrestartsample] | Restarts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json | -| [virtualMachineScaleSetsScaleOutSample.ts][virtualmachinescalesetsscaleoutsample] | Scales out one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json | -| [virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts][virtualmachinescalesetssetorchestrationservicestatesample] | Changes ServiceState property for a given service x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json | -| [virtualMachineScaleSetsStartSample.ts][virtualmachinescalesetsstartsample] | Starts one or more virtual machines in a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json | -| [virtualMachineScaleSetsUpdateInstancesSample.ts][virtualmachinescalesetsupdateinstancessample] | Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json | -| [virtualMachineScaleSetsUpdateSample.ts][virtualmachinescalesetsupdatesample] | Update a VM scale set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json | -| [virtualMachineSizesListSample.ts][virtualmachinesizeslistsample] | This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json | -| [virtualMachinesAssessPatchesSample.ts][virtualmachinesassesspatchessample] | Assess patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json | -| [virtualMachinesAttachDetachDataDisksSample.ts][virtualmachinesattachdetachdatadiskssample] | Attach and detach data disks to/from the virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json | -| [virtualMachinesCaptureSample.ts][virtualmachinescapturesample] | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json | -| [virtualMachinesConvertToManagedDisksSample.ts][virtualmachinesconverttomanageddiskssample] | Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json | -| [virtualMachinesCreateOrUpdateSample.ts][virtualmachinescreateorupdatesample] | The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json | -| [virtualMachinesDeallocateSample.ts][virtualmachinesdeallocatesample] | Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json | -| [virtualMachinesDeleteSample.ts][virtualmachinesdeletesample] | The operation to delete a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json | -| [virtualMachinesGeneralizeSample.ts][virtualmachinesgeneralizesample] | Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json | -| [virtualMachinesGetSample.ts][virtualmachinesgetsample] | Retrieves information about the model view or the instance view of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get.json | -| [virtualMachinesInstallPatchesSample.ts][virtualmachinesinstallpatchessample] | Installs patches on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json | -| [virtualMachinesInstanceViewSample.ts][virtualmachinesinstanceviewsample] | Retrieves information about the run-time state of a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json | -| [virtualMachinesListAllSample.ts][virtualmachineslistallsample] | Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json | -| [virtualMachinesListAvailableSizesSample.ts][virtualmachineslistavailablesizessample] | Lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json | -| [virtualMachinesListByLocationSample.ts][virtualmachineslistbylocationsample] | Gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json | -| [virtualMachinesListSample.ts][virtualmachineslistsample] | Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json | -| [virtualMachinesMigrateToVMScaleSetSample.ts][virtualmachinesmigratetovmscalesetsample] | Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json | -| [virtualMachinesPerformMaintenanceSample.ts][virtualmachinesperformmaintenancesample] | The operation to perform maintenance on a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json | -| [virtualMachinesPowerOffSample.ts][virtualmachinespoweroffsample] | The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json | -| [virtualMachinesReapplySample.ts][virtualmachinesreapplysample] | The operation to reapply a virtual machine's state. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json | -| [virtualMachinesRedeploySample.ts][virtualmachinesredeploysample] | Shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json | -| [virtualMachinesReimageSample.ts][virtualmachinesreimagesample] | Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json | -| [virtualMachinesRestartSample.ts][virtualmachinesrestartsample] | The operation to restart a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json | -| [virtualMachinesRetrieveBootDiagnosticsDataSample.ts][virtualmachinesretrievebootdiagnosticsdatasample] | The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json | -| [virtualMachinesRunCommandSample.ts][virtualmachinesruncommandsample] | Run command on the VM. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand.json | -| [virtualMachinesSimulateEvictionSample.ts][virtualmachinessimulateevictionsample] | The operation to simulate the eviction of spot virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json | -| [virtualMachinesStartSample.ts][virtualmachinesstartsample] | The operation to start a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json | -| [virtualMachinesUpdateSample.ts][virtualmachinesupdatesample] | The operation to update a virtual machine. x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json | +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts][availabilitysetscancelmigrationtovirtualmachinescalesetsample] | cancel the migration operation on an Availability Set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json | +| [availabilitySetsConvertToVirtualMachineScaleSetSample.ts][availabilitysetsconverttovirtualmachinescalesetsample] | create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json | +| [availabilitySetsCreateOrUpdateSample.ts][availabilitysetscreateorupdatesample] | create or update an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create.json | +| [availabilitySetsDeleteSample.ts][availabilitysetsdeletesample] | delete an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json | +| [availabilitySetsGetSample.ts][availabilitysetsgetsample] | retrieves information about an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json | +| [availabilitySetsListAvailableSizesSample.ts][availabilitysetslistavailablesizessample] | lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json | +| [availabilitySetsListBySubscriptionSample.ts][availabilitysetslistbysubscriptionsample] | lists all availability sets in a subscription. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListBySubscription.json | +| [availabilitySetsListSample.ts][availabilitysetslistsample] | lists all availability sets in a resource group. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json | +| [availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts][availabilitysetsstartmigrationtovirtualmachinescalesetsample] | start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json | +| [availabilitySetsUpdateSample.ts][availabilitysetsupdatesample] | update an availability set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json | +| [availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts][availabilitysetsvalidatemigrationtovirtualmachinescalesetsample] | validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json | +| [capacityReservationGroupsCreateOrUpdateSample.ts][capacityreservationgroupscreateorupdatesample] | the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json | +| [capacityReservationGroupsDeleteSample.ts][capacityreservationgroupsdeletesample] | the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json | +| [capacityReservationGroupsGetSample.ts][capacityreservationgroupsgetsample] | the operation that retrieves information about a capacity reservation group. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_Get.json | +| [capacityReservationGroupsListByResourceGroupSample.ts][capacityreservationgroupslistbyresourcegroupsample] | lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json | +| [capacityReservationGroupsListBySubscriptionSample.ts][capacityreservationgroupslistbysubscriptionsample] | lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json | +| [capacityReservationGroupsUpdateSample.ts][capacityreservationgroupsupdatesample] | the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json | +| [capacityReservationsCreateOrUpdateSample.ts][capacityreservationscreateorupdatesample] | the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json | +| [capacityReservationsDeleteSample.ts][capacityreservationsdeletesample] | the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json | +| [capacityReservationsGetSample.ts][capacityreservationsgetsample] | the operation that retrieves information about the capacity reservation. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_Get.json | +| [capacityReservationsListByCapacityReservationGroupSample.ts][capacityreservationslistbycapacityreservationgroupsample] | lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json | +| [capacityReservationsUpdateSample.ts][capacityreservationsupdatesample] | the operation to update a capacity reservation. x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json | +| [communityGalleriesGetSample.ts][communitygalleriesgetsample] | get a community gallery by gallery public name. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGallery_Get.json | +| [communityGalleryImageVersionsGetSample.ts][communitygalleryimageversionsgetsample] | get a community gallery image version. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_Get.json | +| [communityGalleryImageVersionsListSample.ts][communitygalleryimageversionslistsample] | list community gallery image versions inside an image. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_List.json | +| [communityGalleryImagesGetSample.ts][communitygalleryimagesgetsample] | get a community gallery image. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_Get.json | +| [communityGalleryImagesListSample.ts][communitygalleryimageslistsample] | list community gallery images inside a gallery. x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_List.json | +| [dedicatedHostGroupsCreateOrUpdateSample.ts][dedicatedhostgroupscreateorupdatesample] | create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json | +| [dedicatedHostGroupsDeleteSample.ts][dedicatedhostgroupsdeletesample] | delete a dedicated host group. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json | +| [dedicatedHostGroupsGetSample.ts][dedicatedhostgroupsgetsample] | retrieves information about a dedicated host group. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get.json | +| [dedicatedHostGroupsListByResourceGroupSample.ts][dedicatedhostgroupslistbyresourcegroupsample] | lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json | +| [dedicatedHostGroupsListBySubscriptionSample.ts][dedicatedhostgroupslistbysubscriptionsample] | lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json | +| [dedicatedHostGroupsUpdateSample.ts][dedicatedhostgroupsupdatesample] | update an dedicated host group. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json | +| [dedicatedHostsCreateOrUpdateSample.ts][dedicatedhostscreateorupdatesample] | create or update a dedicated host . x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json | +| [dedicatedHostsDeleteSample.ts][dedicatedhostsdeletesample] | delete a dedicated host. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json | +| [dedicatedHostsGetSample.ts][dedicatedhostsgetsample] | retrieves information about a dedicated host. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Get.json | +| [dedicatedHostsListAvailableSizesSample.ts][dedicatedhostslistavailablesizessample] | lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json | +| [dedicatedHostsListByHostGroupSample.ts][dedicatedhostslistbyhostgroupsample] | lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json | +| [dedicatedHostsRedeploySample.ts][dedicatedhostsredeploysample] | redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Redeploy.json | +| [dedicatedHostsRestartSample.ts][dedicatedhostsrestartsample] | restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Restart.json | +| [dedicatedHostsUpdateSample.ts][dedicatedhostsupdatesample] | update a dedicated host . x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json | +| [diskAccessesCreateOrUpdateSample.ts][diskaccessescreateorupdatesample] | creates or updates a disk access resource x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Create.json | +| [diskAccessesDeleteAPrivateEndpointConnectionSample.ts][diskaccessesdeleteaprivateendpointconnectionsample] | deletes a private endpoint connection under a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json | +| [diskAccessesDeleteSample.ts][diskaccessesdeletesample] | deletes a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Delete.json | +| [diskAccessesGetAPrivateEndpointConnectionSample.ts][diskaccessesgetaprivateendpointconnectionsample] | gets information about a private endpoint connection under a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json | +| [diskAccessesGetPrivateLinkResourcesSample.ts][diskaccessesgetprivatelinkresourcessample] | gets the private link resources possible under disk access resource x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json | +| [diskAccessesGetSample.ts][diskaccessesgetsample] | gets information about a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get.json | +| [diskAccessesListByResourceGroupSample.ts][diskaccesseslistbyresourcegroupsample] | lists all the disk access resources under a resource group. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListByResourceGroup.json | +| [diskAccessesListPrivateEndpointConnectionsSample.ts][diskaccesseslistprivateendpointconnectionssample] | list information about private endpoint connections under a disk access resource x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json | +| [diskAccessesListSample.ts][diskaccesseslistsample] | lists all the disk access resources under a subscription. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListBySubscription.json | +| [diskAccessesUpdateAPrivateEndpointConnectionSample.ts][diskaccessesupdateaprivateendpointconnectionsample] | approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json | +| [diskAccessesUpdateSample.ts][diskaccessesupdatesample] | updates (patches) a disk access resource. x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Update.json | +| [diskEncryptionSetsCreateOrUpdateSample.ts][diskencryptionsetscreateorupdatesample] | creates or updates a disk encryption set x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create.json | +| [diskEncryptionSetsDeleteSample.ts][diskencryptionsetsdeletesample] | deletes a disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json | +| [diskEncryptionSetsGetSample.ts][diskencryptionsetsgetsample] | gets information about a disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get.json | +| [diskEncryptionSetsListAssociatedResourcesSample.ts][diskencryptionsetslistassociatedresourcessample] | lists all resources that are encrypted with this disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json | +| [diskEncryptionSetsListByResourceGroupSample.ts][diskencryptionsetslistbyresourcegroupsample] | lists all the disk encryption sets under a resource group. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json | +| [diskEncryptionSetsListSample.ts][diskencryptionsetslistsample] | lists all the disk encryption sets under a subscription. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json | +| [diskEncryptionSetsUpdateSample.ts][diskencryptionsetsupdatesample] | updates (patches) a disk encryption set. x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update.json | +| [diskRestorePointGetSample.ts][diskrestorepointgetsample] | get disk restorePoint resource x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get.json | +| [diskRestorePointGrantAccessSample.ts][diskrestorepointgrantaccesssample] | grants access to a diskRestorePoint. x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json | +| [diskRestorePointListByRestorePointSample.ts][diskrestorepointlistbyrestorepointsample] | lists diskRestorePoints under a vmRestorePoint. x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json | +| [diskRestorePointRevokeAccessSample.ts][diskrestorepointrevokeaccesssample] | revokes access to a diskRestorePoint. x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json | +| [disksCreateOrUpdateSample.ts][diskscreateorupdatesample] | creates or updates a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json | +| [disksDeleteSample.ts][disksdeletesample] | deletes a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_Delete.json | +| [disksGetSample.ts][disksgetsample] | gets information about a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_Get.json | +| [disksGrantAccessSample.ts][disksgrantaccesssample] | grants access to a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess.json | +| [disksListByResourceGroupSample.ts][diskslistbyresourcegroupsample] | lists all the disks under a resource group. x-ms-original-file: 2025-01-02/diskExamples/Disk_ListByResourceGroup.json | +| [disksListSample.ts][diskslistsample] | lists all the disks under a subscription. x-ms-original-file: 2025-01-02/diskExamples/Disk_ListBySubscription.json | +| [disksRevokeAccessSample.ts][disksrevokeaccesssample] | revokes access to a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_EndGetAccess.json | +| [disksUpdateSample.ts][disksupdatesample] | updates (patches) a disk. x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json | +| [galleriesCreateOrUpdateSample.ts][galleriescreateorupdatesample] | create or update a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Create.json | +| [galleriesDeleteSample.ts][galleriesdeletesample] | delete a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Delete.json | +| [galleriesGetSample.ts][galleriesgetsample] | retrieves information about a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Get.json | +| [galleriesListByResourceGroupSample.ts][gallerieslistbyresourcegroupsample] | list galleries under a resource group. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListByResourceGroup.json | +| [galleriesListSample.ts][gallerieslistsample] | list galleries under a subscription. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListBySubscription.json | +| [galleriesUpdateSample.ts][galleriesupdatesample] | update a Shared Image Gallery. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Update.json | +| [galleryApplicationVersionsCreateOrUpdateSample.ts][galleryapplicationversionscreateorupdatesample] | create or update a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Create.json | +| [galleryApplicationVersionsDeleteSample.ts][galleryapplicationversionsdeletesample] | delete a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Delete.json | +| [galleryApplicationVersionsGetSample.ts][galleryapplicationversionsgetsample] | retrieves information about a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get.json | +| [galleryApplicationVersionsListByGalleryApplicationSample.ts][galleryapplicationversionslistbygalleryapplicationsample] | list gallery Application Versions in a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json | +| [galleryApplicationVersionsUpdateSample.ts][galleryapplicationversionsupdatesample] | update a gallery Application Version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Update.json | +| [galleryApplicationsCreateOrUpdateSample.ts][galleryapplicationscreateorupdatesample] | create or update a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Create.json | +| [galleryApplicationsDeleteSample.ts][galleryapplicationsdeletesample] | delete a gallery Application. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Delete.json | +| [galleryApplicationsGetSample.ts][galleryapplicationsgetsample] | retrieves information about a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Get.json | +| [galleryApplicationsListByGallerySample.ts][galleryapplicationslistbygallerysample] | list gallery Application Definitions in a gallery. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_ListByGallery.json | +| [galleryApplicationsUpdateSample.ts][galleryapplicationsupdatesample] | update a gallery Application Definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Update.json | +| [galleryImageVersionsCreateOrUpdateSample.ts][galleryimageversionscreateorupdatesample] | create or update a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create.json | +| [galleryImageVersionsDeleteSample.ts][galleryimageversionsdeletesample] | delete a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Delete.json | +| [galleryImageVersionsGetSample.ts][galleryimageversionsgetsample] | retrieves information about a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get.json | +| [galleryImageVersionsListByGalleryImageSample.ts][galleryimageversionslistbygalleryimagesample] | list gallery image versions in a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_ListByGalleryImage.json | +| [galleryImageVersionsUpdateSample.ts][galleryimageversionsupdatesample] | update a gallery image version. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update.json | +| [galleryImagesCreateOrUpdateSample.ts][galleryimagescreateorupdatesample] | create or update a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Create.json | +| [galleryImagesDeleteSample.ts][galleryimagesdeletesample] | delete a gallery image. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Delete.json | +| [galleryImagesGetSample.ts][galleryimagesgetsample] | retrieves information about a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Get.json | +| [galleryImagesListByGallerySample.ts][galleryimageslistbygallerysample] | list gallery image definitions in a gallery. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_ListByGallery.json | +| [galleryImagesUpdateSample.ts][galleryimagesupdatesample] | update a gallery image definition. x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Update.json | +| [galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts][galleryinvmaccesscontrolprofileversionscreateorupdatesample] | create or update a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json | +| [galleryInVMAccessControlProfileVersionsDeleteSample.ts][galleryinvmaccesscontrolprofileversionsdeletesample] | delete a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json | +| [galleryInVMAccessControlProfileVersionsGetSample.ts][galleryinvmaccesscontrolprofileversionsgetsample] | retrieves information about a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json | +| [galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts][galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample] | list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json | +| [galleryInVMAccessControlProfileVersionsUpdateSample.ts][galleryinvmaccesscontrolprofileversionsupdatesample] | update a gallery inVMAccessControlProfile version. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json | +| [galleryInVMAccessControlProfilesCreateOrUpdateSample.ts][galleryinvmaccesscontrolprofilescreateorupdatesample] | create or update a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json | +| [galleryInVMAccessControlProfilesDeleteSample.ts][galleryinvmaccesscontrolprofilesdeletesample] | delete a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json | +| [galleryInVMAccessControlProfilesGetSample.ts][galleryinvmaccesscontrolprofilesgetsample] | retrieves information about a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json | +| [galleryInVMAccessControlProfilesListByGallerySample.ts][galleryinvmaccesscontrolprofileslistbygallerysample] | list gallery inVMAccessControlProfiles in a gallery. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json | +| [galleryInVMAccessControlProfilesUpdateSample.ts][galleryinvmaccesscontrolprofilesupdatesample] | update a gallery inVMAccessControlProfile. x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json | +| [galleryScriptVersionsCreateOrUpdateSample.ts][galleryscriptversionscreateorupdatesample] | create or update a gallery Script Version. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Create.json | +| [galleryScriptVersionsDeleteSample.ts][galleryscriptversionsdeletesample] | delete a gallery Script Version. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Delete.json | +| [galleryScriptVersionsGetSample.ts][galleryscriptversionsgetsample] | custom ArmResourceRead operation template with CloudError as Error x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get.json | +| [galleryScriptVersionsListByGalleryScriptSample.ts][galleryscriptversionslistbygalleryscriptsample] | list gallery Script Versions in a gallery Script Definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json | +| [galleryScriptVersionsUpdateSample.ts][galleryscriptversionsupdatesample] | update a gallery Script Version. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Update.json | +| [galleryScriptsCreateOrUpdateSample.ts][galleryscriptscreateorupdatesample] | create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Create.json | +| [galleryScriptsDeleteSample.ts][galleryscriptsdeletesample] | delete a gallery Script Definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Delete.json | +| [galleryScriptsGetSample.ts][galleryscriptsgetsample] | retrieves information about a gallery script definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Get.json | +| [galleryScriptsListByGallerySample.ts][galleryscriptslistbygallerysample] | list gallery Script Definitions in a gallery. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_ListByGallery.json | +| [galleryScriptsUpdateSample.ts][galleryscriptsupdatesample] | update a gallery Script Definition. x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Update.json | +| [gallerySharingProfileUpdateSample.ts][gallerysharingprofileupdatesample] | update sharing profile of a gallery. x-ms-original-file: 2025-03-03/galleryExamples/Gallery_AddToSharingProfile.json | +| [imagesCreateOrUpdateSample.ts][imagescreateorupdatesample] | create or update an image. x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlob.json | +| [imagesDeleteSample.ts][imagesdeletesample] | deletes an Image. x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MaximumSet_Gen.json | +| [imagesGetSample.ts][imagesgetsample] | gets an image. x-ms-original-file: 2025-11-01/imageExamples/Image_Get.json | +| [imagesListByResourceGroupSample.ts][imageslistbyresourcegroupsample] | gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: 2025-11-01/imageExamples/Image_ListByResourceGroup.json | +| [imagesListSample.ts][imageslistsample] | gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. x-ms-original-file: 2025-11-01/imageExamples/Image_ListBySubscription.json | +| [imagesUpdateSample.ts][imagesupdatesample] | update an image. x-ms-original-file: 2025-11-01/imageExamples/Image_Update.json | +| [logAnalyticsExportRequestRateByIntervalSample.ts][loganalyticsexportrequestratebyintervalsample] | export logs that show Api requests made by this subscription in the given time window to show throttling activities. x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json | +| [logAnalyticsExportThrottledRequestsSample.ts][loganalyticsexportthrottledrequestssample] | export logs that show total throttled Api requests for this subscription in the given time window. x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_ThrottledRequests.json | +| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json | +| [proximityPlacementGroupsCreateOrUpdateSample.ts][proximityplacementgroupscreateorupdatesample] | create or update a proximity placement group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json | +| [proximityPlacementGroupsDeleteSample.ts][proximityplacementgroupsdeletesample] | delete a proximity placement group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json | +| [proximityPlacementGroupsGetSample.ts][proximityplacementgroupsgetsample] | retrieves information about a proximity placement group . x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json | +| [proximityPlacementGroupsListByResourceGroupSample.ts][proximityplacementgroupslistbyresourcegroupsample] | lists all proximity placement groups in a resource group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json | +| [proximityPlacementGroupsListBySubscriptionSample.ts][proximityplacementgroupslistbysubscriptionsample] | lists all proximity placement groups in a subscription. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json | +| [proximityPlacementGroupsUpdateSample.ts][proximityplacementgroupsupdatesample] | update a proximity placement group. x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json | +| [resourceSkusListSample.ts][resourceskuslistsample] | gets the list of Microsoft.Compute SKUs available for your Subscription. x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkus.json | +| [restorePointCollectionsCreateOrUpdateSample.ts][restorepointcollectionscreateorupdatesample] | the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate.json | +| [restorePointCollectionsDeleteSample.ts][restorepointcollectionsdeletesample] | the operation to delete the restore point collection. This operation will also delete all the contained restore points. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json | +| [restorePointCollectionsGetSample.ts][restorepointcollectionsgetsample] | the operation to get the restore point collection. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get.json | +| [restorePointCollectionsListAllSample.ts][restorepointcollectionslistallsample] | gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListBySubscription.json | +| [restorePointCollectionsListSample.ts][restorepointcollectionslistsample] | gets the list of restore point collections in a resource group. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListByResourceGroup.json | +| [restorePointCollectionsUpdateSample.ts][restorepointcollectionsupdatesample] | the operation to update the restore point collection. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json | +| [restorePointsCreateSample.ts][restorepointscreatesample] | the operation to create the restore point. Updating properties of an existing restore point is not allowed x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Copy_BetweenRegions.json | +| [restorePointsDeleteSample.ts][restorepointsdeletesample] | the operation to delete the restore point. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json | +| [restorePointsGetSample.ts][restorepointsgetsample] | the operation to get the restore point. x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get.json | +| [sharedGalleriesGetSample.ts][sharedgalleriesgetsample] | get a shared gallery by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_Get.json | +| [sharedGalleriesListSample.ts][sharedgallerieslistsample] | list shared galleries by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_List.json | +| [sharedGalleryImageVersionsGetSample.ts][sharedgalleryimageversionsgetsample] | get a shared gallery image version by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersion_Get.json | +| [sharedGalleryImageVersionsListSample.ts][sharedgalleryimageversionslistsample] | list shared gallery image versions by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersions_List.json | +| [sharedGalleryImagesGetSample.ts][sharedgalleryimagesgetsample] | get a shared gallery image by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImage_Get.json | +| [sharedGalleryImagesListSample.ts][sharedgalleryimageslistsample] | list shared gallery images by subscription id or tenant id. x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImages_List.json | +| [snapshotsCreateOrUpdateSample.ts][snapshotscreateorupdatesample] | creates or updates a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json | +| [snapshotsDeleteSample.ts][snapshotsdeletesample] | deletes a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Delete.json | +| [snapshotsGetSample.ts][snapshotsgetsample] | gets information about a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Get.json | +| [snapshotsGrantAccessSample.ts][snapshotsgrantaccesssample] | grants access to a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_BeginGetAccess.json | +| [snapshotsListByResourceGroupSample.ts][snapshotslistbyresourcegroupsample] | lists snapshots under a resource group. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListByResourceGroup.json | +| [snapshotsListSample.ts][snapshotslistsample] | lists snapshots under a subscription. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListBySubscription.json | +| [snapshotsRevokeAccessSample.ts][snapshotsrevokeaccesssample] | revokes access to a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_EndGetAccess.json | +| [snapshotsUpdateSample.ts][snapshotsupdatesample] | updates (patches) a snapshot. x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update.json | +| [softDeletedResourceListByArtifactNameSample.ts][softdeletedresourcelistbyartifactnamesample] | list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. x-ms-original-file: 2025-03-03/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json | +| [sshPublicKeysCreateSample.ts][sshpublickeyscreatesample] | creates a new SSH public key resource. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Create.json | +| [sshPublicKeysDeleteSample.ts][sshpublickeysdeletesample] | delete an SSH public key. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json | +| [sshPublicKeysGenerateKeyPairSample.ts][sshpublickeysgeneratekeypairsample] | generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json | +| [sshPublicKeysGetSample.ts][sshpublickeysgetsample] | retrieves information about an SSH public key. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Get.json | +| [sshPublicKeysListByResourceGroupSample.ts][sshpublickeyslistbyresourcegroupsample] | lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json | +| [sshPublicKeysListBySubscriptionSample.ts][sshpublickeyslistbysubscriptionsample] | lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json | +| [sshPublicKeysUpdateSample.ts][sshpublickeysupdatesample] | updates a new SSH public key resource. x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json | +| [usageListSample.ts][usagelistsample] | gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json | +| [virtualMachineExtensionImagesGetSample.ts][virtualmachineextensionimagesgetsample] | gets a virtual machine extension image. x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json | +| [virtualMachineExtensionImagesListTypesSample.ts][virtualmachineextensionimageslisttypessample] | gets a list of virtual machine extension image types. x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json | +| [virtualMachineExtensionImagesListVersionsSample.ts][virtualmachineextensionimageslistversionssample] | gets a list of virtual machine extension image versions. x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json | +| [virtualMachineExtensionsCreateOrUpdateSample.ts][virtualmachineextensionscreateorupdatesample] | the operation to create or update the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json | +| [virtualMachineExtensionsDeleteSample.ts][virtualmachineextensionsdeletesample] | the operation to delete the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json | +| [virtualMachineExtensionsGetSample.ts][virtualmachineextensionsgetsample] | the operation to get the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json | +| [virtualMachineExtensionsListSample.ts][virtualmachineextensionslistsample] | the operation to get all extensions of a Virtual Machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json | +| [virtualMachineExtensionsUpdateSample.ts][virtualmachineextensionsupdatesample] | the operation to update the extension. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Update.json | +| [virtualMachineImagesEdgeZoneGetSample.ts][virtualmachineimagesedgezonegetsample] | gets a virtual machine image in an edge zone. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListOffersSample.ts][virtualmachineimagesedgezonelistofferssample] | gets a list of virtual machine image offers for the specified location, edge zone and publisher. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListPublishersSample.ts][virtualmachineimagesedgezonelistpublisherssample] | gets a list of virtual machine image publishers for the specified Azure location and edge zone. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSample.ts][virtualmachineimagesedgezonelistsample] | gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json | +| [virtualMachineImagesEdgeZoneListSkusSample.ts][virtualmachineimagesedgezonelistskussample] | gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json | +| [virtualMachineImagesGetSample.ts][virtualmachineimagesgetsample] | gets a virtual machine image. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json | +| [virtualMachineImagesListByEdgeZoneSample.ts][virtualmachineimageslistbyedgezonesample] | gets a list of all virtual machine image versions for the specified edge zone x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json | +| [virtualMachineImagesListOffersSample.ts][virtualmachineimageslistofferssample] | gets a list of virtual machine image offers for the specified location and publisher. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json | +| [virtualMachineImagesListPublishersSample.ts][virtualmachineimageslistpublisherssample] | gets a list of virtual machine image publishers for the specified Azure location. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json | +| [virtualMachineImagesListSample.ts][virtualmachineimageslistsample] | gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json | +| [virtualMachineImagesListSkusSample.ts][virtualmachineimageslistskussample] | gets a list of virtual machine image SKUs for the specified location, publisher, and offer. x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json | +| [virtualMachineImagesListWithPropertiesSample.ts][virtualmachineimageslistwithpropertiessample] | execute listWithProperties x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json | +| [virtualMachineRunCommandsCreateOrUpdateSample.ts][virtualmachineruncommandscreateorupdatesample] | the operation to create or update the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json | +| [virtualMachineRunCommandsDeleteSample.ts][virtualmachineruncommandsdeletesample] | the operation to delete the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Delete.json | +| [virtualMachineRunCommandsGetByVirtualMachineSample.ts][virtualmachineruncommandsgetbyvirtualmachinesample] | the operation to get the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Get.json | +| [virtualMachineRunCommandsGetSample.ts][virtualmachineruncommandsgetsample] | gets specific run command for a subscription in a location. x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_Get.json | +| [virtualMachineRunCommandsListByVirtualMachineSample.ts][virtualmachineruncommandslistbyvirtualmachinesample] | the operation to get all run commands of a Virtual Machine. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_List.json | +| [virtualMachineRunCommandsListSample.ts][virtualmachineruncommandslistsample] | lists all available run commands for a subscription in a location. x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_List.json | +| [virtualMachineRunCommandsUpdateSample.ts][virtualmachineruncommandsupdatesample] | the operation to update the run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Update.json | +| [virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts][virtualmachinescalesetextensionscreateorupdatesample] | the operation to create or update an extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsDeleteSample.ts][virtualmachinescalesetextensionsdeletesample] | the operation to delete the extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsGetSample.ts][virtualmachinescalesetextensionsgetsample] | the operation to get the extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsListSample.ts][virtualmachinescalesetextensionslistsample] | gets a list of all extensions in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json | +| [virtualMachineScaleSetExtensionsUpdateSample.ts][virtualmachinescalesetextensionsupdatesample] | the operation to update an extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json | +| [virtualMachineScaleSetLifeCycleHookEventsGetSample.ts][virtualmachinescalesetlifecyclehookeventsgetsample] | gets a virtual machine scale set lifecycle hook event. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Get.json | +| [virtualMachineScaleSetLifeCycleHookEventsListSample.ts][virtualmachinescalesetlifecyclehookeventslistsample] | gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_List.json | +| [virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts][virtualmachinescalesetlifecyclehookeventsupdatesample] | the operation to update a virtual machine scale set lifecycle hook event. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Update.json | +| [virtualMachineScaleSetRollingUpgradesCancelSample.ts][virtualmachinescalesetrollingupgradescancelsample] | cancels the current virtual machine scale set rolling upgrade. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesGetLatestSample.ts][virtualmachinescalesetrollingupgradesgetlatestsample] | gets the status of the latest virtual machine scale set rolling upgrade. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json | +| [virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts][virtualmachinescalesetrollingupgradesstartextensionupgradesample] | starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json | +| [virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts][virtualmachinescalesetrollingupgradesstartosupgradesample] | starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts][virtualmachinescalesetvmextensionscreateorupdatesample] | the operation to create or update the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json | +| [virtualMachineScaleSetVMExtensionsDeleteSample.ts][virtualmachinescalesetvmextensionsdeletesample] | the operation to delete the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json | +| [virtualMachineScaleSetVMExtensionsGetSample.ts][virtualmachinescalesetvmextensionsgetsample] | the operation to get the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json | +| [virtualMachineScaleSetVMExtensionsListSample.ts][virtualmachinescalesetvmextensionslistsample] | the operation to get all extensions of an instance in Virtual Machine Scaleset. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json | +| [virtualMachineScaleSetVMExtensionsUpdateSample.ts][virtualmachinescalesetvmextensionsupdatesample] | the operation to update the VMSS VM extension. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json | +| [virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts][virtualmachinescalesetvmruncommandscreateorupdatesample] | the operation to create or update the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json | +| [virtualMachineScaleSetVMRunCommandsDeleteSample.ts][virtualmachinescalesetvmruncommandsdeletesample] | the operation to delete the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json | +| [virtualMachineScaleSetVMRunCommandsGetSample.ts][virtualmachinescalesetvmruncommandsgetsample] | the operation to get the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json | +| [virtualMachineScaleSetVMRunCommandsListSample.ts][virtualmachinescalesetvmruncommandslistsample] | the operation to get all run commands of an instance in Virtual Machine Scaleset. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json | +| [virtualMachineScaleSetVMRunCommandsUpdateSample.ts][virtualmachinescalesetvmruncommandsupdatesample] | the operation to update the VMSS VM run command. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json | +| [virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts][virtualmachinescalesetvmsapproverollingupgradesample] | approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json | +| [virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts][virtualmachinescalesetvmsattachdetachdatadiskssample] | attach and detach data disks to/from a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsDeallocateSample.ts][virtualmachinescalesetvmsdeallocatesample] | deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsDeleteSample.ts][virtualmachinescalesetvmsdeletesample] | deletes a virtual machine from a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json | +| [virtualMachineScaleSetVMsGetInstanceViewSample.ts][virtualmachinescalesetvmsgetinstanceviewsample] | gets the status of a virtual machine from a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json | +| [virtualMachineScaleSetVMsGetSample.ts][virtualmachinescalesetvmsgetsample] | gets a virtual machine from a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json | +| [virtualMachineScaleSetVMsListSample.ts][virtualmachinescalesetvmslistsample] | gets a list of all virtual machines in a VM scale sets. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsPerformMaintenanceSample.ts][virtualmachinescalesetvmsperformmaintenancesample] | performs maintenance on a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsPowerOffSample.ts][virtualmachinescalesetvmspoweroffsample] | power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsRedeploySample.ts][virtualmachinescalesetvmsredeploysample] | shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsReimageAllSample.ts][virtualmachinescalesetvmsreimageallsample] | allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsReimageSample.ts][virtualmachinescalesetvmsreimagesample] | reimages (upgrade the operating system) a specific virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsRestartSample.ts][virtualmachinescalesetvmsrestartsample] | restarts a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts][virtualmachinescalesetvmsretrievebootdiagnosticsdatasample] | the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json | +| [virtualMachineScaleSetVMsRunCommandSample.ts][virtualmachinescalesetvmsruncommandsample] | run command on a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json | +| [virtualMachineScaleSetVMsSimulateEvictionSample.ts][virtualmachinescalesetvmssimulateevictionsample] | the operation to simulate the eviction of spot virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json | +| [virtualMachineScaleSetVMsStartSample.ts][virtualmachinescalesetvmsstartsample] | starts a virtual machine in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json | +| [virtualMachineScaleSetVMsUpdateSample.ts][virtualmachinescalesetvmsupdatesample] | updates a virtual machine of a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json | +| [virtualMachineScaleSetsApproveRollingUpgradeSample.ts][virtualmachinescalesetsapproverollingupgradesample] | approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json | +| [virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts][virtualmachinescalesetsconverttosingleplacementgroupsample] | converts SinglePlacementGroup property to false for a existing virtual machine scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json | +| [virtualMachineScaleSetsCreateOrUpdateSample.ts][virtualmachinescalesetscreateorupdatesample] | create or update a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json | +| [virtualMachineScaleSetsDeallocateSample.ts][virtualmachinescalesetsdeallocatesample] | deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json | +| [virtualMachineScaleSetsDeleteInstancesSample.ts][virtualmachinescalesetsdeleteinstancessample] | deletes virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json | +| [virtualMachineScaleSetsDeleteSample.ts][virtualmachinescalesetsdeletesample] | deletes a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json | +| [virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts][virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample] | manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetInstanceViewSample.ts][virtualmachinescalesetsgetinstanceviewsample] | gets the status of a VM scale set instance. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetOSUpgradeHistorySample.ts][virtualmachinescalesetsgetosupgradehistorysample] | gets list of OS upgrades on a VM scale set instance. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json | +| [virtualMachineScaleSetsGetSample.ts][virtualmachinescalesetsgetsample] | display information about a virtual machine scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json | +| [virtualMachineScaleSetsListAllSample.ts][virtualmachinescalesetslistallsample] | gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetsListByLocationSample.ts][virtualmachinescalesetslistbylocationsample] | gets all the VM scale sets under the specified subscription for the specified location. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json | +| [virtualMachineScaleSetsListSample.ts][virtualmachinescalesetslistsample] | gets a list of all VM scale sets under a resource group. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json | +| [virtualMachineScaleSetsListSkusSample.ts][virtualmachinescalesetslistskussample] | gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json | +| [virtualMachineScaleSetsPerformMaintenanceSample.ts][virtualmachinescalesetsperformmaintenancesample] | perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json | +| [virtualMachineScaleSetsPowerOffSample.ts][virtualmachinescalesetspoweroffsample] | power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json | +| [virtualMachineScaleSetsReapplySample.ts][virtualmachinescalesetsreapplysample] | reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json | +| [virtualMachineScaleSetsRedeploySample.ts][virtualmachinescalesetsredeploysample] | shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json | +| [virtualMachineScaleSetsReimageAllSample.ts][virtualmachinescalesetsreimageallsample] | reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json | +| [virtualMachineScaleSetsReimageSample.ts][virtualmachinescalesetsreimagesample] | reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json | +| [virtualMachineScaleSetsRestartSample.ts][virtualmachinescalesetsrestartsample] | restarts one or more virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json | +| [virtualMachineScaleSetsScaleOutSample.ts][virtualmachinescalesetsscaleoutsample] | scales out one or more virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json | +| [virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts][virtualmachinescalesetssetorchestrationservicestatesample] | changes ServiceState property for a given service x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json | +| [virtualMachineScaleSetsStartSample.ts][virtualmachinescalesetsstartsample] | starts one or more virtual machines in a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json | +| [virtualMachineScaleSetsUpdateInstancesSample.ts][virtualmachinescalesetsupdateinstancessample] | upgrades one or more virtual machines to the latest SKU set in the VM scale set model. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json | +| [virtualMachineScaleSetsUpdateSample.ts][virtualmachinescalesetsupdatesample] | update a VM scale set. x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json | +| [virtualMachineSizesListSample.ts][virtualmachinesizeslistsample] | this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json | +| [virtualMachinesAssessPatchesSample.ts][virtualmachinesassesspatchessample] | assess patches on the VM. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AssessPatches.json | +| [virtualMachinesAttachDetachDataDisksSample.ts][virtualmachinesattachdetachdatadiskssample] | attach and detach data disks to/from the virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json | +| [virtualMachinesCaptureSample.ts][virtualmachinescapturesample] | captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json | +| [virtualMachinesConvertToManagedDisksSample.ts][virtualmachinesconverttomanageddiskssample] | converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json | +| [virtualMachinesCreateOrUpdateSample.ts][virtualmachinescreateorupdatesample] | the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json | +| [virtualMachinesDeallocateSample.ts][virtualmachinesdeallocatesample] | shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json | +| [virtualMachinesDeleteSample.ts][virtualmachinesdeletesample] | the operation to delete a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Delete_Force.json | +| [virtualMachinesGeneralizeSample.ts][virtualmachinesgeneralizesample] | sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Generalize.json | +| [virtualMachinesGetSample.ts][virtualmachinesgetsample] | retrieves information about the model view or the instance view of a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get.json | +| [virtualMachinesInstallPatchesSample.ts][virtualmachinesinstallpatchessample] | installs patches on the VM. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_InstallPatches.json | +| [virtualMachinesInstanceViewSample.ts][virtualmachinesinstanceviewsample] | retrieves information about the run-time state of a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceView.json | +| [virtualMachinesListAllSample.ts][virtualmachineslistallsample] | lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json | +| [virtualMachinesListAvailableSizesSample.ts][virtualmachineslistavailablesizessample] | lists all available virtual machine sizes to which the specified virtual machine can be resized. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json | +| [virtualMachinesListByLocationSample.ts][virtualmachineslistbylocationsample] | gets all the virtual machines under the specified subscription for the specified location. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json | +| [virtualMachinesListSample.ts][virtualmachineslistsample] | lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json | +| [virtualMachinesMigrateToVMScaleSetSample.ts][virtualmachinesmigratetovmscalesetsample] | migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json | +| [virtualMachinesPerformMaintenanceSample.ts][virtualmachinesperformmaintenancesample] | the operation to perform maintenance on a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json | +| [virtualMachinesPowerOffSample.ts][virtualmachinespoweroffsample] | the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json | +| [virtualMachinesReapplySample.ts][virtualmachinesreapplysample] | the operation to reapply a virtual machine's state. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reapply.json | +| [virtualMachinesRedeploySample.ts][virtualmachinesredeploysample] | shuts down the virtual machine, moves it to a new node, and powers it back on. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json | +| [virtualMachinesReimageSample.ts][virtualmachinesreimagesample] | reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage.json | +| [virtualMachinesRestartSample.ts][virtualmachinesrestartsample] | the operation to restart a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json | +| [virtualMachinesRetrieveBootDiagnosticsDataSample.ts][virtualmachinesretrievebootdiagnosticsdatasample] | the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json | +| [virtualMachinesRunCommandSample.ts][virtualmachinesruncommandsample] | run command on the VM. x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand.json | +| [virtualMachinesSimulateEvictionSample.ts][virtualmachinessimulateevictionsample] | the operation to simulate the eviction of spot virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_SimulateEviction.json | +| [virtualMachinesStartSample.ts][virtualmachinesstartsample] | the operation to start a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json | +| [virtualMachinesUpdateSample.ts][virtualmachinesupdatesample] | the operation to update a virtual machine. x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json | ## Prerequisites @@ -362,328 +335,301 @@ node dist/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env COMPUTE_SUBSCRIPTION_ID="" COMPUTE_RESOURCE_GROUP="" node dist/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js +node dist/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[availabilitysetscancelmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts -[availabilitysetsconverttovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts -[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsCreateOrUpdateSample.ts -[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsDeleteSample.ts -[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsGetSample.ts -[availabilitysetslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListAvailableSizesSample.ts -[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListBySubscriptionSample.ts -[availabilitysetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListSample.ts -[availabilitysetsstartmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts -[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsUpdateSample.ts -[availabilitysetsvalidatemigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts -[capacityreservationgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts -[capacityreservationgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsDeleteSample.ts -[capacityreservationgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsGetSample.ts -[capacityreservationgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts -[capacityreservationgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts -[capacityreservationgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsUpdateSample.ts -[capacityreservationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsCreateOrUpdateSample.ts -[capacityreservationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsDeleteSample.ts -[capacityreservationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsGetSample.ts -[capacityreservationslistbycapacityreservationgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts -[capacityreservationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsUpdateSample.ts -[cloudserviceoperatingsystemsgetosfamilysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSFamilySample.ts -[cloudserviceoperatingsystemsgetosversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsGetOSVersionSample.ts -[cloudserviceoperatingsystemslistosfamiliessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSFamiliesSample.ts -[cloudserviceoperatingsystemslistosversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceOperatingSystemsListOSVersionsSample.ts -[cloudserviceroleinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesDeleteSample.ts -[cloudserviceroleinstancesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetInstanceViewSample.ts -[cloudserviceroleinstancesgetremotedesktopfilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetRemoteDesktopFileSample.ts -[cloudserviceroleinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesGetSample.ts -[cloudserviceroleinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesListSample.ts -[cloudserviceroleinstancesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRebuildSample.ts -[cloudserviceroleinstancesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesReimageSample.ts -[cloudserviceroleinstancesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRoleInstancesRestartSample.ts -[cloudservicerolesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesGetSample.ts -[cloudserviceroleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServiceRolesListSample.ts -[cloudservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesCreateOrUpdateSample.ts -[cloudservicesdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteInstancesSample.ts -[cloudservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesDeleteSample.ts -[cloudservicesgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetInstanceViewSample.ts -[cloudservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesGetSample.ts -[cloudserviceslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListAllSample.ts -[cloudserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesListSample.ts -[cloudservicespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesPowerOffSample.ts -[cloudservicesrebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRebuildSample.ts -[cloudservicesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesReimageSample.ts -[cloudservicesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesRestartSample.ts -[cloudservicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesStartSample.ts -[cloudservicesupdatedomaingetupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainGetUpdateDomainSample.ts -[cloudservicesupdatedomainlistupdatedomainssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainListUpdateDomainsSample.ts -[cloudservicesupdatedomainwalkupdatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateDomainWalkUpdateDomainSample.ts -[cloudservicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/cloudServicesUpdateSample.ts -[communitygalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleriesGetSample.ts -[communitygalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsGetSample.ts -[communitygalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsListSample.ts -[communitygalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesGetSample.ts -[communitygalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesListSample.ts -[dedicatedhostgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts -[dedicatedhostgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsDeleteSample.ts -[dedicatedhostgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsGetSample.ts -[dedicatedhostgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts -[dedicatedhostgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts -[dedicatedhostgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsUpdateSample.ts -[dedicatedhostscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsCreateOrUpdateSample.ts -[dedicatedhostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsDeleteSample.ts -[dedicatedhostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsGetSample.ts -[dedicatedhostslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListAvailableSizesSample.ts -[dedicatedhostslistbyhostgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListByHostGroupSample.ts -[dedicatedhostsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRedeploySample.ts -[dedicatedhostsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRestartSample.ts -[dedicatedhostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsUpdateSample.ts -[diskaccessescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesCreateOrUpdateSample.ts -[diskaccessesdeleteaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts -[diskaccessesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesDeleteSample.ts -[diskaccessesgetaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts -[diskaccessesgetprivatelinkresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts -[diskaccessesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetSample.ts -[diskaccesseslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListByResourceGroupSample.ts -[diskaccesseslistprivateendpointconnectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts -[diskaccesseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListSample.ts -[diskaccessesupdateaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts -[diskaccessesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesUpdateSample.ts -[diskencryptionsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts -[diskencryptionsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsDeleteSample.ts -[diskencryptionsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsGetSample.ts -[diskencryptionsetslistassociatedresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts -[diskencryptionsetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts -[diskencryptionsetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListSample.ts -[diskencryptionsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsUpdateSample.ts -[diskrestorepointgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGetSample.ts -[diskrestorepointgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointGrantAccessSample.ts -[diskrestorepointlistbyrestorepointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointListByRestorePointSample.ts -[diskrestorepointrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/diskRestorePointRevokeAccessSample.ts -[diskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksCreateOrUpdateSample.ts -[disksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksDeleteSample.ts -[disksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksGetSample.ts -[disksgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksGrantAccessSample.ts -[diskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksListByResourceGroupSample.ts -[diskslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksListSample.ts -[disksrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksRevokeAccessSample.ts -[disksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/disksUpdateSample.ts -[galleriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesCreateOrUpdateSample.ts -[galleriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesDeleteSample.ts -[galleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesGetSample.ts -[gallerieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListByResourceGroupSample.ts -[gallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListSample.ts -[galleriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesUpdateSample.ts -[galleryapplicationversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts -[galleryapplicationversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsDeleteSample.ts -[galleryapplicationversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsGetSample.ts -[galleryapplicationversionslistbygalleryapplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts -[galleryapplicationversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsUpdateSample.ts -[galleryapplicationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsCreateOrUpdateSample.ts -[galleryapplicationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsDeleteSample.ts -[galleryapplicationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsGetSample.ts -[galleryapplicationslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsListByGallerySample.ts -[galleryapplicationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsUpdateSample.ts -[galleryimageversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts -[galleryimageversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsDeleteSample.ts -[galleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsGetSample.ts -[galleryimageversionslistbygalleryimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsListByGalleryImageSample.ts -[galleryimageversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsUpdateSample.ts -[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesCreateOrUpdateSample.ts -[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesDeleteSample.ts -[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesGetSample.ts -[galleryimageslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesListByGallerySample.ts -[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImagesUpdateSample.ts -[galleryinvmaccesscontrolprofileversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts -[galleryinvmaccesscontrolprofileversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts -[galleryinvmaccesscontrolprofileversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts -[galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts -[galleryinvmaccesscontrolprofileversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts -[galleryinvmaccesscontrolprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts -[galleryinvmaccesscontrolprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts -[galleryinvmaccesscontrolprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesGetSample.ts -[galleryinvmaccesscontrolprofileslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts -[galleryinvmaccesscontrolprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts -[galleryscriptversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts -[galleryscriptversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsDeleteSample.ts -[galleryscriptversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsGetSample.ts -[galleryscriptversionslistbygalleryscriptsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts -[galleryscriptversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsUpdateSample.ts -[galleryscriptscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsCreateOrUpdateSample.ts -[galleryscriptsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsDeleteSample.ts -[galleryscriptsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsGetSample.ts -[galleryscriptslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsListByGallerySample.ts -[galleryscriptsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsUpdateSample.ts -[gallerysharingprofileupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/gallerySharingProfileUpdateSample.ts -[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/imagesCreateOrUpdateSample.ts -[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/imagesDeleteSample.ts -[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/imagesGetSample.ts -[imageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/imagesListByResourceGroupSample.ts -[imageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/imagesListSample.ts -[imagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/imagesUpdateSample.ts -[loganalyticsexportrequestratebyintervalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts -[loganalyticsexportthrottledrequestssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportThrottledRequestsSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/operationsListSample.ts -[proximityplacementgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts -[proximityplacementgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsDeleteSample.ts -[proximityplacementgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsGetSample.ts -[proximityplacementgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts -[proximityplacementgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts -[proximityplacementgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsUpdateSample.ts -[resourceskuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/resourceSkusListSample.ts -[restorepointcollectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts -[restorepointcollectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsDeleteSample.ts -[restorepointcollectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsGetSample.ts -[restorepointcollectionslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListAllSample.ts -[restorepointcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListSample.ts -[restorepointcollectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsUpdateSample.ts -[restorepointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsCreateSample.ts -[restorepointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsDeleteSample.ts -[restorepointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointsGetSample.ts -[sharedgalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesGetSample.ts -[sharedgallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesListSample.ts -[sharedgalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsGetSample.ts -[sharedgalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsListSample.ts -[sharedgalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesGetSample.ts -[sharedgalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesListSample.ts -[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsCreateOrUpdateSample.ts -[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsDeleteSample.ts -[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGetSample.ts -[snapshotsgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsGrantAccessSample.ts -[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListByResourceGroupSample.ts -[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListSample.ts -[snapshotsrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsRevokeAccessSample.ts -[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsUpdateSample.ts -[softdeletedresourcelistbyartifactnamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/softDeletedResourceListByArtifactNameSample.ts -[sshpublickeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysCreateSample.ts -[sshpublickeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysDeleteSample.ts -[sshpublickeysgeneratekeypairsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGenerateKeyPairSample.ts -[sshpublickeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysGetSample.ts -[sshpublickeyslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListByResourceGroupSample.ts -[sshpublickeyslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListBySubscriptionSample.ts -[sshpublickeysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysUpdateSample.ts -[usagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/usageListSample.ts -[virtualmachineextensionimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesGetSample.ts -[virtualmachineextensionimageslisttypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListTypesSample.ts -[virtualmachineextensionimageslistversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts -[virtualmachineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts -[virtualmachineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsDeleteSample.ts -[virtualmachineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsGetSample.ts -[virtualmachineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsListSample.ts -[virtualmachineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineExtensionsUpdateSample.ts -[virtualmachineimagesedgezonegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts -[virtualmachineimagesedgezonelistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts -[virtualmachineimagesedgezonelistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts -[virtualmachineimagesedgezonelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSample.ts -[virtualmachineimagesedgezonelistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts -[virtualmachineimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesGetSample.ts -[virtualmachineimageslistbyedgezonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts -[virtualmachineimageslistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListOffersSample.ts -[virtualmachineimageslistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListPublishersSample.ts -[virtualmachineimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSample.ts -[virtualmachineimageslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListSkusSample.ts -[virtualmachineimageslistwithpropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListWithPropertiesSample.ts -[virtualmachineruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts -[virtualmachineruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsDeleteSample.ts -[virtualmachineruncommandsgetbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts -[virtualmachineruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsGetSample.ts -[virtualmachineruncommandslistbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts -[virtualmachineruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListSample.ts -[virtualmachineruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsUpdateSample.ts -[virtualmachinescalesetextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts -[virtualmachinescalesetextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts -[virtualmachinescalesetextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts -[virtualmachinescalesetextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsListSample.ts -[virtualmachinescalesetextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts -[virtualmachinescalesetrollingupgradescancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts -[virtualmachinescalesetrollingupgradesgetlatestsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts -[virtualmachinescalesetrollingupgradesstartextensionupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts -[virtualmachinescalesetrollingupgradesstartosupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts -[virtualmachinescalesetvmextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts -[virtualmachinescalesetvmextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts -[virtualmachinescalesetvmextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts -[virtualmachinescalesetvmextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts -[virtualmachinescalesetvmextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts -[virtualmachinescalesetvmruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts -[virtualmachinescalesetvmruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts -[virtualmachinescalesetvmruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts -[virtualmachinescalesetvmruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts -[virtualmachinescalesetvmruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts -[virtualmachinescalesetvmsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSApproveRollingUpgradeSample.ts -[virtualmachinescalesetvmsattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSAttachDetachDataDisksSample.ts -[virtualmachinescalesetvmsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeallocateSample.ts -[virtualmachinescalesetvmsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSDeleteSample.ts -[virtualmachinescalesetvmsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetInstanceViewSample.ts -[virtualmachinescalesetvmsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSGetSample.ts -[virtualmachinescalesetvmslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSListSample.ts -[virtualmachinescalesetvmsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPerformMaintenanceSample.ts -[virtualmachinescalesetvmspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSPowerOffSample.ts -[virtualmachinescalesetvmsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRedeploySample.ts -[virtualmachinescalesetvmsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageAllSample.ts -[virtualmachinescalesetvmsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSReimageSample.ts -[virtualmachinescalesetvmsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRestartSample.ts -[virtualmachinescalesetvmsretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRetrieveBootDiagnosticsDataSample.ts -[virtualmachinescalesetvmsruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSRunCommandSample.ts -[virtualmachinescalesetvmssimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSSimulateEvictionSample.ts -[virtualmachinescalesetvmsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSStartSample.ts -[virtualmachinescalesetvmsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMSUpdateSample.ts -[virtualmachinescalesetsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts -[virtualmachinescalesetsconverttosingleplacementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts -[virtualmachinescalesetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts -[virtualmachinescalesetsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeallocateSample.ts -[virtualmachinescalesetsdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts -[virtualmachinescalesetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsDeleteSample.ts -[virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts -[virtualmachinescalesetsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts -[virtualmachinescalesetsgetosupgradehistorysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts -[virtualmachinescalesetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsGetSample.ts -[virtualmachinescalesetslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListAllSample.ts -[virtualmachinescalesetslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListByLocationSample.ts -[virtualmachinescalesetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSample.ts -[virtualmachinescalesetslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSkusSample.ts -[virtualmachinescalesetsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts -[virtualmachinescalesetspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPowerOffSample.ts -[virtualmachinescalesetsreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReapplySample.ts -[virtualmachinescalesetsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRedeploySample.ts -[virtualmachinescalesetsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageAllSample.ts -[virtualmachinescalesetsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsReimageSample.ts -[virtualmachinescalesetsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsRestartSample.ts -[virtualmachinescalesetsscaleoutsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsScaleOutSample.ts -[virtualmachinescalesetssetorchestrationservicestatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts -[virtualmachinescalesetsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsStartSample.ts -[virtualmachinescalesetsupdateinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts -[virtualmachinescalesetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateSample.ts -[virtualmachinesizeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineSizesListSample.ts -[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAssessPatchesSample.ts -[virtualmachinesattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts -[virtualmachinescapturesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCaptureSample.ts -[virtualmachinesconverttomanageddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesConvertToManagedDisksSample.ts -[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCreateOrUpdateSample.ts -[virtualmachinesdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeallocateSample.ts -[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesDeleteSample.ts -[virtualmachinesgeneralizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGeneralizeSample.ts -[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGetSample.ts -[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstallPatchesSample.ts -[virtualmachinesinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesInstanceViewSample.ts -[virtualmachineslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAllSample.ts -[virtualmachineslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAvailableSizesSample.ts -[virtualmachineslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListByLocationSample.ts -[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListSample.ts -[virtualmachinesmigratetovmscalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts -[virtualmachinesperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPerformMaintenanceSample.ts -[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesPowerOffSample.ts -[virtualmachinesreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReapplySample.ts -[virtualmachinesredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRedeploySample.ts -[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReimageSample.ts -[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRestartSample.ts -[virtualmachinesretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts -[virtualmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesRunCommandSample.ts -[virtualmachinessimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesSimulateEvictionSample.ts -[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesStartSample.ts -[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesUpdateSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview +[availabilitysetscancelmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts +[availabilitysetsconverttovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts +[availabilitysetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCreateOrUpdateSample.ts +[availabilitysetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsDeleteSample.ts +[availabilitysetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsGetSample.ts +[availabilitysetslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListAvailableSizesSample.ts +[availabilitysetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListBySubscriptionSample.ts +[availabilitysetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListSample.ts +[availabilitysetsstartmigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts +[availabilitysetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsUpdateSample.ts +[availabilitysetsvalidatemigrationtovirtualmachinescalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts +[capacityreservationgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts +[capacityreservationgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsDeleteSample.ts +[capacityreservationgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsGetSample.ts +[capacityreservationgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts +[capacityreservationgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts +[capacityreservationgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsUpdateSample.ts +[capacityreservationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsCreateOrUpdateSample.ts +[capacityreservationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsDeleteSample.ts +[capacityreservationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsGetSample.ts +[capacityreservationslistbycapacityreservationgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts +[capacityreservationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsUpdateSample.ts +[communitygalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleriesGetSample.ts +[communitygalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsGetSample.ts +[communitygalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsListSample.ts +[communitygalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesGetSample.ts +[communitygalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesListSample.ts +[dedicatedhostgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts +[dedicatedhostgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsDeleteSample.ts +[dedicatedhostgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsGetSample.ts +[dedicatedhostgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts +[dedicatedhostgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts +[dedicatedhostgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsUpdateSample.ts +[dedicatedhostscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsCreateOrUpdateSample.ts +[dedicatedhostsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsDeleteSample.ts +[dedicatedhostsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsGetSample.ts +[dedicatedhostslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListAvailableSizesSample.ts +[dedicatedhostslistbyhostgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListByHostGroupSample.ts +[dedicatedhostsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRedeploySample.ts +[dedicatedhostsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRestartSample.ts +[dedicatedhostsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsUpdateSample.ts +[diskaccessescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesCreateOrUpdateSample.ts +[diskaccessesdeleteaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts +[diskaccessesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteSample.ts +[diskaccessesgetaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts +[diskaccessesgetprivatelinkresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts +[diskaccessesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetSample.ts +[diskaccesseslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListByResourceGroupSample.ts +[diskaccesseslistprivateendpointconnectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts +[diskaccesseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListSample.ts +[diskaccessesupdateaprivateendpointconnectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts +[diskaccessesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateSample.ts +[diskencryptionsetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts +[diskencryptionsetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsDeleteSample.ts +[diskencryptionsetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsGetSample.ts +[diskencryptionsetslistassociatedresourcessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts +[diskencryptionsetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts +[diskencryptionsetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListSample.ts +[diskencryptionsetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsUpdateSample.ts +[diskrestorepointgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGetSample.ts +[diskrestorepointgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGrantAccessSample.ts +[diskrestorepointlistbyrestorepointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointListByRestorePointSample.ts +[diskrestorepointrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointRevokeAccessSample.ts +[diskscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksCreateOrUpdateSample.ts +[disksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksDeleteSample.ts +[disksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksGetSample.ts +[disksgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksGrantAccessSample.ts +[diskslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksListByResourceGroupSample.ts +[diskslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksListSample.ts +[disksrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksRevokeAccessSample.ts +[disksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/disksUpdateSample.ts +[galleriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesCreateOrUpdateSample.ts +[galleriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesDeleteSample.ts +[galleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesGetSample.ts +[gallerieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListByResourceGroupSample.ts +[gallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListSample.ts +[galleriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesUpdateSample.ts +[galleryapplicationversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts +[galleryapplicationversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsDeleteSample.ts +[galleryapplicationversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsGetSample.ts +[galleryapplicationversionslistbygalleryapplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts +[galleryapplicationversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsUpdateSample.ts +[galleryapplicationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsCreateOrUpdateSample.ts +[galleryapplicationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsDeleteSample.ts +[galleryapplicationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsGetSample.ts +[galleryapplicationslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsListByGallerySample.ts +[galleryapplicationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsUpdateSample.ts +[galleryimageversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts +[galleryimageversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsDeleteSample.ts +[galleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsGetSample.ts +[galleryimageversionslistbygalleryimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsListByGalleryImageSample.ts +[galleryimageversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsUpdateSample.ts +[galleryimagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesCreateOrUpdateSample.ts +[galleryimagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesDeleteSample.ts +[galleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesGetSample.ts +[galleryimageslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesListByGallerySample.ts +[galleryimagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesUpdateSample.ts +[galleryinvmaccesscontrolprofileversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts +[galleryinvmaccesscontrolprofileversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts +[galleryinvmaccesscontrolprofileversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts +[galleryinvmaccesscontrolprofileversionslistbygalleryinvmaccesscontrolprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts +[galleryinvmaccesscontrolprofileversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts +[galleryinvmaccesscontrolprofilescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts +[galleryinvmaccesscontrolprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts +[galleryinvmaccesscontrolprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesGetSample.ts +[galleryinvmaccesscontrolprofileslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts +[galleryinvmaccesscontrolprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts +[galleryscriptversionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts +[galleryscriptversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsDeleteSample.ts +[galleryscriptversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsGetSample.ts +[galleryscriptversionslistbygalleryscriptsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts +[galleryscriptversionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsUpdateSample.ts +[galleryscriptscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsCreateOrUpdateSample.ts +[galleryscriptsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsDeleteSample.ts +[galleryscriptsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsGetSample.ts +[galleryscriptslistbygallerysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsListByGallerySample.ts +[galleryscriptsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsUpdateSample.ts +[gallerysharingprofileupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/gallerySharingProfileUpdateSample.ts +[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/imagesCreateOrUpdateSample.ts +[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/imagesDeleteSample.ts +[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/imagesGetSample.ts +[imageslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/imagesListByResourceGroupSample.ts +[imageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/imagesListSample.ts +[imagesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/imagesUpdateSample.ts +[loganalyticsexportrequestratebyintervalsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts +[loganalyticsexportthrottledrequestssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportThrottledRequestsSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/operationsListSample.ts +[proximityplacementgroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts +[proximityplacementgroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsDeleteSample.ts +[proximityplacementgroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsGetSample.ts +[proximityplacementgroupslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts +[proximityplacementgroupslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts +[proximityplacementgroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsUpdateSample.ts +[resourceskuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/resourceSkusListSample.ts +[restorepointcollectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts +[restorepointcollectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsDeleteSample.ts +[restorepointcollectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsGetSample.ts +[restorepointcollectionslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListAllSample.ts +[restorepointcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListSample.ts +[restorepointcollectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsUpdateSample.ts +[restorepointscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsCreateSample.ts +[restorepointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsDeleteSample.ts +[restorepointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsGetSample.ts +[sharedgalleriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesGetSample.ts +[sharedgallerieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesListSample.ts +[sharedgalleryimageversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsGetSample.ts +[sharedgalleryimageversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsListSample.ts +[sharedgalleryimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesGetSample.ts +[sharedgalleryimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesListSample.ts +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsCreateOrUpdateSample.ts +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsDeleteSample.ts +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGetSample.ts +[snapshotsgrantaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGrantAccessSample.ts +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListByResourceGroupSample.ts +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListSample.ts +[snapshotsrevokeaccesssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsRevokeAccessSample.ts +[snapshotsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsUpdateSample.ts +[softdeletedresourcelistbyartifactnamesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/softDeletedResourceListByArtifactNameSample.ts +[sshpublickeyscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysCreateSample.ts +[sshpublickeysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysDeleteSample.ts +[sshpublickeysgeneratekeypairsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGenerateKeyPairSample.ts +[sshpublickeysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGetSample.ts +[sshpublickeyslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListByResourceGroupSample.ts +[sshpublickeyslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListBySubscriptionSample.ts +[sshpublickeysupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysUpdateSample.ts +[usagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/usageListSample.ts +[virtualmachineextensionimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesGetSample.ts +[virtualmachineextensionimageslisttypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListTypesSample.ts +[virtualmachineextensionimageslistversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts +[virtualmachineextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts +[virtualmachineextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsDeleteSample.ts +[virtualmachineextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsGetSample.ts +[virtualmachineextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsListSample.ts +[virtualmachineextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsUpdateSample.ts +[virtualmachineimagesedgezonegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts +[virtualmachineimagesedgezonelistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts +[virtualmachineimagesedgezonelistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts +[virtualmachineimagesedgezonelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSample.ts +[virtualmachineimagesedgezonelistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts +[virtualmachineimagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesGetSample.ts +[virtualmachineimageslistbyedgezonesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts +[virtualmachineimageslistofferssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListOffersSample.ts +[virtualmachineimageslistpublisherssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListPublishersSample.ts +[virtualmachineimageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSample.ts +[virtualmachineimageslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSkusSample.ts +[virtualmachineimageslistwithpropertiessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListWithPropertiesSample.ts +[virtualmachineruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts +[virtualmachineruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsDeleteSample.ts +[virtualmachineruncommandsgetbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts +[virtualmachineruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetSample.ts +[virtualmachineruncommandslistbyvirtualmachinesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts +[virtualmachineruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListSample.ts +[virtualmachineruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsUpdateSample.ts +[virtualmachinescalesetextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts +[virtualmachinescalesetextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts +[virtualmachinescalesetextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts +[virtualmachinescalesetextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsListSample.ts +[virtualmachinescalesetextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts +[virtualmachinescalesetlifecyclehookeventsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts +[virtualmachinescalesetlifecyclehookeventslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsListSample.ts +[virtualmachinescalesetlifecyclehookeventsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts +[virtualmachinescalesetrollingupgradescancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts +[virtualmachinescalesetrollingupgradesgetlatestsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts +[virtualmachinescalesetrollingupgradesstartextensionupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts +[virtualmachinescalesetrollingupgradesstartosupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts +[virtualmachinescalesetvmextensionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts +[virtualmachinescalesetvmextensionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts +[virtualmachinescalesetvmextensionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts +[virtualmachinescalesetvmextensionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts +[virtualmachinescalesetvmextensionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts +[virtualmachinescalesetvmruncommandscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts +[virtualmachinescalesetvmruncommandsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts +[virtualmachinescalesetvmruncommandsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts +[virtualmachinescalesetvmruncommandslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts +[virtualmachinescalesetvmruncommandsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts +[virtualmachinescalesetvmsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts +[virtualmachinescalesetvmsattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts +[virtualmachinescalesetvmsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeallocateSample.ts +[virtualmachinescalesetvmsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeleteSample.ts +[virtualmachinescalesetvmsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetInstanceViewSample.ts +[virtualmachinescalesetvmsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetSample.ts +[virtualmachinescalesetvmslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsListSample.ts +[virtualmachinescalesetvmsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPerformMaintenanceSample.ts +[virtualmachinescalesetvmspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPowerOffSample.ts +[virtualmachinescalesetvmsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRedeploySample.ts +[virtualmachinescalesetvmsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageAllSample.ts +[virtualmachinescalesetvmsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageSample.ts +[virtualmachinescalesetvmsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRestartSample.ts +[virtualmachinescalesetvmsretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts +[virtualmachinescalesetvmsruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRunCommandSample.ts +[virtualmachinescalesetvmssimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsSimulateEvictionSample.ts +[virtualmachinescalesetvmsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsStartSample.ts +[virtualmachinescalesetvmsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsUpdateSample.ts +[virtualmachinescalesetsapproverollingupgradesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts +[virtualmachinescalesetsconverttosingleplacementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts +[virtualmachinescalesetscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts +[virtualmachinescalesetsdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeallocateSample.ts +[virtualmachinescalesetsdeleteinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts +[virtualmachinescalesetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteSample.ts +[virtualmachinescalesetsforcerecoveryservicefabricplatformupdatedomainwalksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts +[virtualmachinescalesetsgetinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts +[virtualmachinescalesetsgetosupgradehistorysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts +[virtualmachinescalesetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetSample.ts +[virtualmachinescalesetslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListAllSample.ts +[virtualmachinescalesetslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListByLocationSample.ts +[virtualmachinescalesetslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSample.ts +[virtualmachinescalesetslistskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSkusSample.ts +[virtualmachinescalesetsperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts +[virtualmachinescalesetspoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPowerOffSample.ts +[virtualmachinescalesetsreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReapplySample.ts +[virtualmachinescalesetsredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRedeploySample.ts +[virtualmachinescalesetsreimageallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageAllSample.ts +[virtualmachinescalesetsreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageSample.ts +[virtualmachinescalesetsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRestartSample.ts +[virtualmachinescalesetsscaleoutsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsScaleOutSample.ts +[virtualmachinescalesetssetorchestrationservicestatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts +[virtualmachinescalesetsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsStartSample.ts +[virtualmachinescalesetsupdateinstancessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts +[virtualmachinescalesetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateSample.ts +[virtualmachinesizeslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineSizesListSample.ts +[virtualmachinesassesspatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAssessPatchesSample.ts +[virtualmachinesattachdetachdatadiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts +[virtualmachinescapturesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCaptureSample.ts +[virtualmachinesconverttomanageddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesConvertToManagedDisksSample.ts +[virtualmachinescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCreateOrUpdateSample.ts +[virtualmachinesdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeallocateSample.ts +[virtualmachinesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeleteSample.ts +[virtualmachinesgeneralizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGeneralizeSample.ts +[virtualmachinesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGetSample.ts +[virtualmachinesinstallpatchessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstallPatchesSample.ts +[virtualmachinesinstanceviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstanceViewSample.ts +[virtualmachineslistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAllSample.ts +[virtualmachineslistavailablesizessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAvailableSizesSample.ts +[virtualmachineslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListByLocationSample.ts +[virtualmachineslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListSample.ts +[virtualmachinesmigratetovmscalesetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts +[virtualmachinesperformmaintenancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPerformMaintenanceSample.ts +[virtualmachinespoweroffsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPowerOffSample.ts +[virtualmachinesreapplysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReapplySample.ts +[virtualmachinesredeploysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRedeploySample.ts +[virtualmachinesreimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReimageSample.ts +[virtualmachinesrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRestartSample.ts +[virtualmachinesretrievebootdiagnosticsdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts +[virtualmachinesruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRunCommandSample.ts +[virtualmachinessimulateevictionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesSimulateEvictionSample.ts +[virtualmachinesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesStartSample.ts +[virtualmachinesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesUpdateSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-compute [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute/README.md [typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/compute/arm-compute/samples/v23/typescript/package.json b/sdk/compute/arm-compute/samples/v24/typescript/package.json similarity index 86% rename from sdk/compute/arm-compute/samples/v23/typescript/package.json rename to sdk/compute/arm-compute/samples/v24/typescript/package.json index 4dc38fd520f3..19daef60910a 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/package.json +++ b/sdk/compute/arm-compute/samples/v24/typescript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-compute-ts", "private": true, "version": "1.0.0", - "description": " client library samples for TypeScript", + "description": "@azure/arm-compute client library samples for TypeScript", "engines": { "node": ">=20.0.0" }, @@ -18,10 +18,10 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "author": "Microsoft Corporation", "license": "MIT", @@ -38,6 +38,6 @@ "@types/node": "^20.0.0", "cross-env": "latest", "rimraf": "latest", - "typescript": "~5.9.3" + "typescript": "~6.0.2" } } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/sample.env b/sdk/compute/arm-compute/samples/v24/typescript/sample.env similarity index 100% rename from sdk/compute/arm-compute/samples/v23/typescript/sample.env rename to sdk/compute/arm-compute/samples/v24/typescript/sample.env diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts new file mode 100644 index 000000000000..e6359719685c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCancelMigrationToVirtualMachineScaleSetSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to cancel the migration operation on an Availability Set. + * + * @summary cancel the migration operation on an Availability Set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_CancelMigrationToVirtualMachineScaleSet.json + */ +async function availabilitySetCancelMigrationToVirtualMachineScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.cancelMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + ); +} + +async function main(): Promise { + await availabilitySetCancelMigrationToVirtualMachineScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts new file mode 100644 index 000000000000..5ecaaf697dd5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsConvertToVirtualMachineScaleSetSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. + * + * @summary create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ConvertToVirtualMachineScaleSet.json + */ +async function availabilitySetConvertToVirtualMachineScaleSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.convertToVirtualMachineScaleSet("rgcompute", "myAvailabilitySet", { + parameters: { virtualMachineScaleSetName: "{vmss-name}" }, + }); +} + +async function main(): Promise { + await availabilitySetConvertToVirtualMachineScaleSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7e3c2b6de4ce --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update an availability set. + * + * @summary create or update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create.json + */ +async function createAnAvailabilitySet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.createOrUpdate( + "myResourceGroup", + "myAvailabilitySet", + { location: "westus", platformFaultDomainCount: 2, platformUpdateDomainCount: 20 }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update an availability set. + * + * @summary create or update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json + */ +async function createAnAvailabilitySetWithScheduledEventPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.createOrUpdate( + "myResourceGroup", + "myAvailabilitySet", + { location: "westus", platformFaultDomainCount: 2, platformUpdateDomainCount: 20 }, + ); + console.log(result); +} + +async function main(): Promise { + await createAnAvailabilitySet(); + await createAnAvailabilitySetWithScheduledEventPolicy(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsDeleteSample.ts new file mode 100644 index 000000000000..dd4ca2aedf2c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an availability set. + * + * @summary delete an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json + */ +async function availabilitySetDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to delete an availability set. + * + * @summary delete an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json + */ +async function availabilitySetDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.delete("rgcompute", "aaaaaaaaaaa"); +} + +async function main(): Promise { + await availabilitySetDeleteMaximumSetGen(); + await availabilitySetDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsGetSample.ts new file mode 100644 index 000000000000..c6473d383405 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about an availability set. + * + * @summary retrieves information about an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + */ +async function availabilitySetGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get("rgcompute", "aaaaaaaaaaaa"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about an availability set. + * + * @summary retrieves information about an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + */ +async function availabilitySetGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.get("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); + console.log(result); +} + +async function main(): Promise { + await availabilitySetGetMaximumSetGen(); + await availabilitySetGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListAvailableSizesSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListAvailableSizesSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListAvailableSizesSample.ts index 6947686cf2b8..ed8a1e27336e 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/availabilitySetsListAvailableSizesSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListAvailableSizesSample.ts @@ -3,53 +3,43 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * This sample demonstrates how to lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. * - * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json + * @summary lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json */ async function availabilitySetListAvailableSizesMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.availabilitySets.listAvailableSizes( - resourceGroupName, - availabilitySetName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * This sample demonstrates how to lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. * - * @summary Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json + * @summary lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json */ async function availabilitySetListAvailableSizesMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const availabilitySetName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.availabilitySets.listAvailableSizes( - resourceGroupName, - availabilitySetName, - )) { + for await (const item of client.availabilitySets.listAvailableSizes("rgcompute", "aa")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListBySubscriptionSample.ts new file mode 100644 index 000000000000..412777308976 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all availability sets in a subscription. + * + * @summary lists all availability sets in a subscription. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ListBySubscription.json + */ +async function listAvailabilitySetsInASubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.availabilitySets.listBySubscription({ + expand: "virtualMachines\\$ref", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAvailabilitySetsInASubscription(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListSample.ts new file mode 100644 index 000000000000..d274bda01735 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsListSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all availability sets in a resource group. + * + * @summary lists all availability sets in a resource group. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json + */ +async function availabilitySetListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.availabilitySets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to lists all availability sets in a resource group. + * + * @summary lists all availability sets in a resource group. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json + */ +async function availabilitySetListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.availabilitySets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await availabilitySetListMaximumSetGen(); + await availabilitySetListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts new file mode 100644 index 000000000000..650c6e7e09d1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsStartMigrationToVirtualMachineScaleSetSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. + * + * @summary start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_StartMigrationToVirtualMachineScaleSet.json + */ +async function availabilitySetStartMigrationToVirtualMachineScaleSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.startMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + { + virtualMachineScaleSetFlexible: { + id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", + }, + }, + ); +} + +async function main(): Promise { + await availabilitySetStartMigrationToVirtualMachineScaleSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsUpdateSample.ts new file mode 100644 index 000000000000..f3d5f1824835 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsUpdateSample.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update an availability set. + * + * @summary update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json + */ +async function availabilitySetUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update("rgcompute", "aaaaaaaaaaaaaaaaaaa", { + platformFaultDomainCount: 2, + platformUpdateDomainCount: 20, + virtualMachines: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + proximityPlacementGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + sku: { name: "DSv3-Type1", tier: "aaa", capacity: 7 }, + tags: { key2574: "aaaaaaaa" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update an availability set. + * + * @summary update an availability set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json + */ +async function availabilitySetUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.availabilitySets.update("rgcompute", "aaaaaaaaaaaaaaaaaaaa", {}); + console.log(result); +} + +async function main(): Promise { + await availabilitySetUpdateMaximumSetGen(); + await availabilitySetUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts new file mode 100644 index 000000000000..2df666994f93 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/availabilitySetsValidateMigrationToVirtualMachineScaleSetSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. + * + * @summary validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. + * x-ms-original-file: 2025-11-01/availabilitySetExamples/AvailabilitySet_ValidateMigrationToVirtualMachineScaleSet.json + */ +async function availabilitySetValidateMigrationToVirtualMachineScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.availabilitySets.validateMigrationToVirtualMachineScaleSet( + "rgcompute", + "myAvailabilitySet", + { + virtualMachineScaleSetFlexible: { + id: "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}", + }, + }, + ); +} + +async function main(): Promise { + await availabilitySetValidateMigrationToVirtualMachineScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..44277ea253ff --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsCreateOrUpdateSample.ts @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_CreateOrUpdate.json + */ +async function createOrUpdateABlockCapacityReservationGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + "myResourceGroup", + "blockCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + reservationType: "Block", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json + */ +async function createOrUpdateACapacityReservationGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + "myResourceGroup", + "myCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + sharingProfile: { + subscriptionIds: [ + { id: "/subscriptions/{subscription-id1}" }, + { id: "/subscriptions/{subscription-id2}" }, + ], + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservationGroup_CreateOrUpdate.json + */ +async function createOrUpdateATargetedCapacityReservationGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.createOrUpdate( + "myResourceGroup", + "targetedCapacityReservationGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1", "2"], + sharingProfile: { + subscriptionIds: [ + { id: "/subscriptions/{subscription-id1}" }, + { id: "/subscriptions/{subscription-id2}" }, + ], + }, + reservationType: "Targeted", + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateABlockCapacityReservationGroup(); + await createOrUpdateACapacityReservationGroup(); + await createOrUpdateATargetedCapacityReservationGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsDeleteSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsDeleteSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsDeleteSample.ts index 75403d223e20..ed5d07ffccea 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsDeleteSample.ts @@ -3,48 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json + * @summary the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json */ async function capacityReservationGroupDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "a"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.delete( - resourceGroupName, - capacityReservationGroupName, - ); - console.log(result); + await client.capacityReservationGroups.delete("rgcompute", "a"); } /** - * This sample demonstrates how to The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * This sample demonstrates how to the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. * - * @summary The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json + * @summary the operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json */ async function capacityReservationGroupDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservationGroups.delete( - resourceGroupName, - capacityReservationGroupName, - ); - console.log(result); + await client.capacityReservationGroups.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsGetSample.ts new file mode 100644 index 000000000000..4c5610fea708 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsGetSample.ts @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. + * + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservationGroup_Get.json + */ +async function getABlockCapacityReservationGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + "myResourceGroup", + "blockCapacityReservationGroup", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. + * + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Get.json + */ +async function getACapacityReservationGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + "myResourceGroup", + "myCapacityReservationGroup", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about a capacity reservation group. + * + * @summary the operation that retrieves information about a capacity reservation group. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservationGroup_Get.json + */ +async function getATargetedCapacityReservationGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.get( + "myResourceGroup", + "targetedCapacityReservationGroup", + { expand: "instanceView" }, + ); + console.log(result); +} + +async function main(): Promise { + await getABlockCapacityReservationGroup(); + await getACapacityReservationGroup(); + await getATargetedCapacityReservationGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts new file mode 100644 index 000000000000..daa2b9cb66d2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListByResourceGroupSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * + * @summary lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json + */ +async function listCapacityReservationGroupsInResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.capacityReservationGroups.listByResourceGroup("myResourceGroup", { + expand: "virtualMachines/$ref", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listCapacityReservationGroupsInResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts similarity index 53% rename from sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts index f962373e680d..d285be3b9159 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsListBySubscriptionSample.ts @@ -1,59 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - CapacityReservationGroupsListBySubscriptionOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json + * @summary lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json */ async function listCapacityReservationGroupsInSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const expand = "virtualMachines/$ref"; - const options: CapacityReservationGroupsListBySubscriptionOptionalParams = { - expand, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listBySubscription( - options, - )) { + for await (const item of client.capacityReservationGroups.listBySubscription({ + expand: "virtualMachines/$ref", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * This sample demonstrates how to lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. * - * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json + * @summary lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json */ async function listCapacityReservationGroupsWithResourceIdsOnlyInSubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceIdsOnly = "All"; - const options: CapacityReservationGroupsListBySubscriptionOptionalParams = { - resourceIdsOnly, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.capacityReservationGroups.listBySubscription( - options, - )) { + for await (const item of client.capacityReservationGroups.listBySubscription({ + resourceIdsOnly: "All", + })) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsUpdateSample.ts new file mode 100644 index 000000000000..306052f2bec6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationGroupsUpdateSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * + * @summary the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json + */ +async function capacityReservationGroupUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + { tags: { key5355: "aaa" } }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * + * @summary the operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json + */ +async function capacityReservationGroupUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservationGroups.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await capacityReservationGroupUpdateMaximumSetGen(); + await capacityReservationGroupUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8fae63edb0eb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsCreateOrUpdateSample.ts @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_CreateOrUpdate.json + */ +async function createOrUpdateABlockCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "blockCapacityReservationGroup", + "blockCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_ND96isr_H100_v5", capacity: 1 }, + scheduleProfile: { start: "2025-08-01", end: "2025-08-02" }, + zones: ["1"], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json + */ +async function createOrUpdateACapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_DS1_v2", capacity: 4 }, + zones: ["1"], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * + * @summary the operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_CreateOrUpdate.json + */ +async function createOrUpdateATargetedCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.createOrUpdate( + "myResourceGroup", + "targetedCapacityReservationGroup", + "targetedCapacityReservation", + { + location: "westus", + tags: { department: "HR" }, + sku: { name: "Standard_DS1_v2", capacity: 4 }, + zones: ["1"], + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateABlockCapacityReservation(); + await createOrUpdateACapacityReservation(); + await createOrUpdateATargetedCapacityReservation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsDeleteSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsDeleteSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsDeleteSample.ts index 7ac41575efa6..d1e38ea45317 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsDeleteSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsDeleteSample.ts @@ -3,52 +3,35 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * This sample demonstrates how to the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. * - * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json + * @summary the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json */ async function capacityReservationDeleteMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaaaaaaaaaa"; - const capacityReservationName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginDeleteAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, + await client.capacityReservations.delete( + "rgcompute", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); - console.log(result); } /** - * This sample demonstrates how to The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * This sample demonstrates how to the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. * - * @summary The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json + * @summary the operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json */ async function capacityReservationDeleteMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const capacityReservationGroupName = "aaa"; - const capacityReservationName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.capacityReservations.beginDeleteAndWait( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - ); - console.log(result); + await client.capacityReservations.delete("rgcompute", "aaa", "aaaaaa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsGetSample.ts new file mode 100644 index 000000000000..85acb674e3d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsGetSample.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. + * + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_Get.json + */ +async function getABlockCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + "myResourceGroup", + "blockCapacityReservationGroup", + "blockCapacityReservation", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. + * + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Get.json + */ +async function getACapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + "myResourceGroup", + "myCapacityReservationGroup", + "myCapacityReservation", + { expand: "instanceView" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation that retrieves information about the capacity reservation. + * + * @summary the operation that retrieves information about the capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_Get.json + */ +async function getATargetedCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.get( + "myResourceGroup", + "targetedCapacityReservationGroup", + "targetedCapacityReservation", + { expand: "instanceView" }, + ); + console.log(result); +} + +async function main(): Promise { + await getABlockCapacityReservation(); + await getACapacityReservation(); + await getATargetedCapacityReservation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts similarity index 55% rename from sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts index 402628ae8abb..2ba4604a1abd 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsListByCapacityReservationGroupSample.ts @@ -3,77 +3,70 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/BlockCapacityReservation_ListByReservationGroup.json */ async function listBlockCapacityReservationsInReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "blockCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "blockCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json */ async function listCapacityReservationsInReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "myCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "myCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * This sample demonstrates how to lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. * - * @summary Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/capacityReservationExamples/TargetedCapacityReservation_ListByReservationGroup.json + * @summary lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/TargetedCapacityReservation_ListByReservationGroup.json */ async function listCapacityReservationsInTargetedReservationGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const capacityReservationGroupName = "targetedCapacityReservationGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.capacityReservations.listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, + "myResourceGroup", + "targetedCapacityReservationGroup", + { expand: "virtualMachines/$ref" }, )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsUpdateSample.ts new file mode 100644 index 000000000000..6d3aa0112425 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/capacityReservationsUpdateSample.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a capacity reservation. + * + * @summary the operation to update a capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json + */ +async function capacityReservationUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.update( + "rgcompute", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + { + sku: { name: "Standard_DS1_v2", tier: "aaa", capacity: 7 }, + tags: { key4974: "aaaaaaaaaaaaaaaa" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update a capacity reservation. + * + * @summary the operation to update a capacity reservation. + * x-ms-original-file: 2025-11-01/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json + */ +async function capacityReservationUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.capacityReservations.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaa", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await capacityReservationUpdateMaximumSetGen(); + await capacityReservationUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleriesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleriesGetSample.ts new file mode 100644 index 000000000000..367e1043bc8a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleriesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a community gallery by gallery public name. + * + * @summary get a community gallery by gallery public name. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGallery_Get.json + */ +async function getACommunityGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleries.get("myLocation", "publicGalleryName"); + console.log(result); +} + +async function main(): Promise { + await getACommunityGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..ab1c75c68ef3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a community gallery image version. + * + * @summary get a community gallery image version. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_Get.json + */ +async function getACommunityGalleryImageVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.communityGalleryImageVersions.get( + "myLocation", + "publicGalleryName", + "myGalleryImageName", + "myGalleryImageVersionName", + ); + console.log(result); +} + +async function main(): Promise { + await getACommunityGalleryImageVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsListSample.ts similarity index 53% rename from sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsListSample.ts index da3a76c8f459..38ff4c1257de 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImageVersionsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImageVersionsListSample.ts @@ -3,30 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List community gallery image versions inside an image. + * This sample demonstrates how to list community gallery image versions inside an image. * - * @summary List community gallery image versions inside an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json + * @summary list community gallery image versions inside an image. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImageVersion_List.json */ async function listCommunityGalleryImageVersions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.communityGalleryImageVersions.list( - location, - publicGalleryName, - galleryImageName, + "myLocation", + "publicGalleryName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesGetSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesGetSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesGetSample.ts index 3f7231694610..b7532338cd91 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesGetSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesGetSample.ts @@ -3,26 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a community gallery image. + * This sample demonstrates how to get a community gallery image. * - * @summary Get a community gallery image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json + * @summary get a community gallery image. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_Get.json */ async function getACommunityGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.communityGalleryImages.get( - location, - publicGalleryName, - galleryImageName, + "myLocation", + "publicGalleryName", + "myGalleryImageName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesListSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesListSample.ts index 7ad2f95f0774..a9b7fa9253da 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/communityGalleryImagesListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/communityGalleryImagesListSample.ts @@ -3,28 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List community gallery images inside a gallery. + * This sample demonstrates how to list community gallery images inside a gallery. * - * @summary List community gallery images inside a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json + * @summary list community gallery images inside a gallery. + * x-ms-original-file: 2025-03-03/communityGalleryExamples/CommunityGalleryImage_List.json */ async function listCommunityGalleryImages(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const publicGalleryName = "publicGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.communityGalleryImages.list( - location, - publicGalleryName, - )) { + for await (const item of client.communityGalleryImages.list("myLocation", "publicGalleryName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..10fffab32115 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsCreateOrUpdateSample.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * + * @summary create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json + */ +async function createOrUpdateADedicatedHostGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.createOrUpdate( + "myResourceGroup", + "myDedicatedHostGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1"], + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * + * @summary create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json + */ +async function createOrUpdateADedicatedHostGroupWithUltraSSDSupport(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.createOrUpdate( + "myResourceGroup", + "myDedicatedHostGroup", + { + location: "westus", + tags: { department: "finance" }, + zones: ["1"], + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + additionalCapabilities: { ultraSSDEnabled: true }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateADedicatedHostGroup(); + await createOrUpdateADedicatedHostGroupWithUltraSSDSupport(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsDeleteSample.ts new file mode 100644 index 000000000000..99e77dca602a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a dedicated host group. + * + * @summary delete a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostGroupDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHostGroups.delete("rgcompute", "a"); +} + +/** + * This sample demonstrates how to delete a dedicated host group. + * + * @summary delete a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostGroupDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHostGroups.delete("rgcompute", "aaaa"); +} + +async function main(): Promise { + await dedicatedHostGroupDeleteMaximumSetGen(); + await dedicatedHostGroupDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsGetSample.ts new file mode 100644 index 000000000000..86bdaf885256 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a dedicated host group. + * + * @summary retrieves information about a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get.json + */ +async function createADedicatedHostGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.get("myResourceGroup", "myDedicatedHostGroup"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a dedicated host group. + * + * @summary retrieves information about a dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + */ +async function createAnUltraSSDEnabledDedicatedHostGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.get("myResourceGroup", "myDedicatedHostGroup"); + console.log(result); +} + +async function main(): Promise { + await createADedicatedHostGroup(); + await createAnUltraSSDEnabledDedicatedHostGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts similarity index 59% rename from sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts index 880caf3bdcbb..c60e3cee17ba 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListByResourceGroupSample.ts @@ -3,49 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json + * @summary lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json */ async function dedicatedHostGroupListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHostGroups.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.dedicatedHostGroups.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json + * @summary lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json */ async function dedicatedHostGroupListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHostGroups.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.dedicatedHostGroups.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts similarity index 65% rename from sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts index 94f53dc3d365..d4dcf899a5a5 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsListBySubscriptionSample.ts @@ -3,41 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json + * @summary lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json */ async function dedicatedHostGroupListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHostGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * This sample demonstrates how to lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. * - * @summary Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json + * @summary lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json */ async function dedicatedHostGroupListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHostGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsUpdateSample.ts new file mode 100644 index 000000000000..a0774a2e9d9d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostGroupsUpdateSample.ts @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update an dedicated host group. + * + * @summary update an dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json + */ +async function dedicatedHostGroupUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update("rgcompute", "aaaa", { + platformFaultDomainCount: 3, + supportAutomaticPlacement: true, + zones: ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"], + tags: { key9921: "aaaaaaaaaa" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to update an dedicated host group. + * + * @summary update an dedicated host group. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json + */ +async function dedicatedHostGroupUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHostGroups.update("rgcompute", "aaaaaaaaaaa", {}); + console.log(result); +} + +async function main(): Promise { + await dedicatedHostGroupUpdateMaximumSetGen(); + await dedicatedHostGroupUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..94a71231ced2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsCreateOrUpdateSample.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a dedicated host . + * + * @summary create or update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json + */ +async function createOrUpdateADedicatedHost(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.createOrUpdate( + "myResourceGroup", + "myDedicatedHostGroup", + "myDedicatedHost", + { + location: "westus", + tags: { department: "HR" }, + platformFaultDomain: 1, + sku: { name: "DSv3-Type1" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateADedicatedHost(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsDeleteSample.ts new file mode 100644 index 000000000000..c8f9a48f0db9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a dedicated host. + * + * @summary delete a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json + */ +async function dedicatedHostDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHosts.delete("rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to delete a dedicated host. + * + * @summary delete a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json + */ +async function dedicatedHostDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.dedicatedHosts.delete("rgcompute", "aaaaaaaaaaaaaaa", "aaaaa"); +} + +async function main(): Promise { + await dedicatedHostDeleteMaximumSetGen(); + await dedicatedHostDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsGetSample.ts new file mode 100644 index 000000000000..3bd12f478161 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a dedicated host. + * + * @summary retrieves information about a dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Get.json + */ +async function getADedicatedHost(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.get( + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", + { expand: "instanceView" }, + ); + console.log(result); +} + +async function main(): Promise { + await getADedicatedHost(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListAvailableSizesSample.ts similarity index 60% rename from sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListAvailableSizesSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListAvailableSizesSample.ts index 870289e37b52..673bb080601a 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListAvailableSizesSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListAvailableSizesSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. + * This sample demonstrates how to lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. * - * @summary Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json + * @summary lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json */ async function getAvailableDedicatedHostSizes(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHosts.listAvailableSizes( - resourceGroupName, - hostGroupName, - hostName, + "myResourceGroup", + "myDedicatedHostGroup", + "myHost", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListByHostGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListByHostGroupSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListByHostGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListByHostGroupSample.ts index 506164d4279d..5563cc444ce9 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsListByHostGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsListByHostGroupSample.ts @@ -3,53 +3,43 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * This sample demonstrates how to lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. * - * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json + * @summary lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json */ async function dedicatedHostListByHostGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.dedicatedHosts.listByHostGroup( - resourceGroupName, - hostGroupName, + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * This sample demonstrates how to lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. * - * @summary Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json + * @summary lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json */ async function dedicatedHostListByHostGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const hostGroupName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.dedicatedHosts.listByHostGroup( - resourceGroupName, - hostGroupName, - )) { + for await (const item of client.dedicatedHosts.listByHostGroup("rgcompute", "aaaa")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRedeploySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRedeploySample.ts similarity index 61% rename from sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRedeploySample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRedeploySample.ts index 5e16adb854cb..05744c1aac57 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRedeploySample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRedeploySample.ts @@ -3,29 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * This sample demonstrates how to redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. * - * @summary Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json + * @summary redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Redeploy.json */ async function redeployDedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginRedeployAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.redeploy("myResourceGroup", "myDedicatedHostGroup", "myHost"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRestartSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRestartSample.ts similarity index 61% rename from sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRestartSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRestartSample.ts index 30d98d5c8513..bacefa902824 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/dedicatedHostsRestartSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsRestartSample.ts @@ -3,29 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * This sample demonstrates how to restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. * - * @summary Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json + * @summary restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Restart.json */ async function restartDedicatedHost(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const hostGroupName = "myDedicatedHostGroup"; - const hostName = "myHost"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.dedicatedHosts.beginRestartAndWait( - resourceGroupName, - hostGroupName, - hostName, - ); - console.log(result); + await client.dedicatedHosts.restart("myResourceGroup", "myDedicatedHostGroup", "myHost"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsUpdateSample.ts new file mode 100644 index 000000000000..9cab34deb1be --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/dedicatedHostsUpdateSample.ts @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a dedicated host . + * + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json + */ +async function dedicatedHostUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.update( + "rgcompute", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { + platformFaultDomain: 1, + autoReplaceOnFailure: true, + licenseType: "Windows_Server_Hybrid", + tags: { key8813: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a dedicated host . + * + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json + */ +async function dedicatedHostUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.update( + "rgcompute", + "aa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + {}, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a dedicated host . + * + * @summary update a dedicated host . + * x-ms-original-file: 2025-11-01/dedicatedHostExamples/DedicatedHost_Update_Resize.json + */ +async function dedicatedHostUpdateResize(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.dedicatedHosts.update( + "rgcompute", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { sku: { name: "DSv3-Type1" } }, + ); + console.log(result); +} + +async function main(): Promise { + await dedicatedHostUpdateMaximumSetGen(); + await dedicatedHostUpdateMinimumSetGen(); + await dedicatedHostUpdateResize(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..051b2a078cff --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesCreateOrUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a disk access resource + * + * @summary creates or updates a disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Create.json + */ +async function createADiskAccessResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.createOrUpdate("myResourceGroup", "myDiskAccess", { + location: "West US", + }); + console.log(result); +} + +async function main(): Promise { + await createADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..9b5a2021a588 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteAPrivateEndpointConnectionSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a private endpoint connection under a disk access resource. + * + * @summary deletes a private endpoint connection under a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json + */ +async function deleteAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskAccesses.deleteAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + ); +} + +async function main(): Promise { + await deleteAPrivateEndpointConnectionUnderADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteSample.ts new file mode 100644 index 000000000000..682b1325bffc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a disk access resource. + * + * @summary deletes a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Delete.json + */ +async function deleteADiskAccessResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskAccesses.delete("myResourceGroup", "myDiskAccess"); +} + +async function main(): Promise { + await deleteADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts similarity index 52% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts index b167c750bd48..f02e5c6c673d 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetAPrivateEndpointConnectionSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets information about a private endpoint connection under a disk access resource. + * This sample demonstrates how to gets information about a private endpoint connection under a disk access resource. * - * @summary Gets information about a private endpoint connection under a disk access resource. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + * @summary gets information about a private endpoint connection under a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json */ async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; - const privateEndpointConnectionName = "myPrivateEndpointConnection"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.diskAccesses.getAPrivateEndpointConnection( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts index 8e4820c286e2..a224a7d318df 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetPrivateLinkResourcesSample.ts @@ -3,25 +3,20 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the private link resources possible under disk access resource + * This sample demonstrates how to gets the private link resources possible under disk access resource * - * @summary Gets the private link resources possible under disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json + * @summary gets the private link resources possible under disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json */ async function listAllPossiblePrivateLinkResourcesUnderDiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.diskAccesses.getPrivateLinkResources( - resourceGroupName, - diskAccessName, + "myResourceGroup", + "myDiskAccess", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetSample.ts new file mode 100644 index 000000000000..711fa7646ac8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a disk access resource. + * + * @summary gets information about a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get.json + */ +async function getInformationAboutADiskAccessResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get("myResourceGroup", "myDiskAccess"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a disk access resource. + * + * @summary gets information about a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + */ +async function getInformationAboutADiskAccessResourceWithPrivateEndpoints(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.get("myResourceGroup", "myDiskAccess"); + console.log(result); +} + +async function main(): Promise { + await getInformationAboutADiskAccessResource(); + await getInformationAboutADiskAccessResourceWithPrivateEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListByResourceGroupSample.ts similarity index 57% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListByResourceGroupSample.ts index 7be4c467ccd5..8cfc3e8bc08d 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk access resources under a resource group. + * This sample demonstrates how to lists all the disk access resources under a resource group. * - * @summary Lists all the disk access resources under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json + * @summary lists all the disk access resources under a resource group. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListByResourceGroup.json */ async function listAllDiskAccessResourcesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.diskAccesses.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.diskAccesses.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts similarity index 58% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts index 80bc72757860..eb9823dbc4c7 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListPrivateEndpointConnectionsSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List information about private endpoint connections under a disk access resource + * This sample demonstrates how to list information about private endpoint connections under a disk access resource * - * @summary List information about private endpoint connections under a disk access resource - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json + * @summary list information about private endpoint connections under a disk access resource + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json */ async function getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskAccessName = "myDiskAccess"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskAccesses.listPrivateEndpointConnections( - resourceGroupName, - diskAccessName, + "myResourceGroup", + "myDiskAccess", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListSample.ts similarity index 63% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListSample.ts index 7f49b691f7b6..69e67fe77817 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskAccessesListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk access resources under a subscription. + * This sample demonstrates how to lists all the disk access resources under a subscription. * - * @summary Lists all the disk access resources under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json + * @summary lists all the disk access resources under a subscription. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_ListBySubscription.json */ async function listAllDiskAccessResourcesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskAccesses.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts new file mode 100644 index 000000000000..9ad23e306a06 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateAPrivateEndpointConnectionSample.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * + * @summary approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + */ +async function approveAPrivateEndpointConnectionUnderADiskAccessResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.updateAPrivateEndpointConnection( + "myResourceGroup", + "myDiskAccess", + "myPrivateEndpointConnection", + { + privateLinkServiceConnectionState: { + status: "Approved", + description: "Approving myPrivateEndpointConnection", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await approveAPrivateEndpointConnectionUnderADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateSample.ts new file mode 100644 index 000000000000..206a27e7cbbe --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskAccessesUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates (patches) a disk access resource. + * + * @summary updates (patches) a disk access resource. + * x-ms-original-file: 2025-01-02/diskAccessExamples/DiskAccess_Update.json + */ +async function updateADiskAccessResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskAccesses.update("myResourceGroup", "myDiskAccess", { + tags: { department: "Development", project: "PrivateEndpoints" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateADiskAccessResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5accad7a9349 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsCreateOrUpdateSample.ts @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a disk encryption set + * + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create.json + */ +async function createADiskEncryptionSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { type: "SystemAssigned" }, + activeKey: { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/{key}", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk encryption set + * + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json + */ +async function createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { type: "SystemAssigned" }, + activeKey: { keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}" }, + encryptionType: "EncryptionAtRestWithCustomerKey", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk encryption set + * + * @summary creates or updates a disk encryption set + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json + */ +async function createADiskEncryptionSetWithKeyVaultFromADifferentTenant(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.createOrUpdate( + "myResourceGroup", + "myDiskEncryptionSet", + { + location: "West US", + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": + {}, + }, + }, + activeKey: { keyUrl: "https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}" }, + encryptionType: "EncryptionAtRestWithCustomerKey", + federatedClientId: "00000000-0000-0000-0000-000000000000", + }, + ); + console.log(result); +} + +async function main(): Promise { + await createADiskEncryptionSet(); + await createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(); + await createADiskEncryptionSetWithKeyVaultFromADifferentTenant(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsDeleteSample.ts new file mode 100644 index 000000000000..a990b53c6fa6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a disk encryption set. + * + * @summary deletes a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json + */ +async function deleteADiskEncryptionSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskEncryptionSets.delete("myResourceGroup", "myDiskEncryptionSet"); +} + +async function main(): Promise { + await deleteADiskEncryptionSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsGetSample.ts new file mode 100644 index 000000000000..92fb656013f4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a disk encryption set. + * + * @summary gets information about a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + */ +async function getInformationAboutADiskEncryptionSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get("myResourceGroup", "myDiskEncryptionSet"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a disk encryption set. + * + * @summary gets information about a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + */ +async function getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.get("myResourceGroup", "myDiskEncryptionSet"); + console.log(result); +} + +async function main(): Promise { + await getInformationAboutADiskEncryptionSet(); + await getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts similarity index 55% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts index 3684449edd67..02138f2ff04e 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListAssociatedResourcesSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all resources that are encrypted with this disk encryption set. + * This sample demonstrates how to lists all resources that are encrypted with this disk encryption set. * - * @summary Lists all resources that are encrypted with this disk encryption set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json + * @summary lists all resources that are encrypted with this disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json */ async function listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const diskEncryptionSetName = "myDiskEncryptionSet"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskEncryptionSets.listAssociatedResources( - resourceGroupName, - diskEncryptionSetName, + "myResourceGroup", + "myDiskEncryptionSet", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts index 1342eca575d3..638cb156fd75 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk encryption sets under a resource group. + * This sample demonstrates how to lists all the disk encryption sets under a resource group. * - * @summary Lists all the disk encryption sets under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json + * @summary lists all the disk encryption sets under a resource group. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json */ async function listAllDiskEncryptionSetsInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.diskEncryptionSets.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.diskEncryptionSets.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListSample.ts similarity index 62% rename from sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListSample.ts index 026902eec273..ffb21524f887 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/diskEncryptionSetsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disk encryption sets under a subscription. + * This sample demonstrates how to lists all the disk encryption sets under a subscription. * - * @summary Lists all the disk encryption sets under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json + * @summary lists all the disk encryption sets under a subscription. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json */ async function listAllDiskEncryptionSetsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.diskEncryptionSets.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsUpdateSample.ts new file mode 100644 index 000000000000..2453efa69472 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskEncryptionSetsUpdateSample.ts @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates (patches) a disk encryption set. + * + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update.json + */ +async function updateADiskEncryptionSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + activeKey: { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault", + }, + keyUrl: "https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + tags: { department: "Development", project: "Encryption" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk encryption set. + * + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + identity: { type: "SystemAssigned" }, + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + rotationToLatestKeyVersionEnabled: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk encryption set. + * + * @summary updates (patches) a disk encryption set. + * x-ms-original-file: 2025-01-02/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json + */ +async function updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskEncryptionSets.update("myResourceGroup", "myDiskEncryptionSet", { + identity: { type: "SystemAssigned" }, + activeKey: { + keyUrl: "https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1", + }, + encryptionType: "EncryptionAtRestWithCustomerKey", + rotationToLatestKeyVersionEnabled: true, + }); + console.log(result); +} + +async function main(): Promise { + await updateADiskEncryptionSet(); + await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(); + await updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGetSample.ts new file mode 100644 index 000000000000..92c369c47830 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGetSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get disk restorePoint resource + * + * @summary get disk restorePoint resource + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get.json + */ +async function getAnIncrementalDiskRestorePointResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePoint.get( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + ); + console.log(result); +} + +/** + * This sample demonstrates how to get disk restorePoint resource + * + * @summary get disk restorePoint resource + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + */ +async function getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePoint.get( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + ); + console.log(result); +} + +async function main(): Promise { + await getAnIncrementalDiskRestorePointResource(); + await getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGrantAccessSample.ts new file mode 100644 index 000000000000..dc7321c3d02e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointGrantAccessSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to grants access to a diskRestorePoint. + * + * @summary grants access to a diskRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json + */ +async function grantsAccessToADiskRestorePoint(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.diskRestorePoint.grantAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + { access: "Read", durationInSeconds: 300, fileFormat: "VHDX" }, + ); + console.log(result); +} + +async function main(): Promise { + await grantsAccessToADiskRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointListByRestorePointSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointListByRestorePointSample.ts new file mode 100644 index 000000000000..5cbb1df3e862 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointListByRestorePointSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists diskRestorePoints under a vmRestorePoint. + * + * @summary lists diskRestorePoints under a vmRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json + */ +async function getAnIncrementalDiskRestorePointResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.diskRestorePoint.listByRestorePoint( + "myResourceGroup", + "rpc", + "vmrp", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getAnIncrementalDiskRestorePointResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointRevokeAccessSample.ts new file mode 100644 index 000000000000..8a9445e1e29e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/diskRestorePointRevokeAccessSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to revokes access to a diskRestorePoint. + * + * @summary revokes access to a diskRestorePoint. + * x-ms-original-file: 2025-01-02/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json + */ +async function revokesAccessToADiskRestorePoint(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.diskRestorePoint.revokeAccess( + "myResourceGroup", + "rpc", + "vmrp", + "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", + ); +} + +async function main(): Promise { + await revokesAccessToADiskRestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/disksCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3de6a69eb4dd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksCreateOrUpdateSample.ts @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_AvailabilityPolicy.json + */ +async function createAManagedDiskWithAvailabilityPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 1024, + availabilityPolicy: { actionOnDiskDelay: "AutomaticReattach" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByCopyingASnapshot.json + */ +async function createAManagedDiskByCopyingASnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "Import", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json + */ +async function createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json + */ +async function createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { + securityType: "ConfidentialVM_DiskEncryptedWithCustomerKey", + secureVMDiskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + }, + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_Empty.json + */ +async function createAnEmptyManagedDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAPlatformImage.json + */ +async function createAManagedDiskFromAPlatformImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json + */ +async function createAManagedDiskFromAnAzureComputeGalleryCommunityImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + galleryImageReference: { + communityGalleryImageId: + "/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json + */ +async function createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + galleryImageReference: { + sharedGalleryImageId: + "/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json + */ +async function createAManagedDiskFromAnAzureComputeGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + creationData: { + createOption: "FromImage", + galleryImageReference: { + id: "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json + */ +async function createAManagedDiskFromElasticSanVolumeSnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { + createOption: "CopyFromSanSnapshot", + elasticSanResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromAnExistingManagedDisk.json + */ +async function createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk2", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromImportSecure.json + */ +async function createAManagedDiskFromImportSecureCreateOption(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" }, + creationData: { + createOption: "ImportSecure", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromImportSecure_WithVMMetadata.json + */ +async function createAManagedDiskFromImportSecureCreateOptionWithMetadataURIForConfidentialVM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" }, + creationData: { + createOption: "ImportSecure", + storageAccountId: + "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + securityDataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd", + securityMetadataUri: "https://mystorageaccount.blob.core.windows.net/osimages/vmmd.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_FromUploadPreparedSecure.json + */ +async function createAManagedDiskFromUploadPreparedSecureCreateOption(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + creationData: { createOption: "UploadPreparedSecure", uploadSizeBytes: 10737418752 }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_InExtendedLocation.json + */ +async function createAnEmptyManagedDiskInExtendedLocation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + extendedLocation: { type: "EdgeZone", name: "{edge-zone-id}" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_PerformancePlus.json + */ +async function createAManagedDiskWithPerformancePlus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Upload", performancePlus: true }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_UploadDisk.json + */ +async function createAManagedUploadDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Upload", uploadSizeBytes: 10737418752 }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDataAccessAuthMode.json + */ +async function createAManagedDiskWithDataAccessAuthMode(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + dataAccessAuthMode: "AzureActiveDirectory", + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDiskAccess.json + */ +async function createAManagedDiskAndAssociateWithDiskAccessResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + networkAccessPolicy: "AllowPrivate", + diskAccessId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}", + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithDiskEncryptionSet.json + */ +async function createAManagedDiskAndAssociateWithDiskEncryptionSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + encryption: { + diskEncryptionSetId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithLogicalSectorSize.json + */ +async function createAnUltraManagedDiskWithLogicalSectorSize512E(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + sku: { name: "UltraSSD_LRS" }, + creationData: { createOption: "Empty", logicalSectorSize: 512 }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json + */ +async function createAManagedDiskWithOptimizedForFrequentAttach(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + optimizedForFrequentAttach: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + */ +async function createAManagedDiskWithPremiumV2AccountType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myPremiumV2Disk", { + location: "West US", + sku: { name: "PremiumV2_LRS" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + diskIopsReadWrite: 125, + diskMBpsReadWrite: 3000, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithSSDZRSAccountType.json + */ +async function createAManagedDiskWithSsdZrsAccountType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "West US", + sku: { name: "Premium_ZRS" }, + creationData: { createOption: "Empty" }, + diskSizeGB: 200, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithSecurityProfile.json + */ +async function createAManagedDiskWithSecurityProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myDisk", { + location: "North Central US", + osType: "Windows", + securityProfile: { securityType: "TrustedLaunch" }, + creationData: { + createOption: "FromImage", + imageReference: { + id: "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a disk. + * + * @summary creates or updates a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json + */ +async function createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.createOrUpdate("myResourceGroup", "myUltraReadOnlyDisk", { + location: "West US", + sku: { name: "UltraSSD_LRS" }, + creationData: { createOption: "Empty", logicalSectorSize: 4096 }, + diskSizeGB: 200, + diskIopsReadWrite: 125, + diskMBpsReadWrite: 3000, + encryption: { type: "EncryptionAtRestWithPlatformKey" }, + }); + console.log(result); +} + +async function main(): Promise { + await createAManagedDiskWithAvailabilityPolicy(); + await createAManagedDiskByCopyingASnapshot(); + await createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(); + await createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(); + await createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(); + await createAnEmptyManagedDisk(); + await createAManagedDiskFromAPlatformImage(); + await createAManagedDiskFromAnAzureComputeGalleryCommunityImage(); + await createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage(); + await createAManagedDiskFromAnAzureComputeGalleryImage(); + await createAManagedDiskFromElasticSanVolumeSnapshot(); + await createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(); + await createAManagedDiskFromImportSecureCreateOption(); + await createAManagedDiskFromImportSecureCreateOptionWithMetadataURIForConfidentialVM(); + await createAManagedDiskFromUploadPreparedSecureCreateOption(); + await createAnEmptyManagedDiskInExtendedLocation(); + await createAManagedDiskWithPerformancePlus(); + await createAManagedUploadDisk(); + await createAManagedDiskWithDataAccessAuthMode(); + await createAManagedDiskAndAssociateWithDiskAccessResource(); + await createAManagedDiskAndAssociateWithDiskEncryptionSet(); + await createAnUltraManagedDiskWithLogicalSectorSize512E(); + await createAManagedDiskWithOptimizedForFrequentAttach(); + await createAManagedDiskWithPremiumV2AccountType(); + await createAManagedDiskWithSsdZrsAccountType(); + await createAManagedDiskWithSecurityProfile(); + await createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/disksDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksDeleteSample.ts new file mode 100644 index 000000000000..a393adfd138d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a disk. + * + * @summary deletes a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Delete.json + */ +async function deleteAManagedDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.disks.delete("myResourceGroup", "myDisk"); +} + +async function main(): Promise { + await deleteAManagedDisk(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/disksGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksGetSample.ts new file mode 100644 index 000000000000..078b5afed49d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a disk. + * + * @summary gets information about a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Get.json + */ +async function getInformationAboutAManagedDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.get("myResourceGroup", "myManagedDisk"); + console.log(result); +} + +async function main(): Promise { + await getInformationAboutAManagedDisk(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/disksGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksGrantAccessSample.ts new file mode 100644 index 000000000000..33aa6fa22d00 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksGrantAccessSample.ts @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to grants access to a disk. + * + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess.json + */ +async function getASasOnAManagedDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { + access: "Read", + durationInSeconds: 300, + fileFormat: "VHD", + }); + console.log(result); +} + +/** + * This sample demonstrates how to grants access to a disk. + * + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json + */ +async function getSasOnManagedDiskAndVMGuestState(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { + access: "Read", + durationInSeconds: 300, + getSecureVMGuestStateSAS: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to grants access to a disk. + * + * @summary grants access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_BeginGetAccess_WithVMGuestStateAndVMMetadata.json + */ +async function getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.grantAccess("myResourceGroup", "myDisk", { + access: "Read", + durationInSeconds: 300, + getSecureVMGuestStateSAS: true, + }); + console.log(result); +} + +async function main(): Promise { + await getASasOnAManagedDisk(); + await getSasOnManagedDiskAndVMGuestState(); + await getSasOnManagedDiskVMGuestStateAndVMMetadataForConfidentialVM(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksListByResourceGroupSample.ts similarity index 52% rename from sdk/compute/arm-compute/samples/v23/typescript/src/disksListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/disksListByResourceGroupSample.ts index c0cedb81c6a9..413af66b8bd8 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disks under a resource group. + * This sample demonstrates how to lists all the disks under a resource group. * - * @summary Lists all the disks under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListByResourceGroup.json + * @summary lists all the disks under a resource group. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_ListByResourceGroup.json */ async function listAllManagedDisksInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.disks.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.disks.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/disksListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksListSample.ts similarity index 63% rename from sdk/compute/arm-compute/samples/v23/typescript/src/disksListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/disksListSample.ts index 6fc48a5100c5..204f6704804e 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/disksListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all the disks under a subscription. + * This sample demonstrates how to lists all the disks under a subscription. * - * @summary Lists all the disks under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/diskExamples/Disk_ListBySubscription.json + * @summary lists all the disks under a subscription. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_ListBySubscription.json */ async function listAllManagedDisksInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.disks.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/disksRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksRevokeAccessSample.ts new file mode 100644 index 000000000000..deb852441cc9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksRevokeAccessSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to revokes access to a disk. + * + * @summary revokes access to a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_EndGetAccess.json + */ +async function revokeAccessToAManagedDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.disks.revokeAccess("myResourceGroup", "myDisk"); +} + +async function main(): Promise { + await revokeAccessToAManagedDisk(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/disksUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/disksUpdateSample.ts new file mode 100644 index 000000000000..035db7263a0d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/disksUpdateSample.ts @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json + */ +async function createOrUpdateABurstingEnabledManagedDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + diskSizeGB: 1024, + burstingEnabled: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddAcceleratedNetworking.json + */ +async function updateAManagedDiskToAddAcceleratedNetworking(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { acceleratedNetwork: false }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddDiskControllerTypes.json + */ +async function updateAManagedDiskWithDiskControllerTypes(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { diskControllerTypes: "SCSI" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddPurchasePlan.json + */ +async function updateAManagedDiskToAddPurchasePlan(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + purchasePlan: { + name: "myPurchasePlanName", + publisher: "myPurchasePlanPublisher", + product: "myPurchasePlanProduct", + promotionCode: "myPurchasePlanPromotionCode", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_AddSupportsHibernation.json + */ +async function updateAManagedDiskToAddSupportsHibernation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportsHibernation: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_ChangeTier.json + */ +async function updateAManagedDiskToChangeTier(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { tier: "P30" }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_DisableBursting.json + */ +async function updateAManagedDiskToDisableBursting(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { burstingEnabled: false }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json + */ +async function updateAManagedDiskToDisableOptimizedForFrequentAttach(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + optimizedForFrequentAttach: false, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_RemoveDiskAccess.json + */ +async function updateManagedDiskToRemoveDiskAccessResourceAssociation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + networkAccessPolicy: "AllowAll", + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a disk. + * + * @summary updates (patches) a disk. + * x-ms-original-file: 2025-01-02/diskExamples/Disk_Update_ToAddArchitecture.json + */ +async function updateAManagedDiskToAddArchitecture(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.disks.update("myResourceGroup", "myDisk", { + supportedCapabilities: { architecture: "Arm64" }, + }); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateABurstingEnabledManagedDisk(); + await updateAManagedDiskToAddAcceleratedNetworking(); + await updateAManagedDiskWithDiskControllerTypes(); + await updateAManagedDiskToAddPurchasePlan(); + await updateAManagedDiskToAddSupportsHibernation(); + await updateAManagedDiskToChangeTier(); + await updateAManagedDiskToDisableBursting(); + await updateAManagedDiskToDisableOptimizedForFrequentAttach(); + await updateManagedDiskToRemoveDiskAccessResourceAssociation(); + await updateAManagedDiskToAddArchitecture(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..1cfb618f1b7d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesCreateOrUpdateSample.ts @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Create.json + */ +async function createACommunityGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + sharingProfile: { + permissions: "Community", + communityGalleryInfo: { + publisherUri: "uri", + publisherContact: "pir@microsoft.com", + eula: "eula", + publicNamePrefix: "PirPublic", + }, + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create.json + */ +async function createOrUpdateASimpleGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_SoftDeletionEnabled.json + */ +async function createOrUpdateASimpleGalleryWithSoftDeletionEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + softDeletePolicy: { isSoftDeleteEnabled: true }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_WithManagedIdentity.json + */ +async function createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + identity: { + type: "SystemAssigned, UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": + {}, + }, + }, + description: "This is the gallery description.", + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a Shared Image Gallery. + * + * @summary create or update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Create_WithSharingProfile.json + */ +async function createOrUpdateASimpleGalleryWithSharingProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.createOrUpdate("myResourceGroup", "myGalleryName", { + location: "West US", + description: "This is the gallery description.", + sharingProfile: { permissions: "Groups" }, + }); + console.log(result); +} + +async function main(): Promise { + await createACommunityGallery(); + await createOrUpdateASimpleGallery(); + await createOrUpdateASimpleGalleryWithSoftDeletionEnabled(); + await createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); + await createOrUpdateASimpleGalleryWithSharingProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesDeleteSample.ts new file mode 100644 index 000000000000..3a8b231d36c2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a Shared Image Gallery. + * + * @summary delete a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Delete.json + */ +async function deleteAGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleries.delete("myResourceGroup", "myGalleryName"); +} + +async function main(): Promise { + await deleteAGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesGetSample.ts new file mode 100644 index 000000000000..1fe787589f40 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesGetSample.ts @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/CommunityGallery_Get.json + */ +async function getACommunityGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get.json + */ +async function getAGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json + */ +async function getAGalleryWithExpandSharingProfileGroups(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName", { + expand: "SharingProfile/Groups", + }); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithManagedIdentity.json + */ +async function getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a Shared Image Gallery. + * + * @summary retrieves information about a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Get_WithSelectPermissions.json + */ +async function getAGalleryWithSelectPermissions(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.get("myResourceGroup", "myGalleryName", { + select: "Permissions", + }); + console.log(result); +} + +async function main(): Promise { + await getACommunityGallery(); + await getAGallery(); + await getAGalleryWithExpandSharingProfileGroups(); + await getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities(); + await getAGalleryWithSelectPermissions(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListByResourceGroupSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListByResourceGroupSample.ts index bf216f1aac1c..4b0ab078b5bc 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List galleries under a resource group. + * This sample demonstrates how to list galleries under a resource group. * - * @summary List galleries under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json + * @summary list galleries under a resource group. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListByResourceGroup.json */ async function listGalleriesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.galleries.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.galleries.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListSample.ts similarity index 62% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListSample.ts index 3dc92135078a..03de1c6bdad9 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleriesListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List galleries under a subscription. + * This sample demonstrates how to list galleries under a subscription. * - * @summary List galleries under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/Gallery_ListBySubscription.json + * @summary list galleries under a subscription. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ListBySubscription.json */ async function listGalleriesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleries.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesUpdateSample.ts new file mode 100644 index 000000000000..3028fca96d89 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleriesUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a Shared Image Gallery. + * + * @summary update a Shared Image Gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_Update.json + */ +async function updateASimpleGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleries.update("myResourceGroup", "myGalleryName", { + description: "This is the gallery description.", + }); + console.log(result); +} + +async function main(): Promise { + await updateASimpleGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..47a662f4311a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsCreateOrUpdateSample.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a gallery Application Version. + * + * @summary create or update a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Create.json + */ +async function createOrUpdateASimpleGalleryApplicationVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { + location: "West US", + publishingProfile: { + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", + }, + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', + remove: "del C:\\package ", + }, + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 1, + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASimpleGalleryApplicationVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsDeleteSample.ts new file mode 100644 index 000000000000..786489da8630 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsDeleteSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery Application Version. + * + * @summary delete a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Delete.json + */ +async function deleteAGalleryApplicationVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryApplicationVersions.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + ); +} + +async function main(): Promise { + await deleteAGalleryApplicationVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsGetSample.ts new file mode 100644 index 000000000000..9e4d22e4145d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsGetSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a gallery Application Version. + * + * @summary retrieves information about a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get.json + */ +async function getAGalleryApplicationVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery Application Version. + * + * @summary retrieves information about a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json + */ +async function getAGalleryApplicationVersionWithReplicationStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { expand: "ReplicationStatus" }, + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryApplicationVersion(); + await getAGalleryApplicationVersionWithReplicationStatus(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts index 639b1a3b8a19..84559e2cdb8f 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsListByGalleryApplicationSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Application Versions in a gallery Application Definition. + * This sample demonstrates how to list gallery Application Versions in a gallery Application Definition. * - * @summary List gallery Application Versions in a gallery Application Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json + * @summary list gallery Application Versions in a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json */ async function listGalleryApplicationVersionsInAGalleryApplicationDefinition(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryApplicationName = "myGalleryApplicationName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryApplicationVersions.listByGalleryApplication( - resourceGroupName, - galleryName, - galleryApplicationName, + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsUpdateSample.ts new file mode 100644 index 000000000000..3eac329dbc5d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationVersionsUpdateSample.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a gallery Application Version. + * + * @summary update a gallery Application Version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplicationVersion_Update.json + */ +async function updateASimpleGalleryApplicationVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplicationVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + "1.0.0", + { + publishingProfile: { + source: { + mediaLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}", + }, + manageActions: { + install: + 'powershell -command "Expand-Archive -Path package.zip -DestinationPath C:\\package"', + remove: "del C:\\package ", + }, + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 1, + endOfLifeDate: new Date("2019-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateASimpleGalleryApplicationVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d38e1089b60d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a gallery Application Definition. + * + * @summary create or update a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Create.json + */ +async function createOrUpdateASimpleGalleryApplication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + { + location: "West US", + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASimpleGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsDeleteSample.ts new file mode 100644 index 000000000000..0a108cde8a32 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery Application. + * + * @summary delete a gallery Application. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Delete.json + */ +async function deleteAGalleryApplication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryApplications.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + ); +} + +async function main(): Promise { + await deleteAGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsGetSample.ts new file mode 100644 index 000000000000..ffa741dd41b6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a gallery Application Definition. + * + * @summary retrieves information about a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Get.json + */ +async function getAGalleryApplication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.get( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsListByGallerySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsListByGallerySample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsListByGallerySample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsListByGallerySample.ts index af317182ba80..b183a2f9de36 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryApplicationsListByGallerySample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsListByGallerySample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Application Definitions in a gallery. + * This sample demonstrates how to list gallery Application Definitions in a gallery. * - * @summary List gallery Application Definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json + * @summary list gallery Application Definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_ListByGallery.json */ async function listGalleryApplicationsInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryApplications.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsUpdateSample.ts new file mode 100644 index 000000000000..a1f98aefa2e0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryApplicationsUpdateSample.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a gallery Application Definition. + * + * @summary update a gallery Application Definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryApplication_Update.json + */ +async function updateASimpleGalleryApplication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryApplications.update( + "myResourceGroup", + "myGalleryName", + "myGalleryApplicationName", + { + description: "This is the gallery application description.", + eula: "This is the gallery application EULA.", + privacyStatementUri: "myPrivacyStatementUri}", + releaseNoteUri: "myReleaseNoteUri", + supportedOSType: "Windows", + customActions: [ + { + name: "myCustomAction", + script: "myCustomActionScript", + description: "This is the custom action description.", + parameters: [ + { + name: "myCustomActionParameter", + required: false, + type: "String", + defaultValue: "default value of parameter.", + description: "This is the description of the parameter", + }, + ], + }, + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateASimpleGalleryApplication(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3bd34d26f618 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsCreateOrUpdateSample.ts @@ -0,0 +1,830 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithAdditionalReplicaSets.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + additionalReplicaSets: [ + { storageAccountType: "PreviumV2_LRS", regionalReplicaCount: 1 }, + ], + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + communityGalleryImageId: + "/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [{ name: "West US", regionalReplicaCount: 1, excludeFromLatest: false }], + replicationMode: "Shallow", + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + osDiskImage: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}", + }, + hostCaching: "ReadOnly", + }, + dataDiskImages: [ + { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithStorageAccountStrategy.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { name: "West US" }, + { name: "East US" }, + { name: "East US 2", storageAccountType: "Premium_LRS" }, + ], + storageAccountStrategy: "PreferStandard_ZRS", + }, + storageProfile: { + source: { + virtualMachineId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json + */ +async function createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVHD.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", + }, + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1, + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + osDiskImage: { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + hostCaching: "ReadOnly", + }, + dataDiskImages: [ + { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 1, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet", + }, + dataDiskImages: [ + { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet", + lun: 1, + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + osDiskImage: { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + hostCaching: "ReadOnly", + }, + dataDiskImages: [ + { + source: { + storageAccountId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}", + uri: "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd", + }, + lun: 1, + hostCaching: "None", + }, + ], + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + securityProfile: { + uefiSettings: { + signatureTemplateNames: ["MicrosoftUefiCertificateAuthorityTemplate"], + additionalSignatures: { + kek: [{ type: "sha256", value: [""] }], + db: [{ type: "x509", value: [""] }], + dbx: [{ type: "x509", value: [""] }], + }, + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a gallery image version. + * + * @summary create or update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json + */ +async function createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + location: "West US", + publishingProfile: { + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 2, + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + { + name: "East US", + regionalReplicaCount: 2, + storageAccountType: "Standard_ZRS", + encryption: { + osDiskImage: { + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + dataDiskImages: [ + { + lun: 0, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet", + }, + { + lun: 1, + diskEncryptionSetId: + "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet", + }, + ], + }, + excludeFromLatest: false, + }, + ], + }, + storageProfile: { + source: { + virtualMachineId: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}", + }, + }, + safetyProfile: { + allowDeletionOfReplicatedLocations: false, + blockDeletionBeforeEndOfLife: false, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(); + await createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas(); + await createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource(); + await createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(); + await createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(); + await createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(); + await createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride(); + await createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified(); + await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(); + await createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys(); + await createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsDeleteSample.ts new file mode 100644 index 000000000000..d6fa05d770bb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsDeleteSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery image version. + * + * @summary delete a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Delete.json + */ +async function deleteAGalleryImageVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryImageVersions.delete( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); +} + +async function main(): Promise { + await deleteAGalleryImageVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..f3b68f6a3255 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsGetSample.ts @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get.json + */ +async function getAGalleryImageVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json + */ +async function getAGalleryImageVersionWithReplicationStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ReplicationStatus" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json + */ +async function getAGalleryImageVersionWithSnapshotsAsASource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithValidationProfile.json + */ +async function getAGalleryImageVersionWithValidationProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ValidationProfile" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json + */ +async function getAGalleryImageVersionWithValidationProfileAndReplicationStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { expand: "ValidationProfile,ReplicationStatus" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about a gallery image version. + * + * @summary retrieves information about a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json + */ +async function getAGalleryImageVersionWithVhdAsASource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryImageVersion(); + await getAGalleryImageVersionWithReplicationStatus(); + await getAGalleryImageVersionWithSnapshotsAsASource(); + await getAGalleryImageVersionWithValidationProfile(); + await getAGalleryImageVersionWithValidationProfileAndReplicationStatus(); + await getAGalleryImageVersionWithVhdAsASource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsListByGalleryImageSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsListByGalleryImageSample.ts similarity index 53% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsListByGalleryImageSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsListByGalleryImageSample.ts index 55e8aad7bad5..63183dd7f404 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryImageVersionsListByGalleryImageSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsListByGalleryImageSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery image versions in a gallery image definition. + * This sample demonstrates how to list gallery image versions in a gallery image definition. * - * @summary List gallery image versions in a gallery image definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json + * @summary list gallery image versions in a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_ListByGalleryImage.json */ async function listGalleryImageVersionsInAGalleryImageDefinition(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryImageVersions.listByGalleryImage( - resourceGroupName, - galleryName, - galleryImageName, + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsUpdateSample.ts new file mode 100644 index 000000000000..61a7438c4a9c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImageVersionsUpdateSample.ts @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a gallery image version. + * + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update.json + */ +async function updateASimpleGalleryImageVersionManagedImageAsSource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { name: "East US", regionalReplicaCount: 2, storageAccountType: "Standard_ZRS" }, + ], + }, + storageProfile: { + source: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a gallery image version. + * + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json + */ +async function restoreASoftDeletedGalleryImageVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { restore: true, storageProfile: {} }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a gallery image version. + * + * @summary update a gallery image version. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json + */ +async function updateASimpleGalleryImageVersionWithoutSourceId(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImageVersions.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + "1.0.0", + { + publishingProfile: { + targetRegions: [ + { name: "West US", regionalReplicaCount: 1 }, + { name: "East US", regionalReplicaCount: 2, storageAccountType: "Standard_ZRS" }, + ], + }, + storageProfile: {}, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateASimpleGalleryImageVersionManagedImageAsSource(); + await restoreASoftDeletedGalleryImageVersion(); + await updateASimpleGalleryImageVersionWithoutSourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..75e30c816347 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesCreateOrUpdateSample.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a gallery image definition. + * + * @summary create or update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Create.json + */ +async function createOrUpdateASimpleGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + location: "West US", + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V1", + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASimpleGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesDeleteSample.ts new file mode 100644 index 000000000000..1f9692513637 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery image. + * + * @summary delete a gallery image. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Delete.json + */ +async function deleteAGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryImages.delete("myResourceGroup", "myGalleryName", "myGalleryImageName"); +} + +async function main(): Promise { + await deleteAGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesGetSample.ts new file mode 100644 index 000000000000..77898a83a496 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a gallery image definition. + * + * @summary retrieves information about a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Get.json + */ +async function getAGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.get( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryImage(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesListByGallerySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesListByGallerySample.ts new file mode 100644 index 000000000000..53770633e0a9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesListByGallerySample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list gallery image definitions in a gallery. + * + * @summary list gallery image definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_ListByGallery.json + */ +async function listGalleryImagesInAGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.galleryImages.listByGallery("myResourceGroup", "myGalleryName")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listGalleryImagesInAGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesUpdateSample.ts new file mode 100644 index 000000000000..4e9b051b5172 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryImagesUpdateSample.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a gallery image definition. + * + * @summary update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_Update.json + */ +async function updateASimpleGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V1", + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to update a gallery image definition. + * + * @summary update a gallery image definition. + * x-ms-original-file: 2025-03-03/galleryExamples/GalleryImage_UpdateFeatures.json + */ +async function updateAGalleryImageFeature(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryImages.update( + "myResourceGroup", + "myGalleryName", + "myGalleryImageName", + { + osType: "Windows", + osState: "Generalized", + hyperVGeneration: "V2", + allowUpdateImage: true, + features: [{ name: "SecurityType", value: "TrustedLaunch", startsAtVersion: "2.0.0" }], + identifier: { publisher: "myPublisherName", offer: "myOfferName", sku: "mySkuName" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateASimpleGalleryImage(); + await updateAGalleryImageFeature(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..31d834c8da9f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsCreateOrUpdateSample.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a gallery inVMAccessControlProfile version. + * + * @summary create or update a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json + */ +async function createOrUpdateAGalleryInVMAccessControlProfileVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + { + location: "West US", + mode: "Audit", + defaultAccess: "Allow", + rules: { + privileges: [ + { name: "GoalState", path: "/machine", queryParameters: { comp: "goalstate" } }, + ], + roles: [{ name: "Provisioning", privileges: ["GoalState"] }], + identities: [ + { + name: "WinPA", + userName: "SYSTEM", + groupName: "Administrators", + exePath: "C:\\Windows\\System32\\cscript.exe", + processName: "cscript", + }, + ], + roleAssignments: [{ role: "Provisioning", identities: ["WinPA"] }], + }, + targetLocations: [{ name: "West US" }, { name: "South Central US" }], + excludeFromLatest: false, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts new file mode 100644 index 000000000000..4e4dcfcacbdc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsDeleteSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery inVMAccessControlProfile version. + * + * @summary delete a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json + */ +async function deleteAGalleryInVMAccessControlProfileVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryInVMAccessControlProfileVersions.delete( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + ); +} + +async function main(): Promise { + await deleteAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts new file mode 100644 index 000000000000..375c5c0bbdd3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a gallery inVMAccessControlProfile version. + * + * @summary retrieves information about a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json + */ +async function getAGalleryInVMAccessControlProfileVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.get( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts index f4018263e6dd..aa2d019ce1d9 100644 --- a/sdk/compute/arm-compute/samples-dev/galleryInVMAccessControlProfileVersionsListByGalleryInVmaccessControlProfileSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSample.ts @@ -3,36 +3,31 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * This sample demonstrates how to list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile * - * @summary List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json + * @summary list gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json */ -async function listGalleryInVMAccessControlProfileVersionsInAGalleryInVmaccessControlProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const inVMAccessControlProfileName = "myInVMAccessControlProfileName"; +async function listGalleryInVMAccessControlProfileVersionsInAGalleryInVMAccessControlProfile(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryInVMAccessControlProfileVersions.listByGalleryInVMAccessControlProfile( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", )) { resArray.push(item); } + console.log(resArray); } async function main(): Promise { - await listGalleryInVMAccessControlProfileVersionsInAGalleryInVmaccessControlProfile(); + await listGalleryInVMAccessControlProfileVersionsInAGalleryInVMAccessControlProfile(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts new file mode 100644 index 000000000000..faaf59cdce57 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfileVersionsUpdateSample.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a gallery inVMAccessControlProfile version. + * + * @summary update a gallery inVMAccessControlProfile version. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json + */ +async function updateAGalleryInVMAccessControlProfileVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfileVersions.update( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + "1.0.0", + { + mode: "Audit", + defaultAccess: "Allow", + targetLocations: [{ name: "West US" }, { name: "South Central US" }, { name: "East US" }], + excludeFromLatest: false, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateAGalleryInVMAccessControlProfileVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..848475a94b75 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesCreateOrUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a gallery inVMAccessControlProfile. + * + * @summary create or update a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json + */ +async function createOrUpdateAGalleryInVMAccessControlProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfiles.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + { location: "West US", properties: { osType: "Linux", applicableHostEndpoint: "WireServer" } }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts new file mode 100644 index 000000000000..4b0573ebac86 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery inVMAccessControlProfile. + * + * @summary delete a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json + */ +async function deleteAGalleryInVMAccessControlProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryInVMAccessControlProfiles.delete( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + ); +} + +async function main(): Promise { + await deleteAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesGetSample.ts new file mode 100644 index 000000000000..15577e6ba5b9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a gallery inVMAccessControlProfile. + * + * @summary retrieves information about a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json + */ +async function getAGalleryInVMAccessControlProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfiles.get( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts index a43a9aa34043..3a3c62b5ca77 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesListByGallerySample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery inVMAccessControlProfiles in a gallery. + * This sample demonstrates how to list gallery inVMAccessControlProfiles in a gallery. * - * @summary List gallery inVMAccessControlProfiles in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json + * @summary list gallery inVMAccessControlProfiles in a gallery. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json */ async function listGalleryInVMAccessControlProfilesInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryInVMAccessControlProfiles.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts new file mode 100644 index 000000000000..94b19177bd93 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryInVMAccessControlProfilesUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a gallery inVMAccessControlProfile. + * + * @summary update a gallery inVMAccessControlProfile. + * x-ms-original-file: 2025-03-03/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json + */ +async function updateAGalleryInVMAccessControlProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryInVMAccessControlProfiles.update( + "myResourceGroup", + "myGalleryName", + "myInVMAccessControlProfileName", + { properties: { osType: "Linux", applicableHostEndpoint: "WireServer" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateAGalleryInVMAccessControlProfile(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..50ac949cf226 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a gallery Script Version. + * + * @summary create or update a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Create.json + */ +async function createOrUpdateASimpleGalleryScriptVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + { + location: "West US", + properties: { + publishingProfile: { + source: { + scriptLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", + parameters: [ + { name: "location", required: true, defaultValue: "westus", type: "String" }, + { + name: "myGalleryScriptParameter1", + required: true, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "myGalleryScriptParameter2", + required: false, + type: "String", + defaultValue: "default value of parameter", + description: "description of the parameter", + }, + { + name: "numberOfUnits", + required: true, + type: "Int", + defaultValue: "3", + description: "description of the parameter", + minValue: "1", + maxValue: "5", + }, + { + name: "weightOfUnit", + required: true, + type: "Double", + defaultValue: "0.6", + description: "description of the parameter", + minValue: "0.1", + maxValue: "2", + }, + { + name: "typeOfProduct", + required: false, + type: "Enum", + defaultValue: "Fruit", + description: "description of the parameter", + enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], + }, + ], + }, + targetRegions: [ + { + name: "West US", + regionalReplicaCount: 2, + storageAccountType: "Standard_LRS", + excludeFromLatest: false, + }, + ], + replicaCount: 2, + endOfLifeDate: new Date("2027-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", + }, + safetyProfile: { allowDeletionOfReplicatedLocations: false }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASimpleGalleryScriptVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsDeleteSample.ts new file mode 100644 index 000000000000..f55d96f9a25f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsDeleteSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery Script Version. + * + * @summary delete a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Delete.json + */ +async function deleteAGalleryScriptVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryScriptVersions.delete( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + ); +} + +async function main(): Promise { + await deleteAGalleryScriptVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsGetSample.ts new file mode 100644 index 000000000000..44b3cb3d78b9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsGetSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to custom ArmResourceRead operation template with CloudError as Error + * + * @summary custom ArmResourceRead operation template with CloudError as Error + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get.json + */ +async function getAGalleryScriptVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.get( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to custom ArmResourceRead operation template with CloudError as Error + * + * @summary custom ArmResourceRead operation template with CloudError as Error + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json + */ +async function getAGalleryScriptVersionWithReplicationStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.get( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryScriptVersion(); + await getAGalleryScriptVersionWithReplicationStatus(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts similarity index 53% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts index 9082a43e1554..4847f78976c0 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsListByGalleryScriptSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Script Versions in a gallery Script Definition. + * This sample demonstrates how to list gallery Script Versions in a gallery Script Definition. * - * @summary List gallery Script Versions in a gallery Script Definition. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json + * @summary list gallery Script Versions in a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json */ async function listGalleryScriptVersionsInAGalleryScriptDefinition(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroupName"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryScriptVersions.listByGalleryScript( - resourceGroupName, - galleryName, - galleryScriptName, + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsUpdateSample.ts similarity index 63% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsUpdateSample.ts index fe6e8b61efb1..675e15d93e7f 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptVersionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptVersionsUpdateSample.ts @@ -1,113 +1,93 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - GalleryScriptVersion} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update a gallery Script Version. + * This sample demonstrates how to update a gallery Script Version. * - * @summary Create or update a gallery Script Version. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScriptVersion_Create.json + * @summary update a gallery Script Version. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScriptVersion_Update.json */ -async function createOrUpdateASimpleGalleryScriptVersion(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const galleryScriptName = "myGalleryScriptName"; - const galleryScriptVersionName = "1.0.0"; - const galleryScriptVersion: GalleryScriptVersion = { - location: "West US", - properties: { +async function updateASimpleGalleryScriptVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScriptVersions.update( + "myResourceGroupName", + "myGalleryName", + "myGalleryScriptName", + "1.0.0", + { publishingProfile: { - endOfLifeDate: new Date("2027-07-01T07:00:00Z"), - replicaCount: 2, source: { + scriptLink: + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", parameters: [ - { - name: "location", - type: "String", - defaultValue: "westus", - required: true, - }, + { name: "location", required: true, defaultValue: "westus", type: "String" }, { name: "myGalleryScriptParameter1", + required: true, type: "String", - description: "description of the parameter", defaultValue: "default value of parameter", - required: true, + description: "description of the parameter", }, { name: "myGalleryScriptParameter2", + required: false, type: "String", - description: "description of the parameter", defaultValue: "default value of parameter", - required: false, + description: "description of the parameter", }, { name: "numberOfUnits", + required: true, type: "Int", - description: "description of the parameter", defaultValue: "3", - maxValue: "5", + description: "description of the parameter", minValue: "1", - required: true, + maxValue: "5", }, { name: "weightOfUnit", + required: true, type: "Double", - description: "description of the parameter", defaultValue: "0.6", - maxValue: "2", + description: "description of the parameter", minValue: "0.1", - required: true, + maxValue: "2", }, { name: "typeOfProduct", + required: false, type: "Enum", - description: "description of the parameter", defaultValue: "Fruit", + description: "description of the parameter", enumValues: ["Fruit", "Vegetable", "Greens", "Nuts"], - required: false, }, ], - scriptLink: - "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}", }, - storageAccountType: "Standard_LRS", targetRegions: [ { name: "West US", - excludeFromLatest: false, regionalReplicaCount: 2, storageAccountType: "Standard_LRS", + excludeFromLatest: false, }, ], + replicaCount: 2, + endOfLifeDate: new Date("2027-07-01T07:00:00Z"), + storageAccountType: "Standard_LRS", }, safetyProfile: { allowDeletionOfReplicatedLocations: false }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.galleryScriptVersions.beginCreateOrUpdateAndWait( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, ); console.log(result); } async function main(): Promise { - await createOrUpdateASimpleGalleryScriptVersion(); + await updateASimpleGalleryScriptVersion(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3cdc7da00c73 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsCreateOrUpdateSample.ts @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts + * + * @summary create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Create.json + */ +async function createOrUpdateASimpleGalleryScript(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScripts.createOrUpdate( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + { + location: "West US", + properties: { + description: "This is the gallery script description.", + eula: "This is the gallery script EULA.", + privacyStatementUri: "{myPrivacyStatementUri}", + releaseNoteUri: "{myReleaseNoteUri}", + supportedOSType: "Windows", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateASimpleGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsDeleteSample.ts new file mode 100644 index 000000000000..215d81625e2f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a gallery Script Definition. + * + * @summary delete a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Delete.json + */ +async function deleteAGalleryScript(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.galleryScripts.delete("myResourceGroup", "myGalleryName", "myGalleryScriptName"); +} + +async function main(): Promise { + await deleteAGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsGetSample.ts new file mode 100644 index 000000000000..7f58e5463498 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a gallery script definition. + * + * @summary retrieves information about a gallery script definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Get.json + */ +async function getAGalleryScript(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScripts.get( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + ); + console.log(result); +} + +async function main(): Promise { + await getAGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsListByGallerySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsListByGallerySample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsListByGallerySample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsListByGallerySample.ts index 925269fbd468..5962273b727c 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/galleryScriptsListByGallerySample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsListByGallerySample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List gallery Script Definitions in a gallery. + * This sample demonstrates how to list gallery Script Definitions in a gallery. * - * @summary List gallery Script Definitions in a gallery. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryScriptExamples/GalleryScript_ListByGallery.json + * @summary list gallery Script Definitions in a gallery. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_ListByGallery.json */ async function listGalleryScriptsInAGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.galleryScripts.listByGallery( - resourceGroupName, - galleryName, + "myResourceGroup", + "myGalleryName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsUpdateSample.ts new file mode 100644 index 000000000000..b7dea1e09716 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/galleryScriptsUpdateSample.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a gallery Script Definition. + * + * @summary update a gallery Script Definition. + * x-ms-original-file: 2025-03-03/galleryScriptExamples/GalleryScript_Update.json + */ +async function updateASimpleGalleryScript(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.galleryScripts.update( + "myResourceGroup", + "myGalleryName", + "myGalleryScriptName", + { + description: "This is the gallery script description.", + eula: "This is the gallery script EULA.", + privacyStatementUri: "{myPrivacyStatementUri}", + releaseNoteUri: "{myReleaseNoteUri}", + supportedOSType: "Windows", + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateASimpleGalleryScript(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/gallerySharingProfileUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/gallerySharingProfileUpdateSample.ts new file mode 100644 index 000000000000..d7c7de35a948 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/gallerySharingProfileUpdateSample.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update sharing profile of a gallery. + * + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_AddToSharingProfile.json + */ +async function addSharingIdToTheSharingProfileOfAGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "Add", + groups: [ + { + type: "Subscriptions", + ids: ["34a4ab42-0d72-47d9-bd1a-aed207386dac", "380fd389-260b-41aa-bad9-0a83108c370b"], + }, + { type: "AADTenants", ids: ["c24c76aa-8897-4027-9b03-8f7928b54ff6"] }, + ], + }); + console.log(result); +} + +/** + * This sample demonstrates how to update sharing profile of a gallery. + * + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_EnableCommunityGallery.json + */ +async function shareAGalleryToCommunity(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "EnableCommunity", + }); + console.log(result); +} + +/** + * This sample demonstrates how to update sharing profile of a gallery. + * + * @summary update sharing profile of a gallery. + * x-ms-original-file: 2025-03-03/galleryExamples/Gallery_ResetSharingProfile.json + */ +async function resetSharingProfileOfAGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.gallerySharingProfile.update("myResourceGroup", "myGalleryName", { + operationType: "Reset", + }); + console.log(result); +} + +async function main(): Promise { + await addSharingIdToTheSharingProfileOfAGallery(); + await shareAGalleryToCommunity(); + await resetSharingProfileOfAGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesCreateOrUpdateSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/imagesCreateOrUpdateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/imagesCreateOrUpdateSample.ts index 5cf4e62b14ca..0ef678618fe4 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesCreateOrUpdateSample.ts @@ -1,309 +1,236 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Image} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlob.json */ -async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { - location: "West US", - storageProfile: { - osDisk: { - blobUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - osState: "Generalized", - osType: "Linux", - }, - }, - }; +async function createAVirtualMachineImageFromABlob(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or update an image. - * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromABlob.json - */ -async function createAVirtualMachineImageFromABlob(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { - blobUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - osState: "Generalized", osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json */ -async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { +async function createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", diskEncryptionSet: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", }, osState: "Generalized", - osType: "Linux", - snapshot: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAManagedDisk.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAManagedDisk.json */ async function createAVirtualMachineImageFromAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", managedDisk: { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", }, osState: "Generalized", - osType: "Linux", }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json */ -async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { +async function createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, diskEncryptionSet: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", }, - managedDisk: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", - }, osState: "Generalized", - osType: "Linux", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromASnapshot.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromASnapshot.json */ async function createAVirtualMachineImageFromASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { osDisk: { - osState: "Generalized", osType: "Linux", snapshot: { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", }, + osState: "Generalized", }, zoneResilient: false, }, - }; + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or update an image. + * + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + */ +async function createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { + location: "West US", + storageProfile: { + osDisk: { + osType: "Linux", + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + osState: "Generalized", + }, + }, + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_CreateFromAVM.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_CreateFromAVM.json */ async function createAVirtualMachineImageFromAnExistingVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", sourceVirtualMachine: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromABlobIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromABlob(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + blobUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + osState: "Generalized", + }, dataDisks: [ { - blobUri: - "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", lun: 1, + blobUri: "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd", }, ], - osDisk: { - blobUri: - "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", - osState: "Generalized", - osType: "Linux", - }, zoneResilient: false, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + managedDisk: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", + }, + osState: "Generalized", + }, dataDisks: [ { lun: 1, @@ -312,41 +239,32 @@ async function createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() }, }, ], - osDisk: { - managedDisk: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk", - }, - osState: "Generalized", - osType: "Linux", - }, zoneResilient: false, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to Create or update an image. + * This sample demonstrates how to create or update an image. * - * @summary Create or update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json + * @summary create or update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json */ async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: Image = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.createOrUpdate("myResourceGroup", "myImage", { location: "West US", storageProfile: { + osDisk: { + osType: "Linux", + snapshot: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + osState: "Generalized", + }, dataDisks: [ { lun: 1, @@ -355,33 +273,19 @@ async function createAVirtualMachineImageThatIncludesADataDiskFromASnapshot(): P }, }, ], - osDisk: { - osState: "Generalized", - osType: "Linux", - snapshot: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - }, zoneResilient: true, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } async function main(): Promise { - await createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromABlob(); - await createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(); + await createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromAManagedDisk(); - await createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(); + await createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromASnapshot(); + await createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(); await createAVirtualMachineImageFromAnExistingVirtualMachine(); await createAVirtualMachineImageThatIncludesADataDiskFromABlob(); await createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk(); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/imagesDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesDeleteSample.ts new file mode 100644 index 000000000000..512cb2d5dc7f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes an Image. + * + * @summary deletes an Image. + * x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MaximumSet_Gen.json + */ +async function imageDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.images.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to deletes an Image. + * + * @summary deletes an Image. + * x-ms-original-file: 2025-11-01/imageExamples/Images_Delete_MinimumSet_Gen.json + */ +async function imageDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.images.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await imageDeleteMaximumSetGen(); + await imageDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesGetSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/imagesGetSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/imagesGetSample.ts index d4769b7bcc49..8892b2a6b773 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesGetSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesGetSample.ts @@ -3,23 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets an image. + * This sample demonstrates how to gets an image. * - * @summary Gets an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Get.json + * @summary gets an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Get.json */ async function getInformationAboutAVirtualMachineImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.get(resourceGroupName, imageName); + const result = await client.images.get("myResourceGroup", "myImage"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesListByResourceGroupSample.ts similarity index 60% rename from sdk/compute/arm-compute/samples/v23/typescript/src/imagesListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/imagesListByResourceGroupSample.ts index 98f529bc7f4b..3d7ff46e2ce8 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * This sample demonstrates how to gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. * - * @summary Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListByResourceGroup.json + * @summary gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: 2025-11-01/imageExamples/Image_ListByResourceGroup.json */ async function listAllVirtualMachineImagesInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.images.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.images.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesListSample.ts similarity index 69% rename from sdk/compute/arm-compute/samples/v23/typescript/src/imagesListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/imagesListSample.ts index 799678baa056..ee0a87098217 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * This sample demonstrates how to gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. * - * @summary Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_ListBySubscription.json + * @summary gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. + * x-ms-original-file: 2025-11-01/imageExamples/Image_ListBySubscription.json */ async function listAllVirtualMachineImagesInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.images.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesUpdateSample.ts similarity index 52% rename from sdk/compute/arm-compute/samples/v23/typescript/src/imagesUpdateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/imagesUpdateSample.ts index e44f50b61d5d..7e064bc818ac 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/imagesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/imagesUpdateSample.ts @@ -1,37 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { ImageUpdate} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update an image. + * This sample demonstrates how to update an image. * - * @summary Update an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/imageExamples/Image_Update.json + * @summary update an image. + * x-ms-original-file: 2025-11-01/imageExamples/Image_Update.json */ async function updatesTagsOfAnImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const imageName = "myImage"; - const parameters: ImageUpdate = { - hyperVGeneration: "V1", + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.images.update("myResourceGroup", "myImage", { sourceVirtualMachine: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, + hyperVGeneration: "V1", tags: { department: "HR" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.images.beginUpdateAndWait( - resourceGroupName, - imageName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts index d54adee46487..cc2db2d8de03 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportRequestRateByIntervalSample.ts @@ -1,38 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - RequestRateByIntervalInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * This sample demonstrates how to export logs that show Api requests made by this subscription in the given time window to show throttling activities. * - * @summary Export logs that show Api requests made by this subscription in the given time window to show throttling activities. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json + * @summary export logs that show Api requests made by this subscription in the given time window to show throttling activities. + * x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json */ async function exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus"; - const parameters: RequestRateByIntervalInput = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.exportRequestRateByInterval("westus", { + intervalLength: "FiveMins", blobContainerSasUri: "https://somesasuri", fromTime: new Date("2018-01-21T01:54:06.862601Z"), - groupByResourceName: true, - intervalLength: "FiveMins", toTime: new Date("2018-01-23T01:54:06.862601Z"), - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.logAnalytics.beginExportRequestRateByIntervalAndWait( - location, - parameters, - ); + groupByResourceName: true, + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportThrottledRequestsSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportThrottledRequestsSample.ts similarity index 57% rename from sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportThrottledRequestsSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportThrottledRequestsSample.ts index e56693a50bf6..3195d61c82fb 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/logAnalyticsExportThrottledRequestsSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/logAnalyticsExportThrottledRequestsSample.ts @@ -1,39 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ThrottledRequestsInput} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Export logs that show total throttled Api requests for this subscription in the given time window. + * This sample demonstrates how to export logs that show total throttled Api requests for this subscription in the given time window. * - * @summary Export logs that show total throttled Api requests for this subscription in the given time window. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json + * @summary export logs that show total throttled Api requests for this subscription in the given time window. + * x-ms-original-file: 2025-11-01/logAnalyticExamples/LogAnalytics_ThrottledRequests.json */ async function exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "westus"; - const parameters: ThrottledRequestsInput = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.logAnalytics.exportThrottledRequests("westus", { blobContainerSasUri: "https://somesasuri", fromTime: new Date("2018-01-21T01:54:06.862601Z"), - groupByClientApplicationId: false, + toTime: new Date("2018-01-23T01:54:06.862601Z"), groupByOperationName: true, groupByResourceName: false, + groupByClientApplicationId: false, groupByUserAgent: false, - toTime: new Date("2018-01-23T01:54:06.862601Z"), - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.logAnalytics.beginExportThrottledRequestsAndWait( - location, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/operationsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..61ecfd81c77e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/operationsListSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const client = new ComputeManagementClient(credential); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await operationsListMaximumSetGen(); + await operationsListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..89a3d7b1eb31 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsCreateOrUpdateSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a proximity placement group. + * + * @summary create or update a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json + */ +async function createOrUpdateAProximityPlacementGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.createOrUpdate( + "myResourceGroup", + "myProximityPlacementGroup", + { + location: "westus", + zones: ["1"], + proximityPlacementGroupType: "Standard", + intent: { vmSizes: ["Basic_A0", "Basic_A2"] }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAProximityPlacementGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsDeleteSample.ts new file mode 100644 index 000000000000..6085245aedc8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a proximity placement group. + * + * @summary delete a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json + */ +async function deleteAProximityPlacementGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.proximityPlacementGroups.delete("myResourceGroup", "myProximityPlacementGroup"); +} + +async function main(): Promise { + await deleteAProximityPlacementGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsGetSample.ts new file mode 100644 index 000000000000..5cfe879d6138 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about a proximity placement group . + * + * @summary retrieves information about a proximity placement group . + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + */ +async function getProximityPlacementGroups(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.get( + "myResourceGroup", + "myProximityPlacementGroup", + ); + console.log(result); +} + +async function main(): Promise { + await getProximityPlacementGroups(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts index a60002ac9c15..7e06fdd00e15 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all proximity placement groups in a resource group. + * This sample demonstrates how to lists all proximity placement groups in a resource group. * - * @summary Lists all proximity placement groups in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json + * @summary lists all proximity placement groups in a resource group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json */ async function listProximityPlacementGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.proximityPlacementGroups.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.proximityPlacementGroups.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts similarity index 61% rename from sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts index ab3016fb54d1..2c91347b9769 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsListBySubscriptionSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all proximity placement groups in a subscription. + * This sample demonstrates how to lists all proximity placement groups in a subscription. * - * @summary Lists all proximity placement groups in a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json + * @summary lists all proximity placement groups in a subscription. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json */ async function listProximityPlacementGroups(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.proximityPlacementGroups.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsUpdateSample.ts new file mode 100644 index 000000000000..ca1254d6f13a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/proximityPlacementGroupsUpdateSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a proximity placement group. + * + * @summary update a proximity placement group. + * x-ms-original-file: 2025-11-01/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json + */ +async function updateAProximityPlacementGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.proximityPlacementGroups.update( + "myResourceGroup", + "myProximityPlacementGroup", + { tags: { additionalProp1: "string" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateAProximityPlacementGroup(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/resourceSkusListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/resourceSkusListSample.ts new file mode 100644 index 000000000000..d50f1ff67bcd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/resourceSkusListSample.ts @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkus.json + */ +async function listsAllAvailableResourceSKUs(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.resourceSkus.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkusForARegion.json + */ +async function listsAllAvailableResourceSKUsForTheSpecifiedRegion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.resourceSkus.list({ filter: "location eq 'westus'" })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @summary gets the list of Microsoft.Compute SKUs available for your Subscription. + * x-ms-original-file: 2021-07-01/skus/ListAvailableResourceSkusWithExtendedLocations.json + */ +async function listsAllAvailableResourceSKUsWithExtendedLocationInformation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.resourceSkus.list({ includeExtendedLocations: "true" })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listsAllAvailableResourceSKUs(); + await listsAllAvailableResourceSKUsForTheSpecifiedRegion(); + await listsAllAvailableResourceSKUsWithExtendedLocationInformation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts similarity index 57% rename from sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts index 1ca0c46af733..fb2cad2fa340 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsCreateOrUpdateSample.ts @@ -1,76 +1,53 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - RestorePointCollection} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * This sample demonstrates how to the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. * - * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json + * @summary the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate.json */ -async function createOrUpdateARestorePointCollectionForCrossRegionCopy(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const parameters: RestorePointCollection = { +async function createOrUpdateARestorePointCollection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate("myResourceGroup", "myRpc", { location: "norwayeast", source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", }, + instantAccess: true, tags: { myTag1: "tagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.createOrUpdate( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * This sample demonstrates how to the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. * - * @summary The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json + * @summary the operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json */ -async function createOrUpdateARestorePointCollection(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const restorePointCollectionName = "myRpc"; - const parameters: RestorePointCollection = { - instantAccess: true, +async function createOrUpdateARestorePointCollectionForCrossRegionCopy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.createOrUpdate("myResourceGroup", "myRpc", { location: "norwayeast", source: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName", }, tags: { myTag1: "tagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.restorePointCollections.createOrUpdate( - resourceGroupName, - restorePointCollectionName, - parameters, - ); + }); console.log(result); } async function main(): Promise { - await createOrUpdateARestorePointCollectionForCrossRegionCopy(); await createOrUpdateARestorePointCollection(); + await createOrUpdateARestorePointCollectionForCrossRegionCopy(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsDeleteSample.ts new file mode 100644 index 000000000000..1bc75dfdcf74 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json + */ +async function restorePointCollectionDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePointCollections.delete("rgcompute", "aaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * + * @summary the operation to delete the restore point collection. This operation will also delete all the contained restore points. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json + */ +async function restorePointCollectionDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePointCollections.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await restorePointCollectionDeleteMaximumSetGen(); + await restorePointCollectionDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsGetSample.ts new file mode 100644 index 000000000000..99cf39f38926 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get the restore point collection. + * + * @summary the operation to get the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get.json + */ +async function getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get("myResourceGroup", "myRpc"); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the restore point collection. + * + * @summary the operation to get the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + */ +async function getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.get("myResourceGroup", "rpcName"); + console.log(result); +} + +async function main(): Promise { + await getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(); + await getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListAllSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListAllSample.ts similarity index 71% rename from sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListAllSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListAllSample.ts index 667e112e5019..03e2f06a92a9 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListAllSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListAllSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * This sample demonstrates how to gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. * - * @summary Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json + * @summary gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListBySubscription.json */ async function getsTheListOfRestorePointCollectionsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.restorePointCollections.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListSample.ts similarity index 52% rename from sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListSample.ts index b80209a25cb0..2bbd8dbce675 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/restorePointCollectionsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsListSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the list of restore point collections in a resource group. + * This sample demonstrates how to gets the list of restore point collections in a resource group. * - * @summary Gets the list of restore point collections in a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json + * @summary gets the list of restore point collections in a resource group. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_ListByResourceGroup.json */ async function getsTheListOfRestorePointCollectionsInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.restorePointCollections.list( - resourceGroupName, - )) { + for await (const item of client.restorePointCollections.list("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsUpdateSample.ts new file mode 100644 index 000000000000..4cd6b93e08f8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointCollectionsUpdateSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update the restore point collection. + * + * @summary the operation to update the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json + */ +async function restorePointCollectionUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update("rgcompute", "aaaaaaaaaaaaaaaaaaaa", { + source: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM", + }, + instantAccess: true, + tags: { key8536: "aaaaaaaaaaaaaaaaaaa" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update the restore point collection. + * + * @summary the operation to update the restore point collection. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json + */ +async function restorePointCollectionUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePointCollections.update("rgcompute", "aaaaaaaaaaaaaaaaaa", {}); + console.log(result); +} + +async function main(): Promise { + await restorePointCollectionUpdateMaximumSetGen(); + await restorePointCollectionUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsCreateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsCreateSample.ts new file mode 100644 index 000000000000..9c4dc90a7f49 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsCreateSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary the operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + */ +async function copyARestorePointToADifferentRegion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.create("myResourceGroup", "rpcName", "rpName", { + sourceRestorePoint: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create the restore point. Updating properties of an existing restore point is not allowed + * + * @summary the operation to create the restore point. Updating properties of an existing restore point is not allowed + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Create.json + */ +async function createARestorePoint(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.create("myResourceGroup", "rpcName", "rpName", { + excludeDisks: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + ], + instantAccessDurationMinutes: 120, + }); + console.log(result); +} + +async function main(): Promise { + await copyARestorePointToADifferentRegion(); + await createARestorePoint(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsDeleteSample.ts new file mode 100644 index 000000000000..dda1662ee81c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete the restore point. + * + * @summary the operation to delete the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json + */ +async function restorePointDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePoints.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", "a"); +} + +/** + * This sample demonstrates how to the operation to delete the restore point. + * + * @summary the operation to delete the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json + */ +async function restorePointDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.restorePoints.delete("rgcompute", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await restorePointDeleteMaximumSetGen(); + await restorePointDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsGetSample.ts new file mode 100644 index 000000000000..419dd5f36bb2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/restorePointsGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get the restore point. + * + * @summary the operation to get the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get.json + */ +async function getARestorePoint(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get("myResourceGroup", "rpcName", "rpName"); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the restore point. + * + * @summary the operation to get the restore point. + * x-ms-original-file: 2025-11-01/restorePointExamples/RestorePoint_Get_WithInstanceView.json + */ +async function getRestorePointWithInstanceView(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.restorePoints.get("myResourceGroup", "rpcName", "rpName"); + console.log(result); +} + +async function main(): Promise { + await getARestorePoint(); + await getRestorePointWithInstanceView(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesGetSample.ts new file mode 100644 index 000000000000..e794b6089f9c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a shared gallery by subscription id or tenant id. + * + * @summary get a shared gallery by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_Get.json + */ +async function getASharedGallery(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleries.get("myLocation", "galleryUniqueName"); + console.log(result); +} + +async function main(): Promise { + await getASharedGallery(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesListSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesListSample.ts index 1a20930131a7..200c3beae57e 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleriesListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleriesListSample.ts @@ -3,24 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List shared galleries by subscription id or tenant id. + * This sample demonstrates how to list shared galleries by subscription id or tenant id. * - * @summary List shared galleries by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGallery_List.json + * @summary list shared galleries by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGallery_List.json */ async function listSharedGalleries(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sharedGalleries.list(location)) { + for await (const item of client.sharedGalleries.list("myLocation")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsGetSample.ts new file mode 100644 index 000000000000..08a8adebd643 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a shared gallery image version by subscription id or tenant id. + * + * @summary get a shared gallery image version by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersion_Get.json + */ +async function getASharedGalleryImageVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sharedGalleryImageVersions.get( + "myLocation", + "galleryUniqueName", + "myGalleryImageName", + "myGalleryImageVersionName", + ); + console.log(result); +} + +async function main(): Promise { + await getASharedGalleryImageVersion(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsListSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsListSample.ts index 7e8862314e10..d378489eed4e 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImageVersionsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImageVersionsListSample.ts @@ -3,30 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List shared gallery image versions by subscription id or tenant id. + * This sample demonstrates how to list shared gallery image versions by subscription id or tenant id. * - * @summary List shared gallery image versions by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json + * @summary list shared gallery image versions by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImageVersions_List.json */ async function listSharedGalleryImageVersions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sharedGalleryImageVersions.list( - location, - galleryUniqueName, - galleryImageName, + "myLocation", + "galleryUniqueName", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesGetSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesGetSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesGetSample.ts index 30c6dc6984bc..c37772e633cd 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesGetSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesGetSample.ts @@ -3,26 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Get a shared gallery image by subscription id or tenant id. + * This sample demonstrates how to get a shared gallery image by subscription id or tenant id. * - * @summary Get a shared gallery image by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json + * @summary get a shared gallery image by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImage_Get.json */ async function getASharedGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; - const galleryImageName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.sharedGalleryImages.get( - location, - galleryUniqueName, - galleryImageName, + "myLocation", + "galleryUniqueName", + "myGalleryImageName", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesListSample.ts similarity index 51% rename from sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesListSample.ts index a541bdefb774..e3e4a3b084cd 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sharedGalleryImagesListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sharedGalleryImagesListSample.ts @@ -3,28 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List shared gallery images by subscription id or tenant id. + * This sample demonstrates how to list shared gallery images by subscription id or tenant id. * - * @summary List shared gallery images by subscription id or tenant id. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json + * @summary list shared gallery images by subscription id or tenant id. + * x-ms-original-file: 2025-03-03/sharedGalleryExamples/SharedGalleryImages_List.json */ async function listSharedGalleryImages(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "myLocation"; - const galleryUniqueName = "galleryUniqueName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sharedGalleryImages.list( - location, - galleryUniqueName, - )) { + for await (const item of client.sharedGalleryImages.list("myLocation", "galleryUniqueName")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..6628fa6227d8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsCreateOrUpdateSample.ts @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot1", { + location: "West US", + creationData: { + createOption: "Import", + storageAccountId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json + */ +async function createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot1", { + location: "West US", + creationData: { + createOption: "Import", + sourceUri: "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + provisionedBandwidthCopySpeed: "Enhanced", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json + */ +async function createASnapshotFromAnElasticSanVolumeSnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot", { + location: "West US", + creationData: { + createOption: "CopyFromSanSnapshot", + elasticSanResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json + */ +async function createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "CopyStart", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a snapshot. + * + * @summary creates or updates a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Create_InstantAccessSnapshot.json + */ +async function createASnapshotWhichCanBeInstantlyAccessable(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate("myResourceGroup", "mySnapshot2", { + location: "West US", + creationData: { + createOption: "Copy", + sourceResourceId: + "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1", + instantAccessDurationMinutes: 120, + }, + }); + console.log(result); +} + +async function main(): Promise { + await createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(); + await createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(); + await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed(); + await createASnapshotFromAnElasticSanVolumeSnapshot(); + await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(); + await createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(); + await createASnapshotWhichCanBeInstantlyAccessable(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsDeleteSample.ts new file mode 100644 index 000000000000..98146c4f58f0 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a snapshot. + * + * @summary deletes a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Delete.json + */ +async function deleteASnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.snapshots.delete("myResourceGroup", "mySnapshot"); +} + +async function main(): Promise { + await deleteASnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGetSample.ts new file mode 100644 index 000000000000..8db4942c1152 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGetSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a snapshot. + * + * @summary gets information about a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Get.json + */ +async function getInformationAboutASnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.get("myResourceGroup", "mySnapshot"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a snapshot. + * + * @summary gets information about a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + */ +async function getInformationAboutAnIncrementalSnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.get("myResourceGroup", "myIncrementalSnapshot"); + console.log(result); +} + +async function main(): Promise { + await getInformationAboutASnapshot(); + await getInformationAboutAnIncrementalSnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGrantAccessSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGrantAccessSample.ts new file mode 100644 index 000000000000..bb09e23f8feb --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsGrantAccessSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to grants access to a snapshot. + * + * @summary grants access to a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_BeginGetAccess.json + */ +async function getASasOnASnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.grantAccess("myResourceGroup", "mySnapshot", { + access: "Read", + durationInSeconds: 300, + fileFormat: "VHDX", + }); + console.log(result); +} + +async function main(): Promise { + await getASasOnASnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListByResourceGroupSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListByResourceGroupSample.ts index a3ce53a14398..fa5e58aa9ea3 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListByResourceGroupSample.ts @@ -3,27 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists snapshots under a resource group. + * This sample demonstrates how to lists snapshots under a resource group. * - * @summary Lists snapshots under a resource group. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json + * @summary lists snapshots under a resource group. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListByResourceGroup.json */ async function listAllSnapshotsInAResourceGroup(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.snapshots.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.snapshots.listByResourceGroup("myResourceGroup")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListSample.ts similarity index 62% rename from sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListSample.ts index cc3045417253..e4cbb34ad0b8 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/snapshotsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists snapshots under a subscription. + * This sample demonstrates how to lists snapshots under a subscription. * - * @summary Lists snapshots under a subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2025-01-02/examples/snapshotExamples/Snapshot_ListBySubscription.json + * @summary lists snapshots under a subscription. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_ListBySubscription.json */ async function listAllSnapshotsInASubscription(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.snapshots.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsRevokeAccessSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsRevokeAccessSample.ts new file mode 100644 index 000000000000..e0686a8fc206 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsRevokeAccessSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to revokes access to a snapshot. + * + * @summary revokes access to a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_EndGetAccess.json + */ +async function revokeAccessToASnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.snapshots.revokeAccess("myResourceGroup", "mySnapshot"); +} + +async function main(): Promise { + await revokeAccessToASnapshot(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsUpdateSample.ts new file mode 100644 index 000000000000..acd0aa1987a2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/snapshotsUpdateSample.ts @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates (patches) a snapshot. + * + * @summary updates (patches) a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update.json + */ +async function updateASnapshot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.update("myResourceGroup", "mySnapshot", { + diskSizeGB: 20, + tags: { department: "Development", project: "UpdateSnapshots" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates (patches) a snapshot. + * + * @summary updates (patches) a snapshot. + * x-ms-original-file: 2025-01-02/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json + */ +async function updateASnapshotWithAcceleratedNetworking(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.snapshots.update("myResourceGroup", "mySnapshot", { + diskSizeGB: 20, + supportedCapabilities: { acceleratedNetwork: false }, + tags: { department: "Development", project: "UpdateSnapshots" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateASnapshot(); + await updateASnapshotWithAcceleratedNetworking(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/softDeletedResourceListByArtifactNameSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/softDeletedResourceListByArtifactNameSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/softDeletedResourceListByArtifactNameSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/softDeletedResourceListByArtifactNameSample.ts index b3b0c7fe3f26..899bf414ef2d 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/softDeletedResourceListByArtifactNameSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/softDeletedResourceListByArtifactNameSample.ts @@ -3,33 +3,27 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. + * This sample demonstrates how to list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. * - * @summary List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json + * @summary list soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. + * x-ms-original-file: 2025-03-03/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json */ async function listSoftDeletedResourcesOfAnArtifactInTheGallery(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const galleryName = "myGalleryName"; - const artifactType = "images"; - const artifactName = "myGalleryImageName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.softDeletedResource.listByArtifactName( - resourceGroupName, - galleryName, - artifactType, - artifactName, + "myResourceGroup", + "myGalleryName", + "images", + "myGalleryImageName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysCreateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysCreateSample.ts new file mode 100644 index 000000000000..17f68c4d706f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysCreateSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates a new SSH public key resource. + * + * @summary creates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Create.json + */ +async function createANewSSHPublicKeyResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.create("myResourceGroup", "mySshPublicKeyName", { + location: "westus", + publicKey: "{ssh-rsa public key}", + }); + console.log(result); +} + +async function main(): Promise { + await createANewSSHPublicKeyResource(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysDeleteSample.ts new file mode 100644 index 000000000000..96ff342d1dc2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysDeleteSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete an SSH public key. + * + * @summary delete an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json + */ +async function sshPublicKeyDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.sshPublicKeys.delete("rgcompute", "aaaaaaaaaa"); +} + +/** + * This sample demonstrates how to delete an SSH public key. + * + * @summary delete an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json + */ +async function sshPublicKeyDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.sshPublicKeys.delete("rgcompute", "aaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await sshPublicKeyDeleteMaximumSetGen(); + await sshPublicKeyDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGenerateKeyPairSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGenerateKeyPairSample.ts new file mode 100644 index 000000000000..35c68a058c69 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGenerateKeyPairSample.ts @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json + */ +async function generateAnSSHKeyPair(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + "myResourceGroup", + "mySshPublicKeyName", + ); + console.log(result); +} + +/** + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json + */ +async function generateAnSSHKeyPairWithEd25519Encryption(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + "myResourceGroup", + "mySshPublicKeyName", + { parameters: { encryptionType: "Ed25519" } }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * + * @summary generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json + */ +async function generateAnSSHKeyPairWithRSAEncryption(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.generateKeyPair( + "myResourceGroup", + "mySshPublicKeyName", + { parameters: { encryptionType: "RSA" } }, + ); + console.log(result); +} + +async function main(): Promise { + await generateAnSSHKeyPair(); + await generateAnSSHKeyPairWithEd25519Encryption(); + await generateAnSSHKeyPairWithRSAEncryption(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGetSample.ts new file mode 100644 index 000000000000..b46dd5694d56 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about an SSH public key. + * + * @summary retrieves information about an SSH public key. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Get.json + */ +async function getAnSshPublicKey(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.get("myResourceGroup", "mySshPublicKeyName"); + console.log(result); +} + +async function main(): Promise { + await getAnSshPublicKey(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListByResourceGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListByResourceGroupSample.ts similarity index 58% rename from sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListByResourceGroupSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListByResourceGroupSample.ts index ffdb0bb51658..a82a9e04966f 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListByResourceGroupSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListByResourceGroupSample.ts @@ -3,49 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json + * @summary lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json */ async function sshPublicKeyListByResourceGroupMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sshPublicKeys.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.sshPublicKeys.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json + * @summary lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json */ async function sshPublicKeyListByResourceGroupMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.sshPublicKeys.listByResourceGroup( - resourceGroupName, - )) { + for await (const item of client.sshPublicKeys.listByResourceGroup("rgcompute")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListBySubscriptionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListBySubscriptionSample.ts similarity index 64% rename from sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListBySubscriptionSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListBySubscriptionSample.ts index 92906743fe8a..c6c198ecc3e5 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/sshPublicKeysListBySubscriptionSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysListBySubscriptionSample.ts @@ -3,41 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json + * @summary lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json */ async function sshPublicKeyListBySubscriptionMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sshPublicKeys.listBySubscription()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * This sample demonstrates how to lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. * - * @summary Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json + * @summary lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json */ async function sshPublicKeyListBySubscriptionMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.sshPublicKeys.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysUpdateSample.ts new file mode 100644 index 000000000000..e14ec29b69e8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/sshPublicKeysUpdateSample.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a new SSH public key resource. + * + * @summary updates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json + */ +async function sshPublicKeyUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update("rgcompute", "aaaaaaaaaaaa", { + publicKey: "{ssh-rsa public key}", + tags: { key2854: "a" }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to updates a new SSH public key resource. + * + * @summary updates a new SSH public key resource. + * x-ms-original-file: 2025-11-01/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json + */ +async function sshPublicKeyUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.sshPublicKeys.update("rgcompute", "aaaaaaaaaaa", {}); + console.log(result); +} + +async function main(): Promise { + await sshPublicKeyUpdateMaximumSetGen(); + await sshPublicKeyUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/usageListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/usageListSample.ts similarity index 57% rename from sdk/compute/arm-compute/samples/v23/typescript/src/usageListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/usageListSample.ts index 6f30c97319bb..d6847a04c839 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/usageListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/usageListSample.ts @@ -3,43 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * This sample demonstrates how to gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. * - * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json + * @summary gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json */ async function usageListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "4_."; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.usageOperations.list(location)) { + for await (const item of client.usage.list("4_.")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * This sample demonstrates how to gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. * - * @summary Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json + * @summary gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json */ async function usageListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "_--"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.usageOperations.list(location)) { + for await (const item of client.usage.list("_--")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesGetSample.ts new file mode 100644 index 000000000000..c7ae1bcb5637 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesGetSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine extension image. + * + * @summary gets a virtual machine extension image. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImageGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine extension image. + * + * @summary gets a virtual machine extension image. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImageGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.get( + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aa", + "aaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineExtensionImageGetMaximumSetGen(); + await virtualMachineExtensionImageGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListTypesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListTypesSample.ts new file mode 100644 index 000000000000..7c6854c51ad9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListTypesSample.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of virtual machine extension image types. + * + * @summary gets a list of virtual machine extension image types. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImageListTypesMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine extension image types. + * + * @summary gets a list of virtual machine extension image types. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImageListTypesMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listTypes("aaaa", "aa"); + console.log(result); +} + +async function main(): Promise { + await virtualMachineExtensionImageListTypesMaximumSetGen(); + await virtualMachineExtensionImageListTypesMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts new file mode 100644 index 000000000000..1685a76224c7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionImagesListVersionsSample.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of virtual machine extension image versions. + * + * @summary gets a list of virtual machine extension image versions. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json + */ +async function virtualMachineExtensionImageListVersionsMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + { filter: "aaaaaaaaaaaaaaaaaaaaaaaaa", top: 22, orderby: "a" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine extension image versions. + * + * @summary gets a list of virtual machine extension image versions. + * x-ms-original-file: 2025-11-01/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json + */ +async function virtualMachineExtensionImageListVersionsMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensionImages.listVersions( + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineExtensionImageListVersionsMaximumSetGen(); + await virtualMachineExtensionImageListVersionsMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9cb7f274e1af --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update the extension. + * + * @summary the operation to create or update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineExtensionCreateOrUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.createOrUpdate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", + { + location: "westus", + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + suppressFailures: true, + settings: {}, + forceUpdateTag: "a", + enableAutomaticUpgrade: true, + protectedSettings: {}, + instanceView: { + name: "aaaaaaaaaaaaaaaaa", + type: "aaaaaaaaa", + typeHandlerVersion: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + substatuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + level: "Info", + displayStatus: "aaaaaa", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + statuses: [ + { + code: "aaaaaaaaaaaaaaaaaaaaaaa", + level: "Info", + displayStatus: "aaaaaa", + message: "a", + time: new Date("2021-11-30T12:58:26.522Z"), + }, + ], + }, + tags: { key9183: "aa" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update the extension. + * + * @summary the operation to create or update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineExtensionCreateOrUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.createOrUpdate( + "rgcompute", + "myVM", + "myVMExtension", + { location: "westus" }, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineExtensionCreateOrUpdateMaximumSetGen(); + await virtualMachineExtensionCreateOrUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsDeleteSample.ts new file mode 100644 index 000000000000..a6798b90c2a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsDeleteSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json + */ +async function virtualMachineExtensionDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineExtensions.delete( + "rgcompute", + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json + */ +async function virtualMachineExtensionDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineExtensions.delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa"); +} + +async function main(): Promise { + await virtualMachineExtensionDeleteMaximumSetGen(); + await virtualMachineExtensionDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsGetSample.ts new file mode 100644 index 000000000000..23c99b55ca2f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsGetSample.ts @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + */ +async function virtualMachineExtensionGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", + { expand: "aaaaaa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + */ +async function virtualMachineExtensionGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.get("rgcompute", "myVM", "myVMExtension"); + console.log(result); +} + +async function main(): Promise { + await virtualMachineExtensionGetMaximumSetGen(); + await virtualMachineExtensionGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsListSample.ts new file mode 100644 index 000000000000..0f95e29c7db8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsListSample.ts @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get all extensions of a Virtual Machine. + * + * @summary the operation to get all extensions of a Virtual Machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json + */ +async function virtualMachineExtensionListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list("rgcompute", "aaaaaaaaaaaaa", { + expand: "aaaaaaaaaaaaaaaaa", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get all extensions of a Virtual Machine. + * + * @summary the operation to get all extensions of a Virtual Machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json + */ +async function virtualMachineExtensionListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineExtensionListMaximumSetGen(); + await virtualMachineExtensionListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsUpdateSample.ts new file mode 100644 index 000000000000..f0e8236c103f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineExtensionsUpdateSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update the extension. + * + * @summary the operation to update the extension. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachineExtension_Update.json + */ +async function updateVMExtension(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineExtensions.update( + "myResourceGroup", + "myVM", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + type: "extType", + typeHandlerVersion: "1.2", + suppressFailures: true, + settings: { UserName: "xyz@microsoft.com" }, + protectedSettingsFromKeyVault: { + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", + }, + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts new file mode 100644 index 000000000000..da43530c8b9f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneGetSample.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine image in an edge zone. + * + * @summary gets a virtual machine image in an edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine image in an edge zone. + * + * @summary gets a virtual machine image in an edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.get( + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaa", + "aa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImagesEdgeZoneGetMaximumSetGen(); + await virtualMachineImagesEdgeZoneGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts index 2215b6a03943..bd15c6ec5241 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListOffersSample.ts @@ -3,48 +3,39 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location, edge zone and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListOffersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listOffers( - location, - edgeZone, - publisherName, + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location, edge zone and publisher. * - * @summary Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image offers for the specified location, edge zone and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListOffersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaa"; - const publisherName = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listOffers( - location, - edgeZone, - publisherName, + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts index 6b2dafb9e780..11eb256b2cc6 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListPublishersSample.ts @@ -3,44 +3,37 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location and edge zone. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListPublishersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listPublishers( - location, - edgeZone, + "aaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location and edge zone. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location and edge zone. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListPublishersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaa"; - const edgeZone = "aaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineImagesEdgeZone.listPublishers( - location, - edgeZone, + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSample.ts new file mode 100644 index 000000000000..0701902b93e4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSample.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + "aaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaaaaaaaaaaaaaaaaaaa", top: 12, orderby: "aaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.list( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImagesEdgeZoneListMaximumSetGen(); + await virtualMachineImagesEdgeZoneListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts new file mode 100644 index 000000000000..346fbcaa4f22 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesEdgeZoneListSkusSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + "aaaaaaaaaaaa", + "aaaaa", + "aaaaaaaaaaaa", + "aaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImagesEdgeZoneListSkusMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImagesEdgeZone.listSkus( + "aaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaa", + "aaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImagesEdgeZoneListSkusMaximumSetGen(); + await virtualMachineImagesEdgeZoneListSkusMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesGetSample.ts new file mode 100644 index 000000000000..ed975a2eac27 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesGetSample.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine image. + * + * @summary gets a virtual machine image. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json + */ +async function virtualMachineImageGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + "aaaaaa", + "aaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine image. + * + * @summary gets a virtual machine image. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json + */ +async function virtualMachineImageGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.get( + "aaaaaaaaaaaa", + "aaaaaaaaaaa", + "aa", + "aaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImageGetMaximumSetGen(); + await virtualMachineImageGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts index d064f3a60091..4f356aed678d 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListByEdgeZoneSample.ts @@ -3,47 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified edge zone + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified edge zone * - * @summary Gets a list of all virtual machine image versions for the specified edge zone - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified edge zone + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; - const location = "WestUS"; - const edgeZone = "microsoftlosangeles1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listByEdgeZone( - location, - edgeZone, - ); + const result = await client.virtualMachineImages.listByEdgeZone("WestUS", "microsoftlosangeles1"); console.log(result); } /** - * This sample demonstrates how to Gets a list of all virtual machine image versions for the specified edge zone + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified edge zone * - * @summary Gets a list of all virtual machine image versions for the specified edge zone - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json + * @summary gets a list of all virtual machine image versions for the specified edge zone + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json */ async function virtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || - "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; - const location = "WestUS"; - const edgeZone = "microsoftlosangeles1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "5ece5940-d962-4dad-a98f-ca9ac0f021a5"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listByEdgeZone( - location, - edgeZone, - ); + const result = await client.virtualMachineImages.listByEdgeZone("WestUS", "microsoftlosangeles1"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListOffersSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListOffersSample.ts new file mode 100644 index 000000000000..c620bfa9ce7d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListOffersSample.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json + */ +async function virtualMachineImageListOffersMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers("aaaaaaa", "aaaaaaaa"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine image offers for the specified location and publisher. + * + * @summary gets a list of virtual machine image offers for the specified location and publisher. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json + */ +async function virtualMachineImageListOffersMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listOffers( + "aaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImageListOffersMaximumSetGen(); + await virtualMachineImageListOffersMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListPublishersSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListPublishersSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListPublishersSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListPublishersSample.ts index d262074cfa43..5431649588fc 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineImagesListPublishersSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListPublishersSample.ts @@ -3,37 +3,32 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json */ async function virtualMachineImageListPublishersMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listPublishers(location); + const result = await client.virtualMachineImages.listPublishers("aaaaa"); console.log(result); } /** - * This sample demonstrates how to Gets a list of virtual machine image publishers for the specified Azure location. + * This sample demonstrates how to gets a list of virtual machine image publishers for the specified Azure location. * - * @summary Gets a list of virtual machine image publishers for the specified Azure location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json + * @summary gets a list of virtual machine image publishers for the specified Azure location. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json */ async function virtualMachineImageListPublishersMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "aaaaaaaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineImages.listPublishers(location); + const result = await client.virtualMachineImages.listPublishers("aaaaaaaaaaaaaaaaaaaaaaaaaaa"); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSample.ts new file mode 100644 index 000000000000..0f3f744fa331 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json + */ +async function virtualMachineImageListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + "aaaaaaaaaaaaaaa", + "aaaaaa", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaaaaaaaaaaaaaaaaaaa", top: 18, orderby: "aa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @summary gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json + */ +async function virtualMachineImageListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.list( + "aaaaaaa", + "aaaaaaaaaaa", + "aaaaaaaaaa", + "aaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImageListMaximumSetGen(); + await virtualMachineImageListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSkusSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSkusSample.ts new file mode 100644 index 000000000000..da2b5072fea4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListSkusSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json + */ +async function virtualMachineImageListSkusMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus( + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @summary gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json + */ +async function virtualMachineImageListSkusMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listSkus("aaaa", "aaaaaaaaaaaaa", "aaaaaaa"); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImageListSkusMaximumSetGen(); + await virtualMachineImageListSkusMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListWithPropertiesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListWithPropertiesSample.ts new file mode 100644 index 000000000000..e84876329150 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineImagesListWithPropertiesSample.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to execute listWithProperties + * + * @summary execute listWithProperties + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MaximumSet_Gen.json + */ +async function virtualMachineImagesListWithPropertiesMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listWithProperties( + "eastus", + "MicrosoftWindowsServer", + "WindowsServer", + "2022-datacenter-azure-edition", + "Properties", + { top: 4, orderby: "aa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to execute listWithProperties + * + * @summary execute listWithProperties + * x-ms-original-file: 2025-11-01/virtualMachineImageExamples/VirtualMachineImages_ListWithProperties_MinimumSet_Gen.json + */ +async function virtualMachineImagesListWithPropertiesMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineImages.listWithProperties( + "eastus", + "MicrosoftWindowsServer", + "WindowsServer", + "2022-datacenter-azure-edition", + "Properties", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineImagesListWithPropertiesMaximumSet(); + await virtualMachineImagesListWithPropertiesMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..c81398dc32cd --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update the run command. + * + * @summary the operation to create or update the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json + */ +async function createOrUpdateARunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.createOrUpdate( + "myResourceGroup", + "myVM", + "myRunCommand", + { + location: "West US", + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", + }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + treatFailureAsDeploymentFailure: false, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI", + outputBlobManagedIdentity: { clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsDeleteSample.ts new file mode 100644 index 000000000000..409473082043 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete the run command. + * + * @summary the operation to delete the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Delete.json + */ +async function deleteARunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineRunCommands.delete("myResourceGroup", "myVM", "myRunCommand"); +} + +async function main(): Promise { + await deleteARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts new file mode 100644 index 000000000000..439090449382 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetByVirtualMachineSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get the run command. + * + * @summary the operation to get the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Get.json + */ +async function getARunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.getByVirtualMachine( + "myResourceGroup", + "myVM", + "myRunCommand", + ); + console.log(result); +} + +async function main(): Promise { + await getARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetSample.ts new file mode 100644 index 000000000000..3eac5fd1207f --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets specific run command for a subscription in a location. + * + * @summary gets specific run command for a subscription in a location. + * x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_Get.json + */ +async function virtualMachineRunCommandGet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.get("SoutheastAsia", "RunPowerShellScript"); + console.log(result); +} + +async function main(): Promise { + await virtualMachineRunCommandGet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts similarity index 56% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts index 924092984760..3f10928052a7 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListByVirtualMachineSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get all run commands of a Virtual Machine. + * This sample demonstrates how to the operation to get all run commands of a Virtual Machine. * - * @summary The operation to get all run commands of a Virtual Machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json + * @summary the operation to get all run commands of a Virtual Machine. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_List.json */ async function listRunCommandsInAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineRunCommands.listByVirtualMachine( - resourceGroupName, - vmName, + "myResourceGroup", + "myVM", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListSample.ts similarity index 62% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListSample.ts index df5c7b6267fc..f3264c7e3256 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineRunCommandsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsListSample.ts @@ -3,23 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available run commands for a subscription in a location. + * This sample demonstrates how to lists all available run commands for a subscription in a location. * - * @summary Lists all available run commands for a subscription in a location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/RunCommand_List.json + * @summary lists all available run commands for a subscription in a location. + * x-ms-original-file: 2025-11-01/runCommandExamples/RunCommand_List.json */ async function virtualMachineRunCommandList(): Promise { - const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "subid"; - const location = "SoutheastAsia"; const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineRunCommands.list(location)) { + for await (const item of client.virtualMachineRunCommands.list("SoutheastAsia")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsUpdateSample.ts new file mode 100644 index 000000000000..15aca2100e13 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineRunCommandsUpdateSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update the run command. + * + * @summary the operation to update the run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand_Update.json + */ +async function updateARunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineRunCommands.update( + "myResourceGroup", + "myVM", + "myRunCommand", + { + source: { script: "Write-Host Hello World! ; Remove-Item C:\test\testFile.txt" }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", + errorBlobManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateARunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..03c1b5794e6b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update an extension. + * + * @summary the operation to create or update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.createOrUpdate( + "rgcompute", + "aaaaaaa", + "aaaaaaaaaaaaaaaaaaaaa", + { + name: "{extension-name}", + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update an extension. + * + * @summary the operation to create or update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.createOrUpdate( + "rgcompute", + "aaaaaaaaaaa", + "aaaaaaaaaaa", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen(); + await virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts new file mode 100644 index 000000000000..f92a3d7100a1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsDeleteSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionDeleteMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetExtensions.delete( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to the operation to delete the extension. + * + * @summary the operation to delete the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionDeleteMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetExtensions.delete( + "rgcompute", + "aaaa", + "aaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetExtensionDeleteMaximumSetGen(); + await virtualMachineScaleSetExtensionDeleteMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts new file mode 100644 index 000000000000..430e3e429c30 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsGetSample.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionGetMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + { expand: "aaaaaaa" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to get the extension. + * + * @summary the operation to get the extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionGetMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.get( + "rgcompute", + "a", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetExtensionGetMaximumSetGen(); + await virtualMachineScaleSetExtensionGetMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsListSample.ts new file mode 100644 index 000000000000..05acad53e80e --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsListSample.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of all extensions in a VM scale set. + * + * @summary gets a list of all extensions in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetExtensions.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all extensions in a VM scale set. + * + * @summary gets a list of all extensions in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetExtensions.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await virtualMachineScaleSetExtensionListMaximumSetGen(); + await virtualMachineScaleSetExtensionListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts new file mode 100644 index 000000000000..26f721d1571d --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetExtensionsUpdateSample.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update an extension. + * + * @summary the operation to update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaa", + { + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to update an extension. + * + * @summary the operation to update an extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetExtensionUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetExtensions.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + "aa", + {}, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetExtensionUpdateMaximumSetGen(); + await virtualMachineScaleSetExtensionUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts new file mode 100644 index 000000000000..5424d0ec1d6c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine scale set lifecycle hook event. + * + * @summary gets a virtual machine scale set lifecycle hook event. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Get.json + */ +async function getAVirtualMachineScaleSetLifecycleHookEvent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2167b012-c9f9-4b04-83b2-0ff304e7d51d"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetLifeCycleHookEvents.get( + "RG01", + "VMSS01", + "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717", + ); + console.log(result); +} + +async function main(): Promise { + await getAVirtualMachineScaleSetLifecycleHookEvent(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsListSample.ts new file mode 100644 index 000000000000..f4dd95ad032b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsListSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. + * + * @summary gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_List.json + */ +async function getsAListOfAllLifecycleHookEventsInAVirtualMachineScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetLifeCycleHookEvents.list( + "RG01", + "VMSS01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getsAListOfAllLifecycleHookEventsInAVirtualMachineScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts new file mode 100644 index 000000000000..e28475ed4a85 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetLifeCycleHookEventsUpdateSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update a virtual machine scale set lifecycle hook event. + * + * @summary the operation to update a virtual machine scale set lifecycle hook event. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetLifeCycleHookEvent_Update.json + */ +async function theOperationToUpdateTheVirtualMachineScaleSetLifecycleHookEvent(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2167b012-c9f9-4b04-83b2-0ff304e7d51d"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetLifeCycleHookEvents.update( + "RG01", + "VMSS01", + "445c0a08-cfc5-4ef6-bb89-fe77c5178628", + { + waitUntil: "2025-05-08T11:17:55.6844555+00:00", + targetResources: [ + { + resource: { + id: "/subscriptions/2167b012-c9f9-4b04-83b2-0ff304e7d51d/resourceGroups/RG01/providers/Microsoft.Compute/virtualMachineScaleSets/VMSS01/virtualMachines/2", + }, + actionState: "Approved", + }, + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await theOperationToUpdateTheVirtualMachineScaleSetLifecycleHookEvent(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts new file mode 100644 index 000000000000..a431069b146c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesCancelSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to cancels the current virtual machine scale set rolling upgrade. + * + * @summary cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetRollingUpgrades.cancel("rgcompute", "aaaaa"); +} + +/** + * This sample demonstrates how to cancels the current virtual machine scale set rolling upgrade. + * + * @summary cancels the current virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetRollingUpgrades.cancel("rgcompute", "aaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen(); + await virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts new file mode 100644 index 000000000000..c580aae05d69 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesGetLatestSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the status of the latest virtual machine scale set rolling upgrade. + * + * @summary gets the status of the latest virtual machine scale set rolling upgrade. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetRollingUpgrades.getLatest( + "rgcompute", + "aaaaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen(); + await virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts similarity index 53% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts index 10afd3e3bb9e..3e6df87c19fe 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSample.ts @@ -3,28 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. * - * @summary Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json + * @summary starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json */ async function startAnExtensionRollingUpgrade(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "{vmss-name}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginStartExtensionUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startExtensionUpgrade( + "myResourceGroup", + "{vmss-name}", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts index 3cf2cfb25d92..52c7a4e34cb1 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetRollingUpgradesStartOSUpgradeSample.ts @@ -3,50 +3,34 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. * - * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json + * @summary starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeStartOSUpgradeMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startOSUpgrade("rgcompute", "aaaa"); } /** - * This sample demonstrates how to Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * This sample demonstrates how to starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. * - * @summary Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json + * @summary starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json */ async function virtualMachineScaleSetRollingUpgradeStartOSUpgradeMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSetRollingUpgrades.beginStartOSUpgradeAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSetRollingUpgrades.startOSUpgrade( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + ); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7bf95d868456 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsCreateOrUpdateSample.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update the VMSS VM extension. + * + * @summary the operation to create or update the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json + */ +async function createVirtualMachineScaleSetVMExtension(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + settings: { UserName: "xyz@microsoft.com" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts new file mode 100644 index 000000000000..ac4dec5b0c72 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsDeleteSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete the VMSS VM extension. + * + * @summary the operation to delete the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json + */ +async function deleteVirtualMachineScaleSetVMExtension(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMExtensions.delete( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + ); +} + +async function main(): Promise { + await deleteVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts new file mode 100644 index 000000000000..3b3777db30de --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get the VMSS VM extension. + * + * @summary the operation to get the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + */ +async function getVirtualMachineScaleSetVMExtension(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.get( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + ); + console.log(result); +} + +async function main(): Promise { + await getVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts similarity index 51% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts index cc712079385e..12f8fbdf2ff3 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsListSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get all extensions of an instance in Virtual Machine Scaleset. + * This sample demonstrates how to the operation to get all extensions of an instance in Virtual Machine Scaleset. * - * @summary The operation to get all extensions of an instance in Virtual Machine Scaleset. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json + * @summary the operation to get all extensions of an instance in Virtual Machine Scaleset. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json */ async function listExtensionsInVmssInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMExtensions.list( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myvmScaleSet", + "0", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts new file mode 100644 index 000000000000..036039462fd7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMExtensionsUpdateSample.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update the VMSS VM extension. + * + * @summary the operation to update the VMSS VM extension. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json + */ +async function updateVirtualMachineScaleSetVMExtension(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMExtensions.update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myVMExtension", + { + autoUpgradeMinorVersion: true, + publisher: "extPublisher", + typePropertiesType: "extType", + typeHandlerVersion: "1.2", + settings: { UserName: "xyz@microsoft.com" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateVirtualMachineScaleSetVMExtension(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5619d70ff7af --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsCreateOrUpdateSample.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to create or update the VMSS VM run command. + * + * @summary the operation to create or update the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json + */ +async function createVirtualMachineScaleSetVMRunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.createOrUpdate( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + { + location: "West US", + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", + scriptUriManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + parameters: [ + { name: "param1", value: "value1" }, + { name: "param2", value: "value2" }, + ], + asyncExecution: false, + treatFailureAsDeploymentFailure: true, + runAsUser: "user1", + runAsPassword: "", + timeoutInSeconds: 3600, + outputBlobUri: + "https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt", + errorBlobUri: "https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt", + outputBlobManagedIdentity: { clientId: "22d35efb-0c99-4041-8c5b-6d24db33a69a" }, + errorBlobManagedIdentity: {}, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createVirtualMachineScaleSetVMRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts new file mode 100644 index 000000000000..6afd9e799ec9 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsDeleteSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete the VMSS VM run command. + * + * @summary the operation to delete the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json + */ +async function deleteVirtualMachineScaleSetVMRunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMRunCommands.delete( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + ); +} + +async function main(): Promise { + await deleteVirtualMachineScaleSetVMRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts new file mode 100644 index 000000000000..71ba5d0fd7b2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to get the VMSS VM run command. + * + * @summary the operation to get the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + */ +async function getVirtualMachineScaleSetVMRunCommands(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.get( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + ); + console.log(result); +} + +async function main(): Promise { + await getVirtualMachineScaleSetVMRunCommands(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts index 0d7bfbe85f3e..e10328c88859 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsListSample.ts @@ -3,31 +3,26 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to get all run commands of an instance in Virtual Machine Scaleset. + * This sample demonstrates how to the operation to get all run commands of an instance in Virtual Machine Scaleset. * - * @summary The operation to get all run commands of an instance in Virtual Machine Scaleset. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json + * @summary the operation to get all run commands of an instance in Virtual Machine Scaleset. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json */ async function listRunCommandsInVmssInstance(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myvmScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSetVMRunCommands.list( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myvmScaleSet", + "0", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts new file mode 100644 index 000000000000..007b620a4b87 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMRunCommandsUpdateSample.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to update the VMSS VM run command. + * + * @summary the operation to update the VMSS VM run command. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json + */ +async function updateVirtualMachineScaleSetVMRunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMRunCommands.update( + "myResourceGroup", + "myvmScaleSet", + "0", + "myRunCommand", + { + source: { + scriptUri: "https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1", + scriptUriManagedIdentity: { objectId: "4231e4d2-33e4-4e23-96b2-17888afa6072" }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await updateVirtualMachineScaleSetVMRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts new file mode 100644 index 000000000000..d22e09b421a6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsApproveRollingUpgradeSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. + * + * @summary approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json + */ +async function virtualMachineScaleSetVMApproveRollingUpgrade(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.approveRollingUpgrade( + "rgcompute", + "vmssToApproveRollingUpgradeOn", + "0123", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMApproveRollingUpgrade(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts new file mode 100644 index 000000000000..56a85252d2c6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsAttachDetachDataDisksSample.ts @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to attach and detach data disks to/from a virtual machine in a VM scale set. + * + * @summary attach and detach data disks to/from a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.attachDetachDataDisks( + "rgcompute", + "azure-vmscaleset", + "0", + { + dataDisksToAttach: [ + { + lun: 1, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadOnly", + writeAcceleratorEnabled: true, + }, + { + lun: 2, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadWrite", + writeAcceleratorEnabled: false, + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + detachOption: "ForceDetach", + }, + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", + detachOption: "ForceDetach", + }, + ], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to attach and detach data disks to/from a virtual machine in a VM scale set. + * + * @summary attach and detach data disks to/from a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.attachDetachDataDisks( + "rgcompute", + "azure-vmscaleset", + "0", + { + dataDisksToAttach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + }, + ], + }, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen(); + await virtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeallocateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeallocateSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeallocateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeallocateSample.ts index 2cc4a74f8c3a..7dedd4f85ada 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSDeallocateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeallocateSample.ts @@ -3,52 +3,39 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * This sample demonstrates how to deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * - * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json + * @summary deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json */ async function virtualMachineScaleSetVMDeallocateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaaaaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, + await client.virtualMachineScaleSetVMs.deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", ); - console.log(result); } /** - * This sample demonstrates how to Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * This sample demonstrates how to deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * - * @summary Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json + * @summary deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json */ async function virtualMachineScaleSetVMDeallocateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaaaaaaaaaa"; - const instanceId = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSetVMs.beginDeallocateAndWait( - resourceGroupName, - vmScaleSetName, - instanceId, + await client.virtualMachineScaleSetVMs.deallocate( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaa", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeleteSample.ts new file mode 100644 index 000000000000..570655857462 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a virtual machine from a VM scale set. + * + * @summary deletes a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json + */ +async function forceDeleteAVirtualMachineFromAVMScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.delete("myResourceGroup", "myvmScaleSet", "0", { + forceDeletion: true, + }); +} + +async function main(): Promise { + await forceDeleteAVirtualMachineFromAVMScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetInstanceViewSample.ts similarity index 52% rename from sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetInstanceViewSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetInstanceViewSample.ts index 12eaf3f15226..bb4e47046a79 100644 --- a/sdk/compute/arm-compute/samples-dev/virtualMachineScaleSetVMSGetInstanceViewSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetInstanceViewSample.ts @@ -3,27 +3,21 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets the status of a virtual machine from a VM scale set. + * This sample demonstrates how to gets the status of a virtual machine from a VM scale set. * - * @summary Gets the status of a virtual machine from a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + * @summary gets the status of a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json */ async function getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmScaleSetName = "myVirtualMachineScaleSet"; - const instanceId = "0"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMs.getInstanceView( - resourceGroupName, - vmScaleSetName, - instanceId, + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetSample.ts new file mode 100644 index 000000000000..c712137c5bf1 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsGetSample.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithResilientVMDeletionStatus.json + */ +async function getVMScaleSetVMWithResiliencyView(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "1"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + */ +async function getVMScaleSetVMWithUserData(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "0"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + */ +async function getVMScaleSetVMWithVMSizeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get("myResourceGroup", "{vmss-name}", "0"); + console.log(result); +} + +/** + * This sample demonstrates how to gets a virtual machine from a VM scale set. + * + * @summary gets a virtual machine from a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVirtualMachineResourceId.json + */ +async function getVMScaleSetFlexVMWithVirtualMachineResourceId(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.get( + "myResourceGroup", + "{vmss-flex-name}", + "{vmss-flex-vm-name}", + ); + console.log(result); +} + +async function main(): Promise { + await getVMScaleSetVMWithResiliencyView(); + await getVMScaleSetVMWithUserData(); + await getVMScaleSetVMWithVMSizeProperties(); + await getVMScaleSetFlexVMWithVirtualMachineResourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsListSample.ts new file mode 100644 index 000000000000..bd7d2aa57c92 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsListSample.ts @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaa", + { filter: "aaaaaaaaaaaaaa", select: "aaaaaaaaaaaaaaaaaaaaa", expand: "aaaaaaaaaaaaa" }, + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("rgcompute", "aaaaaaaaaaaaaa")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithResiliencyView.json + */ +async function listVmssVMsWithResilientVMDeletionStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("resourceGroupname", "vmssName")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all virtual machines in a VM scale sets. + * + * @summary gets a list of all virtual machines in a VM scale sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_WithVirtualMachineResourceId.json + */ +async function listVmssVMsWithVirtualMachineResourceId(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSetVMs.list("resourceGroupname", "vmssName")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await virtualMachineScaleSetVMListMaximumSetGen(); + await virtualMachineScaleSetVMListMinimumSetGen(); + await listVmssVMsWithResilientVMDeletionStatus(); + await listVmssVMsWithVirtualMachineResourceId(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPerformMaintenanceSample.ts new file mode 100644 index 000000000000..6814857454e7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPerformMaintenanceSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to performs maintenance on a virtual machine in a VM scale set. + * + * @summary performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.performMaintenance( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to performs maintenance on a virtual machine in a VM scale set. + * + * @summary performs maintenance on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.performMaintenance("rgcompute", "aaaaaaaaaa", "aaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetVMPerformMaintenanceMaximumSetGen(); + await virtualMachineScaleSetVMPerformMaintenanceMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPowerOffSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPowerOffSample.ts new file mode 100644 index 000000000000..83e7bdb82233 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsPowerOffSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMPowerOffMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.powerOff("rgcompute", "aaaaaa", "aaaaaaaaa", { + skipShutdown: true, + }); +} + +/** + * This sample demonstrates how to power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMPowerOffMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.powerOff( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMPowerOffMaximumSetGen(); + await virtualMachineScaleSetVMPowerOffMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRedeploySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRedeploySample.ts new file mode 100644 index 000000000000..66aeb5af14e5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRedeploySample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMRedeployMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.redeploy( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMRedeployMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.redeploy( + "rgcompute", + "aaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMRedeployMaximumSetGen(); + await virtualMachineScaleSetVMRedeployMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageAllSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageAllSample.ts new file mode 100644 index 000000000000..506b9bffc3ae --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageAllSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageAllMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaa", + ); +} + +/** + * This sample demonstrates how to allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * + * @summary allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageAllMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimageAll( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMReimageAllMaximumSetGen(); + await virtualMachineScaleSetVMReimageAllMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageSample.ts new file mode 100644 index 000000000000..8320d64408af --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsReimageSample.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimage( + "rgcompute", + "aaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { vmScaleSetVMReimageInput: { forceUpdateOSDiskForEphemeral: true, tempDisk: true } }, + ); +} + +/** + * This sample demonstrates how to reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @summary reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMReimageMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.reimage("rgcompute", "aaaaaaa", "aaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetVMReimageMaximumSetGen(); + await virtualMachineScaleSetVMReimageMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRestartSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRestartSample.ts new file mode 100644 index 000000000000..846855cc21a5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRestartSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to restarts a virtual machine in a VM scale set. + * + * @summary restarts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMRestartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.restart("rgcompute", "aa", "aaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to restarts a virtual machine in a VM scale set. + * + * @summary restarts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMRestartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.restart("rgcompute", "aaaaaaaaaaaa", "aaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetVMRestartMaximumSetGen(); + await virtualMachineScaleSetVMRestartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts new file mode 100644 index 000000000000..9681c7dd8c94 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * + * @summary the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.retrieveBootDiagnosticsData( + "ResourceGroup", + "myvmScaleSet", + "0", + { sasUriExpirationTimeInMinutes: 60 }, + ); + console.log(result); +} + +async function main(): Promise { + await retrieveBootDiagnosticsDataOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRunCommandSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRunCommandSample.ts new file mode 100644 index 000000000000..cdc8da745c91 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsRunCommandSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to run command on a virtual machine in a VM scale set. + * + * @summary run command on a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json + */ +async function virtualMachineScaleSetVMsRunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.runCommand( + "myResourceGroup", + "myVirtualMachineScaleSet", + "0", + { commandId: "RunPowerShellScript", script: ["Write-Host Hello World!"] }, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetVMsRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsSimulateEvictionSample.ts new file mode 100644 index 000000000000..c14e0793a232 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsSimulateEvictionSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to simulate the eviction of spot virtual machine in a VM scale set. + * + * @summary the operation to simulate the eviction of spot virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json + */ +async function simulateEvictionAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.simulateEviction( + "ResourceGroup", + "VmScaleSetName", + "InstanceId", + ); +} + +async function main(): Promise { + await simulateEvictionAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsStartSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsStartSample.ts new file mode 100644 index 000000000000..720e07f33e97 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsStartSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to starts a virtual machine in a VM scale set. + * + * @summary starts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMStartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.start("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to starts a virtual machine in a VM scale set. + * + * @summary starts a virtual machine in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMStartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSetVMs.start( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaa", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetVMStartMaximumSetGen(); + await virtualMachineScaleSetVMStartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsUpdateSample.ts new file mode 100644 index 000000000000..9f5264af5caf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetVMsUpdateSample.ts @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a virtual machine of a VM scale set. + * + * @summary updates a virtual machine of a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetVMUpdateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.update( + "rgcompute", + "aaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { + location: "westus", + tags: {}, + networkProfileConfiguration: { + networkInterfaceConfigurations: [ + { + name: "vmsstestnetconfig5415", + primary: true, + enableAcceleratedNetworking: true, + dnsSettings: { dnsServers: [] }, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "vmsstestnetconfig9693", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503", + }, + privateIPAddressVersion: "IPv4", + primary: true, + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaa", + idleTimeoutInMinutes: 18, + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + ipTags: [{ ipTagType: "aaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }], + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + publicIPAddressVersion: "IPv4", + deleteOption: "Delete", + sku: { name: "Basic", tier: "Regional" }, + }, + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + }, + ], + enableFpga: true, + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + deleteOption: "Delete", + }, + ], + }, + hardwareProfile: { + vmSize: "Basic_A0", + vmSizeProperties: { vCPUsAvailable: 9, vCPUsPerCore: 12 }, + }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2012-R2-Datacenter", + version: "4.127.20180315", + sharedGalleryImageId: "aaaaaaaaaaaaaaaaaaaa", + id: "a", + }, + osDisk: { + osType: "Windows", + name: "vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + createOption: "FromImage", + caching: "None", + managedDisk: { + storageAccountType: "Standard_LRS", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskSizeGB: 127, + encryptionSettings: { + diskEncryptionKey: { + secretUrl: "aaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + keyEncryptionKey: { + keyUrl: "aaaaaaaaaaaaaa", + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + enabled: true, + }, + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + deleteOption: "Delete", + }, + dataDisks: [ + { + lun: 1, + name: "vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + createOption: "Empty", + caching: "None", + managedDisk: { + storageAccountType: "Standard_LRS", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskSizeGB: 128, + toBeDetached: true, + vhd: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + image: { + uri: "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd", + }, + writeAcceleratorEnabled: true, + detachOption: "ForceDetach", + deleteOption: "Delete", + }, + ], + }, + osProfile: { + computerName: "test000000", + adminUsername: "Foo12", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + timeZone: "aaaaaaaaaaaaaaaaaaaaaaaaaaa", + additionalUnattendContent: [ + { + passName: "OobeSystem", + componentName: "Microsoft-Windows-Shell-Setup", + settingName: "AutoLogon", + content: "aaaaaaaaaaaaaaaaaaaa", + }, + ], + patchSettings: { + patchMode: "Manual", + enableHotpatching: true, + assessmentMode: "ImageDefault", + }, + winRM: { listeners: [{ protocol: "Http", certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa" }] }, + }, + secrets: [], + allowExtensionOperations: true, + requireGuestProvisionSignal: true, + adminPassword: "aaaaaaaaaaaaaaaa", + customData: "aaaa", + linuxConfiguration: { + disablePasswordAuthentication: true, + ssh: { publicKeys: [{ path: "aaa", keyData: "aaaaaa" }] }, + provisionVMAgent: true, + patchSettings: { patchMode: "ImageDefault", assessmentMode: "ImageDefault" }, + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415", + primary: true, + deleteOption: "Delete", + }, + ], + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "aaaaaaaaaaa", + primary: true, + deleteOption: "Delete", + enableAcceleratedNetworking: true, + enableFpga: true, + enableIPForwarding: true, + networkSecurityGroup: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + dnsSettings: { dnsServers: ["aaaaaa"] }, + ipConfigurations: [ + { + name: "aa", + subnet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + primary: true, + publicIPAddressConfiguration: { + name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + idleTimeoutInMinutes: 2, + deleteOption: "Delete", + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + ipTags: [{ ipTagType: "aaaaaaaaaaaaaaaaaaaaaaaaa", tag: "aaaaaaaaaaaaaaaaaaaa" }], + publicIPPrefix: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + publicIPAddressVersion: "IPv4", + publicIPAllocationMethod: "Dynamic", + sku: { name: "Basic", tier: "Regional" }, + }, + privateIPAddressVersion: "IPv4", + applicationSecurityGroups: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + ], + }, + ], + dscpConfiguration: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + }, + ], + }, + diagnosticsProfile: { bootDiagnostics: { enabled: true, storageUri: "aaaaaaaaaaaaa" } }, + additionalCapabilities: { ultraSSDEnabled: true, hibernationEnabled: true }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + encryptionAtHost: true, + securityType: "TrustedLaunch", + }, + availabilitySet: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + licenseType: "aaaaaaaaaa", + protectionPolicy: { protectFromScaleIn: true, protectFromScaleSetActions: true }, + plan: { + name: "aaaaaaaaaa", + publisher: "aaaaaaaaaaaaaaaaaaaaaa", + product: "aaaaaaaaaaaaaaaaaaaa", + promotionCode: "aaaaaaaaaaaaaaaaaaaa", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to updates a virtual machine of a VM scale set. + * + * @summary updates a virtual machine of a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetVMUpdateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSetVMs.update( + "rgcompute", + "aaaaaaaaaaaaaaaaaa", + "aaaaaaaaaaaaaaaaaaaa", + { location: "westus" }, + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetVMUpdateMaximumSetGen(); + await virtualMachineScaleSetVMUpdateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts new file mode 100644 index 000000000000..00be678a0904 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsApproveRollingUpgradeSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. + * + * @summary approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json + */ +async function virtualMachineScaleSetApproveRollingUpgrade(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.approveRollingUpgrade( + "rgcompute", + "vmssToApproveRollingUpgradeOn", + { vmInstanceIDs: { instanceIds: ["0", "1", "2"] } }, + ); +} + +async function main(): Promise { + await virtualMachineScaleSetApproveRollingUpgrade(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts new file mode 100644 index 000000000000..5f1ab34e9743 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsConvertToSinglePlacementGroupSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { activePlacementGroupId: "aaaaaaaaaaaaaaaaaaaaaaaaaaa" }, + ); +} + +/** + * This sample demonstrates how to converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @summary converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.convertToSinglePlacementGroup( + "rgcompute", + "aaaaaaaaaaaaa", + {}, + ); +} + +async function main(): Promise { + await virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen(); + await virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5eb9c35824de --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsCreateOrUpdateSample.ts @@ -0,0 +1,3913 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json + */ +async function createAScaleSetWithEphemeralOsDisksUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAndFullCachingEnabled.json + */ +async function createAScaleSetWithEphemeralOsDisksUsingPlacementPropertyAndEnableFullCachingSetToTrue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { + option: "Local", + placement: "ResourceDisk", + enableFullCaching: true, + }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + */ +async function createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json + */ +async function createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + osDisk: { + caching: "ReadWrite", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + createOption: "FromImage", + name: "osDisk", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json + */ +async function createAScaleSetFromACustomImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json + */ +async function createAScaleSetFromAGeneralizedSharedImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json + */ +async function createAScaleSetFromASpecializedSharedImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json + */ +async function createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{nicConfig1-name}", + primary: true, + enableIPForwarding: true, + disableTcpStateTracking: true, + enableAcceleratedNetworking: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + { + name: "{nicConfig2-name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + disableTcpStateTracking: false, + ipConfigurations: [ + { + name: "{nicConfig2-name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", + }, + privateIPAddressVersion: "IPv4", + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json + */ +async function createAScaleSetWithFpgaNetworkInterfaces(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + { + name: "{fpgaNic-Name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + enableFpga: true, + ipConfigurations: [ + { + name: "{fpgaNic-Name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}", + }, + privateIPAddressVersion: "IPv4", + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json + */ +async function createAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{nicConfig1-name}", + tags: { nicTag: "tag" }, + primary: true, + enableIPForwarding: true, + disableTcpStateTracking: true, + enableAcceleratedNetworking: true, + auxiliaryMode: "AcceleratedConnections", + auxiliarySku: "A1", + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + { + name: "{nicConfig2-name}", + primary: false, + enableAcceleratedNetworking: false, + enableIPForwarding: false, + disableTcpStateTracking: false, + ipConfigurations: [ + { + name: "{nicConfig2-name}", + primary: true, + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}", + }, + privateIPAddressVersion: "IPv4", + publicIPAddressConfiguration: { + name: "publicip", + tags: { pipTag: "tag" }, + idleTimeoutInMinutes: 10, + dnsSettings: { + domainNameLabel: "vmsstestlabel01", + domainNameLabelScope: "NoReuse", + }, + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json + */ +async function createAPlatformImageScaleSetWithUnmanagedOsDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + createOption: "FromImage", + name: "osDisk", + vhdContainers: [ + "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer", + "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer", + ], + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json + */ +async function createAScaleSetWithAMarketplaceImagePlan(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json + */ +async function createAScaleSetWithApplicationProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + applicationProfile: { + galleryApplications: [ + { + tags: "myTag1", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + treatFailureAsDeploymentFailure: true, + enableAutomaticUpgrade: false, + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json + */ +async function createAScaleSetWithAutomaticRepairsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, + }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT10M" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticZoneRebalancingPolicy.json + */ +async function createAScaleSetWithAutomaticZoneRebalancingEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + automaticZoneRebalancingPolicy: { + enabled: true, + rebalanceStrategy: "Recreate", + rebalanceBehavior: "CreateBeforeDelete", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json + */ +async function createAScaleSetWithAnAzureApplicationGateway(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + applicationGatewayBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json + */ +async function createAScaleSetWithAnAzureLoadBalancer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + publicIPAddressConfiguration: { + name: "{vmss-name}", + publicIPAddressVersion: "IPv4", + }, + loadBalancerInboundNatPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}", + }, + ], + loadBalancerBackendAddressPools: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}", + }, + ], + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json + */ +async function createAScaleSetWithBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json + */ +async function createOrUpdateAScaleSetWithCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + capacityReservation: { + capacityReservationGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json + */ +async function createAScaleSetWithEphemeralOsDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json + */ +async function createAScaleSetWithDiskControllerType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, + }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + diskControllerType: "NVMe", + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + hardwareProfile: { vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json + */ +async function createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + createOption: "FromImage", + }, + dataDisks: [ + { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json + */ +async function createAScaleSetWithEmptyDataDisksOnEachVm(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + diskSizeGB: 512, + }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json + */ +async function createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DS1_v2" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { encryptionAtHost: true }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + */ +async function createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + suppressFailures: true, + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + */ +async function createAScaleSetWithExtensionTimeBudget(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + }, + ], + extensionsTimeBudget: "PT1H20M", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExternalHealthPolicy.json + */ +async function createAScaleSetWithExternalHealthPolicyEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, + }, + externalHealthPolicy: { enabled: true, expiryDuration: "PT10M", gracePeriod: "PT4H" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithHighSpeedInterconnectPlacement.json + */ +async function createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_D1_v2" }, + location: "westus", + orchestrationMode: "Flexible", + highSpeedInterconnectPlacement: "None", + platformFaultDomainCount: 1, + virtualMachineProfile: { + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-focal", + sku: "20_04-lts-gen2", + version: "latest", + }, + osDisk: { + createOption: "FromImage", + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + enableAcceleratedNetworking: false, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + primary: true, + applicationGatewayBackendAddressPools: [], + loadBalancerBackendAddressPools: [], + publicIPAddressConfiguration: { name: "{vmss-name}", idleTimeoutInMinutes: 15 }, + }, + ], + }, + ], + networkApiVersion: "2020-11-01", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithLifecycleHooksProfile.json + */ +async function createAVirtualMachineScaleSetWithLifecycleHooksProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "2e2e3046-f85f-4966-8fd2-5fd7bf6ea717"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 4, name: "Standard_D1_v2" }, + location: "westus", + lifecycleHooksProfile: { + lifecycleHooks: [ + { + type: "UpgradeAutoOSRollingBatchStarting", + waitDuration: "PT20M", + defaultAction: "Approve", + }, + ], + }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json + */ +async function createAScaleSetWithManagedBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxInstancePercentPerZonePolicy.json + */ +async function createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + zoneAllocationPolicy: { maxInstancePercentPerZonePolicy: { enabled: true, value: 50 } }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithMaxZoneCount.json + */ +async function createAZonesAutoScaleSetWithMaxZoneCount(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { zoneAllocationPolicy: { maxZoneCount: 2 } }, + placement: { zonePlacementPolicy: "Auto" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json + */ +async function createAScaleSetWithOSImageScheduledEventsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + scheduledEventsProfile: { + osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOperationRecoverySettings.json + */ +async function createAScaleSetWithOperationRecoverySettingsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { + operationRecoverySettings: { + restartRecoveryPolicy: { enabled: true }, + startRecoveryPolicy: { enabled: true }, + reimageRecoveryPolicy: { enabled: true }, + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json + */ +async function createAScaleSetWithPasswordAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPlacement.json + */ +async function createAScaleSetWithPlacementPolicyAuto(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + placement: { zonePlacementPolicy: "Auto", includeZones: ["1", "3"] }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json + */ +async function createAScaleSetWithPremiumStorage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json + */ +async function createAScaleSetWithPriorityMixPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A8m_v2" }, + location: "westus", + orchestrationMode: "Flexible", + platformFaultDomainCount: 1, + priorityMixPolicy: { baseRegularPriorityCount: 10, regularPriorityPercentageAboveBase: 50 }, + virtualMachineProfile: { + priority: "Spot", + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-focal", + sku: "20_04-lts-gen2", + version: "latest", + }, + osDisk: { + createOption: "FromImage", + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + }, + }, + osProfile: { computerNamePrefix: "{vmss-name}", adminUsername: "{your-username}" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + enableAcceleratedNetworking: false, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + primary: true, + applicationGatewayBackendAddressPools: [], + loadBalancerBackendAddressPools: [], + publicIPAddressConfiguration: { name: "{vmss-name}", idleTimeoutInMinutes: 15 }, + }, + ], + }, + ], + networkApiVersion: "2020-11-01", + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json + */ +async function createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + extensionProfile: { + extensions: [ + { + name: "{extension-name}", + autoUpgradeMinorVersion: false, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + protectedSettingsFromKeyVault: { + sourceVault: { + id: "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", + }, + secretUrl: + "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", + }, + }, + ], + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json + */ +async function createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2s_v3" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + publisher: "Canonical", + offer: "0001-com-ubuntu-server-jammy", + sku: "22_04-lts-gen2", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { + proxyAgentSettings: { + enabled: true, + addProxyAgentExtension: true, + wireServer: { + inVMAccessControlProfileReferenceId: + "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", + }, + imds: { + inVMAccessControlProfileReferenceId: + "/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Compute/galleries/{gallery-name}/inVMAccessControlProfiles/{profile-name}/versions/{version}", + }, + }, + }, + osProfile: { computerNamePrefix: "{vmss-name}", adminUsername: "{your-username}" }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json + */ +async function createAScaleSetWithResilientVMCreationEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { resilientVMCreationPolicy: { enabled: true } }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json + */ +async function createAScaleSetWithResilientVMDeletionEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + resiliencyPolicy: { resilientVMDeletionPolicy: { enabled: true } }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json + */ +async function createAScaleSetWithScaleInPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scaleInPolicy: { rules: ["OldestVM"], prioritizeUnhealthyVMs: true, forceDeletion: true }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json + */ +async function createAScaleSetWithSecurityPostureReference(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_A1" }, + location: "eastus2euap", + overprovision: true, + virtualMachineProfile: { + securityPostureReference: { + id: "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest", + }, + storageProfile: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { caching: "ReadWrite", createOption: "FromImage", name: "osDisk" }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { + mode: "Automatic", + automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DC2as_v5" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "VMGuestStateOnly" }, + }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + */ +async function createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_DC2es_v5" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "linux-cvm", + publisher: "UbuntuServer", + version: "17763.2183.2109130127", + offer: "2022-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "NonPersistedTPM" }, + }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json + */ +async function createAScaleSetWithServiceArtifactReference(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_A1" }, + location: "eastus2euap", + overprovision: true, + virtualMachineProfile: { + serviceArtifactReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName", + }, + storageProfile: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { caching: "ReadWrite", createOption: "FromImage", name: "osDisk" }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { + mode: "Automatic", + automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json + */ +async function createAScaleSetWithSkuProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { capacity: 10, name: "Mix" }, + location: "westus", + singlePlacementGroup: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + orchestrationMode: "Flexible", + priorityMixPolicy: { baseRegularPriorityCount: 4, regularPriorityPercentageAboveBase: 50 }, + skuProfile: { + vmSizes: [ + { name: "Standard_D8s_v5" }, + { name: "Standard_E16s_v5" }, + { name: "Standard_D2s_v5" }, + ], + allocationStrategy: "CapacityOptimized", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile_Prioritized.json + */ +async function createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { capacity: 10, name: "Mix" }, + location: "westus", + singlePlacementGroup: false, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + orchestrationMode: "Flexible", + priorityMixPolicy: { baseRegularPriorityCount: 4, regularPriorityPercentageAboveBase: 50 }, + skuProfile: { + vmSizes: [ + { name: "Standard_D8s_v5", rank: 0 }, + { name: "Standard_E16s_v5", rank: 1 }, + { name: "Standard_D2s_v5", rank: 2 }, + ], + allocationStrategy: "Prioritized", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json + */ +async function createAScaleSetWithSpotRestorePolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A8m_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + priority: "Spot", + evictionPolicy: "Deallocate", + billingProfile: { maxPrice: -1 }, + }, + upgradePolicy: { mode: "Manual" }, + spotRestorePolicy: { enabled: true, restoreTimeout: "PT1H" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json + */ +async function createAScaleSetWithSshAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + }, + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithStorageFaultDomainAlignment.json + */ +async function createAScaleSetContainingDisksWithStorageFaultDomainAlignment(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + storageFaultDomainAlignment: "BestEffortAligned", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { eventGridAndResourceGraph: { enable: true } }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + }, + zonalPlatformFaultDomainAlignMode: "Aligned", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json + */ +async function createAScaleSetWithTerminateScheduledEventsEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + scheduledEventsProfile: { + terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT5M" }, + }, + }, + upgradePolicy: { mode: "Manual" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json + */ +async function createAScaleSetWithUefiSettingsOfSecureBootAndVTPM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D2s_v3" }, + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "windows10-tvm", + publisher: "MicrosoftWindowsServer", + version: "18363.592.2001092016", + offer: "windowsserver-gen2preview-preview", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + }, + }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + location: "westus", + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json + */ +async function createAScaleSetWithUserData(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json + */ +async function createAScaleSetWithVmSizeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + upgradePolicy: { mode: "Manual" }, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + hardwareProfile: { vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 } }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json + */ +async function createAScaleSetWithVirtualMachinesInDifferentZones(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 2, name: "Standard_A1_v2" }, + location: "centralus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + diskSizeGB: 512, + }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Automatic" }, + zones: ["1", "3"], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to create or update a VM scale set. + * + * @summary create or update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json + */ +async function createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.createOrUpdate( + "myResourceGroup", + "{vmss-name}", + { + sku: { tier: "Standard", capacity: 3, name: "Standard_D1_v2" }, + location: "westus", + overprovision: true, + virtualMachineProfile: { + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + }, + }, + osProfile: { + computerNamePrefix: "{vmss-name}", + adminUsername: "{your-username}", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaceConfigurations: [ + { + name: "{vmss-name}", + primary: true, + enableIPForwarding: true, + ipConfigurations: [ + { + name: "{vmss-name}", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}", + }, + }, + ], + }, + ], + }, + }, + upgradePolicy: { mode: "Manual" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { eventGridAndResourceGraph: { enable: true } }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + }, + zonalPlatformFaultDomainAlignMode: "Aligned", + }, + ); + console.log(result); +} + +async function main(): Promise { + await createAScaleSetWithEphemeralOsDisksUsingPlacementProperty(); + await createAScaleSetWithEphemeralOsDisksUsingPlacementPropertyAndEnableFullCachingSetToTrue(); + await createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(); + await createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage(); + await createAScaleSetFromACustomImage(); + await createAScaleSetFromAGeneralizedSharedImage(); + await createAScaleSetFromASpecializedSharedImage(); + await createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty(); + await createAScaleSetWithFpgaNetworkInterfaces(); + await createAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings(); + await createAPlatformImageScaleSetWithUnmanagedOsDisks(); + await createAScaleSetWithAMarketplaceImagePlan(); + await createAScaleSetWithApplicationProfile(); + await createAScaleSetWithAutomaticRepairsEnabled(); + await createAScaleSetWithAutomaticZoneRebalancingEnabled(); + await createAScaleSetWithAnAzureApplicationGateway(); + await createAScaleSetWithAnAzureLoadBalancer(); + await createAScaleSetWithBootDiagnostics(); + await createOrUpdateAScaleSetWithCapacityReservation(); + await createAScaleSetWithEphemeralOsDisks(); + await createAScaleSetWithDiskControllerType(); + await createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk(); + await createAScaleSetWithEmptyDataDisksOnEachVm(); + await createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(); + await createAVmssWithAnExtensionThatHasSuppressFailuresEnabled(); + await createAScaleSetWithExtensionTimeBudget(); + await createAScaleSetWithExternalHealthPolicyEnabled(); + await createAVirtualMachineScaleSetWithHighSpeedInterconnectPlacement(); + await createAVirtualMachineScaleSetWithLifecycleHooksProfile(); + await createAScaleSetWithManagedBootDiagnostics(); + await createAScaleSetWithMaxInstancePercentPerZonePolicyEnabled(); + await createAZonesAutoScaleSetWithMaxZoneCount(); + await createAScaleSetWithOSImageScheduledEventsEnabled(); + await createAScaleSetWithOperationRecoverySettingsEnabled(); + await createAScaleSetWithPasswordAuthentication(); + await createAScaleSetWithPlacementPolicyAuto(); + await createAScaleSetWithPremiumStorage(); + await createAScaleSetWithPriorityMixPolicy(); + await createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault(); + await createAScaleSetWithProxyAgentSettingsOfEnabledAndMode(); + await createAScaleSetWithResilientVMCreationEnabled(); + await createAScaleSetWithResilientVMDeletionEnabled(); + await createAScaleSetWithScaleInPolicy(); + await createAScaleSetWithSecurityPostureReference(); + await createAScaleSetWithSecurityTypeAsConfidentialVM(); + await createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType(); + await createAScaleSetWithServiceArtifactReference(); + await createAScaleSetWithSkuProfile(); + await createAScaleSetWithSkuProfileAndPrioritizedAllocationStrategy(); + await createAScaleSetWithSpotRestorePolicy(); + await createAScaleSetWithSshAuthentication(); + await createAScaleSetContainingDisksWithStorageFaultDomainAlignment(); + await createAScaleSetWithTerminateScheduledEventsEnabled(); + await createAScaleSetWithUefiSettingsOfSecureBootAndVTPM(); + await createAScaleSetWithUserData(); + await createAScaleSetWithVmSizeProperties(); + await createAScaleSetWithVirtualMachinesInDifferentZones(); + await createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeallocateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeallocateSample.ts new file mode 100644 index 000000000000..09b4cf551306 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeallocateSample.ts @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetDeallocateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + hibernate: true, + }); +} + +/** + * This sample demonstrates how to deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @summary deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetDeallocateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetDeallocateMaximumSetGen(); + await virtualMachineScaleSetDeallocateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts new file mode 100644 index 000000000000..8cf6a7e6666b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteInstancesSample.ts @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes virtual machines in a VM scale set. + * + * @summary deletes virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetDeleteInstancesMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deleteInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + { instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] }, + { forceDeletion: true }, + ); +} + +/** + * This sample demonstrates how to deletes virtual machines in a VM scale set. + * + * @summary deletes virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetDeleteInstancesMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.deleteInstances("rgcompute", "aaaaaaaaaaaaaaa", { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }); +} + +async function main(): Promise { + await virtualMachineScaleSetDeleteInstancesMaximumSetGen(); + await virtualMachineScaleSetDeleteInstancesMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteSample.ts new file mode 100644 index 000000000000..64362f98fc58 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsDeleteSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a VM scale set. + * + * @summary deletes a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json + */ +async function forceDeleteAVMScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.delete("myResourceGroup", "myvmScaleSet", { + forceDeletion: true, + }); +} + +async function main(): Promise { + await forceDeleteAVMScaleSet(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts similarity index 51% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts index 5b1aa7692184..45bc83c9a159 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSample.ts @@ -3,52 +3,41 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * This sample demonstrates how to manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. * - * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + * @summary manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json */ async function virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; - const platformUpdateDomain = 30; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName, - vmScaleSetName, - platformUpdateDomain, + "rgcompute", + "aaaaaaaaaaaaaaaa", + 30, ); console.log(result); } /** - * This sample demonstrates how to Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * This sample demonstrates how to manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. * - * @summary Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + * @summary manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json */ async function virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaa"; - const platformUpdateDomain = 9; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName, - vmScaleSetName, - platformUpdateDomain, + "rgcompute", + "aaaaaaaaaaaa", + 9, ); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts new file mode 100644 index 000000000000..fee43e879654 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetInstanceViewSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the status of a VM scale set instance. + * + * @summary gets the status of a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetGetInstanceViewMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + "rgcompute", + "aaaaaaaaaaaaaaa", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets the status of a VM scale set instance. + * + * @summary gets the status of a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetGetInstanceViewMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.getInstanceView( + "rgcompute", + "aaaaaaaaaaaaaaa", + ); + console.log(result); +} + +async function main(): Promise { + await virtualMachineScaleSetGetInstanceViewMaximumSetGen(); + await virtualMachineScaleSetGetInstanceViewMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts new file mode 100644 index 000000000000..26d568d0e431 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetOSUpgradeHistorySample.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets list of OS upgrades on a VM scale set instance. + * + * @summary gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.getOSUpgradeHistory( + "rgcompute", + "aaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets list of OS upgrades on a VM scale set instance. + * + * @summary gets list of OS upgrades on a VM scale set instance. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.getOSUpgradeHistory( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaa", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await virtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen(); + await virtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetSample.ts new file mode 100644 index 000000000000..01d6f2cb752c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsGetSample.ts @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + */ +async function getAVirtualMachineScaleSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + ); + console.log(result); +} + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + ); + console.log(result); +} + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + */ +async function getVMScaleSetVMWithDiskControllerType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + { expand: "userData" }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to display information about a virtual machine scale set. + * + * @summary display information about a virtual machine scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + */ +async function getAVirtualMachineScaleSetWithUserData(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.get( + "myResourceGroup", + "myVirtualMachineScaleSet", + { expand: "userData" }, + ); + console.log(result); +} + +async function main(): Promise { + await getAVirtualMachineScaleSet(); + await getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(); + await getVMScaleSetVMWithDiskControllerType(); + await getAVirtualMachineScaleSetWithUserData(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListAllSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListAllSample.ts similarity index 68% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListAllSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListAllSample.ts index 78538262b1f2..191bbe22cd29 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListAllSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListAllSample.ts @@ -3,41 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * This sample demonstrates how to gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. * - * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json + * @summary gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json */ async function virtualMachineScaleSetListAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listAll()) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * This sample demonstrates how to gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. * - * @summary Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json + * @summary gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json */ async function virtualMachineScaleSetListAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListByLocationSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListByLocationSample.ts similarity index 62% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListByLocationSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListByLocationSample.ts index 4430dc36048b..72cf07163dfc 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListByLocationSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListByLocationSample.ts @@ -3,26 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets all the VM scale sets under the specified subscription for the specified location. + * This sample demonstrates how to gets all the VM scale sets under the specified subscription for the specified location. * - * @summary Gets all the VM scale sets under the specified subscription for the specified location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json + * @summary gets all the VM scale sets under the specified subscription for the specified location. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json */ async function listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "eastus"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listByLocation( - location, - )) { + for await (const item of client.virtualMachineScaleSets.listByLocation("eastus")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSample.ts new file mode 100644 index 000000000000..c013b752d578 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of all VM scale sets under a resource group. + * + * @summary gets a list of all VM scale sets under a resource group. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to gets a list of all VM scale sets under a resource group. + * + * @summary gets a list of all VM scale sets under a resource group. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachineScaleSets.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await virtualMachineScaleSetListMaximumSetGen(); + await virtualMachineScaleSetListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSkusSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSkusSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSkusSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSkusSample.ts index ffbe678d54ad..a1c4b30262f0 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsListSkusSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsListSkusSample.ts @@ -3,53 +3,43 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * This sample demonstrates how to gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. * - * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json + * @summary gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json */ async function virtualMachineScaleSetListSkusMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineScaleSets.listSkus( - resourceGroupName, - vmScaleSetName, - )) { + for await (const item of client.virtualMachineScaleSets.listSkus("rgcompute", "aaaaaa")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * This sample demonstrates how to gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. * - * @summary Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json + * @summary gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json */ async function virtualMachineScaleSetListSkusMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaaaa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachineScaleSets.listSkus( - resourceGroupName, - vmScaleSetName, + "rgcompute", + "aaaaaaaaaaaaaaaa", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts similarity index 50% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts index 373bf68cf268..878b4d4f5ecb 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPerformMaintenanceSample.ts @@ -1,64 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetVMInstanceIDs, - VirtualMachineScaleSetsPerformMaintenanceOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * This sample demonstrates how to perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * - * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json + * @summary perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json */ async function virtualMachineScaleSetPerformMaintenanceMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaa"; - const vmInstanceIDs: VirtualMachineScaleSetVMInstanceIDs = { - instanceIds: ["aaaaaaaaaaaaaaaaa"], - }; - const options: VirtualMachineScaleSetsPerformMaintenanceOptionalParams = { - vmInstanceIDs, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - options, - ); - console.log(result); + await client.virtualMachineScaleSets.performMaintenance("rgcompute", "aaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); } /** - * This sample demonstrates how to Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * This sample demonstrates how to perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications * - * @summary Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json + * @summary perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json */ async function virtualMachineScaleSetPerformMaintenanceMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aa"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = - await client.virtualMachineScaleSets.beginPerformMaintenanceAndWait( - resourceGroupName, - vmScaleSetName, - ); - console.log(result); + await client.virtualMachineScaleSets.performMaintenance("rgcompute", "aa"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPowerOffSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPowerOffSample.ts new file mode 100644 index 000000000000..58fc48f865a5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsPowerOffSample.ts @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetPowerOffMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + skipShutdown: true, + }); +} + +/** + * This sample demonstrates how to power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @summary power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetPowerOffMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.powerOff("rgcompute", "a"); +} + +async function main(): Promise { + await virtualMachineScaleSetPowerOffMaximumSetGen(); + await virtualMachineScaleSetPowerOffMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReapplySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReapplySample.ts new file mode 100644 index 000000000000..7820fa887a82 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReapplySample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * + * @summary reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetsReapplyMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "b4f1213b-cacc-4816-8bfb-f30f90643de8"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reapply( + "VirtualMachineScaleSetReapplyTestRG", + "VMSSReapply-Test-ScaleSet", + ); +} + +/** + * This sample demonstrates how to reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * + * @summary reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetsReapplyMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "b4f1213b-cacc-4816-8bfb-f30f90643de8"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reapply( + "VirtualMachineScaleSetReapplyTestRG", + "VMSSReapply-Test-ScaleSet", + ); +} + +async function main(): Promise { + await virtualMachineScaleSetsReapplyMaximumSetGen(); + await virtualMachineScaleSetsReapplyMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRedeploySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRedeploySample.ts new file mode 100644 index 000000000000..2196954e2344 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRedeploySample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRedeployMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * + * @summary shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRedeployMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetRedeployMaximumSetGen(); + await virtualMachineScaleSetRedeployMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageAllSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageAllSample.ts new file mode 100644 index 000000000000..c79a8c8a1051 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageAllSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetReimageAllMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimageAll("rgcompute", "aaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * + * @summary reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetReimageAllMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetReimageAllMaximumSetGen(); + await virtualMachineScaleSetReimageAllMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageSample.ts new file mode 100644 index 000000000000..c1502d063c59 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsReimageSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetReimageMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", { + vmScaleSetReimageInput: { + instanceIds: ["aaaaaaaaaa"], + forceUpdateOSDiskForEphemeral: true, + tempDisk: true, + }, + }); +} + +/** + * This sample demonstrates how to reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * + * @summary reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetReimageMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetReimageMaximumSetGen(); + await virtualMachineScaleSetReimageMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRestartSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRestartSample.ts new file mode 100644 index 000000000000..77a4ae3944d8 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsRestartSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to restarts one or more virtual machines in a VM scale set. + * + * @summary restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetRestartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.restart("rgcompute", "aaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to restarts one or more virtual machines in a VM scale set. + * + * @summary restarts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetRestartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.restart("rgcompute", "aaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetRestartMaximumSetGen(); + await virtualMachineScaleSetRestartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsScaleOutSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsScaleOutSample.ts new file mode 100644 index 000000000000..ea3ae217aaee --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsScaleOutSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to scales out one or more virtual machines in a VM scale set. + * + * @summary scales out one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ScaleOut.json + */ +async function virtualMachineScaleSetScaleOut(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.scaleOut("myResourceGroup", "{vmss-name}", { + capacity: 5, + properties: { zone: "1" }, + }); +} + +async function main(): Promise { + await virtualMachineScaleSetScaleOut(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts new file mode 100644 index 000000000000..cb675521fef4 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsSetOrchestrationServiceStateSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to changes ServiceState property for a given service + * + * @summary changes ServiceState property for a given service + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaa", + { serviceName: "AutomaticRepairs", action: "Resume" }, + ); +} + +/** + * This sample demonstrates how to changes ServiceState property for a given service + * + * @summary changes ServiceState property for a given service + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.setOrchestrationServiceState( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaa", + { serviceName: "AutomaticRepairs", action: "Resume" }, + ); +} + +async function main(): Promise { + await virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen(); + await virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsStartSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsStartSample.ts new file mode 100644 index 000000000000..4b6287563043 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsStartSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to starts one or more virtual machines in a VM scale set. + * + * @summary starts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetStartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.start("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", { + vmInstanceIDs: { instanceIds: ["aaaaaaaaaaaaaaaaa"] }, + }); +} + +/** + * This sample demonstrates how to starts one or more virtual machines in a VM scale set. + * + * @summary starts one or more virtual machines in a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetStartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.start("rgcompute", "aaaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineScaleSetStartMaximumSetGen(); + await virtualMachineScaleSetStartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts new file mode 100644 index 000000000000..7d8de504d8a5 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateInstancesSample.ts @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json + */ +async function virtualMachineScaleSetUpdateInstancesMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.updateInstances("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", { + instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"], + }); +} + +/** + * This sample demonstrates how to upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @summary upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json + */ +async function virtualMachineScaleSetUpdateInstancesMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachineScaleSets.updateInstances( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + { instanceIds: ["aaaaaaaaaaaaaaaaaaaaaaaaa"] }, + ); +} + +async function main(): Promise { + await virtualMachineScaleSetUpdateInstancesMaximumSetGen(); + await virtualMachineScaleSetUpdateInstancesMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateSample.ts similarity index 77% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateSample.ts index 161e3586c779..83617c1280b4 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineScaleSetsUpdateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineScaleSetsUpdateSample.ts @@ -1,110 +1,162 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineScaleSetUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Update a VM scale set. + * This sample demonstrates how to update a VM scale set. * - * @summary Update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json + * @summary update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json */ async function virtualMachineScaleSetUpdateMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetUpdate = { - additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, - automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, - doNotRunExtensionsOnOverprovisionedVMs: true, - identity: { - type: "SystemAssigned", - userAssignedIdentities: { key3951: {} }, - }, - overprovision: true, + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachineScaleSets.update("rgcompute", "aaaaaaaaaaaaa", { + sku: { name: "DSv3-Type1", tier: "aaa", capacity: 7 }, plan: { - name: "windows2016", + publisher: "microsoft-ads", product: "windows-data-science-vm", + name: "windows2016", promotionCode: "aaaaaaaaaa", - publisher: "microsoft-ads", }, - proximityPlacementGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - scaleInPolicy: { forceDeletion: true, rules: ["OldestVM"] }, - singlePlacementGroup: true, - sku: { name: "DSv3-Type1", capacity: 7, tier: "aaa" }, - tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, upgradePolicy: { - automaticOSUpgradePolicy: { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - osRollingUpgradeDeferral: true, - }, mode: "Manual", rollingUpgradePolicy: { - enableCrossZoneUpgrade: true, maxBatchInstancePercent: 49, - maxSurge: true, maxUnhealthyInstancePercent: 81, maxUnhealthyUpgradedInstancePercent: 98, pauseTimeBetweenBatches: "aaaaaaaaaaaaaaa", + enableCrossZoneUpgrade: true, prioritizeUnhealthyInstances: true, rollbackFailedInstancesOnPolicyBreach: true, + maxSurge: true, + }, + automaticOSUpgradePolicy: { + enableAutomaticOSUpgrade: true, + disableAutomaticRollback: true, + osRollingUpgradeDeferral: true, }, }, + automaticRepairsPolicy: { enabled: true, gracePeriod: "PT30M" }, virtualMachineProfile: { - billingProfile: { maxPrice: -1 }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + enableHotpatching: true, + assessmentMode: "ImageDefault", + automaticByPlatformSettings: { rebootSetting: "Never" }, + }, + timeZone: "aaaaaaaaaaaaaaaa", + additionalUnattendContent: [ + { + passName: "OobeSystem", + componentName: "Microsoft-Windows-Shell-Setup", + settingName: "AutoLogon", + content: "aaaaaaaaaaaaaaaaaaaa", + }, + ], + winRM: { listeners: [{ protocol: "Http", certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa" }] }, }, + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + provisionVMAgent: true, + patchSettings: { patchMode: "ImageDefault", assessmentMode: "ImageDefault" }, + }, + secrets: [ + { + sourceVault: { + id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", + }, + vaultCertificates: [ + { certificateUrl: "aaaaaaa", certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa" }, + ], + }, + ], }, - extensionProfile: { - extensionsTimeBudget: "PT1H20M", - extensions: [ + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + sharedGalleryImageId: "aaaaaa", + id: "aaaaaaaaaaaaaaaaaaa", + }, + osDisk: { + caching: "ReadWrite", + writeAcceleratorEnabled: true, + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + diskSizeGB: 6, + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + vhdContainers: ["aa"], + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + }, + dataDisks: [ { - name: "{extension-name}", - typePropertiesType: "{extension-Type}", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - forceUpdateTag: "aaaaaaaaa", - protectedSettings: {}, - provisionAfterExtensions: ["aa"], - publisher: "{extension-Publisher}", - settings: {}, - suppressFailures: true, - typeHandlerVersion: "{handler-version}", + diskSizeGB: 1023, + createOption: "Empty", + lun: 26, + name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", + caching: "None", + writeAcceleratorEnabled: true, + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { id: "aaaaaaaaaaaa" }, + }, + diskIopsReadWrite: 28, + diskMBpsReadWrite: 15, }, ], }, - licenseType: "aaaaaaaaaaaa", networkProfile: { healthProbe: { id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", }, - networkApiVersion: "2020-11-01", networkInterfaceConfigurations: [ { name: "aaaaaaaa", - deleteOption: "Delete", - dnsSettings: { dnsServers: [] }, + primary: true, enableAcceleratedNetworking: true, enableFpga: true, - enableIPForwarding: true, + networkSecurityGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + dnsSettings: { dnsServers: [] }, ipConfigurations: [ { name: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + subnet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", + }, + primary: true, + publicIPAddressConfiguration: { + name: "a", + idleTimeoutInMinutes: 3, + dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, + deleteOption: "Delete", + }, + privateIPAddressVersion: "IPv4", applicationGatewayBackendAddressPools: [ { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", @@ -125,168 +177,76 @@ async function virtualMachineScaleSetUpdateMaximumSetGen(): Promise { id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", }, ], - primary: true, - privateIPAddressVersion: "IPv4", - publicIPAddressConfiguration: { - name: "a", - deleteOption: "Delete", - dnsSettings: { domainNameLabel: "aaaaaaaaaaaaaaaaaa" }, - idleTimeoutInMinutes: 3, - }, - subnet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123", - }, - }, - ], - networkSecurityGroup: { - id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", - }, - primary: true, - }, - ], - }, - osProfile: { - customData: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - linuxConfiguration: { - disablePasswordAuthentication: true, - patchSettings: { - assessmentMode: "ImageDefault", - patchMode: "ImageDefault", - }, - provisionVMAgent: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, - }, - secrets: [ - { - sourceVault: { - id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - }, - vaultCertificates: [ - { - certificateStore: "aaaaaaaaaaaaaaaaaaaaaaaaa", - certificateUrl: "aaaaaaa", }, ], + enableIPForwarding: true, + deleteOption: "Delete", }, ], - windowsConfiguration: { - additionalUnattendContent: [ - { - componentName: "Microsoft-Windows-Shell-Setup", - content: "aaaaaaaaaaaaaaaaaaaa", - passName: "OobeSystem", - settingName: "AutoLogon", - }, - ], - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "ImageDefault", - automaticByPlatformSettings: { rebootSetting: "Never" }, - enableHotpatching: true, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - timeZone: "aaaaaaaaaaaaaaaa", - winRM: { - listeners: [ - { certificateUrl: "aaaaaaaaaaaaaaaaaaaaaa", protocol: "Http" }, - ], - }, - }, - }, - scheduledEventsProfile: { - terminateNotificationProfile: { - enable: true, - notBeforeTimeout: "PT10M", - }, + networkApiVersion: "2020-11-01", }, securityProfile: { encryptionAtHost: true, - securityType: "TrustedLaunch", uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", }, - storageProfile: { - dataDisks: [ + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, + }, + }, + extensionProfile: { + extensions: [ { - name: "aaaaaaaaaaaaaaaaaaaaaaaaaa", - caching: "None", - createOption: "Empty", - diskIopsReadWrite: 28, - diskMBpsReadWrite: 15, - diskSizeGB: 1023, - lun: 26, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - storageAccountType: "Standard_LRS", - }, - writeAcceleratorEnabled: true, + name: "{extension-name}", + autoUpgradeMinorVersion: true, + publisher: "{extension-Publisher}", + typePropertiesType: "{extension-Type}", + typeHandlerVersion: "{handler-version}", + settings: {}, + forceUpdateTag: "aaaaaaaaa", + enableAutomaticUpgrade: true, + protectedSettings: {}, + provisionAfterExtensions: ["aa"], + suppressFailures: true, }, ], - imageReference: { - id: "aaaaaaaaaaaaaaaaaaa", - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sharedGalleryImageId: "aaaaaa", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - caching: "ReadWrite", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - diskSizeGB: 6, - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, - managedDisk: { - diskEncryptionSet: { id: "aaaaaaaaaaaa" }, - storageAccountType: "Standard_LRS", - }, - vhdContainers: ["aa"], - writeAcceleratorEnabled: true, - }, + extensionsTimeBudget: "PT1H20M", + }, + licenseType: "aaaaaaaaaaaa", + billingProfile: { maxPrice: -1 }, + scheduledEventsProfile: { + terminateNotificationProfile: { notBeforeTimeout: "PT10M", enable: true }, }, userData: "aaaaaaaaaaaaa", }, + overprovision: true, + doNotRunExtensionsOnOverprovisionedVMs: true, + singlePlacementGroup: true, + additionalCapabilities: { hibernationEnabled: true, ultraSSDEnabled: true }, + scaleInPolicy: { rules: ["OldestVM"], forceDeletion: true }, + proximityPlacementGroup: { + id: "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot", + }, + identity: { type: "SystemAssigned", userAssignedIdentities: { key3951: {} } }, zones: ["1", "2", "3"], - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + tags: { key246: "aaaaaaaaaaaaaaaaaaaaaaaa" }, + }); console.log(result); } /** - * This sample demonstrates how to Update a VM scale set. + * This sample demonstrates how to update a VM scale set. * - * @summary Update a VM scale set. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json + * @summary update a VM scale set. + * x-ms-original-file: 2025-11-01/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json */ async function virtualMachineScaleSetUpdateMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute"; - const vmScaleSetName = "aaaaaaaaaaaaaa"; - const parameters: VirtualMachineScaleSetUpdate = {}; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachineScaleSets.beginUpdateAndWait( - resourceGroupName, - vmScaleSetName, - parameters, - ); + const result = await client.virtualMachineScaleSets.update("rgcompute", "aaaaaaaaaaaaaa", {}); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineSizesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineSizesListSample.ts similarity index 54% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineSizesListSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineSizesListSample.ts index 234d7aa658c0..8c449e1fb926 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachineSizesListSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachineSizesListSample.ts @@ -3,43 +3,40 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * This sample demonstrates how to this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) * - * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json + * @summary this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json */ async function virtualMachineSizesListMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "-e"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineSizes.list(location)) { + for await (const item of client.virtualMachineSizes.list("-e")) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * This sample demonstrates how to this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) * - * @summary This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json + * @summary this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) + * x-ms-original-file: 2025-11-01/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json */ async function virtualMachineSizesListMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const location = "._.."; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachineSizes.list(location)) { + for await (const item of client.virtualMachineSizes.list("._..")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAssessPatchesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAssessPatchesSample.ts new file mode 100644 index 000000000000..8b31d0c0354c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAssessPatchesSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to assess patches on the VM. + * + * @summary assess patches on the VM. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AssessPatches.json + */ +async function assessPatchStateOfAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.assessPatches("myResourceGroupName", "myVMName"); + console.log(result); +} + +async function main(): Promise { + await assessPatchStateOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts new file mode 100644 index 000000000000..765ca192a360 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesAttachDetachDataDisksSample.ts @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to attach and detach data disks to/from the virtual machine. + * + * @summary attach and detach data disks to/from the virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json + */ +async function virtualMachineAttachDetachDataDisksMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.attachDetachDataDisks( + "rgcompute", + "aaaaaaaaaaaaaaaaaaaa", + { + dataDisksToAttach: [ + { + lun: 1, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadOnly", + deleteOption: "Delete", + writeAcceleratorEnabled: true, + }, + { + lun: 2, + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + caching: "ReadWrite", + deleteOption: "Detach", + writeAcceleratorEnabled: false, + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + detachOption: "ForceDetach", + }, + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z", + detachOption: "ForceDetach", + }, + ], + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to attach and detach data disks to/from the virtual machine. + * + * @summary attach and detach data disks to/from the virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json + */ +async function virtualMachineAttachDetachDataDisksMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.attachDetachDataDisks("rgcompute", "azure-vm", { + dataDisksToAttach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d", + }, + ], + dataDisksToDetach: [ + { + diskId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x", + }, + ], + }); + console.log(result); +} + +async function main(): Promise { + await virtualMachineAttachDetachDataDisksMaximumSetGen(); + await virtualMachineAttachDetachDataDisksMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCaptureSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCaptureSample.ts new file mode 100644 index 000000000000..5fe0cbea96a3 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCaptureSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json + */ +async function virtualMachineCaptureMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.capture("rgcompute", "aaaaaaaaaaaaaaaaaaaa", { + vhdPrefix: "aaaaaaaaa", + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + }); + console.log(result); +} + +/** + * This sample demonstrates how to captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @summary captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json + */ +async function virtualMachineCaptureMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.capture("rgcompute", "aaaaaaaaaaaaa", { + vhdPrefix: "aaaaaaaaa", + destinationContainerName: "aaaaaaa", + overwriteVhds: true, + }); + console.log(result); +} + +async function main(): Promise { + await virtualMachineCaptureMaximumSetGen(); + await virtualMachineCaptureMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesConvertToManagedDisksSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesConvertToManagedDisksSample.ts new file mode 100644 index 000000000000..ef06fcecb65b --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesConvertToManagedDisksSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json + */ +async function virtualMachineConvertToManagedDisksMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.convertToManagedDisks("rgcompute", "aaaaaaa"); +} + +/** + * This sample demonstrates how to converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * + * @summary converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json + */ +async function virtualMachineConvertToManagedDisksMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.convertToManagedDisks("rgcompute", "aaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineConvertToManagedDisksMaximumSetGen(); + await virtualMachineConvertToManagedDisksMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCreateOrUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCreateOrUpdateSample.ts similarity index 63% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCreateOrUpdateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCreateOrUpdateSample.ts index aeac45784a6c..23120fffb9ce 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesCreateOrUpdateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesCreateOrUpdateSample.ts @@ -1,26 +1,41 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { VirtualMachine} from "@azure/arm-compute"; import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json */ -async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createACustomImageVmFromAnUnmanagedGeneralizedOsImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + osDisk: { + name: "myVMosdisk", + image: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", + }, + osType: "Windows", + createOption: "FromImage", + caching: "ReadWrite", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -29,55 +44,40 @@ async function createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault(): Pr }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { assessmentMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json + */ +async function createAVMFromACommunityGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + communityGalleryImageId: + "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json - */ -async function createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -86,62 +86,80 @@ async function createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndA }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { - assessmentMode: "AutomaticByPlatform", - automaticByPlatformSettings: { - bypassPlatformSafetyChecksOnUserSchedule: true, - rebootSetting: "Never", - }, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json + */ +async function createAVmFromACustomImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json */ -async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createAVmFromAGeneralizedSharedImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -150,55 +168,76 @@ async function createALinuxVMWithAPatchSettingPatchModeOfImageDefault(): Promise }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { patchMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json + */ +async function createAVMFromASharedGalleryImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", - version: "latest", + sharedGalleryImageId: + "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json */ -async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, +async function createAVmFromASpecializedSharedImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, networkProfile: { networkInterfaces: [ { @@ -207,58 +246,37 @@ async function createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAu }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - linuxConfiguration: { - patchSettings: { - assessmentMode: "AutomaticByPlatform", - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + */ +async function createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "UbuntuServer", - publisher: "Canonical", - sku: "16.04-LTS", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json - */ -async function createAVMFromACommunityGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -268,48 +286,45 @@ async function createAVMFromACommunityGalleryImage(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", + }, + virtualMachineScaleSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}", }, + platformFaultDomain: 1, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json + */ +async function createAVmInAnAvailabilitySet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - communityGalleryImageId: - "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json - */ -async function createAVMFromASharedGalleryImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -319,129 +334,60 @@ async function createAVMFromASharedGalleryImage(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - sharedGalleryImageId: - "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, + availabilitySet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json */ -async function createAVMWithDiskControllerType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", - }, - }, - hardwareProfile: { vmSize: "Standard_D4_v3" }, +async function createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, - }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { - diskControllerType: "NVMe", imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "U29tZSBDdXN0b20gRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithFips1403Enabled.json - */ -async function createAVMWithFips1403Enabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - additionalCapabilities: { enableFips1403Encryption: true }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + assessmentMode: "AutomaticByPlatform", + automaticByPlatformSettings: { + rebootSetting: "Never", + bypassPlatformSafetyChecksOnUserSchedule: true, + }, + }, }, }, - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "eastus2euap", networkProfile: { networkInterfaces: [ { @@ -450,59 +396,46 @@ async function createAVMWithFips1403Enabled(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json - */ -async function createAVMWithHibernationEnabled(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - additionalCapabilities: { hibernationEnabled: true }, - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { assessmentMode: "ImageDefault" }, }, }, - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "eastus2euap", networkProfile: { networkInterfaces: [ { @@ -511,51 +444,43 @@ async function createAVMWithHibernationEnabled(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + */ +async function createALinuxVmWithAPatchSettingPatchModeOfImageDefault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json - */ -async function createAVMWithProxyAgentSettingsOfEnabledAndMode(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { provisionVMAgent: true, patchSettings: { patchMode: "ImageDefault" } }, + }, networkProfile: { networkInterfaces: [ { @@ -564,58 +489,46 @@ async function createAVMWithProxyAgentSettingsOfEnabledAndMode(): Promise }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - proxyAgentSettings: { - enabled: true, - imds: { mode: "Audit" }, - wireServer: { mode: "Audit" }, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", + sku: "16.04-LTS", + publisher: "Canonical", version: "latest", + offer: "UbuntuServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json - */ -async function createAVMWithUefiSettingsOfSecureBootAndVTpm(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + linuxConfiguration: { + provisionVMAgent: true, + patchSettings: { patchMode: "AutomaticByPlatform", assessmentMode: "AutomaticByPlatform" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -624,62 +537,62 @@ async function createAVMWithUefiSettingsOfSecureBootAndVTpm(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "TrustedLaunch", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "windowsserver-gen2preview-preview", - publisher: "MicrosoftWindowsServer", - sku: "windows10-tvm", - version: "18363.592.2001092016", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json */ -async function createAVMWithUserData(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAPlatformImageVmWithUnmanagedOsAndDataDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", + }, + createOption: "FromImage", + name: "myVMosdisk", }, + dataDisks: [ + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd", + }, + }, + { + diskSizeGB: 1023, + createOption: "Empty", + lun: 1, + vhd: { + uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd", + }, + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -688,62 +601,54 @@ async function createAVMWithUserData(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "{vm-name}", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "vmOSdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "RXhhbXBsZSBVc2VyRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json - */ -async function createAVMWithVMSizeProperties(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { + patchMode: "AutomaticByPlatform", + assessmentMode: "AutomaticByPlatform", + automaticByPlatformSettings: { + rebootSetting: "Never", + bypassPlatformSafetyChecksOnUserSchedule: false, + }, + }, }, }, - hardwareProfile: { - vmSize: "Standard_D4_v3", - vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, - }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -752,52 +657,47 @@ async function createAVMWithVMSizeProperties(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + */ +async function createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - userData: "U29tZSBDdXN0b20gRGF0YQ==", - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPlacement.json - */ -async function createAVMWithAutomaticZonePlacement(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus2", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { assessmentMode: "ImageDefault" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -806,263 +706,145 @@ async function createAVMWithAutomaticZonePlacement(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - placement: { includeZones: ["1", "3"], zonePlacementPolicy: "Any" }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json - */ -async function createAVMWithEncryptionIdentity(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2s_v3" }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/myIdentity": - {}, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByOS" }, }, }, - location: "westus", networkProfile: { networkInterfaces: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", primary: true, }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - encryptionIdentity: { - userAssignedIdentityResourceId: - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity", - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + */ +async function createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", + sku: "2016-Datacenter", publisher: "MicrosoftWindowsServer", - sku: "2019-Datacenter", version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { storageAccountType: "StandardSSD_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json - */ -async function createAVMWithNetworkInterfaceConfiguration(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{nic-config-name}", - deleteOption: "Delete", - ipConfigurations: [ - { - name: "{ip-config-name}", - primary: true, - publicIPAddressConfiguration: { - name: "{publicIP-config-name}", - deleteOption: "Detach", - publicIPAllocationMethod: "Static", - sku: { name: "Basic", tier: "Global" }, - tags: { pipTag: "tag" }, - }, - }, - ], - primary: true, - tags: { nicTag: "tag" }, - }, - ], - }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByPlatform", enableHotpatching: true }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json */ -async function createAVMWithNetworkInterfaceConfigurationWithPublicIPAddressDnsSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAWindowsVmWithAPatchSettingPatchModeOfManual(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkApiVersion: "2020-11-01", - networkInterfaceConfigurations: [ - { - name: "{nic-config-name}", - deleteOption: "Delete", - ipConfigurations: [ - { - name: "{ip-config-name}", - primary: true, - publicIPAddressConfiguration: { - name: "{publicIP-config-name}", - deleteOption: "Detach", - dnsSettings: { - domainNameLabel: "aaaaa", - domainNameLabelScope: "TenantReuse", - }, - publicIPAllocationMethod: "Static", - sku: { name: "Basic", tier: "Global" }, - }, - }, - ], - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json - */ -async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DC2as_v5" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "Manual" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -1071,63 +853,47 @@ async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(): }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + */ +async function createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "2019-datacenter-cvm", + sku: "2016-Datacenter", publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", + version: "latest", + offer: "WindowsServer", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - managedDisk: { - securityProfile: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - securityEncryptionType: "DiskWithVMGuestState", - }, - storageAccountType: "StandardSSD_LRS", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json - */ -async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurityEncryptionType(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DC2es_v5" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + windowsConfiguration: { + provisionVMAgent: true, + enableAutomaticUpdates: true, + patchSettings: { patchMode: "AutomaticByPlatform", assessmentMode: "AutomaticByPlatform" }, + }, + }, networkProfile: { networkInterfaces: [ { @@ -1136,118 +902,44 @@ async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurit }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, - }, - storageProfile: { - imageReference: { - offer: "2022-datacenter-cvm", - publisher: "UbuntuServer", - sku: "linux-cvm", - version: "17763.2183.2109130127", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "NonPersistedTPM" }, - storageAccountType: "StandardSSD_LRS", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json */ -async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DC2as_v5" }, +async function createAVmWithEphemeralOsDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - securityProfile: { - securityType: "ConfidentialVM", - uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, - }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "2019-datacenter-cvm", - publisher: "MicrosoftWindowsServer", - sku: "windows-cvm", - version: "17763.2183.2109130127", + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + diffDiskSettings: { option: "Local" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { - securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, - storageAccountType: "StandardSSD_LRS", - }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json - */ -async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1256,114 +948,44 @@ async function createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault(): }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { assessmentMode: "ImageDefault" }, - provisionVMAgent: true, - }, - }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskAndFullCachingEnabled.json */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVmWithEphemeralOsDiskAndEnableFullCachingSetToTrue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { patchMode: "AutomaticByOS" }, - provisionVMAgent: true, - }, - }, + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "TempDisk", enableFullCaching: true }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1372,63 +994,44 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAn }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "AutomaticByPlatform", - automaticByPlatformSettings: { - bypassPlatformSafetyChecksOnUserSchedule: false, - rebootSetting: "Never", - }, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + */ +async function createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "CacheDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1437,59 +1040,44 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAn }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - enableHotpatching: true, - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + */ +async function createAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json - */ -async function createAWindowsVMWithAPatchSettingPatchModeOfManual(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1498,56 +1086,44 @@ async function createAWindowsVMWithAPatchSettingPatchModeOfManual(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, + managedDisk: { storageAccountType: "Standard_LRS" }, createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json - */ -async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1556,59 +1132,43 @@ async function createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToA }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - windowsConfiguration: { - enableAutomaticUpdates: true, - patchSettings: { - assessmentMode: "AutomaticByPlatform", - patchMode: "AutomaticByPlatform", - }, - provisionVMAgent: true, - }, - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json + */ +async function createAVmWithAMarketplaceImagePlan(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "windows2016", + publisher: "microsoft-ads", version: "latest", + offer: "windows-data-science-vm", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json - */ -async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1617,124 +1177,60 @@ async function createACustomImageVMFromAnUnmanagedGeneralizedOSImage(): Promise< }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - storageProfile: { - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - image: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd", - }, - osType: "Windows", - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json */ -async function createAPlatformImageVMWithUnmanagedOSAndDataDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "{vm-name}"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, +async function createAVmWithApplicationProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { - dataDisks: [ - { - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd", - }, - }, - { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd", - }, - }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + sku: "{image_sku}", + publisher: "{image_publisher}", version: "latest", + offer: "{image_offer}", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - vhd: { - uri: "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd", - }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json - */ -async function createAVMFromACustomImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + applicationProfile: { + galleryApplications: [ + { + tags: "myTag1", + order: 1, + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", + configurationReference: + "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", + treatFailureAsDeploymentFailure: false, + enableAutomaticUpgrade: false, + }, + { + packageReferenceId: + "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1743,48 +1239,37 @@ async function createAVMFromACustomImage(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + */ +async function createAVmWithBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json - */ -async function createAVMFromAGeneralizedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1794,47 +1279,58 @@ async function createAVMFromAGeneralizedSharedImage(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json */ -async function createAVMFromASpecializedSharedImage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createOrUpdateAVMWithCapacityReservation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + capacityReservation: { + capacityReservationGroup: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -1843,43 +1339,68 @@ async function createAVMFromASpecializedSharedImage(): Promise { }, ], }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json + */ +async function createAVmWithDataDisksUsingCopyAndRestoreOptions(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, storageProfile: { imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { + diskSizeGB: 1023, + createOption: "Copy", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}", + }, + lun: 0, + }, + { + diskSizeGB: 1023, + createOption: "Copy", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}", + }, + lun: 1, + }, + { + diskSizeGB: 1023, + createOption: "Restore", + sourceResource: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}", + }, + lun: 2, + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json - */ -async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1888,58 +1409,46 @@ async function createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFau }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + */ +async function createAVMWithDiskControllerType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D4_v3" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, - platformFaultDomain: 1, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + diskControllerType: "NVMe", }, - virtualMachineScaleSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json - */ -async function createAVMInAnAvailabilitySet(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - availabilitySet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}", - }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -1949,68 +1458,82 @@ async function createAVMInAnAvailabilitySet(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + userData: "U29tZSBDdXN0b20gRGF0YQ==", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json */ -async function createAVMWithApplicationProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - applicationProfile: { - galleryApplications: [ +async function createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + name: "myVMosdisk", + createOption: "FromImage", + }, + dataDisks: [ { - configurationReference: - "https://mystorageaccount.blob.core.windows.net/configurations/settings.config", - enableAutomaticUpgrade: false, - order: 1, - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0", - tags: "myTag1", - treatFailureAsDeploymentFailure: false, + caching: "ReadWrite", + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, }, { - packageReferenceId: - "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1", + caching: "ReadWrite", + managedDisk: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + diskSizeGB: 1023, + createOption: "Attach", + lun: 1, }, ], }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2019,51 +1542,92 @@ async function createAVMWithApplicationProfile(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + */ +async function createAVmWithEmptyDataDisks(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2_v2" }, storageProfile: { imageReference: { - offer: "{image_offer}", - publisher: "{image_publisher}", - sku: "{image_sku}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0 }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1 }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json */ -async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVmWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + securityProfile: { encryptionAtHost: true }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2072,80 +1636,94 @@ async function createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk(): }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json + */ +async function createAVMWithEncryptionIdentity(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": + {}, + }, + }, + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + encryptionIdentity: { + userAssignedIdentityResourceId: + "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity", + }, }, storageProfile: { - dataDisks: [ - { - caching: "ReadWrite", - createOption: "Empty", - diskSizeGB: 1023, - lun: 0, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, - }, - { - caching: "ReadWrite", - createOption: "Attach", - diskSizeGB: 1023, - lun: 1, - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}", - storageAccountType: "Standard_LRS", - }, - }, - ], imageReference: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}", + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", }, osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, createOption: "FromImage", - managedDisk: { - diskEncryptionSet: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", - }, - storageAccountType: "Standard_LRS", - }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json */ -async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVmWithAnExtensionsTimeBudget(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + }, networkProfile: { networkInterfaces: [ { @@ -2155,63 +1733,49 @@ async function createAVMWithHostEncryptionUsingEncryptionAtHostProperty(): Promi ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - securityProfile: { encryptionAtHost: true }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + extensionsTimeBudget: "PT30M", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithFips1403Enabled.json */ -async function createAVMWithScheduledEventsProfile(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVMWithFips1403Enabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "eastus2euap", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + additionalCapabilities: { enableFips1403Encryption: true }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2221,65 +1785,48 @@ async function createAVMWithScheduledEventsProfile(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - scheduledEventsPolicy: { - allInstancesDown: { automaticallyApprove: true }, - scheduledEventsAdditionalPublishingTargets: { - eventGridAndResourceGraph: { - enable: true, - scheduledEventsApiVersion: "2020-07-01", - }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, - userInitiatedReboot: { automaticallyApprove: true }, - userInitiatedRedeploy: { automaticallyApprove: true }, - }, - scheduledEventsProfile: { - osImageNotificationProfile: { enable: true, notBeforeTimeout: "PT15M" }, - terminateNotificationProfile: { enable: true, notBeforeTimeout: "PT10M" }, }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json + */ +async function createAVMWithHibernationEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "eastus2euap", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + additionalCapabilities: { hibernationEnabled: true }, storageProfile: { imageReference: { - offer: "WindowsServer", publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", + offer: "WindowsServer", + sku: "2019-Datacenter", version: "latest", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json - */ -async function createAVMWithAMarketplaceImagePlan(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2289,63 +1836,47 @@ async function createAVMWithAMarketplaceImagePlan(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json */ -async function createAVMWithAnExtensionsTimeBudget(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVmWithManagedBootDiagnostics(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - extensionsTimeBudget: "PT30M", - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2355,110 +1886,166 @@ async function createAVMWithAnExtensionsTimeBudget(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, + diagnosticsProfile: { bootDiagnostics: { enabled: true } }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json + */ +async function createAVMWithNetworkInterfaceConfiguration(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + networkProfile: { + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ + { + name: "{nic-config-name}", + tags: { nicTag: "tag" }, + primary: true, + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + tags: { pipTag: "tag" }, + sku: { name: "Basic", tier: "Global" }, + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + }, + }, + ], + }, + ], + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json */ -async function createAVMWithBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { - bootDiagnostics: { - enabled: true, - storageUri: - "http://{existing-storage-account-name}.blob.core.windows.net", +async function createAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { - networkInterfaces: [ + networkApiVersion: "2020-11-01", + networkInterfaceConfigurations: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + name: "{nic-config-name}", primary: true, + deleteOption: "Delete", + ipConfigurations: [ + { + name: "{ip-config-name}", + primary: true, + publicIPAddressConfiguration: { + name: "{publicIP-config-name}", + sku: { name: "Basic", tier: "Global" }, + deleteOption: "Detach", + publicIPAllocationMethod: "Static", + dnsSettings: { domainNameLabel: "aaaaa", domainNameLabelScope: "TenantReuse" }, + }, + }, + ], }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json + */ +async function createAVmWithPasswordAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json - */ -async function createAVMWithDataDisksUsingCopyAndRestoreOptions(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2467,77 +2054,135 @@ async function createAVMWithDataDisksUsingCopyAndRestoreOptions(): Promise }, ], }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPlacement.json + */ +async function createAVMWithAutomaticZonePlacement(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus2", + plan: { publisher: "microsoft-ads", product: "windows-data-science-vm", name: "windows2016" }, + hardwareProfile: { vmSize: "Standard_DS1_v2" }, + storageProfile: { + imageReference: { + sku: "windows2016", + publisher: "microsoft-ads", + version: "latest", + offer: "windows-data-science-vm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "Standard_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - dataDisks: [ - { - createOption: "Copy", - diskSizeGB: 1023, - lun: 0, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}", - }, - }, - { - createOption: "Copy", - diskSizeGB: 1023, - lun: 1, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}", - }, - }, + networkProfile: { + networkInterfaces: [ { - createOption: "Restore", - diskSizeGB: 1023, - lun: 2, - sourceResource: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}", - }, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, ], + }, + placement: { zonePlacementPolicy: "Any", includeZones: ["1", "3"] }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + */ +async function createAVmWithPremiumStorage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json */ -async function createAVMWithEmptyDataDisks(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D2_v2" }, +async function createAVMWithProxyAgentSettingsOfEnabledAndMode(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + proxyAgentSettings: { enabled: true, wireServer: { mode: "Audit" }, imds: { mode: "Audit" } }, + }, + storageProfile: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-Datacenter", + version: "latest", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2546,55 +2191,45 @@ async function createAVMWithEmptyDataDisks(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + */ +async function createAVmWithScheduledEventsProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, + scheduledEventsPolicy: { + scheduledEventsAdditionalPublishingTargets: { + eventGridAndResourceGraph: { enable: true, scheduledEventsApiVersion: "2020-07-01" }, + }, + userInitiatedRedeploy: { automaticallyApprove: true }, + userInitiatedReboot: { automaticallyApprove: true }, + allInstancesDown: { automaticallyApprove: true }, }, storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0 }, - { createOption: "Empty", diskSizeGB: 1023, lun: 1 }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json - */ -async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2604,56 +2239,63 @@ async function createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacement ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "CacheDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + scheduledEventsProfile: { + terminateNotificationProfile: { notBeforeTimeout: "PT10M", enable: true }, + osImageNotificationProfile: { notBeforeTimeout: "PT15M", enable: true }, + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json */ -async function createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + storageProfile: { + imageReference: { + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "DiskWithVMGuestState" }, + }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2662,57 +2304,105 @@ async function createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementP }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + */ +async function createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_DC2as_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "ConfidentialVM", }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", + sku: "windows-cvm", + publisher: "MicrosoftWindowsServer", + version: "17763.2183.2109130127", + offer: "2019-datacenter-cvm", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { + securityEncryptionType: "DiskWithVMGuestState", + diskEncryptionSet: { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}", + }, + }, + }, createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "NvmeDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json */ -async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, +async function createAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", + hardwareProfile: { vmSize: "Standard_DC2es_v5" }, + securityProfile: { + uefiSettings: { secureBootEnabled: false, vTpmEnabled: true }, + securityType: "ConfidentialVM", + }, + storageProfile: { + imageReference: { + sku: "linux-cvm", + publisher: "UbuntuServer", + version: "17763.2183.2109130127", + offer: "2022-datacenter-cvm", + }, + osDisk: { + caching: "ReadOnly", + managedDisk: { + storageAccountType: "StandardSSD_LRS", + securityProfile: { securityEncryptionType: "NonPersistedTPM" }, + }, + createOption: "FromImage", + name: "myVMosdisk", + }, + }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2721,57 +2411,53 @@ async function createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacem }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json + */ +async function createAVmWithSshAuthentication(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", + sku: "{image_sku}", + publisher: "{image_publisher}", version: "latest", + offer: "{image_offer}", }, osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, name: "myVMosdisk", - caching: "ReadOnly", createOption: "FromImage", - diffDiskSettings: { option: "Local", placement: "ResourceDisk" }, - managedDisk: { storageAccountType: "Standard_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json - */ -async function createAVMWithEphemeralOSDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + linuxConfiguration: { + ssh: { + publicKeys: [ + { + path: "/home/{your-username}/.ssh/authorized_keys", + keyData: + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", + }, + ], + }, + disablePasswordAuthentication: true, + }, + }, networkProfile: { networkInterfaces: [ { @@ -2780,58 +2466,46 @@ async function createAVMWithEphemeralOSDisk(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json + */ +async function createAVMWithUefiSettingsOfSecureBootAndVTPM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, + securityProfile: { + uefiSettings: { secureBootEnabled: true, vTpmEnabled: true }, + securityType: "TrustedLaunch", }, storageProfile: { imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", + sku: "windows10-tvm", + publisher: "MicrosoftWindowsServer", + version: "18363.592.2001092016", + offer: "windowsserver-gen2preview-preview", }, osDisk: { - name: "myVMosdisk", caching: "ReadOnly", + managedDisk: { storageAccountType: "StandardSSD_LRS" }, createOption: "FromImage", - diffDiskSettings: { option: "Local" }, - managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json - */ -async function createAVMWithManagedBootDiagnostics(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - diagnosticsProfile: { bootDiagnostics: { enabled: true } }, - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, networkProfile: { networkInterfaces: [ { @@ -2840,51 +2514,37 @@ async function createAVMWithManagedBootDiagnostics(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + */ +async function createAVMWithUserData(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "{vm-name}", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D1_v2" }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "vmOSdisk", + createOption: "FromImage", }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json - */ -async function createAVMWithPasswordAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -2894,103 +2554,51 @@ async function createAVMWithPasswordAuthentication(): Promise { ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", - computerName: "myVM", + computerName: "{vm-name}", + adminPassword: "{your-password}", }, - storageProfile: { - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + userData: "RXhhbXBsZSBVc2VyRGF0YQ==", + }); console.log(result); } /** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json */ -async function createAVMWithPremiumStorage(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, +async function createAVMWithVMSizeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { location: "westus", - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", + hardwareProfile: { + vmSize: "Standard_D4_v3", + vmSizeProperties: { vCPUsAvailable: 1, vCPUsPerCore: 1 }, }, storageProfile: { imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Premium_LRS" }, }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json - */ -async function createAVMWithSshAuthentication(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - hardwareProfile: { vmSize: "Standard_D1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -3002,64 +2610,61 @@ async function createAVMWithSshAuthentication(): Promise { osProfile: { adminUsername: "{your-username}", computerName: "myVM", - linuxConfiguration: { - disablePasswordAuthentication: true, - ssh: { - publicKeys: [ - { - path: "/home/{your-username}/.ssh/authorized_keys", - keyData: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1", - }, - ], - }, + adminPassword: "{your-password}", + }, + diagnosticsProfile: { + bootDiagnostics: { + storageUri: "http://{existing-storage-account-name}.blob.core.windows.net", + enabled: true, }, }, + userData: "U29tZSBDdXN0b20gRGF0YQ==", + }); + console.log(result); +} + +/** + * This sample demonstrates how to the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * + * @summary the operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Create_WithZoneMovementEnabled.json + */ +async function createAVmWithResiliencyProfileAndZoneMovementEnabled(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.createOrUpdate("myResourceGroup", "myVM", { + location: "westus", + hardwareProfile: { vmSize: "Standard_D2s_v3" }, storageProfile: { imageReference: { - offer: "{image_offer}", - publisher: "{image_publisher}", - sku: "{image_sku}", + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", + managedDisk: { storageAccountType: "Premium_ZRS" }, + name: "myVMosdisk", createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, }, + dataDisks: [ + { + diskSizeGB: 128, + lun: 0, + createOption: "Empty", + managedDisk: { storageAccountType: "Premium_ZRS" }, + name: "myVMdatadisk1", + caching: "ReadWrite", + }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * - * @summary The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json - */ -async function createOrUpdateAVMWithCapacityReservation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachine = { - capacityReservation: { - capacityReservationGroup: { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}", - }, + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", }, - hardwareProfile: { vmSize: "Standard_DS1_v2" }, - location: "westus", networkProfile: { networkInterfaces: [ { @@ -3068,93 +2673,65 @@ async function createOrUpdateAVMWithCapacityReservation(): Promise { }, ], }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, - plan: { - name: "windows2016", - product: "windows-data-science-vm", - publisher: "microsoft-ads", - }, - storageProfile: { - imageReference: { - offer: "windows-data-science-vm", - publisher: "microsoft-ads", - sku: "windows2016", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadOnly", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginCreateOrUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + resiliencyProfile: { zoneMovement: { isEnabled: true } }, + }); console.log(result); } async function main(): Promise { - await createALinuxVMWithAPatchSettingAssessmentModeOfImageDefault(); - await createALinuxVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); - await createALinuxVMWithAPatchSettingPatchModeOfImageDefault(); - await createALinuxVMWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createACustomImageVmFromAnUnmanagedGeneralizedOsImage(); await createAVMFromACommunityGalleryImage(); + await createAVmFromACustomImage(); + await createAVmFromAGeneralizedSharedImage(); await createAVMFromASharedGalleryImage(); + await createAVmFromASpecializedSharedImage(); + await createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(); + await createAVmInAnAvailabilitySet(); + await createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); + await createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault(); + await createALinuxVmWithAPatchSettingPatchModeOfImageDefault(); + await createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createAPlatformImageVmWithUnmanagedOsAndDataDisks(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); + await createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS(); + await createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(); + await createAWindowsVmWithAPatchSettingPatchModeOfManual(); + await createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); + await createAVmWithEphemeralOsDisk(); + await createAVmWithEphemeralOsDiskAndEnableFullCachingSetToTrue(); + await createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty(); + await createAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty(); + await createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty(); + await createAVmWithAMarketplaceImagePlan(); + await createAVmWithApplicationProfile(); + await createAVmWithBootDiagnostics(); + await createOrUpdateAVMWithCapacityReservation(); + await createAVmWithDataDisksUsingCopyAndRestoreOptions(); await createAVMWithDiskControllerType(); + await createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk(); + await createAVmWithEmptyDataDisks(); + await createAVmWithHostEncryptionUsingEncryptionAtHostProperty(); + await createAVMWithEncryptionIdentity(); + await createAVmWithAnExtensionsTimeBudget(); await createAVMWithFips1403Enabled(); await createAVMWithHibernationEnabled(); + await createAVmWithManagedBootDiagnostics(); + await createAVMWithNetworkInterfaceConfiguration(); + await createAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings(); + await createAVmWithPasswordAuthentication(); + await createAVMWithAutomaticZonePlacement(); + await createAVmWithPremiumStorage(); await createAVMWithProxyAgentSettingsOfEnabledAndMode(); - await createAVMWithUefiSettingsOfSecureBootAndVTpm(); + await createAVmWithScheduledEventsProfile(); + await createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(); + await createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(); + await createAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType(); + await createAVmWithSshAuthentication(); + await createAVMWithUefiSettingsOfSecureBootAndVTPM(); await createAVMWithUserData(); await createAVMWithVMSizeProperties(); - await createAVMWithAutomaticZonePlacement(); - await createAVMWithEncryptionIdentity(); - await createAVMWithNetworkInterfaceConfiguration(); - await createAVMWithNetworkInterfaceConfigurationWithPublicIPAddressDnsSettings(); - await createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(); - await createAVMWithSecurityTypeConfidentialVMWithNonPersistedTpmSecurityEncryptionType(); - await createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(); - await createAWindowsVMWithAPatchSettingAssessmentModeOfImageDefault(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByOS(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings(); - await createAWindowsVMWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(); - await createAWindowsVMWithAPatchSettingPatchModeOfManual(); - await createAWindowsVMWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(); - await createACustomImageVMFromAnUnmanagedGeneralizedOSImage(); - await createAPlatformImageVMWithUnmanagedOSAndDataDisks(); - await createAVMFromACustomImage(); - await createAVMFromAGeneralizedSharedImage(); - await createAVMFromASpecializedSharedImage(); - await createAVMInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(); - await createAVMInAnAvailabilitySet(); - await createAVMWithApplicationProfile(); - await createAVMWithDiskEncryptionSetResourceIdInTheOSDiskAndDataDisk(); - await createAVMWithHostEncryptionUsingEncryptionAtHostProperty(); - await createAVMWithScheduledEventsProfile(); - await createAVMWithAMarketplaceImagePlan(); - await createAVMWithAnExtensionsTimeBudget(); - await createAVMWithBootDiagnostics(); - await createAVMWithDataDisksUsingCopyAndRestoreOptions(); - await createAVMWithEmptyDataDisks(); - await createAVMWithEphemeralOSDiskProvisioningInCacheDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDiskProvisioningInNvmeDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDiskProvisioningInResourceDiskUsingPlacementProperty(); - await createAVMWithEphemeralOSDisk(); - await createAVMWithManagedBootDiagnostics(); - await createAVMWithPasswordAuthentication(); - await createAVMWithPremiumStorage(); - await createAVMWithSshAuthentication(); - await createOrUpdateAVMWithCapacityReservation(); + await createAVmWithResiliencyProfileAndZoneMovementEnabled(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeallocateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeallocateSample.ts new file mode 100644 index 000000000000..c4c0eefc43d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeallocateSample.ts @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json + */ +async function virtualMachineDeallocateMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_WithForceDeallocate.json + */ +async function virtualMachineDeallocateWithForceDeallocate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa", { + forceDeallocate: true, + }); +} + +/** + * This sample demonstrates how to shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @summary shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Deallocate_WithHibernation.json + */ +async function virtualMachineDeallocateWithHibernation(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.deallocate("rgcompute", "aaaaaaaaaaaaaaaa", { hibernate: true }); +} + +async function main(): Promise { + await virtualMachineDeallocateMinimumSetGen(); + await virtualMachineDeallocateWithForceDeallocate(); + await virtualMachineDeallocateWithHibernation(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeleteSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeleteSample.ts new file mode 100644 index 000000000000..faf16965a3ff --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to delete a virtual machine. + * + * @summary the operation to delete a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Delete_Force.json + */ +async function forceDeleteAVM(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.delete("myResourceGroup", "myVM", { forceDeletion: true }); +} + +async function main(): Promise { + await forceDeleteAVM(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGeneralizeSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGeneralizeSample.ts similarity index 67% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGeneralizeSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGeneralizeSample.ts index dde40f48b392..c5a34d8f8dba 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesGeneralizeSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGeneralizeSample.ts @@ -3,27 +3,18 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * This sample demonstrates how to sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). * - * @summary Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json + * @summary sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Generalize.json */ async function generalizeAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.generalize( - resourceGroupName, - vmName, - ); - console.log(result); + await client.virtualMachines.generalize("myResourceGroup", "myVMName"); } async function main(): Promise { diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGetSample.ts new file mode 100644 index 000000000000..210b638e1a9c --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesGetSample.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get.json + */ +async function getAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM", { + expand: "userData", + }); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + */ +async function getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + */ +async function getAVirtualMachineWithDiskControllerTypeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM", { + expand: "userData", + }); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the model view or the instance view of a virtual machine. + * + * @summary retrieves information about the model view or the instance view of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + */ +async function getAVirtualMachineWithVMSizeProperties(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.get("myResourceGroup", "myVM"); + console.log(result); +} + +async function main(): Promise { + await getAVirtualMachine(); + await getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); + await getAVirtualMachineWithDiskControllerTypeProperties(); + await getAVirtualMachineWithVMSizeProperties(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstallPatchesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstallPatchesSample.ts new file mode 100644 index 000000000000..3264e73056e2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstallPatchesSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to installs patches on the VM. + * + * @summary installs patches on the VM. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_InstallPatches.json + */ +async function installPatchStateOfAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.installPatches("myResourceGroupName", "myVMName", { + maximumDuration: "PT4H", + rebootSetting: "IfRequired", + windowsParameters: { + classificationsToInclude: ["Critical", "Security"], + maxPatchPublishDate: new Date("2020-11-19T02:36:43.0539904+00:00"), + patchNameMasksToInclude: ["*SQL*"], + patchNameMasksToExclude: ["*Windows*"], + }, + }); + console.log(result); +} + +async function main(): Promise { + await installPatchStateOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstanceViewSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstanceViewSample.ts new file mode 100644 index 000000000000..636b76e17bed --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesInstanceViewSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieves information about the run-time state of a virtual machine. + * + * @summary retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceView.json + */ +async function getVirtualMachineInstanceView(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView("myResourceGroup", "myVM"); + console.log(result); +} + +/** + * This sample demonstrates how to retrieves information about the run-time state of a virtual machine. + * + * @summary retrieves information about the run-time state of a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + */ +async function getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.instanceView("myResourceGroup", "myVM"); + console.log(result); +} + +async function main(): Promise { + await getVirtualMachineInstanceView(); + await getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAllSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAllSample.ts similarity index 53% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAllSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAllSample.ts index d8415de3454b..66075f0df628 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAllSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAllSample.ts @@ -1,50 +1,45 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachinesListAllOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json + * @summary lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json */ async function virtualMachineListAllMaximumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const statusOnly = "aaaaaa"; - const filter = "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - const options: VirtualMachinesListAllOptionalParams = { statusOnly, filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.listAll(options)) { + for await (const item of client.virtualMachines.listAll({ + statusOnly: "aaaaaa", + filter: "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", + })) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * This sample demonstrates how to lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. * - * @summary Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json + * @summary lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json */ async function virtualMachineListAllMinimumSetGen(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachines.listAll()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAvailableSizesSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAvailableSizesSample.ts similarity index 60% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAvailableSizesSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAvailableSizesSample.ts index 08a255c9850f..5d0b25e8708a 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListAvailableSizesSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListAvailableSizesSample.ts @@ -3,29 +3,25 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * This sample demonstrates how to lists all available virtual machine sizes to which the specified virtual machine can be resized. * - * @summary Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json + * @summary lists all available virtual machine sizes to which the specified virtual machine can be resized. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json */ async function listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVmName"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.virtualMachines.listAvailableSizes( - resourceGroupName, - vmName, + "myResourceGroup", + "myVmName", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListByLocationSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListByLocationSample.ts similarity index 64% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListByLocationSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListByLocationSample.ts index 2398a205a915..4dd92fddfb65 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesListByLocationSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListByLocationSample.ts @@ -3,24 +3,22 @@ import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Gets all the virtual machines under the specified subscription for the specified location. + * This sample demonstrates how to gets all the virtual machines under the specified subscription for the specified location. * - * @summary Gets all the virtual machines under the specified subscription for the specified location. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json + * @summary gets all the virtual machines under the specified subscription for the specified location. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json */ async function listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const location = "eastus"; const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscriptionId}"; const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.virtualMachines.listByLocation(location)) { + for await (const item of client.virtualMachines.listByLocation("eastus")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListSample.ts new file mode 100644 index 000000000000..9f6d054dea56 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesListSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json + */ +async function virtualMachineListMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachines.list("rgcompute", { + filter: "aaaaaaaaaaaaaaaaaaaaaaa", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * + * @summary lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json + */ +async function virtualMachineListMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.virtualMachines.list("rgcompute")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await virtualMachineListMaximumSetGen(); + await virtualMachineListMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts new file mode 100644 index 000000000000..2f6f2a4a0bdc --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesMigrateToVMScaleSetSample.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. + * + * @summary migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_MigrateToVirtualMachineScaleSet.json + */ +async function migrateAVirtualMachineToFlexibleVirtualMachineScaleSer(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.migrateToVMScaleSet("myResourceGroup", "myVMName", { + parameters: { targetFaultDomain: 0, targetVMSize: "Standard_D1_v2" }, + }); +} + +async function main(): Promise { + await migrateAVirtualMachineToFlexibleVirtualMachineScaleSer(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPerformMaintenanceSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPerformMaintenanceSample.ts new file mode 100644 index 000000000000..0298097b2279 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPerformMaintenanceSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to perform maintenance on a virtual machine. + * + * @summary the operation to perform maintenance on a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json + */ +async function virtualMachinePerformMaintenanceMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.performMaintenance("rgcompute", "aaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to perform maintenance on a virtual machine. + * + * @summary the operation to perform maintenance on a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json + */ +async function virtualMachinePerformMaintenanceMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.performMaintenance("rgcompute", "aaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachinePerformMaintenanceMaximumSetGen(); + await virtualMachinePerformMaintenanceMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPowerOffSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPowerOffSample.ts new file mode 100644 index 000000000000..60f5f28d479a --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesPowerOffSample.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json + */ +async function virtualMachinePowerOffMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", { + skipShutdown: true, + }); +} + +/** + * This sample demonstrates how to the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * + * @summary the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json + */ +async function virtualMachinePowerOffMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachinePowerOffMaximumSetGen(); + await virtualMachinePowerOffMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReapplySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReapplySample.ts new file mode 100644 index 000000000000..abfc156ef4bf --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReapplySample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to reapply a virtual machine's state. + * + * @summary the operation to reapply a virtual machine's state. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reapply.json + */ +async function reapplyTheStateOfAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.reapply("ResourceGroup", "VMName"); +} + +async function main(): Promise { + await reapplyTheStateOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRedeploySample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRedeploySample.ts new file mode 100644 index 000000000000..e177fb2aeca6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRedeploySample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json + */ +async function virtualMachineRedeployMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.redeploy("rgcompute", "a"); +} + +/** + * This sample demonstrates how to shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @summary shuts down the virtual machine, moves it to a new node, and powers it back on. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json + */ +async function virtualMachineRedeployMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.redeploy("rgcompute", "aaaaaaaaaaaaaaa"); +} + +async function main(): Promise { + await virtualMachineRedeployMaximumSetGen(); + await virtualMachineRedeployMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReimageSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReimageSample.ts similarity index 57% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReimageSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReimageSample.ts index 7d99dff1329e..57b40a66ab9e 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesReimageSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesReimageSample.ts @@ -1,73 +1,46 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineReimageParameters, - VirtualMachinesReimageOptionalParams} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * This sample demonstrates how to reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. * - * @summary Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json + * @summary reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage.json */ -async function reimageANonEphemeralVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters: VirtualMachineReimageParameters = { - exactVersion: "aaaaaa", - osProfile: { - adminPassword: "{your-password}", - customData: "{your-custom-data}", - }, - tempDisk: true, - }; - const options: VirtualMachinesReimageOptionalParams = { parameters }; +async function reimageAVirtualMachine(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReimageAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.reimage("myResourceGroup", "myVMName", { + parameters: { tempDisk: true }, + }); } /** - * This sample demonstrates how to Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * This sample demonstrates how to reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. * - * @summary Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json + * @summary reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json */ -async function reimageAVirtualMachine(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVMName"; - const parameters: VirtualMachineReimageParameters = { tempDisk: true }; - const options: VirtualMachinesReimageOptionalParams = { parameters }; +async function reimageANonEphemeralVirtualMachine(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginReimageAndWait( - resourceGroupName, - vmName, - options, - ); - console.log(result); + await client.virtualMachines.reimage("myResourceGroup", "myVMName", { + parameters: { + tempDisk: true, + exactVersion: "aaaaaa", + osProfile: { adminPassword: "{your-password}", customData: "{your-custom-data}" }, + }, + }); } async function main(): Promise { - await reimageANonEphemeralVirtualMachine(); await reimageAVirtualMachine(); + await reimageANonEphemeralVirtualMachine(); } main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRestartSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRestartSample.ts new file mode 100644 index 000000000000..d0d0afc904f6 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRestartSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to restart a virtual machine. + * + * @summary the operation to restart a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json + */ +async function virtualMachineRestartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.restart("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to restart a virtual machine. + * + * @summary the operation to restart a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json + */ +async function virtualMachineRestartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.restart("rgcompute", "aaa"); +} + +async function main(): Promise { + await virtualMachineRestartMaximumSetGen(); + await virtualMachineRestartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts new file mode 100644 index 000000000000..0c1d694543d7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRetrieveBootDiagnosticsDataSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * + * @summary the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json + */ +async function retrieveBootDiagnosticsDataOfAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.retrieveBootDiagnosticsData( + "ResourceGroup", + "VMName", + { sasUriExpirationTimeInMinutes: 60 }, + ); + console.log(result); +} + +async function main(): Promise { + await retrieveBootDiagnosticsDataOfAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRunCommandSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRunCommandSample.ts new file mode 100644 index 000000000000..82e5a9cf0cf2 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesRunCommandSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to run command on the VM. + * + * @summary run command on the VM. + * x-ms-original-file: 2025-11-01/runCommandExamples/VirtualMachineRunCommand.json + */ +async function virtualMachineRunCommand(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "24fb23e3-6ba3-41f0-9b6e-e41131d5d61e"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.runCommand("crptestar98131", "vm3036", { + commandId: "RunPowerShellScript", + }); + console.log(result); +} + +async function main(): Promise { + await virtualMachineRunCommand(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesSimulateEvictionSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesSimulateEvictionSample.ts new file mode 100644 index 000000000000..e9f2a60849c7 --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesSimulateEvictionSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to simulate the eviction of spot virtual machine. + * + * @summary the operation to simulate the eviction of spot virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_SimulateEviction.json + */ +async function simulateEvictionAVirtualMachine(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.simulateEviction("ResourceGroup", "VMName"); +} + +async function main(): Promise { + await simulateEvictionAVirtualMachine(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesStartSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesStartSample.ts new file mode 100644 index 000000000000..1136e35404ee --- /dev/null +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesStartSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeManagementClient } from "@azure/arm-compute"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to the operation to start a virtual machine. + * + * @summary the operation to start a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json + */ +async function virtualMachineStartMaximumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.start("rgcompute", "aaaaaaaaaaaaaaaaaaaa"); +} + +/** + * This sample demonstrates how to the operation to start a virtual machine. + * + * @summary the operation to start a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json + */ +async function virtualMachineStartMinimumSetGen(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + await client.virtualMachines.start("rgcompute", "aaaaa"); +} + +async function main(): Promise { + await virtualMachineStartMaximumSetGen(); + await virtualMachineStartMinimumSetGen(); +} + +main().catch(console.error); diff --git a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesUpdateSample.ts b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesUpdateSample.ts similarity index 58% rename from sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesUpdateSample.ts rename to sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesUpdateSample.ts index e2ea5081ca3a..a563647d7aab 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/src/virtualMachinesUpdateSample.ts +++ b/sdk/compute/arm-compute/samples/v24/typescript/src/virtualMachinesUpdateSample.ts @@ -1,139 +1,106 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - VirtualMachineUpdate} from "@azure/arm-compute"; -import { - ComputeManagementClient, -} from "@azure/arm-compute"; +import { ComputeManagementClient } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; /** - * This sample demonstrates how to The operation to update a virtual machine. + * This sample demonstrates how to the operation to update a virtual machine. * - * @summary The operation to update a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json + * @summary the operation to update a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json */ async function updateAVMByDetachingDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachineUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.update("myResourceGroup", "myVM", { hardwareProfile: { vmSize: "Standard_D2_v2" }, - networkProfile: { - networkInterfaces: [ - { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, - }, - ], - }, - osProfile: { - adminPassword: "{your-password}", - adminUsername: "{your-username}", - computerName: "myVM", - }, storageProfile: { - dataDisks: [ - { createOption: "Empty", diskSizeGB: 1023, lun: 0, toBeDetached: true }, - { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - toBeDetached: false, - }, - ], imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", version: "latest", + offer: "WindowsServer", }, osDisk: { - name: "myVMosdisk", caching: "ReadWrite", - createOption: "FromImage", managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", }, + dataDisks: [ + { diskSizeGB: 1023, createOption: "Empty", lun: 0, toBeDetached: true }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1, toBeDetached: false }, + ], }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + osProfile: { + adminUsername: "{your-username}", + computerName: "myVM", + adminPassword: "{your-password}", + }, + networkProfile: { + networkInterfaces: [ + { + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, + }, + ], + }, + }); console.log(result); } /** - * This sample demonstrates how to The operation to update a virtual machine. + * This sample demonstrates how to the operation to update a virtual machine. * - * @summary The operation to update a virtual machine. - * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json + * @summary the operation to update a virtual machine. + * x-ms-original-file: 2025-11-01/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json */ async function updateAVMByForceDetachingDataDisk(): Promise { - const subscriptionId = - process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = - process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup"; - const vmName = "myVM"; - const parameters: VirtualMachineUpdate = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "{subscription-id}"; + const client = new ComputeManagementClient(credential, subscriptionId); + const result = await client.virtualMachines.update("myResourceGroup", "myVM", { hardwareProfile: { vmSize: "Standard_D2_v2" }, - networkProfile: { - networkInterfaces: [ + storageProfile: { + imageReference: { + sku: "2016-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + osDisk: { + caching: "ReadWrite", + managedDisk: { storageAccountType: "Standard_LRS" }, + name: "myVMosdisk", + createOption: "FromImage", + }, + dataDisks: [ { - id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", - primary: true, + diskSizeGB: 1023, + createOption: "Empty", + lun: 0, + toBeDetached: true, + detachOption: "ForceDetach", }, + { diskSizeGB: 1023, createOption: "Empty", lun: 1, toBeDetached: false }, ], }, osProfile: { - adminPassword: "{your-password}", adminUsername: "{your-username}", computerName: "myVM", + adminPassword: "{your-password}", }, - storageProfile: { - dataDisks: [ - { - createOption: "Empty", - detachOption: "ForceDetach", - diskSizeGB: 1023, - lun: 0, - toBeDetached: true, - }, + networkProfile: { + networkInterfaces: [ { - createOption: "Empty", - diskSizeGB: 1023, - lun: 1, - toBeDetached: false, + id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}", + primary: true, }, ], - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter", - version: "latest", - }, - osDisk: { - name: "myVMosdisk", - caching: "ReadWrite", - createOption: "FromImage", - managedDisk: { storageAccountType: "Standard_LRS" }, - }, }, - }; - const credential = new DefaultAzureCredential(); - const client = new ComputeManagementClient(credential, subscriptionId); - const result = await client.virtualMachines.beginUpdateAndWait( - resourceGroupName, - vmName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/compute/arm-compute/samples/v23/typescript/tsconfig.json b/sdk/compute/arm-compute/samples/v24/typescript/tsconfig.json similarity index 68% rename from sdk/compute/arm-compute/samples/v23/typescript/tsconfig.json rename to sdk/compute/arm-compute/samples/v24/typescript/tsconfig.json index 400db87cf648..9827716ed8f9 100644 --- a/sdk/compute/arm-compute/samples/v23/typescript/tsconfig.json +++ b/sdk/compute/arm-compute/samples/v24/typescript/tsconfig.json @@ -2,17 +2,20 @@ "compilerOptions": { "target": "ES2023", "module": "commonjs", - "lib": [], + "lib": [ + "ESNext" + ], "importHelpers": true, - "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node10", - "esModuleInterop": true, + "types": [ + "node" + ], "outDir": "./dist", - "resolveJsonModule": true + "resolveJsonModule": true, + "moduleResolution": "node10" }, "include": [ "./src" diff --git a/sdk/compute/arm-compute/src/api/availabilitySets/index.ts b/sdk/compute/arm-compute/src/api/availabilitySets/index.ts new file mode 100644 index 000000000000..8a2ae60489fa --- /dev/null +++ b/sdk/compute/arm-compute/src/api/availabilitySets/index.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + convertToVirtualMachineScaleSet, + validateMigrationToVirtualMachineScaleSet, + cancelMigrationToVirtualMachineScaleSet, + startMigrationToVirtualMachineScaleSet, + listAvailableSizes, + listBySubscription, + list, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsListAvailableSizesOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, + AvailabilitySetsListOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/availabilitySets/operations.ts b/sdk/compute/arm-compute/src/api/availabilitySets/operations.ts new file mode 100644 index 000000000000..de58e82b8785 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/availabilitySets/operations.ts @@ -0,0 +1,655 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + _VirtualMachineSizeListResult, + VirtualMachineSize, + AvailabilitySet, + AvailabilitySetUpdate, + _AvailabilitySetListResult, + MigrateToVirtualMachineScaleSetInput, +} from "../../models/compute/models.js"; +import { + _virtualMachineSizeListResultDeserializer, + availabilitySetSerializer, + availabilitySetDeserializer, + availabilitySetUpdateSerializer, + _availabilitySetListResultDeserializer, + migrateToVirtualMachineScaleSetInputSerializer, + convertToVirtualMachineScaleSetInputSerializer, +} from "../../models/compute/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 { + AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsListAvailableSizesOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, + AvailabilitySetsListOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsGetOptionalParams, +} 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 _convertToVirtualMachineScaleSetSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/convertToVirtualMachineScaleSet{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["parameters"] + ? options["parameters"] + : convertToVirtualMachineScaleSetInputSerializer(options["parameters"]), + }); +} + +export async function _convertToVirtualMachineScaleSetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. */ +export function convertToVirtualMachineScaleSet( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _convertToVirtualMachineScaleSetDeserialize, + ["202", "200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _convertToVirtualMachineScaleSetSend( + context, + resourceGroupName, + availabilitySetName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }, + ) as PollerLike, void>; +} + +export function _validateMigrationToVirtualMachineScaleSetSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/validateMigrationToVirtualMachineScaleSet{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: migrateToVirtualMachineScaleSetInputSerializer(parameters), + }); +} + +export async function _validateMigrationToVirtualMachineScaleSetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. */ +export async function validateMigrationToVirtualMachineScaleSet( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _validateMigrationToVirtualMachineScaleSetSend( + context, + resourceGroupName, + availabilitySetName, + parameters, + options, + ); + return _validateMigrationToVirtualMachineScaleSetDeserialize(result); +} + +export function _cancelMigrationToVirtualMachineScaleSetSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/cancelMigrationToVirtualMachineScaleSet{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _cancelMigrationToVirtualMachineScaleSetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Cancel the migration operation on an Availability Set. */ +export async function cancelMigrationToVirtualMachineScaleSet( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _cancelMigrationToVirtualMachineScaleSetSend( + context, + resourceGroupName, + availabilitySetName, + options, + ); + return _cancelMigrationToVirtualMachineScaleSetDeserialize(result); +} + +export function _startMigrationToVirtualMachineScaleSetSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/startMigrationToVirtualMachineScaleSet{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: migrateToVirtualMachineScaleSetInputSerializer(parameters), + }); +} + +export async function _startMigrationToVirtualMachineScaleSetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. */ +export async function startMigrationToVirtualMachineScaleSet( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _startMigrationToVirtualMachineScaleSetSend( + context, + resourceGroupName, + availabilitySetName, + parameters, + options, + ); + return _startMigrationToVirtualMachineScaleSetDeserialize(result); +} + +export function _listAvailableSizesSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsListAvailableSizesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAvailableSizesDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineSizeListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineSizeListResultDeserializer(result.body); +} + +/** Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. */ +export function listAvailableSizes( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsListAvailableSizesOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAvailableSizesSend(context, resourceGroupName, availabilitySetName, options), + _listAvailableSizesDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listBySubscriptionSend( + context: Client, + options: AvailabilitySetsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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<_AvailabilitySetListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _availabilitySetListResultDeserializer(result.body); +} + +/** Lists all availability sets in a subscription. */ +export function listBySubscription( + context: Client, + options: AvailabilitySetsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listSend( + context: Client, + resourceGroupName: string, + options: AvailabilitySetsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_AvailabilitySetListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _availabilitySetListResultDeserializer(result.body); +} + +/** Lists all availability sets in a resource group. */ +export function list( + context: Client, + resourceGroupName: string, + options: AvailabilitySetsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete an availability set. */ +/** + * @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 async function $delete( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, resourceGroupName, availabilitySetName, options); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySetUpdate, + options: AvailabilitySetsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: availabilitySetUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return availabilitySetDeserializer(result.body); +} + +/** Update an availability set. */ +export async function update( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySetUpdate, + options: AvailabilitySetsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + availabilitySetName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySet, + options: AvailabilitySetsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: availabilitySetSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return availabilitySetDeserializer(result.body); +} + +/** Create or update an availability set. */ +export async function createOrUpdate( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySet, + options: AvailabilitySetsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createOrUpdateSend( + context, + resourceGroupName, + availabilitySetName, + parameters, + options, + ); + return _createOrUpdateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + availabilitySetName: availabilitySetName, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return availabilitySetDeserializer(result.body); +} + +/** Retrieves information about an availability set. */ +export async function get( + context: Client, + resourceGroupName: string, + availabilitySetName: string, + options: AvailabilitySetsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, availabilitySetName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/availabilitySets/options.ts b/sdk/compute/arm-compute/src/api/availabilitySets/options.ts new file mode 100644 index 000000000000..00df03543fd0 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/availabilitySets/options.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ConvertToVirtualMachineScaleSetInput } from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Parameters supplied to the migrate operation on the availability set. */ + parameters?: ConvertToVirtualMachineScaleSetInput; +} + +/** Optional parameters. */ +export interface AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsListAvailableSizesOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsListBySubscriptionOptionalParams extends OperationOptions { + /** The expand expression to apply to the operation. Allowed values are 'instanceView'. */ + expand?: string; +} + +/** Optional parameters. */ +export interface AvailabilitySetsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsCreateOrUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AvailabilitySetsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/capacityReservationGroups/index.ts b/sdk/compute/arm-compute/src/api/capacityReservationGroups/index.ts new file mode 100644 index 000000000000..3d7f5dd02692 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/capacityReservationGroups/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + CapacityReservationGroupsListBySubscriptionOptionalParams, + CapacityReservationGroupsListByResourceGroupOptionalParams, + CapacityReservationGroupsDeleteOptionalParams, + CapacityReservationGroupsUpdateOptionalParams, + CapacityReservationGroupsCreateOrUpdateOptionalParams, + CapacityReservationGroupsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/capacityReservationGroups/operations.ts b/sdk/compute/arm-compute/src/api/capacityReservationGroups/operations.ts new file mode 100644 index 000000000000..8db63b2e3c42 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/capacityReservationGroups/operations.ts @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + CapacityReservationGroup, + CapacityReservationGroupUpdate, + _CapacityReservationGroupListResult, +} from "../../models/compute/models.js"; +import { + capacityReservationGroupSerializer, + capacityReservationGroupDeserializer, + capacityReservationGroupUpdateSerializer, + _capacityReservationGroupListResultDeserializer, +} from "../../models/compute/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 { + CapacityReservationGroupsListBySubscriptionOptionalParams, + CapacityReservationGroupsListByResourceGroupOptionalParams, + CapacityReservationGroupsDeleteOptionalParams, + CapacityReservationGroupsUpdateOptionalParams, + CapacityReservationGroupsCreateOrUpdateOptionalParams, + CapacityReservationGroupsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listBySubscriptionSend( + context: Client, + options: CapacityReservationGroupsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups{?api%2Dversion,%24expand,resourceIdsOnly}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + resourceIdsOnly: options?.resourceIdsOnly, + }, + { + 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<_CapacityReservationGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _capacityReservationGroupListResultDeserializer(result.body); +} + +/** Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. */ +export function listBySubscription( + context: Client, + options: CapacityReservationGroupsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: CapacityReservationGroupsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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<_CapacityReservationGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _capacityReservationGroupListResultDeserializer(result.body); +} + +/** Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: CapacityReservationGroupsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + options: CapacityReservationGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. */ +/** + * @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 async function $delete( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + options: CapacityReservationGroupsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + capacityReservationGroupName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroupUpdate, + options: CapacityReservationGroupsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: capacityReservationGroupUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return capacityReservationGroupDeserializer(result.body); +} + +/** The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. */ +export async function update( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroupUpdate, + options: CapacityReservationGroupsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + capacityReservationGroupName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroup, + options: CapacityReservationGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: capacityReservationGroupSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return capacityReservationGroupDeserializer(result.body); +} + +/** The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. */ +export async function createOrUpdate( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroup, + options: CapacityReservationGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createOrUpdateSend( + context, + resourceGroupName, + capacityReservationGroupName, + parameters, + options, + ); + return _createOrUpdateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + options: CapacityReservationGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return capacityReservationGroupDeserializer(result.body); +} + +/** The operation that retrieves information about a capacity reservation group. */ +export async function get( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + options: CapacityReservationGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, capacityReservationGroupName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/capacityReservationGroups/options.ts b/sdk/compute/arm-compute/src/api/capacityReservationGroups/options.ts new file mode 100644 index 000000000000..5caeb37dc044 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/capacityReservationGroups/options.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + CapacityReservationGroupInstanceViewTypes, + ExpandTypesForGetCapacityReservationGroups, + ResourceIdOptionsForGetCapacityReservationGroups, +} from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface CapacityReservationGroupsListBySubscriptionOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. */ + expand?: ExpandTypesForGetCapacityReservationGroups; + /** The query option to fetch Capacity Reservation Group Resource Ids.
'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription.
'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription.
'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created in the subscription. */ + resourceIdsOnly?: ResourceIdOptionsForGetCapacityReservationGroups; +} + +/** Optional parameters. */ +export interface CapacityReservationGroupsListByResourceGroupOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. */ + expand?: ExpandTypesForGetCapacityReservationGroups; +} + +/** Optional parameters. */ +export interface CapacityReservationGroupsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CapacityReservationGroupsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CapacityReservationGroupsCreateOrUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CapacityReservationGroupsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. */ + expand?: CapacityReservationGroupInstanceViewTypes; +} diff --git a/sdk/compute/arm-compute/src/api/capacityReservations/index.ts b/sdk/compute/arm-compute/src/api/capacityReservations/index.ts new file mode 100644 index 000000000000..d8b15f135c68 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/capacityReservations/index.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listByCapacityReservationGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + CapacityReservationsListByCapacityReservationGroupOptionalParams, + CapacityReservationsDeleteOptionalParams, + CapacityReservationsUpdateOptionalParams, + CapacityReservationsCreateOrUpdateOptionalParams, + CapacityReservationsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/capacityReservations/operations.ts b/sdk/compute/arm-compute/src/api/capacityReservations/operations.ts new file mode 100644 index 000000000000..d65dbd64b663 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/capacityReservations/operations.ts @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + CapacityReservation, + CapacityReservationUpdate, + _CapacityReservationListResult, +} from "../../models/compute/models.js"; +import { + capacityReservationSerializer, + capacityReservationDeserializer, + capacityReservationUpdateSerializer, + _capacityReservationListResultDeserializer, +} from "../../models/compute/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 { + CapacityReservationsListByCapacityReservationGroupOptionalParams, + CapacityReservationsDeleteOptionalParams, + CapacityReservationsUpdateOptionalParams, + CapacityReservationsCreateOrUpdateOptionalParams, + CapacityReservationsGetOptionalParams, +} 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 _listByCapacityReservationGroupSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + options: CapacityReservationsListByCapacityReservationGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByCapacityReservationGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_CapacityReservationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _capacityReservationListResultDeserializer(result.body); +} + +/** Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. */ +export function listByCapacityReservationGroup( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + options: CapacityReservationsListByCapacityReservationGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByCapacityReservationGroupSend( + context, + resourceGroupName, + capacityReservationGroupName, + options, + ), + _listByCapacityReservationGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options: CapacityReservationsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + capacityReservationName: capacityReservationName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. */ +/** + * @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, + capacityReservationGroupName: string, + capacityReservationName: string, + options: CapacityReservationsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options: CapacityReservationsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + capacityReservationName: capacityReservationName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: capacityReservationUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return capacityReservationDeserializer(result.body); +} + +/** The operation to update a capacity reservation. */ +export function update( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options: CapacityReservationsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, CapacityReservation> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, CapacityReservation>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options: CapacityReservationsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + capacityReservationName: capacityReservationName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: capacityReservationSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return capacityReservationDeserializer(result.body); +} + +/** The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options: CapacityReservationsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, CapacityReservation> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, CapacityReservation>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options: CapacityReservationsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + capacityReservationGroupName: capacityReservationGroupName, + capacityReservationName: capacityReservationName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return capacityReservationDeserializer(result.body); +} + +/** The operation that retrieves information about the capacity reservation. */ +export async function get( + context: Client, + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options: CapacityReservationsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/capacityReservations/options.ts b/sdk/compute/arm-compute/src/api/capacityReservations/options.ts new file mode 100644 index 000000000000..9403ac4514ef --- /dev/null +++ b/sdk/compute/arm-compute/src/api/capacityReservations/options.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + ExpandTypesForGetCapacityReservationGroups, + CapacityReservationInstanceViewTypes, +} from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface CapacityReservationsListByCapacityReservationGroupOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. */ + expand?: ExpandTypesForGetCapacityReservationGroups; +} + +/** Optional parameters. */ +export interface CapacityReservationsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CapacityReservationsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CapacityReservationsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CapacityReservationsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. */ + expand?: CapacityReservationInstanceViewTypes; +} diff --git a/sdk/compute/arm-compute/src/api/communityGalleries/index.ts b/sdk/compute/arm-compute/src/api/communityGalleries/index.ts new file mode 100644 index 000000000000..421a0157691c --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleries/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export type { CommunityGalleriesGetOptionalParams } from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/communityGalleries/operations.ts b/sdk/compute/arm-compute/src/api/communityGalleries/operations.ts new file mode 100644 index 000000000000..709917ecd86f --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleries/operations.ts @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { CommunityGallery } from "../../models/computeGallery/models.js"; +import { communityGalleryDeserializer } from "../../models/computeGallery/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { CommunityGalleriesGetOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + location: string, + publicGalleryName: string, + options: CommunityGalleriesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publicGalleryName: publicGalleryName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return communityGalleryDeserializer(result.body); +} + +/** Get a community gallery by gallery public name. */ +export async function get( + context: Client, + location: string, + publicGalleryName: string, + options: CommunityGalleriesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, publicGalleryName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/communityGalleries/options.ts b/sdk/compute/arm-compute/src/api/communityGalleries/options.ts new file mode 100644 index 000000000000..0259279848e3 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleries/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 CommunityGalleriesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/index.ts b/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/index.ts new file mode 100644 index 000000000000..dc65a67e1389 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, get } from "./operations.js"; +export type { + CommunityGalleryImageVersionsListOptionalParams, + CommunityGalleryImageVersionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/operations.ts b/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/operations.ts new file mode 100644 index 000000000000..b97ac619d739 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/operations.ts @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + CommunityGalleryImageVersion, + _CommunityGalleryImageVersionList, +} from "../../models/computeGallery/models.js"; +import { + communityGalleryImageVersionDeserializer, + _communityGalleryImageVersionListDeserializer, +} from "../../models/computeGallery/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 { + CommunityGalleryImageVersionsListOptionalParams, + CommunityGalleryImageVersionsGetOptionalParams, +} 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, + location: string, + publicGalleryName: string, + galleryImageName: string, + options: CommunityGalleryImageVersionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publicGalleryName: publicGalleryName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + 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<_CommunityGalleryImageVersionList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _communityGalleryImageVersionListDeserializer(result.body); +} + +/** List community gallery image versions inside an image. */ +export function list( + context: Client, + location: string, + publicGalleryName: string, + galleryImageName: string, + options: CommunityGalleryImageVersionsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, publicGalleryName, galleryImageName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _getSend( + context: Client, + location: string, + publicGalleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: CommunityGalleryImageVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publicGalleryName: publicGalleryName, + galleryImageName: galleryImageName, + galleryImageVersionName: galleryImageVersionName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return communityGalleryImageVersionDeserializer(result.body); +} + +/** Get a community gallery image version. */ +export async function get( + context: Client, + location: string, + publicGalleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: CommunityGalleryImageVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + location, + publicGalleryName, + galleryImageName, + galleryImageVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/options.ts b/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/options.ts new file mode 100644 index 000000000000..41e281dfd2e3 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleryImageVersions/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface CommunityGalleryImageVersionsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CommunityGalleryImageVersionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/communityGalleryImages/index.ts b/sdk/compute/arm-compute/src/api/communityGalleryImages/index.ts new file mode 100644 index 000000000000..16f97f63d08a --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleryImages/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, get } from "./operations.js"; +export type { + CommunityGalleryImagesListOptionalParams, + CommunityGalleryImagesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/communityGalleryImages/operations.ts b/sdk/compute/arm-compute/src/api/communityGalleryImages/operations.ts new file mode 100644 index 000000000000..958c22d419ff --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleryImages/operations.ts @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + CommunityGalleryImage, + _CommunityGalleryImageList, +} from "../../models/computeGallery/models.js"; +import { + communityGalleryImageDeserializer, + _communityGalleryImageListDeserializer, +} from "../../models/computeGallery/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 { + CommunityGalleryImagesListOptionalParams, + CommunityGalleryImagesGetOptionalParams, +} 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, + location: string, + publicGalleryName: string, + options: CommunityGalleryImagesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publicGalleryName: publicGalleryName, + "api%2Dversion": "2025-03-03", + }, + { + 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<_CommunityGalleryImageList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _communityGalleryImageListDeserializer(result.body); +} + +/** List community gallery images inside a gallery. */ +export function list( + context: Client, + location: string, + publicGalleryName: string, + options: CommunityGalleryImagesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, publicGalleryName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _getSend( + context: Client, + location: string, + publicGalleryName: string, + galleryImageName: string, + options: CommunityGalleryImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publicGalleryName: publicGalleryName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return communityGalleryImageDeserializer(result.body); +} + +/** Get a community gallery image. */ +export async function get( + context: Client, + location: string, + publicGalleryName: string, + galleryImageName: string, + options: CommunityGalleryImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, publicGalleryName, galleryImageName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/communityGalleryImages/options.ts b/sdk/compute/arm-compute/src/api/communityGalleryImages/options.ts new file mode 100644 index 000000000000..4b62fc237f74 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/communityGalleryImages/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface CommunityGalleryImagesListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface CommunityGalleryImagesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/computeManagementContext.ts b/sdk/compute/arm-compute/src/api/computeManagementContext.ts new file mode 100644 index 000000000000..d87a240a0854 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/computeManagementContext.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.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"; + +/** Compute Client */ +export interface ComputeManagementContext extends Client { + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface ComputeManagementClientOptionalParams extends ClientOptions { + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** Compute Client */ +export function createComputeManagement( + credential: TokenCredential, + subscriptionId: string, + options: ComputeManagementClientOptionalParams = {}, +): ComputeManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-compute/24.0.0`; + 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); + + if (options.apiVersion) { + logger.warning( + "This client does not support client api-version, please change it at the operation level", + ); + } + return { ...clientContext, subscriptionId } as ComputeManagementContext; +} diff --git a/sdk/compute/arm-compute/src/api/dedicatedHostGroups/index.ts b/sdk/compute/arm-compute/src/api/dedicatedHostGroups/index.ts new file mode 100644 index 000000000000..7648c05b7863 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/dedicatedHostGroups/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + DedicatedHostGroupsListBySubscriptionOptionalParams, + DedicatedHostGroupsListByResourceGroupOptionalParams, + DedicatedHostGroupsDeleteOptionalParams, + DedicatedHostGroupsUpdateOptionalParams, + DedicatedHostGroupsCreateOrUpdateOptionalParams, + DedicatedHostGroupsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/dedicatedHostGroups/operations.ts b/sdk/compute/arm-compute/src/api/dedicatedHostGroups/operations.ts new file mode 100644 index 000000000000..7afa7dcb8e38 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/dedicatedHostGroups/operations.ts @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + DedicatedHostGroup, + DedicatedHostGroupUpdate, + _DedicatedHostGroupListResult, +} from "../../models/compute/models.js"; +import { + dedicatedHostGroupSerializer, + dedicatedHostGroupDeserializer, + dedicatedHostGroupUpdateSerializer, + _dedicatedHostGroupListResultDeserializer, +} from "../../models/compute/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 { + DedicatedHostGroupsListBySubscriptionOptionalParams, + DedicatedHostGroupsListByResourceGroupOptionalParams, + DedicatedHostGroupsDeleteOptionalParams, + DedicatedHostGroupsUpdateOptionalParams, + DedicatedHostGroupsCreateOrUpdateOptionalParams, + DedicatedHostGroupsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listBySubscriptionSend( + context: Client, + options: DedicatedHostGroupsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + 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<_DedicatedHostGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _dedicatedHostGroupListResultDeserializer(result.body); +} + +/** Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. */ +export function listBySubscription( + context: Client, + options: DedicatedHostGroupsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: DedicatedHostGroupsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_DedicatedHostGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _dedicatedHostGroupListResultDeserializer(result.body); +} + +/** Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: DedicatedHostGroupsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + options: DedicatedHostGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a dedicated host group. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + hostGroupName: string, + options: DedicatedHostGroupsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, resourceGroupName, hostGroupName, options); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroupUpdate, + options: DedicatedHostGroupsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: dedicatedHostGroupUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return dedicatedHostGroupDeserializer(result.body); +} + +/** Update an dedicated host group. */ +export async function update( + context: Client, + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroupUpdate, + options: DedicatedHostGroupsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend(context, resourceGroupName, hostGroupName, parameters, options); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroup, + options: DedicatedHostGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: dedicatedHostGroupSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return dedicatedHostGroupDeserializer(result.body); +} + +/** Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) */ +export async function createOrUpdate( + context: Client, + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroup, + options: DedicatedHostGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createOrUpdateSend( + context, + resourceGroupName, + hostGroupName, + parameters, + options, + ); + return _createOrUpdateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + options: DedicatedHostGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return dedicatedHostGroupDeserializer(result.body); +} + +/** Retrieves information about a dedicated host group. */ +export async function get( + context: Client, + resourceGroupName: string, + hostGroupName: string, + options: DedicatedHostGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, hostGroupName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/dedicatedHostGroups/options.ts b/sdk/compute/arm-compute/src/api/dedicatedHostGroups/options.ts new file mode 100644 index 000000000000..9bb49fd8ada3 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/dedicatedHostGroups/options.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { InstanceViewTypes } from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DedicatedHostGroupsListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedHostGroupsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedHostGroupsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedHostGroupsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedHostGroupsCreateOrUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedHostGroupsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host group. */ + expand?: InstanceViewTypes; +} diff --git a/sdk/compute/arm-compute/src/api/dedicatedHosts/index.ts b/sdk/compute/arm-compute/src/api/dedicatedHosts/index.ts new file mode 100644 index 000000000000..28e523d479d7 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/dedicatedHosts/index.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + restart, + redeploy, + listAvailableSizes, + listByHostGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + DedicatedHostsRestartOptionalParams, + DedicatedHostsRedeployOptionalParams, + DedicatedHostsListAvailableSizesOptionalParams, + DedicatedHostsListByHostGroupOptionalParams, + DedicatedHostsDeleteOptionalParams, + DedicatedHostsUpdateOptionalParams, + DedicatedHostsCreateOrUpdateOptionalParams, + DedicatedHostsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/dedicatedHosts/operations.ts b/sdk/compute/arm-compute/src/api/dedicatedHosts/operations.ts new file mode 100644 index 000000000000..eb68cd14cc84 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/dedicatedHosts/operations.ts @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + DedicatedHost, + DedicatedHostUpdate, + _DedicatedHostListResult, + _DedicatedHostSizeListResult, +} from "../../models/compute/models.js"; +import { + dedicatedHostSerializer, + dedicatedHostDeserializer, + dedicatedHostUpdateSerializer, + _dedicatedHostListResultDeserializer, + _dedicatedHostSizeListResultDeserializer, +} from "../../models/compute/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 { + DedicatedHostsRestartOptionalParams, + DedicatedHostsRedeployOptionalParams, + DedicatedHostsListAvailableSizesOptionalParams, + DedicatedHostsListByHostGroupOptionalParams, + DedicatedHostsDeleteOptionalParams, + DedicatedHostsUpdateOptionalParams, + DedicatedHostsCreateOrUpdateOptionalParams, + DedicatedHostsGetOptionalParams, +} 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 _restartSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsRestartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + hostName: hostName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _restartDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. */ +export function restart( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsRestartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _restartDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _restartSend(context, resourceGroupName, hostGroupName, hostName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _redeploySend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsRedeployOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/redeploy{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + hostName: hostName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _redeployDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. */ +export function redeploy( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsRedeployOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _redeployDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _redeploySend(context, resourceGroupName, hostGroupName, hostName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _listAvailableSizesSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsListAvailableSizesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/hostSizes{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + hostName: hostName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAvailableSizesDeserialize( + result: PathUncheckedResponse, +): Promise<_DedicatedHostSizeListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _dedicatedHostSizeListResultDeserializer(result.body); +} + +/** Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. */ +export function listAvailableSizes( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsListAvailableSizesOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAvailableSizesSend(context, resourceGroupName, hostGroupName, hostName, options), + _listAvailableSizesDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listByHostGroupSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + options: DedicatedHostsListByHostGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByHostGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_DedicatedHostListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _dedicatedHostListResultDeserializer(result.body); +} + +/** Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. */ +export function listByHostGroup( + context: Client, + resourceGroupName: string, + hostGroupName: string, + options: DedicatedHostsListByHostGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByHostGroupSend(context, resourceGroupName, hostGroupName, options), + _listByHostGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + hostName: hostName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a dedicated host. */ +/** + * @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, + hostGroupName: string, + hostName: string, + options: DedicatedHostsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, hostGroupName, hostName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options: DedicatedHostsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + hostName: hostName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: dedicatedHostUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return dedicatedHostDeserializer(result.body); +} + +/** Update a dedicated host . */ +export function update( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options: DedicatedHostsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, DedicatedHost> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, hostGroupName, hostName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, DedicatedHost>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options: DedicatedHostsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + hostName: hostName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: dedicatedHostSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return dedicatedHostDeserializer(result.body); +} + +/** Create or update a dedicated host . */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options: DedicatedHostsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, DedicatedHost> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, hostGroupName, hostName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, DedicatedHost>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + hostGroupName: hostGroupName, + hostName: hostName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return dedicatedHostDeserializer(result.body); +} + +/** Retrieves information about a dedicated host. */ +export async function get( + context: Client, + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options: DedicatedHostsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, hostGroupName, hostName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/dedicatedHosts/options.ts b/sdk/compute/arm-compute/src/api/dedicatedHosts/options.ts new file mode 100644 index 000000000000..a3a7e636623e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/dedicatedHosts/options.ts @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { InstanceViewTypes } from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DedicatedHostsRestartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DedicatedHostsRedeployOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DedicatedHostsListAvailableSizesOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedHostsListByHostGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DedicatedHostsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DedicatedHostsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DedicatedHostsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DedicatedHostsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated host. 'UserData' is not supported for dedicated host. */ + expand?: InstanceViewTypes; +} diff --git a/sdk/compute/arm-compute/src/api/diskAccesses/index.ts b/sdk/compute/arm-compute/src/api/diskAccesses/index.ts new file mode 100644 index 000000000000..f09efa93e2c7 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskAccesses/index.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listPrivateEndpointConnections, + deleteAPrivateEndpointConnection, + updateAPrivateEndpointConnection, + getAPrivateEndpointConnection, + getPrivateLinkResources, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + DiskAccessesListPrivateEndpointConnectionsOptionalParams, + DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetPrivateLinkResourcesOptionalParams, + DiskAccessesListOptionalParams, + DiskAccessesListByResourceGroupOptionalParams, + DiskAccessesDeleteOptionalParams, + DiskAccessesUpdateOptionalParams, + DiskAccessesCreateOrUpdateOptionalParams, + DiskAccessesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/diskAccesses/operations.ts b/sdk/compute/arm-compute/src/api/diskAccesses/operations.ts new file mode 100644 index 000000000000..71f5059c5ab9 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskAccesses/operations.ts @@ -0,0 +1,663 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + DiskAccess, + PrivateEndpointConnection, + DiskAccessUpdate, + _DiskAccessList, + PrivateLinkResourceListResult, + _PrivateEndpointConnectionListResult, +} from "../../models/computeDisk/models.js"; +import { + diskAccessSerializer, + diskAccessDeserializer, + privateEndpointConnectionSerializer, + privateEndpointConnectionDeserializer, + diskAccessUpdateSerializer, + _diskAccessListDeserializer, + privateLinkResourceListResultDeserializer, + _privateEndpointConnectionListResultDeserializer, +} from "../../models/computeDisk/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 { + DiskAccessesListPrivateEndpointConnectionsOptionalParams, + DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetPrivateLinkResourcesOptionalParams, + DiskAccessesListOptionalParams, + DiskAccessesListByResourceGroupOptionalParams, + DiskAccessesDeleteOptionalParams, + DiskAccessesUpdateOptionalParams, + DiskAccessesCreateOrUpdateOptionalParams, + DiskAccessesGetOptionalParams, +} 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 _listPrivateEndpointConnectionsSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + options: DiskAccessesListPrivateEndpointConnectionsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listPrivateEndpointConnectionsDeserialize( + result: PathUncheckedResponse, +): Promise<_PrivateEndpointConnectionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _privateEndpointConnectionListResultDeserializer(result.body); +} + +/** List information about private endpoint connections under a disk access resource */ +export function listPrivateEndpointConnections( + context: Client, + resourceGroupName: string, + diskAccessName: string, + options: DiskAccessesListPrivateEndpointConnectionsOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listPrivateEndpointConnectionsSend(context, resourceGroupName, diskAccessName, options), + _listPrivateEndpointConnectionsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _deleteAPrivateEndpointConnectionSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _deleteAPrivateEndpointConnectionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes a private endpoint connection under a disk access resource. */ +export function deleteAPrivateEndpointConnection( + context: Client, + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _deleteAPrivateEndpointConnectionDeserialize, + ["200", "202", "204"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _deleteAPrivateEndpointConnectionSend( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }, + ) as PollerLike, void>; +} + +export function _updateAPrivateEndpointConnectionSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: privateEndpointConnectionSerializer(privateEndpointConnection), + }); +} + +export async function _updateAPrivateEndpointConnectionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. */ +export function updateAPrivateEndpointConnection( + context: Client, + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams = { requestOptions: {} }, +): PollerLike, PrivateEndpointConnection> { + return getLongRunningPoller( + context, + _updateAPrivateEndpointConnectionDeserialize, + ["200", "202", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateAPrivateEndpointConnectionSend( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }, + ) as PollerLike, PrivateEndpointConnection>; +} + +export function _getAPrivateEndpointConnectionSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options: DiskAccessesGetAPrivateEndpointConnectionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getAPrivateEndpointConnectionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Gets information about a private endpoint connection under a disk access resource. */ +export async function getAPrivateEndpointConnection( + context: Client, + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options: DiskAccessesGetAPrivateEndpointConnectionOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getAPrivateEndpointConnectionSend( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + ); + return _getAPrivateEndpointConnectionDeserialize(result); +} + +export function _getPrivateLinkResourcesSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + options: DiskAccessesGetPrivateLinkResourcesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privatelinkresources{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getPrivateLinkResourcesDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return privateLinkResourceListResultDeserializer(result.body); +} + +/** Gets the private link resources possible under disk access resource */ +export async function getPrivateLinkResources( + context: Client, + resourceGroupName: string, + diskAccessName: string, + options: DiskAccessesGetPrivateLinkResourcesOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getPrivateLinkResourcesSend( + context, + resourceGroupName, + diskAccessName, + options, + ); + return _getPrivateLinkResourcesDeserialize(result); +} + +export function _listSend( + context: Client, + options: DiskAccessesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-01-02", + }, + { + 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<_DiskAccessList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _diskAccessListDeserializer(result.body); +} + +/** Lists all the disk access resources under a subscription. */ +export function list( + context: Client, + options: DiskAccessesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: DiskAccessesListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-01-02", + }, + { + 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<_DiskAccessList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _diskAccessListDeserializer(result.body); +} + +/** Lists all the disk access resources under a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: DiskAccessesListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + options: DiskAccessesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes a disk access resource. */ +/** + * @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, + diskAccessName: string, + options: DiskAccessesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, diskAccessName, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options: DiskAccessesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: diskAccessUpdateSerializer(diskAccess), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskAccessDeserializer(result.body); +} + +/** Updates (patches) a disk access resource. */ +export function update( + context: Client, + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options: DiskAccessesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, DiskAccess> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, diskAccessName, diskAccess, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, DiskAccess>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options: DiskAccessesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: diskAccessSerializer(diskAccess), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskAccessDeserializer(result.body); +} + +/** Creates or updates a disk access resource */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options: DiskAccessesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, DiskAccess> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, diskAccessName, diskAccess, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, DiskAccess>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + diskAccessName: string, + options: DiskAccessesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskAccessName: diskAccessName, + "api%2Dversion": "2025-01-02", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskAccessDeserializer(result.body); +} + +/** Gets information about a disk access resource. */ +export async function get( + context: Client, + resourceGroupName: string, + diskAccessName: string, + options: DiskAccessesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, diskAccessName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/diskAccesses/options.ts b/sdk/compute/arm-compute/src/api/diskAccesses/options.ts new file mode 100644 index 000000000000..d3bd0035471c --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskAccesses/options.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DiskAccessesListPrivateEndpointConnectionsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskAccessesGetAPrivateEndpointConnectionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskAccessesGetPrivateLinkResourcesOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskAccessesListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskAccessesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskAccessesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskAccessesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskAccessesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskAccessesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/diskEncryptionSets/index.ts b/sdk/compute/arm-compute/src/api/diskEncryptionSets/index.ts new file mode 100644 index 000000000000..aec6197c320f --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskEncryptionSets/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listAssociatedResources, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + DiskEncryptionSetsListAssociatedResourcesOptionalParams, + DiskEncryptionSetsListOptionalParams, + DiskEncryptionSetsListByResourceGroupOptionalParams, + DiskEncryptionSetsDeleteOptionalParams, + DiskEncryptionSetsUpdateOptionalParams, + DiskEncryptionSetsCreateOrUpdateOptionalParams, + DiskEncryptionSetsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/diskEncryptionSets/operations.ts b/sdk/compute/arm-compute/src/api/diskEncryptionSets/operations.ts new file mode 100644 index 000000000000..4e100ed325ac --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskEncryptionSets/operations.ts @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + DiskEncryptionSet, + DiskEncryptionSetUpdate, + _DiskEncryptionSetList, + _ResourceUriList, +} from "../../models/computeDisk/models.js"; +import { + diskEncryptionSetSerializer, + diskEncryptionSetDeserializer, + diskEncryptionSetUpdateSerializer, + _diskEncryptionSetListDeserializer, + _resourceUriListDeserializer, +} from "../../models/computeDisk/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 { + DiskEncryptionSetsListAssociatedResourcesOptionalParams, + DiskEncryptionSetsListOptionalParams, + DiskEncryptionSetsListByResourceGroupOptionalParams, + DiskEncryptionSetsDeleteOptionalParams, + DiskEncryptionSetsUpdateOptionalParams, + DiskEncryptionSetsCreateOrUpdateOptionalParams, + DiskEncryptionSetsGetOptionalParams, +} 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 _listAssociatedResourcesSend( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + options: DiskEncryptionSetsListAssociatedResourcesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskEncryptionSetName: diskEncryptionSetName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAssociatedResourcesDeserialize( + result: PathUncheckedResponse, +): Promise<_ResourceUriList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _resourceUriListDeserializer(result.body); +} + +/** Lists all resources that are encrypted with this disk encryption set. */ +export function listAssociatedResources( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + options: DiskEncryptionSetsListAssociatedResourcesOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAssociatedResourcesSend(context, resourceGroupName, diskEncryptionSetName, options), + _listAssociatedResourcesDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _listSend( + context: Client, + options: DiskEncryptionSetsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-01-02", + }, + { + 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<_DiskEncryptionSetList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _diskEncryptionSetListDeserializer(result.body); +} + +/** Lists all the disk encryption sets under a subscription. */ +export function list( + context: Client, + options: DiskEncryptionSetsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: DiskEncryptionSetsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-01-02", + }, + { + 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<_DiskEncryptionSetList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _diskEncryptionSetListDeserializer(result.body); +} + +/** Lists all the disk encryption sets under a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: DiskEncryptionSetsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + options: DiskEncryptionSetsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskEncryptionSetName: diskEncryptionSetName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes a disk encryption set. */ +/** + * @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, + diskEncryptionSetName: string, + options: DiskEncryptionSetsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, diskEncryptionSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options: DiskEncryptionSetsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskEncryptionSetName: diskEncryptionSetName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: diskEncryptionSetUpdateSerializer(diskEncryptionSet), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskEncryptionSetDeserializer(result.body); +} + +/** Updates (patches) a disk encryption set. */ +export function update( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options: DiskEncryptionSetsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, DiskEncryptionSet> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, DiskEncryptionSet>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options: DiskEncryptionSetsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskEncryptionSetName: diskEncryptionSetName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: diskEncryptionSetSerializer(diskEncryptionSet), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskEncryptionSetDeserializer(result.body); +} + +/** Creates or updates a disk encryption set */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options: DiskEncryptionSetsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, DiskEncryptionSet> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, DiskEncryptionSet>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + options: DiskEncryptionSetsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskEncryptionSetName: diskEncryptionSetName, + "api%2Dversion": "2025-01-02", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskEncryptionSetDeserializer(result.body); +} + +/** Gets information about a disk encryption set. */ +export async function get( + context: Client, + resourceGroupName: string, + diskEncryptionSetName: string, + options: DiskEncryptionSetsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, diskEncryptionSetName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/diskEncryptionSets/options.ts b/sdk/compute/arm-compute/src/api/diskEncryptionSets/options.ts new file mode 100644 index 000000000000..e3d07192d1e7 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskEncryptionSets/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DiskEncryptionSetsListAssociatedResourcesOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskEncryptionSetsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskEncryptionSetsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskEncryptionSetsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskEncryptionSetsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskEncryptionSetsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskEncryptionSetsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/diskRestorePoint/index.ts b/sdk/compute/arm-compute/src/api/diskRestorePoint/index.ts new file mode 100644 index 000000000000..b752717b0d7a --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskRestorePoint/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { revokeAccess, grantAccess, listByRestorePoint, get } from "./operations.js"; +export type { + DiskRestorePointRevokeAccessOptionalParams, + DiskRestorePointGrantAccessOptionalParams, + DiskRestorePointListByRestorePointOptionalParams, + DiskRestorePointGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/diskRestorePoint/operations.ts b/sdk/compute/arm-compute/src/api/diskRestorePoint/operations.ts new file mode 100644 index 000000000000..f3802e1e51a6 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskRestorePoint/operations.ts @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GrantAccessData, + AccessUri, + DiskRestorePoint, + _DiskRestorePointList, +} from "../../models/computeDisk/models.js"; +import { + grantAccessDataSerializer, + accessUriDeserializer, + diskRestorePointDeserializer, + _diskRestorePointListDeserializer, +} from "../../models/computeDisk/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 { + DiskRestorePointRevokeAccessOptionalParams, + DiskRestorePointGrantAccessOptionalParams, + DiskRestorePointListByRestorePointOptionalParams, + DiskRestorePointGetOptionalParams, +} 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 _revokeAccessSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options: DiskRestorePointRevokeAccessOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + vmRestorePointName: vmRestorePointName, + diskRestorePointName: diskRestorePointName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _revokeAccessDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Revokes access to a diskRestorePoint. */ +export function revokeAccess( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options: DiskRestorePointRevokeAccessOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _revokeAccessDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _revokeAccessSend( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, void>; +} + +export function _grantAccessSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options: DiskRestorePointGrantAccessOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + vmRestorePointName: vmRestorePointName, + diskRestorePointName: diskRestorePointName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: grantAccessDataSerializer(grantAccessData), + }); +} + +export async function _grantAccessDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return accessUriDeserializer(result.body); +} + +/** Grants access to a diskRestorePoint. */ +export function grantAccess( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options: DiskRestorePointGrantAccessOptionalParams = { requestOptions: {} }, +): PollerLike, AccessUri> { + return getLongRunningPoller(context, _grantAccessDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _grantAccessSend( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, AccessUri>; +} + +export function _listByRestorePointSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options: DiskRestorePointListByRestorePointOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + vmRestorePointName: vmRestorePointName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByRestorePointDeserialize( + result: PathUncheckedResponse, +): Promise<_DiskRestorePointList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _diskRestorePointListDeserializer(result.body); +} + +/** Lists diskRestorePoints under a vmRestorePoint. */ +export function listByRestorePoint( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options: DiskRestorePointListByRestorePointOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByRestorePointSend( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options, + ), + _listByRestorePointDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options: DiskRestorePointGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + vmRestorePointName: vmRestorePointName, + diskRestorePointName: diskRestorePointName, + "api%2Dversion": "2025-01-02", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskRestorePointDeserializer(result.body); +} + +/** Get disk restorePoint resource */ +export async function get( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options: DiskRestorePointGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/diskRestorePoint/options.ts b/sdk/compute/arm-compute/src/api/diskRestorePoint/options.ts new file mode 100644 index 000000000000..bccf7ddee5af --- /dev/null +++ b/sdk/compute/arm-compute/src/api/diskRestorePoint/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DiskRestorePointRevokeAccessOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskRestorePointGrantAccessOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DiskRestorePointListByRestorePointOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DiskRestorePointGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/disks/index.ts b/sdk/compute/arm-compute/src/api/disks/index.ts new file mode 100644 index 000000000000..a8996231552c --- /dev/null +++ b/sdk/compute/arm-compute/src/api/disks/index.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + revokeAccess, + grantAccess, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + DisksRevokeAccessOptionalParams, + DisksGrantAccessOptionalParams, + DisksListOptionalParams, + DisksListByResourceGroupOptionalParams, + DisksDeleteOptionalParams, + DisksUpdateOptionalParams, + DisksCreateOrUpdateOptionalParams, + DisksGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/disks/operations.ts b/sdk/compute/arm-compute/src/api/disks/operations.ts new file mode 100644 index 000000000000..1e6bae4a9608 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/disks/operations.ts @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + Disk, + DiskUpdate, + _DiskList, + GrantAccessData, + AccessUri, +} from "../../models/computeDisk/models.js"; +import { + diskSerializer, + diskDeserializer, + diskUpdateSerializer, + _diskListDeserializer, + grantAccessDataSerializer, + accessUriDeserializer, +} from "../../models/computeDisk/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 { + DisksRevokeAccessOptionalParams, + DisksGrantAccessOptionalParams, + DisksListOptionalParams, + DisksListByResourceGroupOptionalParams, + DisksDeleteOptionalParams, + DisksUpdateOptionalParams, + DisksCreateOrUpdateOptionalParams, + DisksGetOptionalParams, +} 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 _revokeAccessSend( + context: Client, + resourceGroupName: string, + diskName: string, + options: DisksRevokeAccessOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskName: diskName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _revokeAccessDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Revokes access to a disk. */ +export function revokeAccess( + context: Client, + resourceGroupName: string, + diskName: string, + options: DisksRevokeAccessOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _revokeAccessDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _revokeAccessSend(context, resourceGroupName, diskName, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, void>; +} + +export function _grantAccessSend( + context: Client, + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options: DisksGrantAccessOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskName: diskName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: grantAccessDataSerializer(grantAccessData), + }); +} + +export async function _grantAccessDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return accessUriDeserializer(result.body); +} + +/** Grants access to a disk. */ +export function grantAccess( + context: Client, + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options: DisksGrantAccessOptionalParams = { requestOptions: {} }, +): PollerLike, AccessUri> { + return getLongRunningPoller(context, _grantAccessDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _grantAccessSend(context, resourceGroupName, diskName, grantAccessData, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, AccessUri>; +} + +export function _listSend( + context: Client, + options: DisksListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-01-02", + }, + { + 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<_DiskList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _diskListDeserializer(result.body); +} + +/** Lists all the disks under a subscription. */ +export function list( + context: Client, + options: DisksListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: DisksListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-01-02", + }, + { + 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<_DiskList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _diskListDeserializer(result.body); +} + +/** Lists all the disks under a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: DisksListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + diskName: string, + options: DisksDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskName: diskName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes a disk. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + diskName: string, + options: DisksDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, diskName, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options: DisksUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskName: diskName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: diskUpdateSerializer(disk), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskDeserializer(result.body); +} + +/** Updates (patches) a disk. */ +export function update( + context: Client, + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options: DisksUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Disk> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _updateSend(context, resourceGroupName, diskName, disk, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, Disk>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + diskName: string, + disk: Disk, + options: DisksCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskName: diskName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: diskSerializer(disk), + }); +} + +export async function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskDeserializer(result.body); +} + +/** Creates or updates a disk. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + diskName: string, + disk: Disk, + options: DisksCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Disk> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, diskName, disk, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, Disk>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + diskName: string, + options: DisksGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + diskName: diskName, + "api%2Dversion": "2025-01-02", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return diskDeserializer(result.body); +} + +/** Gets information about a disk. */ +export async function get( + context: Client, + resourceGroupName: string, + diskName: string, + options: DisksGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, diskName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/disks/options.ts b/sdk/compute/arm-compute/src/api/disks/options.ts new file mode 100644 index 000000000000..1c0c3d6599a0 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/disks/options.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface DisksRevokeAccessOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DisksGrantAccessOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DisksListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DisksListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface DisksDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DisksUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DisksCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface DisksGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/galleries/index.ts b/sdk/compute/arm-compute/src/api/galleries/index.ts new file mode 100644 index 000000000000..2af5ade15c56 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleries/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, listByResourceGroup, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleriesListOptionalParams, + GalleriesListByResourceGroupOptionalParams, + GalleriesDeleteOptionalParams, + GalleriesUpdateOptionalParams, + GalleriesCreateOrUpdateOptionalParams, + GalleriesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleries/operations.ts b/sdk/compute/arm-compute/src/api/galleries/operations.ts new file mode 100644 index 000000000000..e06c8d9f789b --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleries/operations.ts @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { Gallery, GalleryUpdate, _GalleryList } from "../../models/computeGallery/models.js"; +import { + gallerySerializer, + galleryDeserializer, + galleryUpdateSerializer, + _galleryListDeserializer, +} from "../../models/computeGallery/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 { + GalleriesListOptionalParams, + GalleriesListByResourceGroupOptionalParams, + GalleriesDeleteOptionalParams, + GalleriesUpdateOptionalParams, + GalleriesCreateOrUpdateOptionalParams, + GalleriesGetOptionalParams, +} 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 _listSend( + context: Client, + options: GalleriesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-03-03", + }, + { + 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<_GalleryList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryListDeserializer(result.body); +} + +/** List galleries under a subscription. */ +export function list( + context: Client, + options: GalleriesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: GalleriesListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-03-03", + }, + { + 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<_GalleryList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryListDeserializer(result.body); +} + +/** List galleries under a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: GalleriesListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleriesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a Shared Image Gallery. */ +/** + * @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, + galleryName: string, + options: GalleriesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, galleryName, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options: GalleriesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryUpdateSerializer(gallery), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryDeserializer(result.body); +} + +/** Update a Shared Image Gallery. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options: GalleriesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Gallery> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, galleryName, gallery, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, Gallery>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options: GalleriesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: gallerySerializer(gallery), + }); +} + +export async function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryDeserializer(result.body); +} + +/** Create or update a Shared Image Gallery. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options: GalleriesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Gallery> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, galleryName, gallery, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, Gallery>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleriesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}{?api%2Dversion,%24select,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + "%24select": options?.select, + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryDeserializer(result.body); +} + +/** Retrieves information about a Shared Image Gallery. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleriesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, galleryName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleries/options.ts b/sdk/compute/arm-compute/src/api/galleries/options.ts new file mode 100644 index 000000000000..bce16178f622 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleries/options.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { SelectPermissions, GalleryExpandParams } from "../../models/computeGallery/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleriesListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleriesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleriesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleriesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleriesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleriesGetOptionalParams extends OperationOptions { + /** The select expression to apply on the operation. */ + select?: SelectPermissions; + /** The expand query option to apply on the operation. */ + expand?: GalleryExpandParams; +} diff --git a/sdk/compute/arm-compute/src/api/galleryApplicationVersions/index.ts b/sdk/compute/arm-compute/src/api/galleryApplicationVersions/index.ts new file mode 100644 index 000000000000..25277d954485 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryApplicationVersions/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByGalleryApplication, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + GalleryApplicationVersionsDeleteOptionalParams, + GalleryApplicationVersionsUpdateOptionalParams, + GalleryApplicationVersionsCreateOrUpdateOptionalParams, + GalleryApplicationVersionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryApplicationVersions/operations.ts b/sdk/compute/arm-compute/src/api/galleryApplicationVersions/operations.ts new file mode 100644 index 000000000000..6338055d86da --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryApplicationVersions/operations.ts @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryApplicationVersion, + GalleryApplicationVersionUpdate, + _GalleryApplicationVersionList, +} from "../../models/computeGallery/models.js"; +import { + galleryApplicationVersionSerializer, + galleryApplicationVersionDeserializer, + galleryApplicationVersionUpdateSerializer, + _galleryApplicationVersionListDeserializer, +} from "../../models/computeGallery/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 { + GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + GalleryApplicationVersionsDeleteOptionalParams, + GalleryApplicationVersionsUpdateOptionalParams, + GalleryApplicationVersionsCreateOrUpdateOptionalParams, + GalleryApplicationVersionsGetOptionalParams, +} 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 _listByGalleryApplicationSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options: GalleryApplicationVersionsListByGalleryApplicationOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryApplicationDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryApplicationVersionList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryApplicationVersionListDeserializer(result.body); +} + +/** List gallery Application Versions in a gallery Application Definition. */ +export function listByGalleryApplication( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options: GalleryApplicationVersionsListByGalleryApplicationOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByGalleryApplicationSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + options, + ), + _listByGalleryApplicationDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options: GalleryApplicationVersionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + galleryApplicationVersionName: galleryApplicationVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery Application Version. */ +/** + * @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, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options: GalleryApplicationVersionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options: GalleryApplicationVersionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + galleryApplicationVersionName: galleryApplicationVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryApplicationVersionUpdateSerializer(galleryApplicationVersion), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryApplicationVersionDeserializer(result.body); +} + +/** Update a gallery Application Version. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options: GalleryApplicationVersionsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryApplicationVersion> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryApplicationVersion>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options: GalleryApplicationVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + galleryApplicationVersionName: galleryApplicationVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryApplicationVersionSerializer(galleryApplicationVersion), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryApplicationVersionDeserializer(result.body); +} + +/** Create or update a gallery Application Version. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options: GalleryApplicationVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryApplicationVersion> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryApplicationVersion>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options: GalleryApplicationVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + galleryApplicationVersionName: galleryApplicationVersionName, + "api%2Dversion": "2025-03-03", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryApplicationVersionDeserializer(result.body); +} + +/** Retrieves information about a gallery Application Version. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options: GalleryApplicationVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryApplicationVersions/options.ts b/sdk/compute/arm-compute/src/api/galleryApplicationVersions/options.ts new file mode 100644 index 000000000000..1d47fe6fcd7a --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryApplicationVersions/options.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ReplicationStatusTypes } from "../../models/computeGallery/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryApplicationVersionsListByGalleryApplicationOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryApplicationVersionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryApplicationVersionsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryApplicationVersionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryApplicationVersionsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: ReplicationStatusTypes; +} diff --git a/sdk/compute/arm-compute/src/api/galleryApplications/index.ts b/sdk/compute/arm-compute/src/api/galleryApplications/index.ts new file mode 100644 index 000000000000..fad5e0c5dc00 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryApplications/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByGallery, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleryApplicationsListByGalleryOptionalParams, + GalleryApplicationsDeleteOptionalParams, + GalleryApplicationsUpdateOptionalParams, + GalleryApplicationsCreateOrUpdateOptionalParams, + GalleryApplicationsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryApplications/operations.ts b/sdk/compute/arm-compute/src/api/galleryApplications/operations.ts new file mode 100644 index 000000000000..36a6f1253680 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryApplications/operations.ts @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryApplication, + GalleryApplicationUpdate, + _GalleryApplicationList, +} from "../../models/computeGallery/models.js"; +import { + galleryApplicationSerializer, + galleryApplicationDeserializer, + galleryApplicationUpdateSerializer, + _galleryApplicationListDeserializer, +} from "../../models/computeGallery/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 { + GalleryApplicationsListByGalleryOptionalParams, + GalleryApplicationsDeleteOptionalParams, + GalleryApplicationsUpdateOptionalParams, + GalleryApplicationsCreateOrUpdateOptionalParams, + GalleryApplicationsGetOptionalParams, +} 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 _listByGallerySend( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryApplicationsListByGalleryOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryApplicationList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryApplicationListDeserializer(result.body); +} + +/** List gallery Application Definitions in a gallery. */ +export function listByGallery( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryApplicationsListByGalleryOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByGallerySend(context, resourceGroupName, galleryName, options), + _listByGalleryDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options: GalleryApplicationsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery Application. */ +/** + * @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, + galleryName: string, + galleryApplicationName: string, + options: GalleryApplicationsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, galleryName, galleryApplicationName, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options: GalleryApplicationsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryApplicationUpdateSerializer(galleryApplication), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryApplicationDeserializer(result.body); +} + +/** Update a gallery Application Definition. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options: GalleryApplicationsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryApplication> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryApplication>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options: GalleryApplicationsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryApplicationSerializer(galleryApplication), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryApplicationDeserializer(result.body); +} + +/** Create or update a gallery Application Definition. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options: GalleryApplicationsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryApplication> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryApplication>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options: GalleryApplicationsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryApplicationName: galleryApplicationName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryApplicationDeserializer(result.body); +} + +/** Retrieves information about a gallery Application Definition. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options: GalleryApplicationsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryApplications/options.ts b/sdk/compute/arm-compute/src/api/galleryApplications/options.ts new file mode 100644 index 000000000000..e6d79c850ca5 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryApplications/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryApplicationsListByGalleryOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryApplicationsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryApplicationsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryApplicationsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryApplicationsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/galleryImageVersions/index.ts b/sdk/compute/arm-compute/src/api/galleryImageVersions/index.ts new file mode 100644 index 000000000000..36bf466a72ea --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryImageVersions/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByGalleryImage, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleryImageVersionsListByGalleryImageOptionalParams, + GalleryImageVersionsDeleteOptionalParams, + GalleryImageVersionsUpdateOptionalParams, + GalleryImageVersionsCreateOrUpdateOptionalParams, + GalleryImageVersionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryImageVersions/operations.ts b/sdk/compute/arm-compute/src/api/galleryImageVersions/operations.ts new file mode 100644 index 000000000000..f9ea5be8df9a --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryImageVersions/operations.ts @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryImageVersion, + GalleryImageVersionUpdate, + _GalleryImageVersionList, +} from "../../models/computeGallery/models.js"; +import { + galleryImageVersionSerializer, + galleryImageVersionDeserializer, + galleryImageVersionUpdateSerializer, + _galleryImageVersionListDeserializer, +} from "../../models/computeGallery/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 { + GalleryImageVersionsListByGalleryImageOptionalParams, + GalleryImageVersionsDeleteOptionalParams, + GalleryImageVersionsUpdateOptionalParams, + GalleryImageVersionsCreateOrUpdateOptionalParams, + GalleryImageVersionsGetOptionalParams, +} 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 _listByGalleryImageSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options: GalleryImageVersionsListByGalleryImageOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryImageDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryImageVersionList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryImageVersionListDeserializer(result.body); +} + +/** List gallery image versions in a gallery image definition. */ +export function listByGalleryImage( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options: GalleryImageVersionsListByGalleryImageOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByGalleryImageSend(context, resourceGroupName, galleryName, galleryImageName, options), + _listByGalleryImageDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: GalleryImageVersionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + galleryImageVersionName: galleryImageVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery image version. */ +/** + * @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, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: GalleryImageVersionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options: GalleryImageVersionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + galleryImageVersionName: galleryImageVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryImageVersionUpdateSerializer(galleryImageVersion), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryImageVersionDeserializer(result.body); +} + +/** Update a gallery image version. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options: GalleryImageVersionsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryImageVersion> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryImageVersion>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options: GalleryImageVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + galleryImageVersionName: galleryImageVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryImageVersionSerializer(galleryImageVersion), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryImageVersionDeserializer(result.body); +} + +/** Create or update a gallery image version. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options: GalleryImageVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryImageVersion> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryImageVersion>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: GalleryImageVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + galleryImageVersionName: galleryImageVersionName, + "api%2Dversion": "2025-03-03", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryImageVersionDeserializer(result.body); +} + +/** Retrieves information about a gallery image version. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: GalleryImageVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryImageVersions/options.ts b/sdk/compute/arm-compute/src/api/galleryImageVersions/options.ts new file mode 100644 index 000000000000..29687b6fd1ef --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryImageVersions/options.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ReplicationStatusTypes } from "../../models/computeGallery/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryImageVersionsListByGalleryImageOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryImageVersionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImageVersionsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImageVersionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImageVersionsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: ReplicationStatusTypes; +} diff --git a/sdk/compute/arm-compute/src/api/galleryImages/index.ts b/sdk/compute/arm-compute/src/api/galleryImages/index.ts new file mode 100644 index 000000000000..5eae4afe0cf1 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryImages/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByGallery, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleryImagesListByGalleryOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryImages/operations.ts b/sdk/compute/arm-compute/src/api/galleryImages/operations.ts new file mode 100644 index 000000000000..e52613e255c8 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryImages/operations.ts @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryImage, + GalleryImageUpdate, + _GalleryImageList, +} from "../../models/computeGallery/models.js"; +import { + galleryImageSerializer, + galleryImageDeserializer, + galleryImageUpdateSerializer, + _galleryImageListDeserializer, +} from "../../models/computeGallery/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 { + GalleryImagesListByGalleryOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} 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 _listByGallerySend( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryImagesListByGalleryOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryImageList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryImageListDeserializer(result.body); +} + +/** List gallery image definitions in a gallery. */ +export function listByGallery( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryImagesListByGalleryOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByGallerySend(context, resourceGroupName, galleryName, options), + _listByGalleryDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options: GalleryImagesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery image. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options: GalleryImagesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, galleryName, galleryImageName, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options: GalleryImagesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryImageUpdateSerializer(galleryImage), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryImageDeserializer(result.body); +} + +/** Update a gallery image definition. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options: GalleryImagesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryImage> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, galleryName, galleryImageName, galleryImage, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryImage>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options: GalleryImagesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryImageSerializer(galleryImage), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryImageDeserializer(result.body); +} + +/** Create or update a gallery image definition. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options: GalleryImagesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryImage> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImage, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryImage>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options: GalleryImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryImageDeserializer(result.body); +} + +/** Retrieves information about a gallery image definition. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options: GalleryImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, galleryName, galleryImageName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryImages/options.ts b/sdk/compute/arm-compute/src/api/galleryImages/options.ts new file mode 100644 index 000000000000..7bd429485de2 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryImages/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryImagesListByGalleryOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryImagesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImagesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImagesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryImagesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/index.ts b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/index.ts new file mode 100644 index 000000000000..0cfab64d2d5f --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/index.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listByGalleryInVMAccessControlProfile, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/operations.ts b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/operations.ts new file mode 100644 index 000000000000..e023b833c9c9 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/operations.ts @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryInVMAccessControlProfileVersion, + GalleryInVMAccessControlProfileVersionUpdate, + _GalleryInVMAccessControlProfileVersionList, +} from "../../models/computeGallery/models.js"; +import { + galleryInVMAccessControlProfileVersionSerializer, + galleryInVMAccessControlProfileVersionDeserializer, + galleryInVMAccessControlProfileVersionUpdateSerializer, + _galleryInVMAccessControlProfileVersionListDeserializer, +} from "../../models/computeGallery/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 { + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsGetOptionalParams, +} 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 _listByGalleryInVMAccessControlProfileSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryInVMAccessControlProfileDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryInVMAccessControlProfileVersionList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryInVMAccessControlProfileVersionListDeserializer(result.body); +} + +/** List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile */ +export function listByGalleryInVMAccessControlProfile( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByGalleryInVMAccessControlProfileSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + ), + _listByGalleryInVMAccessControlProfileDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + inVMAccessControlProfileVersionName: inVMAccessControlProfileVersionName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery inVMAccessControlProfile version. */ +/** + * @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, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + inVMAccessControlProfileVersionName: inVMAccessControlProfileVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryInVMAccessControlProfileVersionUpdateSerializer( + galleryInVMAccessControlProfileVersion, + ), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryInVMAccessControlProfileVersionDeserializer(result.body); +} + +/** Update a gallery inVMAccessControlProfile version. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion +> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion + >; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + inVMAccessControlProfileVersionName: inVMAccessControlProfileVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryInVMAccessControlProfileVersionSerializer(galleryInVMAccessControlProfileVersion), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryInVMAccessControlProfileVersionDeserializer(result.body); +} + +/** Create or update a gallery inVMAccessControlProfile version. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion +> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options: GalleryInVMAccessControlProfileVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + inVMAccessControlProfileVersionName: inVMAccessControlProfileVersionName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryInVMAccessControlProfileVersionDeserializer(result.body); +} + +/** Retrieves information about a gallery inVMAccessControlProfile version. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options: GalleryInVMAccessControlProfileVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/options.ts b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/options.ts new file mode 100644 index 000000000000..155b35a1bfa4 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfileVersions/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/index.ts b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/index.ts new file mode 100644 index 000000000000..d45d115d4e8b --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByGallery, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + GalleryInVMAccessControlProfilesDeleteOptionalParams, + GalleryInVMAccessControlProfilesUpdateOptionalParams, + GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfilesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/operations.ts b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/operations.ts new file mode 100644 index 000000000000..be86ea513d5e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/operations.ts @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryInVMAccessControlProfile, + GalleryInVMAccessControlProfileUpdate, + _GalleryInVMAccessControlProfileList, +} from "../../models/computeGallery/models.js"; +import { + galleryInVMAccessControlProfileSerializer, + galleryInVMAccessControlProfileDeserializer, + galleryInVMAccessControlProfileUpdateSerializer, + _galleryInVMAccessControlProfileListDeserializer, +} from "../../models/computeGallery/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 { + GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + GalleryInVMAccessControlProfilesDeleteOptionalParams, + GalleryInVMAccessControlProfilesUpdateOptionalParams, + GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfilesGetOptionalParams, +} 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 _listByGallerySend( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryInVMAccessControlProfilesListByGalleryOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryInVMAccessControlProfileList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryInVMAccessControlProfileListDeserializer(result.body); +} + +/** List gallery inVMAccessControlProfiles in a gallery. */ +export function listByGallery( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryInVMAccessControlProfilesListByGalleryOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByGallerySend(context, resourceGroupName, galleryName, options), + _listByGalleryDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options: GalleryInVMAccessControlProfilesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery inVMAccessControlProfile. */ +/** + * @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, + galleryName: string, + inVMAccessControlProfileName: string, + options: GalleryInVMAccessControlProfilesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, galleryName, inVMAccessControlProfileName, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options: GalleryInVMAccessControlProfilesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryInVMAccessControlProfileUpdateSerializer(galleryInVMAccessControlProfile), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryInVMAccessControlProfileDeserializer(result.body); +} + +/** Update a gallery inVMAccessControlProfile. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options: GalleryInVMAccessControlProfilesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryInVMAccessControlProfile> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike< + OperationState, + GalleryInVMAccessControlProfile + >; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryInVMAccessControlProfileSerializer(galleryInVMAccessControlProfile), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryInVMAccessControlProfileDeserializer(result.body); +} + +/** Create or update a gallery inVMAccessControlProfile. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryInVMAccessControlProfile> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike< + OperationState, + GalleryInVMAccessControlProfile + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options: GalleryInVMAccessControlProfilesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + inVMAccessControlProfileName: inVMAccessControlProfileName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryInVMAccessControlProfileDeserializer(result.body); +} + +/** Retrieves information about a gallery inVMAccessControlProfile. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options: GalleryInVMAccessControlProfilesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/options.ts b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/options.ts new file mode 100644 index 000000000000..f5c6aadae9aa --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryInVMAccessControlProfiles/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesListByGalleryOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/galleryScriptVersions/index.ts b/sdk/compute/arm-compute/src/api/galleryScriptVersions/index.ts new file mode 100644 index 000000000000..14467cf62e0b --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryScriptVersions/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByGalleryScript, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleryScriptVersionsListByGalleryScriptOptionalParams, + GalleryScriptVersionsDeleteOptionalParams, + GalleryScriptVersionsUpdateOptionalParams, + GalleryScriptVersionsCreateOrUpdateOptionalParams, + GalleryScriptVersionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryScriptVersions/operations.ts b/sdk/compute/arm-compute/src/api/galleryScriptVersions/operations.ts new file mode 100644 index 000000000000..946d7e2d558f --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryScriptVersions/operations.ts @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryScriptVersion, + GalleryScriptVersionUpdate, + _GalleryScriptVersionList, +} from "../../models/computeGallery/models.js"; +import { + galleryScriptVersionSerializer, + galleryScriptVersionDeserializer, + galleryScriptVersionUpdateSerializer, + _galleryScriptVersionListDeserializer, +} from "../../models/computeGallery/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 { + GalleryScriptVersionsListByGalleryScriptOptionalParams, + GalleryScriptVersionsDeleteOptionalParams, + GalleryScriptVersionsUpdateOptionalParams, + GalleryScriptVersionsCreateOrUpdateOptionalParams, + GalleryScriptVersionsGetOptionalParams, +} 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 _listByGalleryScriptSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options: GalleryScriptVersionsListByGalleryScriptOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryScriptDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryScriptVersionList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryScriptVersionListDeserializer(result.body); +} + +/** List gallery Script Versions in a gallery Script Definition. */ +export function listByGalleryScript( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options: GalleryScriptVersionsListByGalleryScriptOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByGalleryScriptSend(context, resourceGroupName, galleryName, galleryScriptName, options), + _listByGalleryScriptDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options: GalleryScriptVersionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + galleryScriptVersionName: galleryScriptVersionName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery Script Version. */ +/** + * @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, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options: GalleryScriptVersionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + options, + ), + resourceLocationConfig: "azure-async-operation", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options: GalleryScriptVersionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + galleryScriptVersionName: galleryScriptVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryScriptVersionUpdateSerializer(galleryScriptVersion), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryScriptVersionDeserializer(result.body); +} + +/** Update a gallery Script Version. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options: GalleryScriptVersionsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryScriptVersion> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ), + resourceLocationConfig: "azure-async-operation", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryScriptVersion>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options: GalleryScriptVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + galleryScriptVersionName: galleryScriptVersionName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryScriptVersionSerializer(galleryScriptVersion), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryScriptVersionDeserializer(result.body); +} + +/** Create or update a gallery Script Version. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options: GalleryScriptVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryScriptVersion> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ), + resourceLocationConfig: "azure-async-operation", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryScriptVersion>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options: GalleryScriptVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + galleryScriptVersionName: galleryScriptVersionName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryScriptVersionDeserializer(result.body); +} + +/** Custom ArmResourceRead operation template with CloudError as Error */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options: GalleryScriptVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryScriptVersions/options.ts b/sdk/compute/arm-compute/src/api/galleryScriptVersions/options.ts new file mode 100644 index 000000000000..2cb189140f4d --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryScriptVersions/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryScriptVersionsListByGalleryScriptOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryScriptVersionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryScriptVersionsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryScriptVersionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryScriptVersionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/galleryScripts/index.ts b/sdk/compute/arm-compute/src/api/galleryScripts/index.ts new file mode 100644 index 000000000000..60ce5cf64784 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryScripts/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByGallery, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + GalleryScriptsListByGalleryOptionalParams, + GalleryScriptsDeleteOptionalParams, + GalleryScriptsUpdateOptionalParams, + GalleryScriptsCreateOrUpdateOptionalParams, + GalleryScriptsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/galleryScripts/operations.ts b/sdk/compute/arm-compute/src/api/galleryScripts/operations.ts new file mode 100644 index 000000000000..177242074bf0 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryScripts/operations.ts @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GalleryScript, + GalleryScriptUpdate, + _GalleryScriptList, +} from "../../models/computeGallery/models.js"; +import { + galleryScriptSerializer, + galleryScriptDeserializer, + galleryScriptUpdateSerializer, + _galleryScriptListDeserializer, +} from "../../models/computeGallery/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 { + GalleryScriptsListByGalleryOptionalParams, + GalleryScriptsDeleteOptionalParams, + GalleryScriptsUpdateOptionalParams, + GalleryScriptsCreateOrUpdateOptionalParams, + GalleryScriptsGetOptionalParams, +} 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 _listByGallerySend( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryScriptsListByGalleryOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByGalleryDeserialize( + result: PathUncheckedResponse, +): Promise<_GalleryScriptList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _galleryScriptListDeserializer(result.body); +} + +/** List gallery Script Definitions in a gallery. */ +export function listByGallery( + context: Client, + resourceGroupName: string, + galleryName: string, + options: GalleryScriptsListByGalleryOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByGallerySend(context, resourceGroupName, galleryName, options), + _listByGalleryDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options: GalleryScriptsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a gallery Script Definition. */ +/** + * @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, + galleryName: string, + galleryScriptName: string, + options: GalleryScriptsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, galleryName, galleryScriptName, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options: GalleryScriptsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryScriptUpdateSerializer(galleryScript), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryScriptDeserializer(result.body); +} + +/** Update a gallery Script Definition. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options: GalleryScriptsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryScript> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScript, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryScript>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options: GalleryScriptsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: galleryScriptSerializer(galleryScript), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryScriptDeserializer(result.body); +} + +/** Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options: GalleryScriptsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, GalleryScript> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScript, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, GalleryScript>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options: GalleryScriptsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + galleryScriptName: galleryScriptName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return galleryScriptDeserializer(result.body); +} + +/** Retrieves information about a gallery script definition. */ +export async function get( + context: Client, + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options: GalleryScriptsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + galleryName, + galleryScriptName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/galleryScripts/options.ts b/sdk/compute/arm-compute/src/api/galleryScripts/options.ts new file mode 100644 index 000000000000..f4c083d53e5e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/galleryScripts/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GalleryScriptsListByGalleryOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GalleryScriptsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryScriptsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryScriptsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface GalleryScriptsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/gallerySharingProfile/index.ts b/sdk/compute/arm-compute/src/api/gallerySharingProfile/index.ts new file mode 100644 index 000000000000..41108c7d63bc --- /dev/null +++ b/sdk/compute/arm-compute/src/api/gallerySharingProfile/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { update } from "./operations.js"; +export type { GallerySharingProfileUpdateOptionalParams } from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/gallerySharingProfile/operations.ts b/sdk/compute/arm-compute/src/api/gallerySharingProfile/operations.ts new file mode 100644 index 000000000000..7ce3dd216b4d --- /dev/null +++ b/sdk/compute/arm-compute/src/api/gallerySharingProfile/operations.ts @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { SharingUpdate } from "../../models/computeGallery/models.js"; +import { + sharingUpdateSerializer, + sharingUpdateDeserializer, +} from "../../models/computeGallery/models.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { GallerySharingProfileUpdateOptionalParams } 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 _updateSend( + context: Client, + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options: GallerySharingProfileUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: sharingUpdateSerializer(sharingUpdate), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return sharingUpdateDeserializer(result.body); +} + +/** Update sharing profile of a gallery. */ +export function update( + context: Client, + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options: GallerySharingProfileUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, SharingUpdate> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, galleryName, sharingUpdate, options), + resourceLocationConfig: "location", + apiVersion: "2025-03-03", + }) as PollerLike, SharingUpdate>; +} diff --git a/sdk/compute/arm-compute/src/api/gallerySharingProfile/options.ts b/sdk/compute/arm-compute/src/api/gallerySharingProfile/options.ts new file mode 100644 index 000000000000..e9bd1b4dba8f --- /dev/null +++ b/sdk/compute/arm-compute/src/api/gallerySharingProfile/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GallerySharingProfileUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} diff --git a/sdk/compute/arm-compute/src/api/images/index.ts b/sdk/compute/arm-compute/src/api/images/index.ts new file mode 100644 index 000000000000..f0155af4ed3d --- /dev/null +++ b/sdk/compute/arm-compute/src/api/images/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, listByResourceGroup, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + ImagesListOptionalParams, + ImagesListByResourceGroupOptionalParams, + ImagesDeleteOptionalParams, + ImagesUpdateOptionalParams, + ImagesCreateOrUpdateOptionalParams, + ImagesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/images/operations.ts b/sdk/compute/arm-compute/src/api/images/operations.ts new file mode 100644 index 000000000000..08ed813d7475 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/images/operations.ts @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { Image, ImageUpdate, _ImageListResult } from "../../models/compute/models.js"; +import { + imageSerializer, + imageDeserializer, + imageUpdateSerializer, + _imageListResultDeserializer, +} from "../../models/compute/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 { + ImagesListOptionalParams, + ImagesListByResourceGroupOptionalParams, + ImagesDeleteOptionalParams, + ImagesUpdateOptionalParams, + ImagesCreateOrUpdateOptionalParams, + ImagesGetOptionalParams, +} 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 _listSend( + context: Client, + options: ImagesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + 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<_ImageListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _imageListResultDeserializer(result.body); +} + +/** Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. */ +export function list( + context: Client, + options: ImagesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: ImagesListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_ImageListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _imageListResultDeserializer(result.body); +} + +/** Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: ImagesListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + imageName: string, + options: ImagesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + imageName: imageName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes an Image. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + imageName: string, + options: ImagesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, imageName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options: ImagesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + imageName: imageName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: imageUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return imageDeserializer(result.body); +} + +/** Update an image. */ +export function update( + context: Client, + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options: ImagesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Image> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, imageName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, Image>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + imageName: string, + parameters: Image, + options: ImagesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + imageName: imageName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: imageSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return imageDeserializer(result.body); +} + +/** Create or update an image. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + imageName: string, + parameters: Image, + options: ImagesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Image> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, imageName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, Image>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + imageName: string, + options: ImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + imageName: imageName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return imageDeserializer(result.body); +} + +/** Gets an image. */ +export async function get( + context: Client, + resourceGroupName: string, + imageName: string, + options: ImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, imageName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/images/options.ts b/sdk/compute/arm-compute/src/api/images/options.ts new file mode 100644 index 000000000000..53709304ca85 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/images/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ImagesListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ImagesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ImagesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ImagesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ImagesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ImagesGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} diff --git a/sdk/compute/arm-compute/src/api/index.ts b/sdk/compute/arm-compute/src/api/index.ts new file mode 100644 index 000000000000..ae386527af03 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + ComputeManagementContext, + ComputeManagementClientOptionalParams, +} from "./computeManagementContext.js"; +export { createComputeManagement } from "./computeManagementContext.js"; diff --git a/sdk/compute/arm-compute/src/api/logAnalytics/index.ts b/sdk/compute/arm-compute/src/api/logAnalytics/index.ts new file mode 100644 index 000000000000..5c95add0b61e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/logAnalytics/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { exportThrottledRequests, exportRequestRateByInterval } from "./operations.js"; +export type { + LogAnalyticsExportThrottledRequestsOptionalParams, + LogAnalyticsExportRequestRateByIntervalOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/logAnalytics/operations.ts b/sdk/compute/arm-compute/src/api/logAnalytics/operations.ts new file mode 100644 index 000000000000..8ffa38019622 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/logAnalytics/operations.ts @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + RequestRateByIntervalInput, + LogAnalyticsOperationResult, + ThrottledRequestsInput, +} from "../../models/compute/models.js"; +import { + requestRateByIntervalInputSerializer, + logAnalyticsOperationResultDeserializer, + throttledRequestsInputSerializer, +} from "../../models/compute/models.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + LogAnalyticsExportThrottledRequestsOptionalParams, + LogAnalyticsExportRequestRateByIntervalOptionalParams, +} 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 _exportThrottledRequestsSend( + context: Client, + location: string, + parameters: ThrottledRequestsInput, + options: LogAnalyticsExportThrottledRequestsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: throttledRequestsInputSerializer(parameters), + }); +} + +export async function _exportThrottledRequestsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return logAnalyticsOperationResultDeserializer(result.body); +} + +/** Export logs that show total throttled Api requests for this subscription in the given time window. */ +export function exportThrottledRequests( + context: Client, + location: string, + parameters: ThrottledRequestsInput, + options: LogAnalyticsExportThrottledRequestsOptionalParams = { requestOptions: {} }, +): PollerLike, LogAnalyticsOperationResult> { + return getLongRunningPoller(context, _exportThrottledRequestsDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _exportThrottledRequestsSend(context, location, parameters, options), + resourceLocationConfig: "azure-async-operation", + apiVersion: "2025-11-01", + }) as PollerLike, LogAnalyticsOperationResult>; +} + +export function _exportRequestRateByIntervalSend( + context: Client, + location: string, + parameters: RequestRateByIntervalInput, + options: LogAnalyticsExportRequestRateByIntervalOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: requestRateByIntervalInputSerializer(parameters), + }); +} + +export async function _exportRequestRateByIntervalDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return logAnalyticsOperationResultDeserializer(result.body); +} + +/** Export logs that show Api requests made by this subscription in the given time window to show throttling activities. */ +export function exportRequestRateByInterval( + context: Client, + location: string, + parameters: RequestRateByIntervalInput, + options: LogAnalyticsExportRequestRateByIntervalOptionalParams = { requestOptions: {} }, +): PollerLike, LogAnalyticsOperationResult> { + return getLongRunningPoller( + context, + _exportRequestRateByIntervalDeserialize, + ["202", "200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _exportRequestRateByIntervalSend(context, location, parameters, options), + resourceLocationConfig: "azure-async-operation", + apiVersion: "2025-11-01", + }, + ) as PollerLike, LogAnalyticsOperationResult>; +} diff --git a/sdk/compute/arm-compute/src/api/logAnalytics/options.ts b/sdk/compute/arm-compute/src/api/logAnalytics/options.ts new file mode 100644 index 000000000000..5f85d5173bb3 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/logAnalytics/options.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface LogAnalyticsExportThrottledRequestsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface LogAnalyticsExportRequestRateByIntervalOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} diff --git a/sdk/compute/arm-compute/src/api/operations/index.ts b/sdk/compute/arm-compute/src/api/operations/index.ts new file mode 100644 index 000000000000..de883c05d2f1 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export type { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/operations/operations.ts b/sdk/compute/arm-compute/src/api/operations/operations.ts new file mode 100644 index 000000000000..9e2e34f71016 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/operations/operations.ts @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { _OperationListResult, Operation } from "../../models/models.js"; +import { _operationListResultDeserializer } 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.Compute/operations{?api%2Dversion}", + { + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(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: "2025-11-01" }, + ); +} diff --git a/sdk/compute/arm-compute/src/api/operations/options.ts b/sdk/compute/arm-compute/src/api/operations/options.ts new file mode 100644 index 000000000000..b9a3fd9758a3 --- /dev/null +++ b/sdk/compute/arm-compute/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/compute/arm-compute/src/api/proximityPlacementGroups/index.ts b/sdk/compute/arm-compute/src/api/proximityPlacementGroups/index.ts new file mode 100644 index 000000000000..8c8e9cb281af --- /dev/null +++ b/sdk/compute/arm-compute/src/api/proximityPlacementGroups/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + ProximityPlacementGroupsListBySubscriptionOptionalParams, + ProximityPlacementGroupsListByResourceGroupOptionalParams, + ProximityPlacementGroupsDeleteOptionalParams, + ProximityPlacementGroupsUpdateOptionalParams, + ProximityPlacementGroupsCreateOrUpdateOptionalParams, + ProximityPlacementGroupsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/proximityPlacementGroups/operations.ts b/sdk/compute/arm-compute/src/api/proximityPlacementGroups/operations.ts new file mode 100644 index 000000000000..6b05c4f7f8a3 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/proximityPlacementGroups/operations.ts @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + ProximityPlacementGroup, + ProximityPlacementGroupUpdate, + _ProximityPlacementGroupListResult, +} from "../../models/compute/models.js"; +import { + proximityPlacementGroupSerializer, + proximityPlacementGroupDeserializer, + proximityPlacementGroupUpdateSerializer, + _proximityPlacementGroupListResultDeserializer, +} from "../../models/compute/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 { + ProximityPlacementGroupsListBySubscriptionOptionalParams, + ProximityPlacementGroupsListByResourceGroupOptionalParams, + ProximityPlacementGroupsDeleteOptionalParams, + ProximityPlacementGroupsUpdateOptionalParams, + ProximityPlacementGroupsCreateOrUpdateOptionalParams, + ProximityPlacementGroupsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listBySubscriptionSend( + context: Client, + options: ProximityPlacementGroupsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + 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<_ProximityPlacementGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _proximityPlacementGroupListResultDeserializer(result.body); +} + +/** Lists all proximity placement groups in a subscription. */ +export function listBySubscription( + context: Client, + options: ProximityPlacementGroupsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: ProximityPlacementGroupsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_ProximityPlacementGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _proximityPlacementGroupListResultDeserializer(result.body); +} + +/** Lists all proximity placement groups in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: ProximityPlacementGroupsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + options: ProximityPlacementGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + proximityPlacementGroupName: proximityPlacementGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete a proximity placement group. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + options: ProximityPlacementGroupsDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + proximityPlacementGroupName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroupUpdate, + options: ProximityPlacementGroupsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + proximityPlacementGroupName: proximityPlacementGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: proximityPlacementGroupUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return proximityPlacementGroupDeserializer(result.body); +} + +/** Update a proximity placement group. */ +export async function update( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroupUpdate, + options: ProximityPlacementGroupsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + proximityPlacementGroupName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroup, + options: ProximityPlacementGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + proximityPlacementGroupName: proximityPlacementGroupName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: proximityPlacementGroupSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return proximityPlacementGroupDeserializer(result.body); +} + +/** Create or update a proximity placement group. */ +export async function createOrUpdate( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroup, + options: ProximityPlacementGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createOrUpdateSend( + context, + resourceGroupName, + proximityPlacementGroupName, + parameters, + options, + ); + return _createOrUpdateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + options: ProximityPlacementGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}{?api%2Dversion,includeColocationStatus}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + proximityPlacementGroupName: proximityPlacementGroupName, + "api%2Dversion": "2025-11-01", + includeColocationStatus: options?.includeColocationStatus, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return proximityPlacementGroupDeserializer(result.body); +} + +/** Retrieves information about a proximity placement group . */ +export async function get( + context: Client, + resourceGroupName: string, + proximityPlacementGroupName: string, + options: ProximityPlacementGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, proximityPlacementGroupName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/proximityPlacementGroups/options.ts b/sdk/compute/arm-compute/src/api/proximityPlacementGroups/options.ts new file mode 100644 index 000000000000..6e8d8089668a --- /dev/null +++ b/sdk/compute/arm-compute/src/api/proximityPlacementGroups/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ProximityPlacementGroupsListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ProximityPlacementGroupsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ProximityPlacementGroupsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ProximityPlacementGroupsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ProximityPlacementGroupsCreateOrUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ProximityPlacementGroupsGetOptionalParams extends OperationOptions { + /** includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. */ + includeColocationStatus?: string; +} diff --git a/sdk/compute/arm-compute/src/api/resourceSkus/index.ts b/sdk/compute/arm-compute/src/api/resourceSkus/index.ts new file mode 100644 index 000000000000..de64d2fcd789 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/resourceSkus/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export type { ResourceSkusListOptionalParams } from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/resourceSkus/operations.ts b/sdk/compute/arm-compute/src/api/resourceSkus/operations.ts new file mode 100644 index 000000000000..356464dfe0f8 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/resourceSkus/operations.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import type { _ResourceSkusResult, ResourceSku } from "../../models/computeSku/models.js"; +import { _resourceSkusResultDeserializer } from "../../models/computeSku/models.js"; +import { 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 { ResourceSkusListOptionalParams } 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: ResourceSkusListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus{?api%2Dversion,%24filter,includeExtendedLocations}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2021-07-01", + "%24filter": options?.filter, + includeExtendedLocations: options?.includeExtendedLocations, + }, + { + 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<_ResourceSkusResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + + throw error; + } + + return _resourceSkusResultDeserializer(result.body); +} + +/** Gets the list of Microsoft.Compute SKUs available for your Subscription. */ +export function list( + context: Client, + options: ResourceSkusListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2021-07-01" }, + ); +} diff --git a/sdk/compute/arm-compute/src/api/resourceSkus/options.ts b/sdk/compute/arm-compute/src/api/resourceSkus/options.ts new file mode 100644 index 000000000000..39dd030352f1 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/resourceSkus/options.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ResourceSkusListOptionalParams extends OperationOptions { + /** The filter to apply on the operation. Only **location** filter is supported currently. */ + filter?: string; + /** To Include Extended Locations information or not in the response. */ + includeExtendedLocations?: string; +} diff --git a/sdk/compute/arm-compute/src/api/restorePointCollections/index.ts b/sdk/compute/arm-compute/src/api/restorePointCollections/index.ts new file mode 100644 index 000000000000..c211760d82f0 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/restorePointCollections/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listAll, list, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + RestorePointCollectionsListAllOptionalParams, + RestorePointCollectionsListOptionalParams, + RestorePointCollectionsDeleteOptionalParams, + RestorePointCollectionsUpdateOptionalParams, + RestorePointCollectionsCreateOrUpdateOptionalParams, + RestorePointCollectionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/restorePointCollections/operations.ts b/sdk/compute/arm-compute/src/api/restorePointCollections/operations.ts new file mode 100644 index 000000000000..78ee0764c7c7 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/restorePointCollections/operations.ts @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + RestorePointCollection, + RestorePointCollectionUpdate, + _RestorePointCollectionListResult, +} from "../../models/compute/models.js"; +import { + restorePointCollectionSerializer, + restorePointCollectionDeserializer, + restorePointCollectionUpdateSerializer, + _restorePointCollectionListResultDeserializer, +} from "../../models/compute/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 { + RestorePointCollectionsListAllOptionalParams, + RestorePointCollectionsListOptionalParams, + RestorePointCollectionsDeleteOptionalParams, + RestorePointCollectionsUpdateOptionalParams, + RestorePointCollectionsCreateOrUpdateOptionalParams, + RestorePointCollectionsGetOptionalParams, +} 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 _listAllSend( + context: Client, + options: RestorePointCollectionsListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_RestorePointCollectionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _restorePointCollectionListResultDeserializer(result.body); +} + +/** Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. */ +export function listAll( + context: Client, + options: RestorePointCollectionsListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listSend( + context: Client, + resourceGroupName: string, + options: RestorePointCollectionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_RestorePointCollectionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _restorePointCollectionListResultDeserializer(result.body); +} + +/** Gets the list of restore point collections in a resource group. */ +export function list( + context: Client, + resourceGroupName: string, + options: RestorePointCollectionsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + options: RestorePointCollectionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete the restore point collection. This operation will also delete all the contained restore points. */ +/** + * @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, + restorePointCollectionName: string, + options: RestorePointCollectionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, restorePointCollectionName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollectionUpdate, + options: RestorePointCollectionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: restorePointCollectionUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return restorePointCollectionDeserializer(result.body); +} + +/** The operation to update the restore point collection. */ +export async function update( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollectionUpdate, + options: RestorePointCollectionsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + restorePointCollectionName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollection, + options: RestorePointCollectionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: restorePointCollectionSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return restorePointCollectionDeserializer(result.body); +} + +/** The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. */ +export async function createOrUpdate( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollection, + options: RestorePointCollectionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createOrUpdateSend( + context, + resourceGroupName, + restorePointCollectionName, + parameters, + options, + ); + return _createOrUpdateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + options: RestorePointCollectionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return restorePointCollectionDeserializer(result.body); +} + +/** The operation to get the restore point collection. */ +export async function get( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + options: RestorePointCollectionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, restorePointCollectionName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/restorePointCollections/options.ts b/sdk/compute/arm-compute/src/api/restorePointCollections/options.ts new file mode 100644 index 000000000000..536e1d19b1e7 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/restorePointCollections/options.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RestorePointCollectionExpandOptions } from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface RestorePointCollectionsListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RestorePointCollectionsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RestorePointCollectionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RestorePointCollectionsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RestorePointCollectionsCreateOrUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RestorePointCollectionsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points in the restorePointCollection. */ + expand?: RestorePointCollectionExpandOptions; +} diff --git a/sdk/compute/arm-compute/src/api/restorePoints/index.ts b/sdk/compute/arm-compute/src/api/restorePoints/index.ts new file mode 100644 index 000000000000..1d1c3b9eb711 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/restorePoints/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { $delete, create, get } from "./operations.js"; +export type { + RestorePointsDeleteOptionalParams, + RestorePointsCreateOptionalParams, + RestorePointsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/restorePoints/operations.ts b/sdk/compute/arm-compute/src/api/restorePoints/operations.ts new file mode 100644 index 000000000000..33ccad66ba26 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/restorePoints/operations.ts @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { RestorePoint } from "../../models/compute/models.js"; +import { restorePointSerializer, restorePointDeserializer } from "../../models/compute/models.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + RestorePointsDeleteOptionalParams, + RestorePointsCreateOptionalParams, + RestorePointsGetOptionalParams, +} 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 _$deleteSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options: RestorePointsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + restorePointName: restorePointName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete the restore point. */ +/** + * @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, + restorePointCollectionName: string, + restorePointName: string, + options: RestorePointsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options: RestorePointsCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + restorePointName: restorePointName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: restorePointSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["201", "200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return restorePointDeserializer(result.body); +} + +/** The operation to create the restore point. Updating properties of an existing restore point is not allowed */ +export function create( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options: RestorePointsCreateOptionalParams = { requestOptions: {} }, +): PollerLike, RestorePoint> { + return getLongRunningPoller(context, _createDeserialize, ["201", "200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, RestorePoint>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options: RestorePointsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + restorePointCollectionName: restorePointCollectionName, + restorePointName: restorePointName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return restorePointDeserializer(result.body); +} + +/** The operation to get the restore point. */ +export async function get( + context: Client, + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options: RestorePointsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/restorePoints/options.ts b/sdk/compute/arm-compute/src/api/restorePoints/options.ts new file mode 100644 index 000000000000..09d45e8700f1 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/restorePoints/options.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RestorePointExpandOptions } from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface RestorePointsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RestorePointsCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RestorePointsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore point. */ + expand?: RestorePointExpandOptions; +} diff --git a/sdk/compute/arm-compute/src/api/sharedGalleries/index.ts b/sdk/compute/arm-compute/src/api/sharedGalleries/index.ts new file mode 100644 index 000000000000..4d8f1f7a401a --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleries/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, get } from "./operations.js"; +export type { + SharedGalleriesListOptionalParams, + SharedGalleriesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/sharedGalleries/operations.ts b/sdk/compute/arm-compute/src/api/sharedGalleries/operations.ts new file mode 100644 index 000000000000..d68fd58d2149 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleries/operations.ts @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { SharedGallery, _SharedGalleryList } from "../../models/computeGallery/models.js"; +import { + sharedGalleryDeserializer, + _sharedGalleryListDeserializer, +} from "../../models/computeGallery/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 { + SharedGalleriesListOptionalParams, + SharedGalleriesGetOptionalParams, +} 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, + location: string, + options: SharedGalleriesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries{?api%2Dversion,sharedTo}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-03-03", + sharedTo: options?.sharedTo, + }, + { + 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<_SharedGalleryList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _sharedGalleryListDeserializer(result.body); +} + +/** List shared galleries by subscription id or tenant id. */ +export function list( + context: Client, + location: string, + options: SharedGalleriesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _getSend( + context: Client, + location: string, + galleryUniqueName: string, + options: SharedGalleriesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + galleryUniqueName: galleryUniqueName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return sharedGalleryDeserializer(result.body); +} + +/** Get a shared gallery by subscription id or tenant id. */ +export async function get( + context: Client, + location: string, + galleryUniqueName: string, + options: SharedGalleriesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, galleryUniqueName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/sharedGalleries/options.ts b/sdk/compute/arm-compute/src/api/sharedGalleries/options.ts new file mode 100644 index 000000000000..ffa37f83f0d7 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleries/options.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { SharedToValues } from "../../models/computeGallery/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SharedGalleriesListOptionalParams extends OperationOptions { + /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ + sharedTo?: SharedToValues; +} + +/** Optional parameters. */ +export interface SharedGalleriesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/index.ts b/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/index.ts new file mode 100644 index 000000000000..a2190aed4095 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, get } from "./operations.js"; +export type { + SharedGalleryImageVersionsListOptionalParams, + SharedGalleryImageVersionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/operations.ts b/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/operations.ts new file mode 100644 index 000000000000..2adc62531100 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/operations.ts @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + SharedGalleryImageVersion, + _SharedGalleryImageVersionList, +} from "../../models/computeGallery/models.js"; +import { + sharedGalleryImageVersionDeserializer, + _sharedGalleryImageVersionListDeserializer, +} from "../../models/computeGallery/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 { + SharedGalleryImageVersionsListOptionalParams, + SharedGalleryImageVersionsGetOptionalParams, +} 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, + location: string, + galleryUniqueName: string, + galleryImageName: string, + options: SharedGalleryImageVersionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions{?api%2Dversion,sharedTo}", + { + subscriptionId: context.subscriptionId, + location: location, + galleryUniqueName: galleryUniqueName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + sharedTo: options?.sharedTo, + }, + { + 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<_SharedGalleryImageVersionList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _sharedGalleryImageVersionListDeserializer(result.body); +} + +/** List shared gallery image versions by subscription id or tenant id. */ +export function list( + context: Client, + location: string, + galleryUniqueName: string, + galleryImageName: string, + options: SharedGalleryImageVersionsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, galleryUniqueName, galleryImageName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _getSend( + context: Client, + location: string, + galleryUniqueName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: SharedGalleryImageVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + galleryUniqueName: galleryUniqueName, + galleryImageName: galleryImageName, + galleryImageVersionName: galleryImageVersionName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return sharedGalleryImageVersionDeserializer(result.body); +} + +/** Get a shared gallery image version by subscription id or tenant id. */ +export async function get( + context: Client, + location: string, + galleryUniqueName: string, + galleryImageName: string, + galleryImageVersionName: string, + options: SharedGalleryImageVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + location, + galleryUniqueName, + galleryImageName, + galleryImageVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/options.ts b/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/options.ts new file mode 100644 index 000000000000..50f17c65c75e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleryImageVersions/options.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { SharedToValues } from "../../models/computeGallery/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SharedGalleryImageVersionsListOptionalParams extends OperationOptions { + /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ + sharedTo?: SharedToValues; +} + +/** Optional parameters. */ +export interface SharedGalleryImageVersionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/sharedGalleryImages/index.ts b/sdk/compute/arm-compute/src/api/sharedGalleryImages/index.ts new file mode 100644 index 000000000000..9fc5b2693e44 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleryImages/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, get } from "./operations.js"; +export type { + SharedGalleryImagesListOptionalParams, + SharedGalleryImagesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/sharedGalleryImages/operations.ts b/sdk/compute/arm-compute/src/api/sharedGalleryImages/operations.ts new file mode 100644 index 000000000000..88356e73ba41 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleryImages/operations.ts @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + SharedGalleryImage, + _SharedGalleryImageList, +} from "../../models/computeGallery/models.js"; +import { + sharedGalleryImageDeserializer, + _sharedGalleryImageListDeserializer, +} from "../../models/computeGallery/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 { + SharedGalleryImagesListOptionalParams, + SharedGalleryImagesGetOptionalParams, +} 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, + location: string, + galleryUniqueName: string, + options: SharedGalleryImagesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images{?api%2Dversion,sharedTo}", + { + subscriptionId: context.subscriptionId, + location: location, + galleryUniqueName: galleryUniqueName, + "api%2Dversion": "2025-03-03", + sharedTo: options?.sharedTo, + }, + { + 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<_SharedGalleryImageList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _sharedGalleryImageListDeserializer(result.body); +} + +/** List shared gallery images by subscription id or tenant id. */ +export function list( + context: Client, + location: string, + galleryUniqueName: string, + options: SharedGalleryImagesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, galleryUniqueName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} + +export function _getSend( + context: Client, + location: string, + galleryUniqueName: string, + galleryImageName: string, + options: SharedGalleryImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + galleryUniqueName: galleryUniqueName, + galleryImageName: galleryImageName, + "api%2Dversion": "2025-03-03", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return sharedGalleryImageDeserializer(result.body); +} + +/** Get a shared gallery image by subscription id or tenant id. */ +export async function get( + context: Client, + location: string, + galleryUniqueName: string, + galleryImageName: string, + options: SharedGalleryImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, galleryUniqueName, galleryImageName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/sharedGalleryImages/options.ts b/sdk/compute/arm-compute/src/api/sharedGalleryImages/options.ts new file mode 100644 index 000000000000..fbc8a8489f05 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sharedGalleryImages/options.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { SharedToValues } from "../../models/computeGallery/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SharedGalleryImagesListOptionalParams extends OperationOptions { + /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ + sharedTo?: SharedToValues; +} + +/** Optional parameters. */ +export interface SharedGalleryImagesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/snapshots/index.ts b/sdk/compute/arm-compute/src/api/snapshots/index.ts new file mode 100644 index 000000000000..648d0f106761 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/snapshots/index.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + revokeAccess, + grantAccess, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + SnapshotsRevokeAccessOptionalParams, + SnapshotsGrantAccessOptionalParams, + SnapshotsListOptionalParams, + SnapshotsListByResourceGroupOptionalParams, + SnapshotsDeleteOptionalParams, + SnapshotsUpdateOptionalParams, + SnapshotsCreateOrUpdateOptionalParams, + SnapshotsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/snapshots/operations.ts b/sdk/compute/arm-compute/src/api/snapshots/operations.ts new file mode 100644 index 000000000000..3df23736c510 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/snapshots/operations.ts @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + GrantAccessData, + AccessUri, + Snapshot, + SnapshotUpdate, + _SnapshotList, +} from "../../models/computeDisk/models.js"; +import { + grantAccessDataSerializer, + accessUriDeserializer, + snapshotSerializer, + snapshotDeserializer, + snapshotUpdateSerializer, + _snapshotListDeserializer, +} from "../../models/computeDisk/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 { + SnapshotsRevokeAccessOptionalParams, + SnapshotsGrantAccessOptionalParams, + SnapshotsListOptionalParams, + SnapshotsListByResourceGroupOptionalParams, + SnapshotsDeleteOptionalParams, + SnapshotsUpdateOptionalParams, + SnapshotsCreateOrUpdateOptionalParams, + SnapshotsGetOptionalParams, +} 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 _revokeAccessSend( + context: Client, + resourceGroupName: string, + snapshotName: string, + options: SnapshotsRevokeAccessOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + snapshotName: snapshotName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _revokeAccessDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Revokes access to a snapshot. */ +export function revokeAccess( + context: Client, + resourceGroupName: string, + snapshotName: string, + options: SnapshotsRevokeAccessOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _revokeAccessDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _revokeAccessSend(context, resourceGroupName, snapshotName, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, void>; +} + +export function _grantAccessSend( + context: Client, + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options: SnapshotsGrantAccessOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + snapshotName: snapshotName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: grantAccessDataSerializer(grantAccessData), + }); +} + +export async function _grantAccessDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return accessUriDeserializer(result.body); +} + +/** Grants access to a snapshot. */ +export function grantAccess( + context: Client, + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options: SnapshotsGrantAccessOptionalParams = { requestOptions: {} }, +): PollerLike, AccessUri> { + return getLongRunningPoller(context, _grantAccessDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _grantAccessSend(context, resourceGroupName, snapshotName, grantAccessData, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, AccessUri>; +} + +export function _listSend( + context: Client, + options: SnapshotsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-01-02", + }, + { + 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<_SnapshotList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _snapshotListDeserializer(result.body); +} + +/** Lists snapshots under a subscription. */ +export function list( + context: Client, + options: SnapshotsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: SnapshotsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-01-02", + }, + { + 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<_SnapshotList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _snapshotListDeserializer(result.body); +} + +/** Lists snapshots under a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: SnapshotsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-01-02" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + snapshotName: string, + options: SnapshotsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + snapshotName: snapshotName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes a snapshot. */ +/** + * @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, + snapshotName: string, + options: SnapshotsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, snapshotName, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options: SnapshotsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + snapshotName: snapshotName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: snapshotUpdateSerializer(snapshot), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return snapshotDeserializer(result.body); +} + +/** Updates (patches) a snapshot. */ +export function update( + context: Client, + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options: SnapshotsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Snapshot> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, snapshotName, snapshot, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, Snapshot>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options: SnapshotsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + snapshotName: snapshotName, + "api%2Dversion": "2025-01-02", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: snapshotSerializer(snapshot), + }); +} + +export async function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return snapshotDeserializer(result.body); +} + +/** Creates or updates a snapshot. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options: SnapshotsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Snapshot> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, snapshotName, snapshot, options), + resourceLocationConfig: "location", + apiVersion: "2025-01-02", + }) as PollerLike, Snapshot>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + snapshotName: string, + options: SnapshotsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + snapshotName: snapshotName, + "api%2Dversion": "2025-01-02", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return snapshotDeserializer(result.body); +} + +/** Gets information about a snapshot. */ +export async function get( + context: Client, + resourceGroupName: string, + snapshotName: string, + options: SnapshotsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, snapshotName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/snapshots/options.ts b/sdk/compute/arm-compute/src/api/snapshots/options.ts new file mode 100644 index 000000000000..bef35a321d98 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/snapshots/options.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SnapshotsRevokeAccessOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SnapshotsGrantAccessOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SnapshotsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SnapshotsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SnapshotsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SnapshotsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SnapshotsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SnapshotsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/softDeletedResource/index.ts b/sdk/compute/arm-compute/src/api/softDeletedResource/index.ts new file mode 100644 index 000000000000..3502eb5e52ef --- /dev/null +++ b/sdk/compute/arm-compute/src/api/softDeletedResource/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByArtifactName } from "./operations.js"; +export type { SoftDeletedResourceListByArtifactNameOptionalParams } from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/softDeletedResource/operations.ts b/sdk/compute/arm-compute/src/api/softDeletedResource/operations.ts new file mode 100644 index 000000000000..feddeafc72af --- /dev/null +++ b/sdk/compute/arm-compute/src/api/softDeletedResource/operations.ts @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + _GallerySoftDeletedResourceList, + GallerySoftDeletedResource, +} from "../../models/computeGallery/models.js"; +import { _gallerySoftDeletedResourceListDeserializer } from "../../models/computeGallery/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 { SoftDeletedResourceListByArtifactNameOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listByArtifactNameSend( + context: Client, + resourceGroupName: string, + galleryName: string, + artifactType: string, + artifactName: string, + options: SoftDeletedResourceListByArtifactNameOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/softdeletedartifacttypes/{artifactType}/artifacts/{artifactName}/versions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + galleryName: galleryName, + artifactType: artifactType, + artifactName: artifactName, + "api%2Dversion": "2025-03-03", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByArtifactNameDeserialize( + result: PathUncheckedResponse, +): Promise<_GallerySoftDeletedResourceList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _gallerySoftDeletedResourceListDeserializer(result.body); +} + +/** List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. */ +export function listByArtifactName( + context: Client, + resourceGroupName: string, + galleryName: string, + artifactType: string, + artifactName: string, + options: SoftDeletedResourceListByArtifactNameOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByArtifactNameSend( + context, + resourceGroupName, + galleryName, + artifactType, + artifactName, + options, + ), + _listByArtifactNameDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-03-03" }, + ); +} diff --git a/sdk/compute/arm-compute/src/api/softDeletedResource/options.ts b/sdk/compute/arm-compute/src/api/softDeletedResource/options.ts new file mode 100644 index 000000000000..d59a739cfcc9 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/softDeletedResource/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 SoftDeletedResourceListByArtifactNameOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/sshPublicKeys/index.ts b/sdk/compute/arm-compute/src/api/sshPublicKeys/index.ts new file mode 100644 index 000000000000..bdc8521791ba --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sshPublicKeys/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + generateKeyPair, + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export type { + SshPublicKeysGenerateKeyPairOptionalParams, + SshPublicKeysListBySubscriptionOptionalParams, + SshPublicKeysListByResourceGroupOptionalParams, + SshPublicKeysDeleteOptionalParams, + SshPublicKeysUpdateOptionalParams, + SshPublicKeysCreateOptionalParams, + SshPublicKeysGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/sshPublicKeys/operations.ts b/sdk/compute/arm-compute/src/api/sshPublicKeys/operations.ts new file mode 100644 index 000000000000..d32262c7206c --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sshPublicKeys/operations.ts @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + SshPublicKeyResource, + SshPublicKeyUpdateResource, + _SshPublicKeysGroupListResult, + SshPublicKeyGenerateKeyPairResult, +} from "../../models/compute/models.js"; +import { + sshPublicKeyResourceSerializer, + sshPublicKeyResourceDeserializer, + sshPublicKeyUpdateResourceSerializer, + _sshPublicKeysGroupListResultDeserializer, + sshGenerateKeyPairInputParametersSerializer, + sshPublicKeyGenerateKeyPairResultDeserializer, +} from "../../models/compute/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 { + SshPublicKeysGenerateKeyPairOptionalParams, + SshPublicKeysListBySubscriptionOptionalParams, + SshPublicKeysListByResourceGroupOptionalParams, + SshPublicKeysDeleteOptionalParams, + SshPublicKeysUpdateOptionalParams, + SshPublicKeysCreateOptionalParams, + SshPublicKeysGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _generateKeyPairSend( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + options: SshPublicKeysGenerateKeyPairOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + sshPublicKeyName: sshPublicKeyName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: !options["parameters"] + ? options["parameters"] + : sshGenerateKeyPairInputParametersSerializer(options["parameters"]), + }); +} + +export async function _generateKeyPairDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return sshPublicKeyGenerateKeyPairResultDeserializer(result.body); +} + +/** Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. */ +export async function generateKeyPair( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + options: SshPublicKeysGenerateKeyPairOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _generateKeyPairSend(context, resourceGroupName, sshPublicKeyName, options); + return _generateKeyPairDeserialize(result); +} + +export function _listBySubscriptionSend( + context: Client, + options: SshPublicKeysListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + 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<_SshPublicKeysGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _sshPublicKeysGroupListResultDeserializer(result.body); +} + +/** Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. */ +export function listBySubscription( + context: Client, + options: SshPublicKeysListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: SshPublicKeysListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_SshPublicKeysGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _sshPublicKeysGroupListResultDeserializer(result.body); +} + +/** Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: SshPublicKeysListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + options: SshPublicKeysDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + sshPublicKeyName: sshPublicKeyName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Delete an SSH public key. */ +/** + * @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 async function $delete( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + options: SshPublicKeysDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, resourceGroupName, sshPublicKeyName, options); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyUpdateResource, + options: SshPublicKeysUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + sshPublicKeyName: sshPublicKeyName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: sshPublicKeyUpdateResourceSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return sshPublicKeyResourceDeserializer(result.body); +} + +/** Updates a new SSH public key resource. */ +export async function update( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyUpdateResource, + options: SshPublicKeysUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + sshPublicKeyName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyResource, + options: SshPublicKeysCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + sshPublicKeyName: sshPublicKeyName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: sshPublicKeyResourceSerializer(parameters), + }); +} + +export async function _createDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return sshPublicKeyResourceDeserializer(result.body); +} + +/** Creates a new SSH public key resource. */ +export async function create( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyResource, + options: SshPublicKeysCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSend( + context, + resourceGroupName, + sshPublicKeyName, + parameters, + options, + ); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + options: SshPublicKeysGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + sshPublicKeyName: sshPublicKeyName, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return sshPublicKeyResourceDeserializer(result.body); +} + +/** Retrieves information about an SSH public key. */ +export async function get( + context: Client, + resourceGroupName: string, + sshPublicKeyName: string, + options: SshPublicKeysGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, sshPublicKeyName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/sshPublicKeys/options.ts b/sdk/compute/arm-compute/src/api/sshPublicKeys/options.ts new file mode 100644 index 000000000000..fb88feaeeab5 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/sshPublicKeys/options.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { SshGenerateKeyPairInputParameters } from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SshPublicKeysGenerateKeyPairOptionalParams extends OperationOptions { + /** Parameters supplied to generate the SSH public key. */ + parameters?: SshGenerateKeyPairInputParameters; +} + +/** Optional parameters. */ +export interface SshPublicKeysListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SshPublicKeysListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SshPublicKeysDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SshPublicKeysUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SshPublicKeysCreateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SshPublicKeysGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/usage/index.ts b/sdk/compute/arm-compute/src/api/usage/index.ts new file mode 100644 index 000000000000..fc28ca2cef7e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/usage/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export type { UsageListOptionalParams } from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/usage/operations.ts b/sdk/compute/arm-compute/src/api/usage/operations.ts new file mode 100644 index 000000000000..6f167cb3ac6e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/usage/operations.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { _ListUsagesResult, Usage } from "../../models/compute/models.js"; +import { _listUsagesResultDeserializer } from "../../models/compute/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 { UsageListOptionalParams } 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, + location: string, + options: UsageListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + 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<_ListUsagesResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _listUsagesResultDeserializer(result.body); +} + +/** Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. */ +export function list( + context: Client, + location: string, + options: UsageListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} diff --git a/sdk/compute/arm-compute/src/api/usage/options.ts b/sdk/compute/arm-compute/src/api/usage/options.ts new file mode 100644 index 000000000000..94b3240c01f6 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/usage/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 UsageListOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/index.ts new file mode 100644 index 000000000000..bc2420338a4d --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listVersions, listTypes, get } from "./operations.js"; +export type { + VirtualMachineExtensionImagesListVersionsOptionalParams, + VirtualMachineExtensionImagesListTypesOptionalParams, + VirtualMachineExtensionImagesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/operations.ts new file mode 100644 index 000000000000..400e785eb2c9 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/operations.ts @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { VirtualMachineExtensionImage } from "../../models/compute/models.js"; +import { + virtualMachineExtensionImageDeserializer, + virtualMachineExtensionImageArrayDeserializer, +} from "../../models/compute/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VirtualMachineExtensionImagesListVersionsOptionalParams, + VirtualMachineExtensionImagesListTypesOptionalParams, + VirtualMachineExtensionImagesGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listVersionsSend( + context: Client, + location: string, + publisherName: string, + typeParam: string, + options: VirtualMachineExtensionImagesListVersionsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions{?api%2Dversion,%24filter,%24top,%24orderby}", + { + subscriptionId: context.subscriptionId, + location: location, + publisherName: publisherName, + type: typeParam, + "api%2Dversion": "2025-11-01", + "%24filter": options?.filter, + "%24top": options?.top, + "%24orderby": options?.orderby, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listVersionsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineExtensionImageArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine extension image versions. */ +export async function listVersions( + context: Client, + location: string, + publisherName: string, + typeParam: string, + options: VirtualMachineExtensionImagesListVersionsOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listVersionsSend(context, location, publisherName, typeParam, options); + return _listVersionsDeserialize(result); +} + +export function _listTypesSend( + context: Client, + location: string, + publisherName: string, + options: VirtualMachineExtensionImagesListTypesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publisherName: publisherName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listTypesDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineExtensionImageArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine extension image types. */ +export async function listTypes( + context: Client, + location: string, + publisherName: string, + options: VirtualMachineExtensionImagesListTypesOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listTypesSend(context, location, publisherName, options); + return _listTypesDeserialize(result); +} + +export function _getSend( + context: Client, + location: string, + publisherName: string, + typeParam: string, + version: string, + options: VirtualMachineExtensionImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publisherName: publisherName, + type: typeParam, + version: version, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineExtensionImageDeserializer(result.body); +} + +/** Gets a virtual machine extension image. */ +export async function get( + context: Client, + location: string, + publisherName: string, + typeParam: string, + version: string, + options: VirtualMachineExtensionImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, publisherName, typeParam, version, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/options.ts new file mode 100644 index 000000000000..bbb12a85424c --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineExtensionImages/options.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineExtensionImagesListVersionsOptionalParams extends OperationOptions { + /** The filter to apply on the operation. */ + filter?: string; + top?: number; + orderby?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineExtensionImagesListTypesOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineExtensionImagesGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineExtensions/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineExtensions/index.ts new file mode 100644 index 000000000000..8d455160ec37 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineExtensions/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + VirtualMachineExtensionsListOptionalParams, + VirtualMachineExtensionsDeleteOptionalParams, + VirtualMachineExtensionsUpdateOptionalParams, + VirtualMachineExtensionsCreateOrUpdateOptionalParams, + VirtualMachineExtensionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineExtensions/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineExtensions/operations.ts new file mode 100644 index 000000000000..7332c51e78af --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineExtensions/operations.ts @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineExtension, + VirtualMachineExtensionUpdate, + VirtualMachineExtensionsListResult, +} from "../../models/compute/models.js"; +import { + virtualMachineExtensionSerializer, + virtualMachineExtensionDeserializer, + virtualMachineExtensionUpdateSerializer, + virtualMachineExtensionsListResultDeserializer, +} from "../../models/compute/models.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VirtualMachineExtensionsListOptionalParams, + VirtualMachineExtensionsDeleteOptionalParams, + VirtualMachineExtensionsUpdateOptionalParams, + VirtualMachineExtensionsCreateOrUpdateOptionalParams, + VirtualMachineExtensionsGetOptionalParams, +} 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 _listSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachineExtensionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineExtensionsListResultDeserializer(result.body); +} + +/** The operation to get all extensions of a Virtual Machine. */ +export async function list( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachineExtensionsListOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listSend(context, resourceGroupName, vmName, options); + return _listDeserialize(result); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options: VirtualMachineExtensionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete the extension. */ +/** + * @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, + vmName: string, + vmExtensionName: string, + options: VirtualMachineExtensionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, vmName, vmExtensionName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options: VirtualMachineExtensionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineExtensionUpdateSerializer(extensionParameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineExtensionDeserializer(result.body); +} + +/** The operation to update the extension. */ +export function update( + context: Client, + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options: VirtualMachineExtensionsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineExtension> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineExtension>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options: VirtualMachineExtensionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineExtensionSerializer(extensionParameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineExtensionDeserializer(result.body); +} + +/** The operation to create or update the extension. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options: VirtualMachineExtensionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineExtension> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineExtension>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options: VirtualMachineExtensionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineExtensionDeserializer(result.body); +} + +/** The operation to get the extension. */ +export async function get( + context: Client, + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options: VirtualMachineExtensionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, vmName, vmExtensionName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineExtensions/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineExtensions/options.ts new file mode 100644 index 000000000000..65c8ffd36d31 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineExtensions/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineExtensionsListOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineExtensionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineExtensionsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineExtensionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineExtensionsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineImages/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineImages/index.ts new file mode 100644 index 000000000000..837bc6e0bc10 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineImages/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + get, + listWithProperties, + list, + listSkus, + listOffers, + listPublishers, + listByEdgeZone, +} from "./operations.js"; +export type { + VirtualMachineImagesGetOptionalParams, + VirtualMachineImagesListWithPropertiesOptionalParams, + VirtualMachineImagesListOptionalParams, + VirtualMachineImagesListSkusOptionalParams, + VirtualMachineImagesListOffersOptionalParams, + VirtualMachineImagesListPublishersOptionalParams, + VirtualMachineImagesListByEdgeZoneOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineImages/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineImages/operations.ts new file mode 100644 index 000000000000..cfb6cccfa708 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineImages/operations.ts @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineImageResource, + VirtualMachineImage, + VmImagesInEdgeZoneListResult, +} from "../../models/compute/models.js"; +import { + virtualMachineImageDeserializer, + vmImagesInEdgeZoneListResultDeserializer, + virtualMachineImageResourceArrayDeserializer, + virtualMachineImageArrayDeserializer, +} from "../../models/compute/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VirtualMachineImagesGetOptionalParams, + VirtualMachineImagesListWithPropertiesOptionalParams, + VirtualMachineImagesListOptionalParams, + VirtualMachineImagesListSkusOptionalParams, + VirtualMachineImagesListOffersOptionalParams, + VirtualMachineImagesListPublishersOptionalParams, + VirtualMachineImagesListByEdgeZoneOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + location: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options: VirtualMachineImagesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}{?api%2Dversion}", + { + location: location, + publisherName: publisherName, + offer: offer, + skus: skus, + version: version, + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageDeserializer(result.body); +} + +/** Gets a virtual machine image. */ +export async function get( + context: Client, + location: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options: VirtualMachineImagesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, publisherName, offer, skus, version, options); + return _getDeserialize(result); +} + +export function _listWithPropertiesSend( + context: Client, + location: string, + publisherName: string, + offer: string, + skus: string, + expand: string, + options: VirtualMachineImagesListWithPropertiesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions?$expand=Properties{?api%2Dversion,%24expand,%24top,%24orderby}", + { + subscriptionId: context.subscriptionId, + location: location, + publisherName: publisherName, + offer: offer, + skus: skus, + "api%2Dversion": "2025-11-01", + "%24expand": expand, + "%24top": options?.top, + "%24orderby": options?.orderby, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listWithPropertiesDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageArrayDeserializer(result.body); +} + +export async function listWithProperties( + context: Client, + location: string, + publisherName: string, + offer: string, + skus: string, + expand: string, + options: VirtualMachineImagesListWithPropertiesOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listWithPropertiesSend( + context, + location, + publisherName, + offer, + skus, + expand, + options, + ); + return _listWithPropertiesDeserialize(result); +} + +export function _listSend( + context: Client, + location: string, + publisherName: string, + offer: string, + skus: string, + options: VirtualMachineImagesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions{?api%2Dversion,%24expand,%24top,%24orderby}", + { + subscriptionId: context.subscriptionId, + location: location, + publisherName: publisherName, + offer: offer, + skus: skus, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + "%24top": options?.top, + "%24orderby": options?.orderby, + }, + { + 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 { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. */ +export async function list( + context: Client, + location: string, + publisherName: string, + offer: string, + skus: string, + options: VirtualMachineImagesListOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listSend(context, location, publisherName, offer, skus, options); + return _listDeserialize(result); +} + +export function _listSkusSend( + context: Client, + location: string, + publisherName: string, + offer: string, + options: VirtualMachineImagesListSkusOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publisherName: publisherName, + offer: offer, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listSkusDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. */ +export async function listSkus( + context: Client, + location: string, + publisherName: string, + offer: string, + options: VirtualMachineImagesListSkusOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listSkusSend(context, location, publisherName, offer, options); + return _listSkusDeserialize(result); +} + +export function _listOffersSend( + context: Client, + location: string, + publisherName: string, + options: VirtualMachineImagesListOffersOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + publisherName: publisherName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listOffersDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine image offers for the specified location and publisher. */ +export async function listOffers( + context: Client, + location: string, + publisherName: string, + options: VirtualMachineImagesListOffersOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listOffersSend(context, location, publisherName, options); + return _listOffersDeserialize(result); +} + +export function _listPublishersSend( + context: Client, + location: string, + options: VirtualMachineImagesListPublishersOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listPublishersDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine image publishers for the specified Azure location. */ +export async function listPublishers( + context: Client, + location: string, + options: VirtualMachineImagesListPublishersOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listPublishersSend(context, location, options); + return _listPublishersDeserialize(result); +} + +export function _listByEdgeZoneSend( + context: Client, + location: string, + edgeZone: string, + options: VirtualMachineImagesListByEdgeZoneOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + edgeZone: edgeZone, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByEdgeZoneDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return vmImagesInEdgeZoneListResultDeserializer(result.body); +} + +/** Gets a list of all virtual machine image versions for the specified edge zone */ +export async function listByEdgeZone( + context: Client, + location: string, + edgeZone: string, + options: VirtualMachineImagesListByEdgeZoneOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listByEdgeZoneSend(context, location, edgeZone, options); + return _listByEdgeZoneDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineImages/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineImages/options.ts new file mode 100644 index 000000000000..dbd3d358a370 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineImages/options.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineImagesGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineImagesListWithPropertiesOptionalParams extends OperationOptions { + top?: number; + orderby?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineImagesListOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; + top?: number; + orderby?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineImagesListSkusOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineImagesListOffersOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineImagesListPublishersOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineImagesListByEdgeZoneOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/index.ts new file mode 100644 index 000000000000..ac479a129b08 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get, list, listSkus, listOffers, listPublishers } from "./operations.js"; +export type { + VirtualMachineImagesEdgeZoneGetOptionalParams, + VirtualMachineImagesEdgeZoneListOptionalParams, + VirtualMachineImagesEdgeZoneListSkusOptionalParams, + VirtualMachineImagesEdgeZoneListOffersOptionalParams, + VirtualMachineImagesEdgeZoneListPublishersOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/operations.ts new file mode 100644 index 000000000000..e67b00d76242 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/operations.ts @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineImageResource, + VirtualMachineImage, +} from "../../models/compute/models.js"; +import { + virtualMachineImageDeserializer, + virtualMachineImageResourceArrayDeserializer, +} from "../../models/compute/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VirtualMachineImagesEdgeZoneGetOptionalParams, + VirtualMachineImagesEdgeZoneListOptionalParams, + VirtualMachineImagesEdgeZoneListSkusOptionalParams, + VirtualMachineImagesEdgeZoneListOffersOptionalParams, + VirtualMachineImagesEdgeZoneListPublishersOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options: VirtualMachineImagesEdgeZoneGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}{?api%2Dversion}", + { + location: location, + edgeZone: edgeZone, + publisherName: publisherName, + offer: offer, + skus: skus, + version: version, + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageDeserializer(result.body); +} + +/** Gets a virtual machine image in an edge zone. */ +export async function get( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options: VirtualMachineImagesEdgeZoneGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + location, + edgeZone, + publisherName, + offer, + skus, + version, + options, + ); + return _getDeserialize(result); +} + +export function _listSend( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + options: VirtualMachineImagesEdgeZoneListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions{?api%2Dversion,%24expand,%24top,%24orderby}", + { + subscriptionId: context.subscriptionId, + location: location, + edgeZone: edgeZone, + publisherName: publisherName, + offer: offer, + skus: skus, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + "%24top": options?.top, + "%24orderby": options?.orderby, + }, + { + 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 { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. */ +export async function list( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + options: VirtualMachineImagesEdgeZoneListOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listSend(context, location, edgeZone, publisherName, offer, skus, options); + return _listDeserialize(result); +} + +export function _listSkusSend( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + offer: string, + options: VirtualMachineImagesEdgeZoneListSkusOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + edgeZone: edgeZone, + publisherName: publisherName, + offer: offer, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listSkusDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. */ +export async function listSkus( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + offer: string, + options: VirtualMachineImagesEdgeZoneListSkusOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listSkusSend(context, location, edgeZone, publisherName, offer, options); + return _listSkusDeserialize(result); +} + +export function _listOffersSend( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + options: VirtualMachineImagesEdgeZoneListOffersOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + edgeZone: edgeZone, + publisherName: publisherName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listOffersDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine image offers for the specified location, edge zone and publisher. */ +export async function listOffers( + context: Client, + location: string, + edgeZone: string, + publisherName: string, + options: VirtualMachineImagesEdgeZoneListOffersOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listOffersSend(context, location, edgeZone, publisherName, options); + return _listOffersDeserialize(result); +} + +export function _listPublishersSend( + context: Client, + location: string, + edgeZone: string, + options: VirtualMachineImagesEdgeZoneListPublishersOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + edgeZone: edgeZone, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listPublishersDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineImageResourceArrayDeserializer(result.body); +} + +/** Gets a list of virtual machine image publishers for the specified Azure location and edge zone. */ +export async function listPublishers( + context: Client, + location: string, + edgeZone: string, + options: VirtualMachineImagesEdgeZoneListPublishersOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listPublishersSend(context, location, edgeZone, options); + return _listPublishersDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/options.ts new file mode 100644 index 000000000000..72a49d821de8 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineImagesEdgeZone/options.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineImagesEdgeZoneGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineImagesEdgeZoneListOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; + /** An integer value specifying the number of images to return that matches supplied values. */ + top?: number; + /** Specifies the order of the results returned. Formatted as an OData query. */ + orderby?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineImagesEdgeZoneListSkusOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineImagesEdgeZoneListOffersOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineImagesEdgeZoneListPublishersOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/index.ts new file mode 100644 index 000000000000..bc9be93abd58 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + get, + list, + listByVirtualMachine, + $delete, + update, + createOrUpdate, + getByVirtualMachine, +} from "./operations.js"; +export type { + VirtualMachineRunCommandsGetOptionalParams, + VirtualMachineRunCommandsListOptionalParams, + VirtualMachineRunCommandsListByVirtualMachineOptionalParams, + VirtualMachineRunCommandsDeleteOptionalParams, + VirtualMachineRunCommandsUpdateOptionalParams, + VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/operations.ts new file mode 100644 index 000000000000..73bf15354397 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/operations.ts @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineRunCommand, + VirtualMachineRunCommandUpdate, + _VirtualMachineRunCommandsListResult, + _RunCommandListResult, + RunCommandDocumentBase, + RunCommandDocument, +} from "../../models/compute/models.js"; +import { + virtualMachineRunCommandSerializer, + virtualMachineRunCommandDeserializer, + virtualMachineRunCommandUpdateSerializer, + _virtualMachineRunCommandsListResultDeserializer, + _runCommandListResultDeserializer, + runCommandDocumentDeserializer, +} from "../../models/compute/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 { + VirtualMachineRunCommandsGetOptionalParams, + VirtualMachineRunCommandsListOptionalParams, + VirtualMachineRunCommandsListByVirtualMachineOptionalParams, + VirtualMachineRunCommandsDeleteOptionalParams, + VirtualMachineRunCommandsUpdateOptionalParams, + VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, +} 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 _getSend( + context: Client, + location: string, + commandId: string, + options: VirtualMachineRunCommandsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}{?api%2Dversion}", + { + location: location, + commandId: commandId, + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return runCommandDocumentDeserializer(result.body); +} + +/** Gets specific run command for a subscription in a location. */ +export async function get( + context: Client, + location: string, + commandId: string, + options: VirtualMachineRunCommandsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, commandId, options); + return _getDeserialize(result); +} + +export function _listSend( + context: Client, + location: string, + options: VirtualMachineRunCommandsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + 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<_RunCommandListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _runCommandListResultDeserializer(result.body); +} + +/** Lists all available run commands for a subscription in a location. */ +export function list( + context: Client, + location: string, + options: VirtualMachineRunCommandsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listByVirtualMachineSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachineRunCommandsListByVirtualMachineOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByVirtualMachineDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineRunCommandsListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineRunCommandsListResultDeserializer(result.body); +} + +/** The operation to get all run commands of a Virtual Machine. */ +export function listByVirtualMachine( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachineRunCommandsListByVirtualMachineOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByVirtualMachineSend(context, resourceGroupName, vmName, options), + _listByVirtualMachineDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmName: string, + runCommandName: string, + options: VirtualMachineRunCommandsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete the run command. */ +/** + * @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, + vmName: string, + runCommandName: string, + options: VirtualMachineRunCommandsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, vmName, runCommandName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options: VirtualMachineRunCommandsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineRunCommandUpdateSerializer(runCommand), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineRunCommandDeserializer(result.body); +} + +/** The operation to update the run command. */ +export function update( + context: Client, + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options: VirtualMachineRunCommandsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineRunCommand> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, vmName, runCommandName, runCommand, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineRunCommand>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options: VirtualMachineRunCommandsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineRunCommandSerializer(runCommand), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineRunCommandDeserializer(result.body); +} + +/** The operation to create or update the run command. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options: VirtualMachineRunCommandsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineRunCommand> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, vmName, runCommandName, runCommand, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineRunCommand>; +} + +export function _getByVirtualMachineSend( + context: Client, + resourceGroupName: string, + vmName: string, + runCommandName: string, + options: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getByVirtualMachineDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineRunCommandDeserializer(result.body); +} + +/** The operation to get the run command. */ +export async function getByVirtualMachine( + context: Client, + resourceGroupName: string, + vmName: string, + runCommandName: string, + options: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getByVirtualMachineSend( + context, + resourceGroupName, + vmName, + runCommandName, + options, + ); + return _getByVirtualMachineDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/options.ts new file mode 100644 index 000000000000..cea78208db79 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineRunCommands/options.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineRunCommandsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineRunCommandsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineRunCommandsListByVirtualMachineOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineRunCommandsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineRunCommandsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineRunCommandsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineRunCommandsGetByVirtualMachineOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/index.ts new file mode 100644 index 000000000000..5248290f5818 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + VirtualMachineScaleSetExtensionsListOptionalParams, + VirtualMachineScaleSetExtensionsDeleteOptionalParams, + VirtualMachineScaleSetExtensionsUpdateOptionalParams, + VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetExtensionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/operations.ts new file mode 100644 index 000000000000..8c1513c51171 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/operations.ts @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineScaleSetExtension, + VirtualMachineScaleSetExtensionUpdate, + _VirtualMachineScaleSetExtensionListResult, +} from "../../models/compute/models.js"; +import { + virtualMachineScaleSetExtensionSerializer, + virtualMachineScaleSetExtensionDeserializer, + virtualMachineScaleSetExtensionUpdateSerializer, + _virtualMachineScaleSetExtensionListResultDeserializer, +} from "../../models/compute/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 { + VirtualMachineScaleSetExtensionsListOptionalParams, + VirtualMachineScaleSetExtensionsDeleteOptionalParams, + VirtualMachineScaleSetExtensionsUpdateOptionalParams, + VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetExtensionsGetOptionalParams, +} 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 _listSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetExtensionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_VirtualMachineScaleSetExtensionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineScaleSetExtensionListResultDeserializer(result.body); +} + +/** Gets a list of all extensions in a VM scale set. */ +export function list( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetExtensionsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, vmScaleSetName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options: VirtualMachineScaleSetExtensionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + vmssExtensionName: vmssExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete the extension. */ +/** + * @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, + vmScaleSetName: string, + vmssExtensionName: string, + options: VirtualMachineScaleSetExtensionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, vmScaleSetName, vmssExtensionName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options: VirtualMachineScaleSetExtensionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + vmssExtensionName: vmssExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineScaleSetExtensionUpdateSerializer(extensionParameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetExtensionDeserializer(result.body); +} + +/** The operation to update an extension. */ +export function update( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options: VirtualMachineScaleSetExtensionsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineScaleSetExtension> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike< + OperationState, + VirtualMachineScaleSetExtension + >; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + vmssExtensionName: vmssExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineScaleSetExtensionSerializer(extensionParameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetExtensionDeserializer(result.body); +} + +/** The operation to create or update an extension. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineScaleSetExtension> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike< + OperationState, + VirtualMachineScaleSetExtension + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options: VirtualMachineScaleSetExtensionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + vmssExtensionName: vmssExtensionName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetExtensionDeserializer(result.body); +} + +/** The operation to get the extension. */ +export async function get( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options: VirtualMachineScaleSetExtensionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/options.ts new file mode 100644 index 000000000000..98e3bbf86e37 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetExtensions/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineScaleSetExtensionsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetExtensionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetExtensionsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetExtensionsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/index.ts new file mode 100644 index 000000000000..3f18749da10b --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, update, get } from "./operations.js"; +export type { + VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/operations.ts new file mode 100644 index 000000000000..fbbaa3c62185 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/operations.ts @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VMScaleSetLifecycleHookEvent, + VMScaleSetLifecycleHookEventUpdate, + _VMScaleSetLifecycleHookEventListResult, +} from "../../models/compute/models.js"; +import { + vmScaleSetLifecycleHookEventDeserializer, + vmScaleSetLifecycleHookEventUpdateSerializer, + _vmScaleSetLifecycleHookEventListResultDeserializer, +} from "../../models/compute/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 { + VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams, +} 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, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/lifecycleHookEvents{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_VMScaleSetLifecycleHookEventListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _vmScaleSetLifecycleHookEventListResultDeserializer(result.body); +} + +/** Gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. */ +export function list( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, vmScaleSetName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + properties: VMScaleSetLifecycleHookEventUpdate, + options: VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/lifecycleHookEvents/{lifecycleHookEventName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + lifecycleHookEventName: lifecycleHookEventName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: vmScaleSetLifecycleHookEventUpdateSerializer(properties), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return vmScaleSetLifecycleHookEventDeserializer(result.body); +} + +/** The operation to update a virtual machine scale set lifecycle hook event. */ +export async function update( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + properties: VMScaleSetLifecycleHookEventUpdate, + options: VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + vmScaleSetName, + lifecycleHookEventName, + properties, + options, + ); + return _updateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + options: VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/lifecycleHookEvents/{lifecycleHookEventName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + lifecycleHookEventName: lifecycleHookEventName, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return vmScaleSetLifecycleHookEventDeserializer(result.body); +} + +/** Gets a virtual machine scale set lifecycle hook event. */ +export async function get( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + options: VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + vmScaleSetName, + lifecycleHookEventName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/options.ts new file mode 100644 index 000000000000..a1e0966e93de --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetLifeCycleHookEvents/options.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/index.ts new file mode 100644 index 000000000000..eba4287268e0 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { getLatest, cancel, startOSUpgrade, startExtensionUpgrade } from "./operations.js"; +export type { + VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, + VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/operations.ts new file mode 100644 index 000000000000..2572c76204d2 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/operations.ts @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { RollingUpgradeStatusInfo } from "../../models/compute/models.js"; +import { rollingUpgradeStatusInfoDeserializer } from "../../models/compute/models.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, + VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, +} 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 _getLatestSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getLatestDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return rollingUpgradeStatusInfoDeserializer(result.body); +} + +/** Gets the status of the latest virtual machine scale set rolling upgrade. */ +export async function getLatest( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getLatestSend(context, resourceGroupName, vmScaleSetName, options); + return _getLatestDeserialize(result); +} + +export function _cancelSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Cancels the current virtual machine scale set rolling upgrade. */ +export function cancel( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _cancelDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _cancelSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _startOSUpgradeSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _startOSUpgradeDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. */ +export function startOSUpgrade( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller(context, _startOSUpgradeDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _startOSUpgradeSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _startExtensionUpgradeSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _startExtensionUpgradeDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. */ +export function startExtensionUpgrade( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller(context, _startExtensionUpgradeDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _startExtensionUpgradeSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/options.ts new file mode 100644 index 000000000000..74c2d8d8ac54 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetRollingUpgrades/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetRollingUpgradesCancelOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/index.ts new file mode 100644 index 000000000000..ecbf86288ef2 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + VirtualMachineScaleSetVMExtensionsListOptionalParams, + VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/operations.ts new file mode 100644 index 000000000000..89a8a10e8fff --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/operations.ts @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineScaleSetVMExtension, + VirtualMachineScaleSetVMExtensionUpdate, + VirtualMachineScaleSetVMExtensionsListResult, +} from "../../models/compute/models.js"; +import { + virtualMachineScaleSetVMExtensionSerializer, + virtualMachineScaleSetVMExtensionDeserializer, + virtualMachineScaleSetVMExtensionUpdateSerializer, + virtualMachineScaleSetVMExtensionsListResultDeserializer, +} from "../../models/compute/models.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + VirtualMachineScaleSetVMExtensionsListOptionalParams, + VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsGetOptionalParams, +} 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 _listSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMExtensionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetVMExtensionsListResultDeserializer(result.body); +} + +/** The operation to get all extensions of an instance in Virtual Machine Scaleset. */ +export async function list( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMExtensionsListOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listSend(context, resourceGroupName, vmScaleSetName, instanceId, options); + return _listDeserialize(result); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete the VMSS VM extension. */ +/** + * @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, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineScaleSetVMExtensionUpdateSerializer(extensionParameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetVMExtensionDeserializer(result.body); +} + +/** The operation to update the VMSS VM extension. */ +export function update( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + VirtualMachineScaleSetVMExtension +> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike< + OperationState, + VirtualMachineScaleSetVMExtension + >; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineScaleSetVMExtensionSerializer(extensionParameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetVMExtensionDeserializer(result.body); +} + +/** The operation to create or update the VMSS VM extension. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + VirtualMachineScaleSetVMExtension +> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike< + OperationState, + VirtualMachineScaleSetVMExtension + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options: VirtualMachineScaleSetVMExtensionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + vmExtensionName: vmExtensionName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetVMExtensionDeserializer(result.body); +} + +/** The operation to get the VMSS VM extension. */ +export async function get( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options: VirtualMachineScaleSetVMExtensionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/options.ts new file mode 100644 index 000000000000..94332c2ef714 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMExtensions/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMExtensionsListOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMExtensionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMExtensionsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMExtensionsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/index.ts new file mode 100644 index 000000000000..4a5978bd12e5 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + VirtualMachineScaleSetVMRunCommandsListOptionalParams, + VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/operations.ts new file mode 100644 index 000000000000..408db187c163 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/operations.ts @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineRunCommand, + VirtualMachineRunCommandUpdate, + _VirtualMachineRunCommandsListResult, +} from "../../models/compute/models.js"; +import { + virtualMachineRunCommandSerializer, + virtualMachineRunCommandDeserializer, + virtualMachineRunCommandUpdateSerializer, + _virtualMachineRunCommandsListResultDeserializer, +} from "../../models/compute/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 { + VirtualMachineScaleSetVMRunCommandsListOptionalParams, + VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsGetOptionalParams, +} 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 _listSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMRunCommandsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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<_VirtualMachineRunCommandsListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineRunCommandsListResultDeserializer(result.body); +} + +/** The operation to get all run commands of an instance in Virtual Machine Scaleset. */ +export function list( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMRunCommandsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete the VMSS VM run command. */ +/** + * @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, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, vmScaleSetName, instanceId, runCommandName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineRunCommandUpdateSerializer(runCommand), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineRunCommandDeserializer(result.body); +} + +/** The operation to update the VMSS VM run command. */ +export function update( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineRunCommand> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineRunCommand>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineRunCommandSerializer(runCommand), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineRunCommandDeserializer(result.body); +} + +/** The operation to create or update the VMSS VM run command. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineRunCommand> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineRunCommand>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options: VirtualMachineScaleSetVMRunCommandsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + runCommandName: runCommandName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineRunCommandDeserializer(result.body); +} + +/** The operation to get the VMSS VM run command. */ +export async function get( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options: VirtualMachineScaleSetVMRunCommandsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/options.ts new file mode 100644 index 000000000000..1ddd3eaaa6bf --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMRunCommands/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMRunCommandsListOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMRunCommandsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. */ + expand?: string; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/index.ts new file mode 100644 index 000000000000..fca4072c6d8c --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/index.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + runCommand, + start, + retrieveBootDiagnosticsData, + restart, + redeploy, + powerOff, + performMaintenance, + attachDetachDataDisks, + simulateEviction, + reimageAll, + reimage, + getInstanceView, + deallocate, + approveRollingUpgrade, + list, + $delete, + update, + get, +} from "./operations.js"; +export type { + VirtualMachineScaleSetVMsRunCommandOptionalParams, + VirtualMachineScaleSetVMsStartOptionalParams, + VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachineScaleSetVMsRestartOptionalParams, + VirtualMachineScaleSetVMsRedeployOptionalParams, + VirtualMachineScaleSetVMsPowerOffOptionalParams, + VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, + VirtualMachineScaleSetVMsReimageAllOptionalParams, + VirtualMachineScaleSetVMsReimageOptionalParams, + VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, + VirtualMachineScaleSetVMsDeallocateOptionalParams, + VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetVMsListOptionalParams, + VirtualMachineScaleSetVMsDeleteOptionalParams, + VirtualMachineScaleSetVMsUpdateOptionalParams, + VirtualMachineScaleSetVMsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/operations.ts new file mode 100644 index 000000000000..077676ca41fc --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/operations.ts @@ -0,0 +1,1081 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + StorageProfile, + AttachDetachDataDisksRequest, + RetrieveBootDiagnosticsDataResult, + RunCommandInput, + RunCommandResult, + VirtualMachineScaleSetVM, + VirtualMachineScaleSetVMInstanceView, + _VirtualMachineScaleSetVMListResult, +} from "../../models/compute/models.js"; +import { + virtualMachineScaleSetVMReimageParametersSerializer, + storageProfileDeserializer, + attachDetachDataDisksRequestSerializer, + retrieveBootDiagnosticsDataResultDeserializer, + runCommandInputSerializer, + runCommandResultDeserializer, + virtualMachineScaleSetVMSerializer, + virtualMachineScaleSetVMDeserializer, + virtualMachineScaleSetVMInstanceViewDeserializer, + _virtualMachineScaleSetVMListResultDeserializer, +} from "../../models/compute/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 { + VirtualMachineScaleSetVMsRunCommandOptionalParams, + VirtualMachineScaleSetVMsStartOptionalParams, + VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachineScaleSetVMsRestartOptionalParams, + VirtualMachineScaleSetVMsRedeployOptionalParams, + VirtualMachineScaleSetVMsPowerOffOptionalParams, + VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, + VirtualMachineScaleSetVMsReimageAllOptionalParams, + VirtualMachineScaleSetVMsReimageOptionalParams, + VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, + VirtualMachineScaleSetVMsDeallocateOptionalParams, + VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetVMsListOptionalParams, + VirtualMachineScaleSetVMsDeleteOptionalParams, + VirtualMachineScaleSetVMsUpdateOptionalParams, + VirtualMachineScaleSetVMsGetOptionalParams, +} 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 _runCommandSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options: VirtualMachineScaleSetVMsRunCommandOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommand{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: runCommandInputSerializer(parameters), + }); +} + +export async function _runCommandDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return runCommandResultDeserializer(result.body); +} + +/** Run command on a virtual machine in a VM scale set. */ +export function runCommand( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options: VirtualMachineScaleSetVMsRunCommandOptionalParams = { requestOptions: {} }, +): PollerLike, RunCommandResult> { + return getLongRunningPoller(context, _runCommandDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _runCommandSend(context, resourceGroupName, vmScaleSetName, instanceId, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, RunCommandResult>; +} + +export function _startSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsStartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/start{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _startDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Starts a virtual machine in a VM scale set. */ +export function start( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsStartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _startDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _startSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _retrieveBootDiagnosticsDataSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/retrieveBootDiagnosticsData{?api%2Dversion,sasUriExpirationTimeInMinutes}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + sasUriExpirationTimeInMinutes: options?.sasUriExpirationTimeInMinutes, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _retrieveBootDiagnosticsDataDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return retrieveBootDiagnosticsDataResultDeserializer(result.body); +} + +/** The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. */ +export async function retrieveBootDiagnosticsData( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _retrieveBootDiagnosticsDataSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + options, + ); + return _retrieveBootDiagnosticsDataDeserialize(result); +} + +export function _restartSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsRestartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/restart{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _restartDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Restarts a virtual machine in a VM scale set. */ +export function restart( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsRestartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _restartDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _restartSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _redeploySend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsRedeployOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/redeploy{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _redeployDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. */ +export function redeploy( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsRedeployOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _redeployDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _redeploySend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _powerOffSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsPowerOffOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/powerOff{?api%2Dversion,skipShutdown}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + skipShutdown: options?.skipShutdown, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _powerOffDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. */ +export function powerOff( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsPowerOffOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _powerOffDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _powerOffSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _performMaintenanceSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/performMaintenance{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _performMaintenanceDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Performs maintenance on a virtual machine in a VM scale set. */ +export function performMaintenance( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _performMaintenanceDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _performMaintenanceSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _attachDetachDataDisksSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/attachDetachDataDisks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: attachDetachDataDisksRequestSerializer(parameters), + }); +} + +export async function _attachDetachDataDisksDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return storageProfileDeserializer(result.body); +} + +/** Attach and detach data disks to/from a virtual machine in a VM scale set. */ +export function attachDetachDataDisks( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams = { requestOptions: {} }, +): PollerLike, StorageProfile> { + return getLongRunningPoller(context, _attachDetachDataDisksDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _attachDetachDataDisksSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, StorageProfile>; +} + +export function _simulateEvictionSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _simulateEvictionDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to simulate the eviction of spot virtual machine in a VM scale set. */ +export async function simulateEviction( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _simulateEvictionSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + options, + ); + return _simulateEvictionDeserialize(result); +} + +export function _reimageAllSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsReimageAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _reimageAllDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. */ +export function reimageAll( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsReimageAllOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reimageAllDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _reimageAllSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _reimageSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsReimageOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmScaleSetVMReimageInput"] + ? options["vmScaleSetVMReimageInput"] + : virtualMachineScaleSetVMReimageParametersSerializer(options["vmScaleSetVMReimageInput"]), + }); +} + +export async function _reimageDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. */ +export function reimage( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsReimageOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reimageDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _reimageSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _getInstanceViewSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getInstanceViewDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetVMInstanceViewDeserializer(result.body); +} + +/** Gets the status of a virtual machine from a VM scale set. */ +export async function getInstanceView( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getInstanceViewSend( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + options, + ); + return _getInstanceViewDeserialize(result); +} + +export function _deallocateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsDeallocateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _deallocateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. */ +export function deallocate( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsDeallocateOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _deallocateDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _deallocateSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _approveRollingUpgradeSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/approveRollingUpgrade{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _approveRollingUpgradeDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. */ +export function approveRollingUpgrade( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _approveRollingUpgradeDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _approveRollingUpgradeSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _listSend( + context: Client, + resourceGroupName: string, + virtualMachineScaleSetName: string, + options: VirtualMachineScaleSetVMsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines{?api%2Dversion,%24filter,%24select,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + virtualMachineScaleSetName: virtualMachineScaleSetName, + "api%2Dversion": "2025-11-01", + "%24filter": options?.filter, + "%24select": options?.select, + "%24expand": options?.expand, + }, + { + 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<_VirtualMachineScaleSetVMListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineScaleSetVMListResultDeserializer(result.body); +} + +/** Gets a list of all virtual machines in a VM scale sets. */ +export function list( + context: Client, + resourceGroupName: string, + virtualMachineScaleSetName: string, + options: VirtualMachineScaleSetVMsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, virtualMachineScaleSetName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}{?api%2Dversion,forceDeletion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + forceDeletion: options?.forceDeletion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes a virtual machine from a VM scale set. */ +/** + * @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, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, vmScaleSetName, instanceId, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options: VirtualMachineScaleSetVMsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + ...(options?.ifNoneMatch !== undefined ? { "if-none-match": options?.ifNoneMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualMachineScaleSetVMSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetVMDeserializer(result.body); +} + +/** Updates a virtual machine of a VM scale set. */ +export function update( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options: VirtualMachineScaleSetVMsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineScaleSetVM> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, vmScaleSetName, instanceId, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineScaleSetVM>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + instanceId: instanceId, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetVMDeserializer(result.body); +} + +/** Gets a virtual machine from a VM scale set. */ +export async function get( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options: VirtualMachineScaleSetVMsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, vmScaleSetName, instanceId, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/options.ts new file mode 100644 index 000000000000..d78b941750bb --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSetVMs/options.ts @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + VirtualMachineScaleSetVMReimageParameters, + InstanceViewTypes, +} from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsRunCommandOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsStartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams extends OperationOptions { + /** Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. */ + sasUriExpirationTimeInMinutes?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsRestartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsRedeployOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsPowerOffOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified */ + skipShutdown?: boolean; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsSimulateEvictionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsReimageAllOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsReimageOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Parameters for the Reimaging Virtual machine in ScaleSet. */ + vmScaleSetVMReimageInput?: VirtualMachineScaleSetVMReimageParameters; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsGetInstanceViewOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsDeallocateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsListOptionalParams extends OperationOptions { + /** The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. */ + filter?: string; + /** The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. */ + select?: string; + /** The expand expression to apply to the operation. Allowed values are 'instanceView'. */ + expand?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) */ + forceDeletion?: boolean; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ + ifNoneMatch?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetVMsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. */ + expand?: InstanceViewTypes; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/index.ts new file mode 100644 index 000000000000..d21fda670fe0 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/index.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listByLocation, + scaleOut, + start, + listSkus, + setOrchestrationServiceState, + restart, + reimageAll, + reimage, + redeploy, + reapply, + powerOff, + performMaintenance, + getOSUpgradeHistory, + updateInstances, + getInstanceView, + forceRecoveryServiceFabricPlatformUpdateDomainWalk, + deleteInstances, + deallocate, + convertToSinglePlacementGroup, + approveRollingUpgrade, + listAll, + list, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + VirtualMachineScaleSetsListByLocationOptionalParams, + VirtualMachineScaleSetsScaleOutOptionalParams, + VirtualMachineScaleSetsStartOptionalParams, + VirtualMachineScaleSetsListSkusOptionalParams, + VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + VirtualMachineScaleSetsRestartOptionalParams, + VirtualMachineScaleSetsReimageAllOptionalParams, + VirtualMachineScaleSetsReimageOptionalParams, + VirtualMachineScaleSetsRedeployOptionalParams, + VirtualMachineScaleSetsReapplyOptionalParams, + VirtualMachineScaleSetsPowerOffOptionalParams, + VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, + VirtualMachineScaleSetsUpdateInstancesOptionalParams, + VirtualMachineScaleSetsGetInstanceViewOptionalParams, + VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, + VirtualMachineScaleSetsDeleteInstancesOptionalParams, + VirtualMachineScaleSetsDeallocateOptionalParams, + VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, + VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetsListAllOptionalParams, + VirtualMachineScaleSetsListOptionalParams, + VirtualMachineScaleSetsDeleteOptionalParams, + VirtualMachineScaleSetsUpdateOptionalParams, + VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/operations.ts new file mode 100644 index 000000000000..4050fb3a2932 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/operations.ts @@ -0,0 +1,1531 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachineScaleSet, + VirtualMachineScaleSetUpdate, + _VirtualMachineScaleSetListResult, + _VirtualMachineScaleSetListWithLinkResult, + VMScaleSetConvertToSinglePlacementGroupInput, + VirtualMachineScaleSetVMInstanceRequiredIDs, + RecoveryWalkResponse, + VirtualMachineScaleSetInstanceView, + _VirtualMachineScaleSetListOSUpgradeHistory, + UpgradeOperationHistoricalStatusInfo, + OrchestrationServiceStateInput, + _VirtualMachineScaleSetListSkusResult, + VirtualMachineScaleSetSku, + VMScaleSetScaleOutInput, +} from "../../models/compute/models.js"; +import { + virtualMachineScaleSetSerializer, + virtualMachineScaleSetDeserializer, + virtualMachineScaleSetUpdateSerializer, + _virtualMachineScaleSetListResultDeserializer, + _virtualMachineScaleSetListWithLinkResultDeserializer, + virtualMachineScaleSetVMInstanceIDsSerializer, + vmScaleSetConvertToSinglePlacementGroupInputSerializer, + virtualMachineScaleSetVMInstanceRequiredIDsSerializer, + recoveryWalkResponseDeserializer, + virtualMachineScaleSetInstanceViewDeserializer, + _virtualMachineScaleSetListOSUpgradeHistoryDeserializer, + virtualMachineScaleSetReimageParametersSerializer, + orchestrationServiceStateInputSerializer, + _virtualMachineScaleSetListSkusResultDeserializer, + vmScaleSetScaleOutInputSerializer, +} from "../../models/compute/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 { + VirtualMachineScaleSetsListByLocationOptionalParams, + VirtualMachineScaleSetsScaleOutOptionalParams, + VirtualMachineScaleSetsStartOptionalParams, + VirtualMachineScaleSetsListSkusOptionalParams, + VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + VirtualMachineScaleSetsRestartOptionalParams, + VirtualMachineScaleSetsReimageAllOptionalParams, + VirtualMachineScaleSetsReimageOptionalParams, + VirtualMachineScaleSetsRedeployOptionalParams, + VirtualMachineScaleSetsReapplyOptionalParams, + VirtualMachineScaleSetsPowerOffOptionalParams, + VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, + VirtualMachineScaleSetsUpdateInstancesOptionalParams, + VirtualMachineScaleSetsGetInstanceViewOptionalParams, + VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, + VirtualMachineScaleSetsDeleteInstancesOptionalParams, + VirtualMachineScaleSetsDeallocateOptionalParams, + VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, + VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetsListAllOptionalParams, + VirtualMachineScaleSetsListOptionalParams, + VirtualMachineScaleSetsDeleteOptionalParams, + VirtualMachineScaleSetsUpdateOptionalParams, + VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetsGetOptionalParams, +} 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 _listByLocationSend( + context: Client, + location: string, + options: VirtualMachineScaleSetsListByLocationOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByLocationDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineScaleSetListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineScaleSetListResultDeserializer(result.body); +} + +/** Gets all the VM scale sets under the specified subscription for the specified location. */ +export function listByLocation( + context: Client, + location: string, + options: VirtualMachineScaleSetsListByLocationOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByLocationSend(context, location, options), + _listByLocationDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _scaleOutSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options: VirtualMachineScaleSetsScaleOutOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/scaleOut{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: vmScaleSetScaleOutInputSerializer(parameters), + }); +} + +export async function _scaleOutDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Scales out one or more virtual machines in a VM scale set. */ +export function scaleOut( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options: VirtualMachineScaleSetsScaleOutOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _scaleOutDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _scaleOutSend(context, resourceGroupName, vmScaleSetName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _startSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsStartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _startDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Starts one or more virtual machines in a VM scale set. */ +export function start( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsStartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _startDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _startSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _listSkusSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsListSkusOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listSkusDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineScaleSetListSkusResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineScaleSetListSkusResultDeserializer(result.body); +} + +/** Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. */ +export function listSkus( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsListSkusOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSkusSend(context, resourceGroupName, vmScaleSetName, options), + _listSkusDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _setOrchestrationServiceStateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: orchestrationServiceStateInputSerializer(parameters), + }); +} + +export async function _setOrchestrationServiceStateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Changes ServiceState property for a given service */ +export function setOrchestrationServiceState( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _setOrchestrationServiceStateDeserialize, + ["202", "200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _setOrchestrationServiceStateSend( + context, + resourceGroupName, + vmScaleSetName, + parameters, + options, + ), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }, + ) as PollerLike, void>; +} + +export function _restartSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsRestartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _restartDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Restarts one or more virtual machines in a VM scale set. */ +export function restart( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsRestartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _restartDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _restartSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _reimageAllSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsReimageAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _reimageAllDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. */ +export function reimageAll( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsReimageAllOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reimageAllDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _reimageAllSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _reimageSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsReimageOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmScaleSetReimageInput"] + ? options["vmScaleSetReimageInput"] + : virtualMachineScaleSetReimageParametersSerializer(options["vmScaleSetReimageInput"]), + }); +} + +export async function _reimageDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. */ +export function reimage( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsReimageOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reimageDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _reimageSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _redeploySend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsRedeployOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _redeployDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. */ +export function redeploy( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsRedeployOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _redeployDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _redeploySend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _reapplySend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsReapplyOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _reapplyDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances */ +export function reapply( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsReapplyOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reapplyDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _reapplySend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _powerOffSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsPowerOffOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff{?api%2Dversion,skipShutdown}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + skipShutdown: options?.skipShutdown, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _powerOffDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. */ +export function powerOff( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsPowerOffOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _powerOffDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _powerOffSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _performMaintenanceSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsPerformMaintenanceOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _performMaintenanceDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications */ +export function performMaintenance( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsPerformMaintenanceOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _performMaintenanceDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _performMaintenanceSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _getOSUpgradeHistorySend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getOSUpgradeHistoryDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineScaleSetListOSUpgradeHistory> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineScaleSetListOSUpgradeHistoryDeserializer(result.body); +} + +/** Gets list of OS upgrades on a VM scale set instance. */ +export function getOSUpgradeHistory( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _getOSUpgradeHistorySend(context, resourceGroupName, vmScaleSetName, options), + _getOSUpgradeHistoryDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _updateInstancesSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options: VirtualMachineScaleSetsUpdateInstancesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: virtualMachineScaleSetVMInstanceRequiredIDsSerializer(vmInstanceIDs), + }); +} + +export async function _updateInstancesDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. */ +export function updateInstances( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options: VirtualMachineScaleSetsUpdateInstancesOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _updateInstancesDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateInstancesSend(context, resourceGroupName, vmScaleSetName, vmInstanceIDs, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _getInstanceViewSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsGetInstanceViewOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getInstanceViewDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetInstanceViewDeserializer(result.body); +} + +/** Gets the status of a VM scale set instance. */ +export async function getInstanceView( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsGetInstanceViewOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getInstanceViewSend(context, resourceGroupName, vmScaleSetName, options); + return _getInstanceViewDeserialize(result); +} + +export function _forceRecoveryServiceFabricPlatformUpdateDomainWalkSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + platformUpdateDomain: number, + options: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk{?api%2Dversion,platformUpdateDomain,zone,placementGroupId}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + platformUpdateDomain: platformUpdateDomain, + zone: options?.zone, + placementGroupId: options?.placementGroupId, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _forceRecoveryServiceFabricPlatformUpdateDomainWalkDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return recoveryWalkResponseDeserializer(result.body); +} + +/** Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. */ +export async function forceRecoveryServiceFabricPlatformUpdateDomainWalk( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + platformUpdateDomain: number, + options: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _forceRecoveryServiceFabricPlatformUpdateDomainWalkSend( + context, + resourceGroupName, + vmScaleSetName, + platformUpdateDomain, + options, + ); + return _forceRecoveryServiceFabricPlatformUpdateDomainWalkDeserialize(result); +} + +export function _deleteInstancesSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options: VirtualMachineScaleSetsDeleteInstancesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete{?api%2Dversion,forceDeletion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + forceDeletion: options?.forceDeletion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: virtualMachineScaleSetVMInstanceRequiredIDsSerializer(vmInstanceIDs), + }); +} + +export async function _deleteInstancesDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes virtual machines in a VM scale set. */ +export function deleteInstances( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options: VirtualMachineScaleSetsDeleteInstancesOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _deleteInstancesDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _deleteInstancesSend(context, resourceGroupName, vmScaleSetName, vmInstanceIDs, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _deallocateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsDeallocateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate{?api%2Dversion,hibernate}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + hibernate: options?.hibernate, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _deallocateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. */ +export function deallocate( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsDeallocateOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _deallocateDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _deallocateSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _convertToSinglePlacementGroupSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetConvertToSinglePlacementGroupInput, + options: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: vmScaleSetConvertToSinglePlacementGroupInputSerializer(parameters), + }); +} + +export async function _convertToSinglePlacementGroupDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Converts SinglePlacementGroup property to false for a existing virtual machine scale set. */ +export async function convertToSinglePlacementGroup( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetConvertToSinglePlacementGroupInput, + options: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _convertToSinglePlacementGroupSend( + context, + resourceGroupName, + vmScaleSetName, + parameters, + options, + ); + return _convertToSinglePlacementGroupDeserialize(result); +} + +export function _approveRollingUpgradeSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/approveRollingUpgrade{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["vmInstanceIDs"] + ? options["vmInstanceIDs"] + : virtualMachineScaleSetVMInstanceIDsSerializer(options["vmInstanceIDs"]), + }); +} + +export async function _approveRollingUpgradeDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. */ +export function approveRollingUpgrade( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _approveRollingUpgradeDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _approveRollingUpgradeSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _listAllSend( + context: Client, + options: VirtualMachineScaleSetsListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineScaleSetListWithLinkResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineScaleSetListWithLinkResultDeserializer(result.body); +} + +/** Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. */ +export function listAll( + context: Client, + options: VirtualMachineScaleSetsListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listSend( + context: Client, + resourceGroupName: string, + options: VirtualMachineScaleSetsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + }, + { + 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<_VirtualMachineScaleSetListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineScaleSetListResultDeserializer(result.body); +} + +/** Gets a list of all VM scale sets under a resource group. */ +export function list( + context: Client, + resourceGroupName: string, + options: VirtualMachineScaleSetsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}{?api%2Dversion,forceDeletion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + forceDeletion: options?.forceDeletion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes a VM scale set. */ +/** + * @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, + vmScaleSetName: string, + options: VirtualMachineScaleSetsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, vmScaleSetName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options: VirtualMachineScaleSetsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + ...(options?.ifNoneMatch !== undefined ? { "if-none-match": options?.ifNoneMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualMachineScaleSetUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetDeserializer(result.body); +} + +/** Update a VM scale set. */ +export function update( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options: VirtualMachineScaleSetsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineScaleSet> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, vmScaleSetName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineScaleSet>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options: VirtualMachineScaleSetsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + ...(options?.ifNoneMatch !== undefined ? { "if-none-match": options?.ifNoneMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualMachineScaleSetSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetDeserializer(result.body); +} + +/** Create or update a VM scale set. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options: VirtualMachineScaleSetsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineScaleSet> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, vmScaleSetName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineScaleSet>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmScaleSetName: vmScaleSetName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineScaleSetDeserializer(result.body); +} + +/** Display information about a virtual machine scale set. */ +export async function get( + context: Client, + resourceGroupName: string, + vmScaleSetName: string, + options: VirtualMachineScaleSetsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, vmScaleSetName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/options.ts new file mode 100644 index 000000000000..e8d587af229e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineScaleSets/options.ts @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + VirtualMachineScaleSetVMInstanceIDs, + VirtualMachineScaleSetReimageParameters, + ExpandTypesForGetVMScaleSets, +} from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsListByLocationOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsScaleOutOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsStartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsListSkusOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsRestartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsReimageAllOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsReimageOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Parameters for Reimaging VM ScaleSet. */ + vmScaleSetReimageInput?: VirtualMachineScaleSetReimageParameters; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsRedeployOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsReapplyOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsPowerOffOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified */ + skipShutdown?: boolean; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsPerformMaintenanceOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsUpdateInstancesOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsGetInstanceViewOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams extends OperationOptions { + /** The zone in which the manual recovery walk is requested for cross zone virtual machine scale set */ + zone?: string; + /** The placement group id for which the manual recovery walk is requested. */ + placementGroupId?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsDeleteInstancesOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) */ + forceDeletion?: boolean; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsDeallocateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible OrchestrationMode only) */ + hibernate?: boolean; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A list of virtual machine instance IDs from the VM scale set. */ + vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsListAllOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional parameter to force delete a VM scale set. (Feature in Preview) */ + forceDeletion?: boolean; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ + ifNoneMatch?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ + ifNoneMatch?: string; +} + +/** Optional parameters. */ +export interface VirtualMachineScaleSetsGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was provided by the user during the VM scale set Create/Update operation */ + expand?: ExpandTypesForGetVMScaleSets; +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineSizes/index.ts b/sdk/compute/arm-compute/src/api/virtualMachineSizes/index.ts new file mode 100644 index 000000000000..2441076f2c5d --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineSizes/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export type { VirtualMachineSizesListOptionalParams } from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachineSizes/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachineSizes/operations.ts new file mode 100644 index 000000000000..fc2137de1fcd --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineSizes/operations.ts @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + _VirtualMachineSizeListResult, + VirtualMachineSize, +} from "../../models/compute/models.js"; +import { _virtualMachineSizeListResultDeserializer } from "../../models/compute/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 { VirtualMachineSizesListOptionalParams } 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, + location: string, + options: VirtualMachineSizesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + 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<_VirtualMachineSizeListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineSizeListResultDeserializer(result.body); +} + +/** This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) */ +export function list( + context: Client, + location: string, + options: VirtualMachineSizesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachineSizes/options.ts b/sdk/compute/arm-compute/src/api/virtualMachineSizes/options.ts new file mode 100644 index 000000000000..5d7a72fb3e2d --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachineSizes/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 VirtualMachineSizesListOptionalParams extends OperationOptions {} diff --git a/sdk/compute/arm-compute/src/api/virtualMachines/index.ts b/sdk/compute/arm-compute/src/api/virtualMachines/index.ts new file mode 100644 index 000000000000..5b62650413c4 --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachines/index.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listByLocation, + migrateToVMScaleSet, + runCommand, + listAvailableSizes, + start, + simulateEviction, + retrieveBootDiagnosticsData, + restart, + reimage, + redeploy, + reapply, + powerOff, + performMaintenance, + instanceView, + installPatches, + generalize, + deallocate, + convertToManagedDisks, + capture, + attachDetachDataDisks, + assessPatches, + listAll, + list, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + VirtualMachinesListByLocationOptionalParams, + VirtualMachinesMigrateToVMScaleSetOptionalParams, + VirtualMachinesRunCommandOptionalParams, + VirtualMachinesListAvailableSizesOptionalParams, + VirtualMachinesStartOptionalParams, + VirtualMachinesSimulateEvictionOptionalParams, + VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachinesRestartOptionalParams, + VirtualMachinesReimageOptionalParams, + VirtualMachinesRedeployOptionalParams, + VirtualMachinesReapplyOptionalParams, + VirtualMachinesPowerOffOptionalParams, + VirtualMachinesPerformMaintenanceOptionalParams, + VirtualMachinesInstanceViewOptionalParams, + VirtualMachinesInstallPatchesOptionalParams, + VirtualMachinesGeneralizeOptionalParams, + VirtualMachinesDeallocateOptionalParams, + VirtualMachinesConvertToManagedDisksOptionalParams, + VirtualMachinesCaptureOptionalParams, + VirtualMachinesAttachDetachDataDisksOptionalParams, + VirtualMachinesAssessPatchesOptionalParams, + VirtualMachinesListAllOptionalParams, + VirtualMachinesListOptionalParams, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/compute/arm-compute/src/api/virtualMachines/operations.ts b/sdk/compute/arm-compute/src/api/virtualMachines/operations.ts new file mode 100644 index 000000000000..d5930d73d59e --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachines/operations.ts @@ -0,0 +1,1519 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext as Client } from "../index.js"; +import { cloudErrorDeserializer } from "../../models/common/models.js"; +import type { + VirtualMachine, + StorageProfile, + VirtualMachineInstanceView, + VirtualMachineUpdate, + _VirtualMachineListResult, + VirtualMachineAssessPatchesResult, + AttachDetachDataDisksRequest, + VirtualMachineCaptureParameters, + VirtualMachineCaptureResult, + VirtualMachineInstallPatchesParameters, + VirtualMachineInstallPatchesResult, + RetrieveBootDiagnosticsDataResult, + _VirtualMachineSizeListResult, + VirtualMachineSize, + RunCommandInput, + RunCommandResult, +} from "../../models/compute/models.js"; +import { + virtualMachineReimageParametersSerializer, + virtualMachineSerializer, + virtualMachineDeserializer, + storageProfileDeserializer, + virtualMachineInstanceViewDeserializer, + virtualMachineUpdateSerializer, + _virtualMachineListResultDeserializer, + virtualMachineAssessPatchesResultDeserializer, + attachDetachDataDisksRequestSerializer, + virtualMachineCaptureParametersSerializer, + virtualMachineCaptureResultDeserializer, + virtualMachineInstallPatchesParametersSerializer, + virtualMachineInstallPatchesResultDeserializer, + retrieveBootDiagnosticsDataResultDeserializer, + _virtualMachineSizeListResultDeserializer, + runCommandInputSerializer, + runCommandResultDeserializer, + migrateVMToVirtualMachineScaleSetInputSerializer, +} from "../../models/compute/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 { + VirtualMachinesListByLocationOptionalParams, + VirtualMachinesMigrateToVMScaleSetOptionalParams, + VirtualMachinesRunCommandOptionalParams, + VirtualMachinesListAvailableSizesOptionalParams, + VirtualMachinesStartOptionalParams, + VirtualMachinesSimulateEvictionOptionalParams, + VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachinesRestartOptionalParams, + VirtualMachinesReimageOptionalParams, + VirtualMachinesRedeployOptionalParams, + VirtualMachinesReapplyOptionalParams, + VirtualMachinesPowerOffOptionalParams, + VirtualMachinesPerformMaintenanceOptionalParams, + VirtualMachinesInstanceViewOptionalParams, + VirtualMachinesInstallPatchesOptionalParams, + VirtualMachinesGeneralizeOptionalParams, + VirtualMachinesDeallocateOptionalParams, + VirtualMachinesConvertToManagedDisksOptionalParams, + VirtualMachinesCaptureOptionalParams, + VirtualMachinesAttachDetachDataDisksOptionalParams, + VirtualMachinesAssessPatchesOptionalParams, + VirtualMachinesListAllOptionalParams, + VirtualMachinesListOptionalParams, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesGetOptionalParams, +} 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 _listByLocationSend( + context: Client, + location: string, + options: VirtualMachinesListByLocationOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByLocationDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineListResultDeserializer(result.body); +} + +/** Gets all the virtual machines under the specified subscription for the specified location. */ +export function listByLocation( + context: Client, + location: string, + options: VirtualMachinesListByLocationOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByLocationSend(context, location, options), + _listByLocationDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _migrateToVMScaleSetSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesMigrateToVMScaleSetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/migrateToVirtualMachineScaleSet{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["parameters"] + ? options["parameters"] + : migrateVMToVirtualMachineScaleSetInputSerializer(options["parameters"]), + }); +} + +export async function _migrateToVMScaleSetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. */ +export function migrateToVMScaleSet( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesMigrateToVMScaleSetOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _migrateToVMScaleSetDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _migrateToVMScaleSetSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _runCommandSend( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options: VirtualMachinesRunCommandOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: runCommandInputSerializer(parameters), + }); +} + +export async function _runCommandDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return runCommandResultDeserializer(result.body); +} + +/** Run command on the VM. */ +export function runCommand( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options: VirtualMachinesRunCommandOptionalParams = { requestOptions: {} }, +): PollerLike, RunCommandResult> { + return getLongRunningPoller(context, _runCommandDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _runCommandSend(context, resourceGroupName, vmName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, RunCommandResult>; +} + +export function _listAvailableSizesSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesListAvailableSizesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAvailableSizesDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineSizeListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineSizeListResultDeserializer(result.body); +} + +/** Lists all available virtual machine sizes to which the specified virtual machine can be resized. */ +export function listAvailableSizes( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesListAvailableSizesOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAvailableSizesSend(context, resourceGroupName, vmName, options), + _listAvailableSizesDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _startSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesStartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _startDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to start a virtual machine. */ +export function start( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesStartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _startDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _startSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _simulateEvictionSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesSimulateEvictionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _simulateEvictionDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to simulate the eviction of spot virtual machine. */ +export async function simulateEviction( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesSimulateEvictionOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _simulateEvictionSend(context, resourceGroupName, vmName, options); + return _simulateEvictionDeserialize(result); +} + +export function _retrieveBootDiagnosticsDataSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData{?api%2Dversion,sasUriExpirationTimeInMinutes}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + sasUriExpirationTimeInMinutes: options?.sasUriExpirationTimeInMinutes, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _retrieveBootDiagnosticsDataDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return retrieveBootDiagnosticsDataResultDeserializer(result.body); +} + +/** The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. */ +export async function retrieveBootDiagnosticsData( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _retrieveBootDiagnosticsDataSend( + context, + resourceGroupName, + vmName, + options, + ); + return _retrieveBootDiagnosticsDataDeserialize(result); +} + +export function _restartSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesRestartOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _restartDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to restart a virtual machine. */ +export function restart( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesRestartOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _restartDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _restartSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _reimageSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesReimageOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: !options["parameters"] + ? options["parameters"] + : virtualMachineReimageParametersSerializer(options["parameters"]), + }); +} + +export async function _reimageDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. */ +export function reimage( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesReimageOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reimageDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _reimageSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _redeploySend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesRedeployOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _redeployDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Shuts down the virtual machine, moves it to a new node, and powers it back on. */ +export function redeploy( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesRedeployOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _redeployDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _redeploySend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _reapplySend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesReapplyOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _reapplyDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to reapply a virtual machine's state. */ +export function reapply( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesReapplyOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reapplyDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _reapplySend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _powerOffSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesPowerOffOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff{?api%2Dversion,skipShutdown}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + skipShutdown: options?.skipShutdown, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _powerOffDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. */ +export function powerOff( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesPowerOffOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _powerOffDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _powerOffSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _performMaintenanceSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesPerformMaintenanceOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _performMaintenanceDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to perform maintenance on a virtual machine. */ +export function performMaintenance( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesPerformMaintenanceOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _performMaintenanceDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _performMaintenanceSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _instanceViewSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesInstanceViewOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _instanceViewDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineInstanceViewDeserializer(result.body); +} + +/** Retrieves information about the run-time state of a virtual machine. */ +export async function instanceView( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesInstanceViewOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _instanceViewSend(context, resourceGroupName, vmName, options); + return _instanceViewDeserialize(result); +} + +export function _installPatchesSend( + context: Client, + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options: VirtualMachinesInstallPatchesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineInstallPatchesParametersSerializer(installPatchesInput), + }); +} + +export async function _installPatchesDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineInstallPatchesResultDeserializer(result.body); +} + +/** Installs patches on the VM. */ +export function installPatches( + context: Client, + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options: VirtualMachinesInstallPatchesOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + VirtualMachineInstallPatchesResult +> { + return getLongRunningPoller(context, _installPatchesDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _installPatchesSend(context, resourceGroupName, vmName, installPatchesInput, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike< + OperationState, + VirtualMachineInstallPatchesResult + >; +} + +export function _generalizeSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesGeneralizeOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _generalizeDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). */ +export async function generalize( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesGeneralizeOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _generalizeSend(context, resourceGroupName, vmName, options); + return _generalizeDeserialize(result); +} + +export function _deallocateSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesDeallocateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate{?api%2Dversion,hibernate,forceDeallocate}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + hibernate: options?.hibernate, + forceDeallocate: options?.forceDeallocate, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _deallocateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. */ +export function deallocate( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesDeallocateOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _deallocateDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _deallocateSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _convertToManagedDisksSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesConvertToManagedDisksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _convertToManagedDisksDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. */ +export function convertToManagedDisks( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesConvertToManagedDisksOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _convertToManagedDisksDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _convertToManagedDisksSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _captureSend( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options: VirtualMachinesCaptureOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualMachineCaptureParametersSerializer(parameters), + }); +} + +export async function _captureDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineCaptureResultDeserializer(result.body); +} + +/** Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. */ +export function capture( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options: VirtualMachinesCaptureOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachineCaptureResult> { + return getLongRunningPoller(context, _captureDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _captureSend(context, resourceGroupName, vmName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachineCaptureResult>; +} + +export function _attachDetachDataDisksSend( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options: VirtualMachinesAttachDetachDataDisksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/attachDetachDataDisks{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: attachDetachDataDisksRequestSerializer(parameters), + }); +} + +export async function _attachDetachDataDisksDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return storageProfileDeserializer(result.body); +} + +/** Attach and detach data disks to/from the virtual machine. */ +export function attachDetachDataDisks( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options: VirtualMachinesAttachDetachDataDisksOptionalParams = { requestOptions: {} }, +): PollerLike, StorageProfile> { + return getLongRunningPoller(context, _attachDetachDataDisksDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _attachDetachDataDisksSend(context, resourceGroupName, vmName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, StorageProfile>; +} + +export function _assessPatchesSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesAssessPatchesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _assessPatchesDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineAssessPatchesResultDeserializer(result.body); +} + +/** Assess patches on the VM. */ +export function assessPatches( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesAssessPatchesOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + VirtualMachineAssessPatchesResult +> { + return getLongRunningPoller(context, _assessPatchesDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _assessPatchesSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike< + OperationState, + VirtualMachineAssessPatchesResult + >; +} + +export function _listAllSend( + context: Client, + options: VirtualMachinesListAllOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines{?api%2Dversion,statusOnly,%24filter,%24expand}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": "2025-11-01", + statusOnly: options?.statusOnly, + "%24filter": options?.filter, + "%24expand": options?.expand, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAllDeserialize( + result: PathUncheckedResponse, +): Promise<_VirtualMachineListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineListResultDeserializer(result.body); +} + +/** Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. */ +export function listAll( + context: Client, + options: VirtualMachinesListAllOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAllSend(context, options), + _listAllDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _listSend( + context: Client, + resourceGroupName: string, + options: VirtualMachinesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines{?api%2Dversion,%24filter,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": "2025-11-01", + "%24filter": options?.filter, + "%24expand": options?.expand, + }, + { + 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<_VirtualMachineListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _virtualMachineListResultDeserializer(result.body); +} + +/** Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. */ +export function list( + context: Client, + resourceGroupName: string, + options: VirtualMachinesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: "2025-11-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}{?api%2Dversion,forceDeletion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + forceDeletion: options?.forceDeletion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** The operation to delete a virtual machine. */ +/** + * @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, + vmName: string, + options: VirtualMachinesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, vmName, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options: VirtualMachinesUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + ...(options?.ifNoneMatch !== undefined ? { "if-none-match": options?.ifNoneMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualMachineUpdateSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineDeserializer(result.body); +} + +/** The operation to update a virtual machine. */ +export function update( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options: VirtualMachinesUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachine> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _updateSend(context, resourceGroupName, vmName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachine>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options: VirtualMachinesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + ...(options?.ifNoneMatch !== undefined ? { "if-none-match": options?.ifNoneMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: virtualMachineSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineDeserializer(result.body); +} + +/** The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options: VirtualMachinesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, VirtualMachine> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, vmName, parameters, options), + resourceLocationConfig: "location", + apiVersion: "2025-11-01", + }) as PollerLike, VirtualMachine>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}{?api%2Dversion,%24expand}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + vmName: vmName, + "api%2Dversion": "2025-11-01", + "%24expand": options?.expand, + }, + { + 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 = cloudErrorDeserializer(result.body); + + throw error; + } + + return virtualMachineDeserializer(result.body); +} + +/** Retrieves information about the model view or the instance view of a virtual machine. */ +export async function get( + context: Client, + resourceGroupName: string, + vmName: string, + options: VirtualMachinesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, vmName, options); + return _getDeserialize(result); +} diff --git a/sdk/compute/arm-compute/src/api/virtualMachines/options.ts b/sdk/compute/arm-compute/src/api/virtualMachines/options.ts new file mode 100644 index 000000000000..1499dbd81c0d --- /dev/null +++ b/sdk/compute/arm-compute/src/api/virtualMachines/options.ts @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + VirtualMachineReimageParameters, + MigrateVMToVirtualMachineScaleSetInput, + InstanceViewTypes, + ExpandTypeForListVMs, + ExpandTypesForListVMs, +} from "../../models/compute/models.js"; +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface VirtualMachinesListByLocationOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachinesMigrateToVMScaleSetOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Parameters supplied to the Migrate Virtual Machine operation. */ + parameters?: MigrateVMToVirtualMachineScaleSetInput; +} + +/** Optional parameters. */ +export interface VirtualMachinesRunCommandOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesListAvailableSizesOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachinesStartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesSimulateEvictionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams extends OperationOptions { + /** Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. */ + sasUriExpirationTimeInMinutes?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesRestartOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesReimageOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Parameters supplied to the Reimage Virtual Machine operation. */ + parameters?: VirtualMachineReimageParameters; +} + +/** Optional parameters. */ +export interface VirtualMachinesRedeployOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesReapplyOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesPowerOffOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified */ + skipShutdown?: boolean; +} + +/** Optional parameters. */ +export interface VirtualMachinesPerformMaintenanceOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesInstanceViewOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachinesInstallPatchesOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesGeneralizeOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VirtualMachinesDeallocateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional parameter to hibernate a virtual machine. */ + hibernate?: boolean; + /** Optional parameter to force deallocate a virtual machine. Default is false. */ + forceDeallocate?: boolean; +} + +/** Optional parameters. */ +export interface VirtualMachinesConvertToManagedDisksOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesCaptureOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesAttachDetachDataDisksOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesAssessPatchesOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface VirtualMachinesListAllOptionalParams extends OperationOptions { + /** statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. */ + statusOnly?: string; + /** The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' */ + filter?: string; + /** The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this can only be specified if a valid $filter option is specified */ + expand?: ExpandTypesForListVMs; +} + +/** Optional parameters. */ +export interface VirtualMachinesListOptionalParams extends OperationOptions { + /** The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' */ + filter?: string; + /** The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this can only be specified if a valid $filter option is specified */ + expand?: ExpandTypeForListVMs; +} + +/** Optional parameters. */ +export interface VirtualMachinesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Optional parameter to force delete virtual machines. */ + forceDeletion?: boolean; +} + +/** Optional parameters. */ +export interface VirtualMachinesUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ + ifNoneMatch?: string; +} + +/** Optional parameters. */ +export interface VirtualMachinesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ + ifNoneMatch?: string; +} + +/** Optional parameters. */ +export interface VirtualMachinesGetOptionalParams extends OperationOptions { + /** The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. */ + expand?: InstanceViewTypes; +} diff --git a/sdk/compute/arm-compute/src/classic/availabilitySets/index.ts b/sdk/compute/arm-compute/src/classic/availabilitySets/index.ts new file mode 100644 index 000000000000..a7488ecdb6d5 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/availabilitySets/index.ts @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + convertToVirtualMachineScaleSet, + validateMigrationToVirtualMachineScaleSet, + cancelMigrationToVirtualMachineScaleSet, + startMigrationToVirtualMachineScaleSet, + listAvailableSizes, + listBySubscription, + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/availabilitySets/operations.js"; +import type { + AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsListAvailableSizesOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, + AvailabilitySetsListOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsGetOptionalParams, +} from "../../api/availabilitySets/options.js"; +import type { + VirtualMachineSize, + AvailabilitySet, + AvailabilitySetUpdate, + MigrateToVirtualMachineScaleSetInput, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a AvailabilitySets operations. */ +export interface AvailabilitySetsOperations { + /** Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. */ + convertToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + ) => PollerLike, void>; + /** @deprecated use convertToVirtualMachineScaleSet instead */ + beginConvertToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + ) => Promise, void>>; + /** @deprecated use convertToVirtualMachineScaleSet instead */ + beginConvertToVirtualMachineScaleSetAndWait: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + ) => Promise; + /** Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual Machine Scale Set. */ + validateMigrationToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options?: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, + ) => Promise; + /** Cancel the migration operation on an Availability Set. */ + cancelMigrationToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, + ) => Promise; + /** Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. */ + startMigrationToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options?: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, + ) => Promise; + /** Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. */ + listAvailableSizes: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsListAvailableSizesOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all availability sets in a subscription. */ + listBySubscription: ( + options?: AvailabilitySetsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all availability sets in a resource group. */ + list: ( + resourceGroupName: string, + options?: AvailabilitySetsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an availability set. */ + /** + * @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, + availabilitySetName: string, + options?: AvailabilitySetsDeleteOptionalParams, + ) => Promise; + /** Update an availability set. */ + update: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySetUpdate, + options?: AvailabilitySetsUpdateOptionalParams, + ) => Promise; + /** Create or update an availability set. */ + createOrUpdate: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySet, + options?: AvailabilitySetsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about an availability set. */ + get: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsGetOptionalParams, + ) => Promise; +} + +function _getAvailabilitySets(context: ComputeManagementContext) { + return { + convertToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + ) => convertToVirtualMachineScaleSet(context, resourceGroupName, availabilitySetName, options), + beginConvertToVirtualMachineScaleSet: async ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + ) => { + const poller = convertToVirtualMachineScaleSet( + context, + resourceGroupName, + availabilitySetName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginConvertToVirtualMachineScaleSetAndWait: async ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + ) => { + return await convertToVirtualMachineScaleSet( + context, + resourceGroupName, + availabilitySetName, + options, + ); + }, + validateMigrationToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options?: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, + ) => + validateMigrationToVirtualMachineScaleSet( + context, + resourceGroupName, + availabilitySetName, + parameters, + options, + ), + cancelMigrationToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, + ) => + cancelMigrationToVirtualMachineScaleSet( + context, + resourceGroupName, + availabilitySetName, + options, + ), + startMigrationToVirtualMachineScaleSet: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: MigrateToVirtualMachineScaleSetInput, + options?: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, + ) => + startMigrationToVirtualMachineScaleSet( + context, + resourceGroupName, + availabilitySetName, + parameters, + options, + ), + listAvailableSizes: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsListAvailableSizesOptionalParams, + ) => listAvailableSizes(context, resourceGroupName, availabilitySetName, options), + listBySubscription: (options?: AvailabilitySetsListBySubscriptionOptionalParams) => + listBySubscription(context, options), + list: (resourceGroupName: string, options?: AvailabilitySetsListOptionalParams) => + list(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, availabilitySetName, options), + update: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySetUpdate, + options?: AvailabilitySetsUpdateOptionalParams, + ) => update(context, resourceGroupName, availabilitySetName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + availabilitySetName: string, + parameters: AvailabilitySet, + options?: AvailabilitySetsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, availabilitySetName, parameters, options), + get: ( + resourceGroupName: string, + availabilitySetName: string, + options?: AvailabilitySetsGetOptionalParams, + ) => get(context, resourceGroupName, availabilitySetName, options), + }; +} + +export function _getAvailabilitySetsOperations( + context: ComputeManagementContext, +): AvailabilitySetsOperations { + return { + ..._getAvailabilitySets(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/capacityReservationGroups/index.ts b/sdk/compute/arm-compute/src/classic/capacityReservationGroups/index.ts new file mode 100644 index 000000000000..21e6170daadd --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/capacityReservationGroups/index.ts @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/capacityReservationGroups/operations.js"; +import type { + CapacityReservationGroupsListBySubscriptionOptionalParams, + CapacityReservationGroupsListByResourceGroupOptionalParams, + CapacityReservationGroupsDeleteOptionalParams, + CapacityReservationGroupsUpdateOptionalParams, + CapacityReservationGroupsCreateOrUpdateOptionalParams, + CapacityReservationGroupsGetOptionalParams, +} from "../../api/capacityReservationGroups/options.js"; +import type { + CapacityReservationGroup, + CapacityReservationGroupUpdate, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a CapacityReservationGroups operations. */ +export interface CapacityReservationGroupsOperations { + /** Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. */ + listBySubscription: ( + options?: CapacityReservationGroupsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: CapacityReservationGroupsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. */ + /** + * @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, + capacityReservationGroupName: string, + options?: CapacityReservationGroupsDeleteOptionalParams, + ) => Promise; + /** The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. */ + update: ( + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroupUpdate, + options?: CapacityReservationGroupsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. */ + createOrUpdate: ( + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroup, + options?: CapacityReservationGroupsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation that retrieves information about a capacity reservation group. */ + get: ( + resourceGroupName: string, + capacityReservationGroupName: string, + options?: CapacityReservationGroupsGetOptionalParams, + ) => Promise; +} + +function _getCapacityReservationGroups(context: ComputeManagementContext) { + return { + listBySubscription: (options?: CapacityReservationGroupsListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: CapacityReservationGroupsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + capacityReservationGroupName: string, + options?: CapacityReservationGroupsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, capacityReservationGroupName, options), + update: ( + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroupUpdate, + options?: CapacityReservationGroupsUpdateOptionalParams, + ) => update(context, resourceGroupName, capacityReservationGroupName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + capacityReservationGroupName: string, + parameters: CapacityReservationGroup, + options?: CapacityReservationGroupsCreateOrUpdateOptionalParams, + ) => + createOrUpdate(context, resourceGroupName, capacityReservationGroupName, parameters, options), + get: ( + resourceGroupName: string, + capacityReservationGroupName: string, + options?: CapacityReservationGroupsGetOptionalParams, + ) => get(context, resourceGroupName, capacityReservationGroupName, options), + }; +} + +export function _getCapacityReservationGroupsOperations( + context: ComputeManagementContext, +): CapacityReservationGroupsOperations { + return { + ..._getCapacityReservationGroups(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/capacityReservations/index.ts b/sdk/compute/arm-compute/src/classic/capacityReservations/index.ts new file mode 100644 index 000000000000..560c76d3b828 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/capacityReservations/index.ts @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByCapacityReservationGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/capacityReservations/operations.js"; +import type { + CapacityReservationsListByCapacityReservationGroupOptionalParams, + CapacityReservationsDeleteOptionalParams, + CapacityReservationsUpdateOptionalParams, + CapacityReservationsCreateOrUpdateOptionalParams, + CapacityReservationsGetOptionalParams, +} from "../../api/capacityReservations/options.js"; +import type { + CapacityReservation, + CapacityReservationUpdate, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a CapacityReservations operations. */ +export interface CapacityReservationsOperations { + /** Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations. */ + listByCapacityReservationGroup: ( + resourceGroupName: string, + capacityReservationGroupName: string, + options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be deleted after it has been successfully allocated until the schedule end time. */ + /** + * @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, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsDeleteOptionalParams, + ) => Promise; + /** The operation to update a capacity reservation. */ + update: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options?: CapacityReservationsUpdateOptionalParams, + ) => PollerLike, CapacityReservation>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options?: CapacityReservationsUpdateOptionalParams, + ) => Promise, CapacityReservation>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options?: CapacityReservationsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. */ + createOrUpdate: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options?: CapacityReservationsCreateOrUpdateOptionalParams, + ) => PollerLike, CapacityReservation>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options?: CapacityReservationsCreateOrUpdateOptionalParams, + ) => Promise, CapacityReservation>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options?: CapacityReservationsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation that retrieves information about the capacity reservation. */ + get: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsGetOptionalParams, + ) => Promise; +} + +function _getCapacityReservations(context: ComputeManagementContext) { + return { + listByCapacityReservationGroup: ( + resourceGroupName: string, + capacityReservationGroupName: string, + options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, + ) => + listByCapacityReservationGroup( + context, + resourceGroupName, + capacityReservationGroupName, + options, + ), + delete: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + options, + ); + }, + update: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options?: CapacityReservationsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options?: CapacityReservationsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservationUpdate, + options?: CapacityReservationsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options?: CapacityReservationsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options?: CapacityReservationsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + parameters: CapacityReservation, + options?: CapacityReservationsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + capacityReservationGroupName: string, + capacityReservationName: string, + options?: CapacityReservationsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + capacityReservationGroupName, + capacityReservationName, + options, + ), + }; +} + +export function _getCapacityReservationsOperations( + context: ComputeManagementContext, +): CapacityReservationsOperations { + return { + ..._getCapacityReservations(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/communityGalleries/index.ts b/sdk/compute/arm-compute/src/classic/communityGalleries/index.ts new file mode 100644 index 000000000000..add8c188358d --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/communityGalleries/index.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { get } from "../../api/communityGalleries/operations.js"; +import type { CommunityGalleriesGetOptionalParams } from "../../api/communityGalleries/options.js"; +import type { CommunityGallery } from "../../models/computeGallery/models.js"; + +/** Interface representing a CommunityGalleries operations. */ +export interface CommunityGalleriesOperations { + /** Get a community gallery by gallery public name. */ + get: ( + location: string, + publicGalleryName: string, + options?: CommunityGalleriesGetOptionalParams, + ) => Promise; +} + +function _getCommunityGalleries(context: ComputeManagementContext) { + return { + get: ( + location: string, + publicGalleryName: string, + options?: CommunityGalleriesGetOptionalParams, + ) => get(context, location, publicGalleryName, options), + }; +} + +export function _getCommunityGalleriesOperations( + context: ComputeManagementContext, +): CommunityGalleriesOperations { + return { + ..._getCommunityGalleries(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/communityGalleryImageVersions/index.ts b/sdk/compute/arm-compute/src/classic/communityGalleryImageVersions/index.ts new file mode 100644 index 000000000000..aa9351d215c4 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/communityGalleryImageVersions/index.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list, get } from "../../api/communityGalleryImageVersions/operations.js"; +import type { + CommunityGalleryImageVersionsListOptionalParams, + CommunityGalleryImageVersionsGetOptionalParams, +} from "../../api/communityGalleryImageVersions/options.js"; +import type { CommunityGalleryImageVersion } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a CommunityGalleryImageVersions operations. */ +export interface CommunityGalleryImageVersionsOperations { + /** List community gallery image versions inside an image. */ + list: ( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImageVersionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a community gallery image version. */ + get: ( + location: string, + publicGalleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: CommunityGalleryImageVersionsGetOptionalParams, + ) => Promise; +} + +function _getCommunityGalleryImageVersions(context: ComputeManagementContext) { + return { + list: ( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImageVersionsListOptionalParams, + ) => list(context, location, publicGalleryName, galleryImageName, options), + get: ( + location: string, + publicGalleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: CommunityGalleryImageVersionsGetOptionalParams, + ) => + get(context, location, publicGalleryName, galleryImageName, galleryImageVersionName, options), + }; +} + +export function _getCommunityGalleryImageVersionsOperations( + context: ComputeManagementContext, +): CommunityGalleryImageVersionsOperations { + return { + ..._getCommunityGalleryImageVersions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/communityGalleryImages/index.ts b/sdk/compute/arm-compute/src/classic/communityGalleryImages/index.ts new file mode 100644 index 000000000000..1666ba9c1176 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/communityGalleryImages/index.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list, get } from "../../api/communityGalleryImages/operations.js"; +import type { + CommunityGalleryImagesListOptionalParams, + CommunityGalleryImagesGetOptionalParams, +} from "../../api/communityGalleryImages/options.js"; +import type { CommunityGalleryImage } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a CommunityGalleryImages operations. */ +export interface CommunityGalleryImagesOperations { + /** List community gallery images inside a gallery. */ + list: ( + location: string, + publicGalleryName: string, + options?: CommunityGalleryImagesListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a community gallery image. */ + get: ( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImagesGetOptionalParams, + ) => Promise; +} + +function _getCommunityGalleryImages(context: ComputeManagementContext) { + return { + list: ( + location: string, + publicGalleryName: string, + options?: CommunityGalleryImagesListOptionalParams, + ) => list(context, location, publicGalleryName, options), + get: ( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImagesGetOptionalParams, + ) => get(context, location, publicGalleryName, galleryImageName, options), + }; +} + +export function _getCommunityGalleryImagesOperations( + context: ComputeManagementContext, +): CommunityGalleryImagesOperations { + return { + ..._getCommunityGalleryImages(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/dedicatedHostGroups/index.ts b/sdk/compute/arm-compute/src/classic/dedicatedHostGroups/index.ts new file mode 100644 index 000000000000..233223966d46 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/dedicatedHostGroups/index.ts @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/dedicatedHostGroups/operations.js"; +import type { + DedicatedHostGroupsListBySubscriptionOptionalParams, + DedicatedHostGroupsListByResourceGroupOptionalParams, + DedicatedHostGroupsDeleteOptionalParams, + DedicatedHostGroupsUpdateOptionalParams, + DedicatedHostGroupsCreateOrUpdateOptionalParams, + DedicatedHostGroupsGetOptionalParams, +} from "../../api/dedicatedHostGroups/options.js"; +import type { DedicatedHostGroup, DedicatedHostGroupUpdate } from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a DedicatedHostGroups operations. */ +export interface DedicatedHostGroupsOperations { + /** Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. */ + listBySubscription: ( + options?: DedicatedHostGroupsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: DedicatedHostGroupsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a dedicated host group. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + hostGroupName: string, + options?: DedicatedHostGroupsDeleteOptionalParams, + ) => Promise; + /** Update an dedicated host group. */ + update: ( + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroupUpdate, + options?: DedicatedHostGroupsUpdateOptionalParams, + ) => Promise; + /** Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) */ + createOrUpdate: ( + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroup, + options?: DedicatedHostGroupsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a dedicated host group. */ + get: ( + resourceGroupName: string, + hostGroupName: string, + options?: DedicatedHostGroupsGetOptionalParams, + ) => Promise; +} + +function _getDedicatedHostGroups(context: ComputeManagementContext) { + return { + listBySubscription: (options?: DedicatedHostGroupsListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: DedicatedHostGroupsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + hostGroupName: string, + options?: DedicatedHostGroupsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, hostGroupName, options), + update: ( + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroupUpdate, + options?: DedicatedHostGroupsUpdateOptionalParams, + ) => update(context, resourceGroupName, hostGroupName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + hostGroupName: string, + parameters: DedicatedHostGroup, + options?: DedicatedHostGroupsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, hostGroupName, parameters, options), + get: ( + resourceGroupName: string, + hostGroupName: string, + options?: DedicatedHostGroupsGetOptionalParams, + ) => get(context, resourceGroupName, hostGroupName, options), + }; +} + +export function _getDedicatedHostGroupsOperations( + context: ComputeManagementContext, +): DedicatedHostGroupsOperations { + return { + ..._getDedicatedHostGroups(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/dedicatedHosts/index.ts b/sdk/compute/arm-compute/src/classic/dedicatedHosts/index.ts new file mode 100644 index 000000000000..2dee9cf287ee --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/dedicatedHosts/index.ts @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + restart, + redeploy, + listAvailableSizes, + listByHostGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/dedicatedHosts/operations.js"; +import type { + DedicatedHostsRestartOptionalParams, + DedicatedHostsRedeployOptionalParams, + DedicatedHostsListAvailableSizesOptionalParams, + DedicatedHostsListByHostGroupOptionalParams, + DedicatedHostsDeleteOptionalParams, + DedicatedHostsUpdateOptionalParams, + DedicatedHostsCreateOrUpdateOptionalParams, + DedicatedHostsGetOptionalParams, +} from "../../api/dedicatedHosts/options.js"; +import type { DedicatedHost, DedicatedHostUpdate } from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DedicatedHosts operations. */ +export interface DedicatedHostsOperations { + /** Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. */ + restart: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRestartOptionalParams, + ) => PollerLike, void>; + /** @deprecated use restart instead */ + beginRestart: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRestartOptionalParams, + ) => Promise, void>>; + /** @deprecated use restart instead */ + beginRestartAndWait: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRestartOptionalParams, + ) => Promise; + /** Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. */ + redeploy: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRedeployOptionalParams, + ) => PollerLike, void>; + /** @deprecated use redeploy instead */ + beginRedeploy: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRedeployOptionalParams, + ) => Promise, void>>; + /** @deprecated use redeploy instead */ + beginRedeployAndWait: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRedeployOptionalParams, + ) => Promise; + /** Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. */ + listAvailableSizes: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsListAvailableSizesOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. */ + listByHostGroup: ( + resourceGroupName: string, + hostGroupName: string, + options?: DedicatedHostsListByHostGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a dedicated host. */ + /** + * @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, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsDeleteOptionalParams, + ) => Promise; + /** Update a dedicated host . */ + update: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options?: DedicatedHostsUpdateOptionalParams, + ) => PollerLike, DedicatedHost>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options?: DedicatedHostsUpdateOptionalParams, + ) => Promise, DedicatedHost>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options?: DedicatedHostsUpdateOptionalParams, + ) => Promise; + /** Create or update a dedicated host . */ + createOrUpdate: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options?: DedicatedHostsCreateOrUpdateOptionalParams, + ) => PollerLike, DedicatedHost>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options?: DedicatedHostsCreateOrUpdateOptionalParams, + ) => Promise, DedicatedHost>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options?: DedicatedHostsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a dedicated host. */ + get: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsGetOptionalParams, + ) => Promise; +} + +function _getDedicatedHosts(context: ComputeManagementContext) { + return { + restart: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRestartOptionalParams, + ) => restart(context, resourceGroupName, hostGroupName, hostName, options), + beginRestart: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRestartOptionalParams, + ) => { + const poller = restart(context, resourceGroupName, hostGroupName, hostName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRestartAndWait: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRestartOptionalParams, + ) => { + return await restart(context, resourceGroupName, hostGroupName, hostName, options); + }, + redeploy: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRedeployOptionalParams, + ) => redeploy(context, resourceGroupName, hostGroupName, hostName, options), + beginRedeploy: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRedeployOptionalParams, + ) => { + const poller = redeploy(context, resourceGroupName, hostGroupName, hostName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRedeployAndWait: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsRedeployOptionalParams, + ) => { + return await redeploy(context, resourceGroupName, hostGroupName, hostName, options); + }, + listAvailableSizes: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsListAvailableSizesOptionalParams, + ) => listAvailableSizes(context, resourceGroupName, hostGroupName, hostName, options), + listByHostGroup: ( + resourceGroupName: string, + hostGroupName: string, + options?: DedicatedHostsListByHostGroupOptionalParams, + ) => listByHostGroup(context, resourceGroupName, hostGroupName, options), + delete: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, hostGroupName, hostName, options), + beginDelete: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, hostGroupName, hostName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, hostGroupName, hostName, options); + }, + update: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options?: DedicatedHostsUpdateOptionalParams, + ) => update(context, resourceGroupName, hostGroupName, hostName, parameters, options), + beginUpdate: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options?: DedicatedHostsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + hostGroupName, + hostName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHostUpdate, + options?: DedicatedHostsUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, hostGroupName, hostName, parameters, options); + }, + createOrUpdate: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options?: DedicatedHostsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, hostGroupName, hostName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options?: DedicatedHostsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + hostGroupName, + hostName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + parameters: DedicatedHost, + options?: DedicatedHostsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + hostGroupName, + hostName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + hostGroupName: string, + hostName: string, + options?: DedicatedHostsGetOptionalParams, + ) => get(context, resourceGroupName, hostGroupName, hostName, options), + }; +} + +export function _getDedicatedHostsOperations( + context: ComputeManagementContext, +): DedicatedHostsOperations { + return { + ..._getDedicatedHosts(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/diskAccesses/index.ts b/sdk/compute/arm-compute/src/classic/diskAccesses/index.ts new file mode 100644 index 000000000000..b735ef9e4563 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/diskAccesses/index.ts @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listPrivateEndpointConnections, + deleteAPrivateEndpointConnection, + updateAPrivateEndpointConnection, + getAPrivateEndpointConnection, + getPrivateLinkResources, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/diskAccesses/operations.js"; +import type { + DiskAccessesListPrivateEndpointConnectionsOptionalParams, + DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetPrivateLinkResourcesOptionalParams, + DiskAccessesListOptionalParams, + DiskAccessesListByResourceGroupOptionalParams, + DiskAccessesDeleteOptionalParams, + DiskAccessesUpdateOptionalParams, + DiskAccessesCreateOrUpdateOptionalParams, + DiskAccessesGetOptionalParams, +} from "../../api/diskAccesses/options.js"; +import type { + DiskAccess, + PrivateEndpointConnection, + DiskAccessUpdate, + PrivateLinkResourceListResult, +} from "../../models/computeDisk/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DiskAccesses operations. */ +export interface DiskAccessesOperations { + /** List information about private endpoint connections under a disk access resource */ + listPrivateEndpointConnections: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a private endpoint connection under a disk access resource. */ + deleteAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ) => PollerLike, void>; + /** @deprecated use deleteAPrivateEndpointConnection instead */ + beginDeleteAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ) => Promise, void>>; + /** @deprecated use deleteAPrivateEndpointConnection instead */ + beginDeleteAPrivateEndpointConnectionAndWait: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ) => Promise; + /** Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. */ + updateAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ) => PollerLike, PrivateEndpointConnection>; + /** @deprecated use updateAPrivateEndpointConnection instead */ + beginUpdateAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ) => Promise< + SimplePollerLike, PrivateEndpointConnection> + >; + /** @deprecated use updateAPrivateEndpointConnection instead */ + beginUpdateAPrivateEndpointConnectionAndWait: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ) => Promise; + /** Gets information about a private endpoint connection under a disk access resource. */ + getAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + ) => Promise; + /** Gets the private link resources possible under disk access resource */ + getPrivateLinkResources: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetPrivateLinkResourcesOptionalParams, + ) => Promise; + /** Lists all the disk access resources under a subscription. */ + list: (options?: DiskAccessesListOptionalParams) => PagedAsyncIterableIterator; + /** Lists all the disk access resources under a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: DiskAccessesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a disk access resource. */ + /** + * @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, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ) => Promise; + /** Updates (patches) a disk access resource. */ + update: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ) => PollerLike, DiskAccess>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ) => Promise, DiskAccess>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ) => Promise; + /** Creates or updates a disk access resource */ + createOrUpdate: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ) => PollerLike, DiskAccess>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ) => Promise, DiskAccess>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about a disk access resource. */ + get: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetOptionalParams, + ) => Promise; +} + +function _getDiskAccesses(context: ComputeManagementContext) { + return { + listPrivateEndpointConnections: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + ) => listPrivateEndpointConnections(context, resourceGroupName, diskAccessName, options), + deleteAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ) => + deleteAPrivateEndpointConnection( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + ), + beginDeleteAPrivateEndpointConnection: async ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ) => { + const poller = deleteAPrivateEndpointConnection( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAPrivateEndpointConnectionAndWait: async ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ) => { + return await deleteAPrivateEndpointConnection( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + ); + }, + updateAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ) => + updateAPrivateEndpointConnection( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection, + options, + ), + beginUpdateAPrivateEndpointConnection: async ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ) => { + const poller = updateAPrivateEndpointConnection( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAPrivateEndpointConnectionAndWait: async ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ) => { + return await updateAPrivateEndpointConnection( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection, + options, + ); + }, + getAPrivateEndpointConnection: ( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + ) => + getAPrivateEndpointConnection( + context, + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + ), + getPrivateLinkResources: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetPrivateLinkResourcesOptionalParams, + ) => getPrivateLinkResources(context, resourceGroupName, diskAccessName, options), + list: (options?: DiskAccessesListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: DiskAccessesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, diskAccessName, options), + beginDelete: async ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, diskAccessName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, diskAccessName, options); + }, + update: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ) => update(context, resourceGroupName, diskAccessName, diskAccess, options), + beginUpdate: async ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, diskAccessName, diskAccess, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, diskAccessName, diskAccess, options); + }, + createOrUpdate: ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, diskAccessName, diskAccess, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + diskAccessName, + diskAccess, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, diskAccessName, diskAccess, options); + }, + get: ( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetOptionalParams, + ) => get(context, resourceGroupName, diskAccessName, options), + }; +} + +export function _getDiskAccessesOperations( + context: ComputeManagementContext, +): DiskAccessesOperations { + return { + ..._getDiskAccesses(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/diskEncryptionSets/index.ts b/sdk/compute/arm-compute/src/classic/diskEncryptionSets/index.ts new file mode 100644 index 000000000000..25ccfc577312 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/diskEncryptionSets/index.ts @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listAssociatedResources, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/diskEncryptionSets/operations.js"; +import type { + DiskEncryptionSetsListAssociatedResourcesOptionalParams, + DiskEncryptionSetsListOptionalParams, + DiskEncryptionSetsListByResourceGroupOptionalParams, + DiskEncryptionSetsDeleteOptionalParams, + DiskEncryptionSetsUpdateOptionalParams, + DiskEncryptionSetsCreateOrUpdateOptionalParams, + DiskEncryptionSetsGetOptionalParams, +} from "../../api/diskEncryptionSets/options.js"; +import type { + DiskEncryptionSet, + DiskEncryptionSetUpdate, +} from "../../models/computeDisk/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DiskEncryptionSets operations. */ +export interface DiskEncryptionSetsOperations { + /** Lists all resources that are encrypted with this disk encryption set. */ + listAssociatedResources: ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all the disk encryption sets under a subscription. */ + list: ( + options?: DiskEncryptionSetsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all the disk encryption sets under a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a disk encryption set. */ + /** + * @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, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ) => Promise; + /** Updates (patches) a disk encryption set. */ + update: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ) => PollerLike, DiskEncryptionSet>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ) => Promise, DiskEncryptionSet>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ) => Promise; + /** Creates or updates a disk encryption set */ + createOrUpdate: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ) => PollerLike, DiskEncryptionSet>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ) => Promise, DiskEncryptionSet>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about a disk encryption set. */ + get: ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsGetOptionalParams, + ) => Promise; +} + +function _getDiskEncryptionSets(context: ComputeManagementContext) { + return { + listAssociatedResources: ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + ) => listAssociatedResources(context, resourceGroupName, diskEncryptionSetName, options), + list: (options?: DiskEncryptionSetsListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, diskEncryptionSetName, options), + beginDelete: async ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, diskEncryptionSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, diskEncryptionSetName, options); + }, + update: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ) => update(context, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options), + beginUpdate: async ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ) => + createOrUpdate(context, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + ); + }, + get: ( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsGetOptionalParams, + ) => get(context, resourceGroupName, diskEncryptionSetName, options), + }; +} + +export function _getDiskEncryptionSetsOperations( + context: ComputeManagementContext, +): DiskEncryptionSetsOperations { + return { + ..._getDiskEncryptionSets(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/diskRestorePoint/index.ts b/sdk/compute/arm-compute/src/classic/diskRestorePoint/index.ts new file mode 100644 index 000000000000..24764765dea9 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/diskRestorePoint/index.ts @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + revokeAccess, + grantAccess, + listByRestorePoint, + get, +} from "../../api/diskRestorePoint/operations.js"; +import type { + DiskRestorePointRevokeAccessOptionalParams, + DiskRestorePointGrantAccessOptionalParams, + DiskRestorePointListByRestorePointOptionalParams, + DiskRestorePointGetOptionalParams, +} from "../../api/diskRestorePoint/options.js"; +import type { + GrantAccessData, + AccessUri, + DiskRestorePoint, +} from "../../models/computeDisk/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a DiskRestorePoint operations. */ +export interface DiskRestorePointOperations { + /** Revokes access to a diskRestorePoint. */ + revokeAccess: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ) => PollerLike, void>; + /** @deprecated use revokeAccess instead */ + beginRevokeAccess: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ) => Promise, void>>; + /** @deprecated use revokeAccess instead */ + beginRevokeAccessAndWait: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ) => Promise; + /** Grants access to a diskRestorePoint. */ + grantAccess: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ) => PollerLike, AccessUri>; + /** @deprecated use grantAccess instead */ + beginGrantAccess: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ) => Promise, AccessUri>>; + /** @deprecated use grantAccess instead */ + beginGrantAccessAndWait: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ) => Promise; + /** Lists diskRestorePoints under a vmRestorePoint. */ + listByRestorePoint: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options?: DiskRestorePointListByRestorePointOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get disk restorePoint resource */ + get: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointGetOptionalParams, + ) => Promise; +} + +function _getDiskRestorePoint(context: ComputeManagementContext) { + return { + revokeAccess: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ) => + revokeAccess( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + ), + beginRevokeAccess: async ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ) => { + const poller = revokeAccess( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRevokeAccessAndWait: async ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ) => { + return await revokeAccess( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + ); + }, + grantAccess: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ) => + grantAccess( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + options, + ), + beginGrantAccess: async ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ) => { + const poller = grantAccess( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginGrantAccessAndWait: async ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ) => { + return await grantAccess( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + options, + ); + }, + listByRestorePoint: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options?: DiskRestorePointListByRestorePointOptionalParams, + ) => + listByRestorePoint( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options, + ), + get: ( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointGetOptionalParams, + ) => + get( + context, + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + ), + }; +} + +export function _getDiskRestorePointOperations( + context: ComputeManagementContext, +): DiskRestorePointOperations { + return { + ..._getDiskRestorePoint(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/disks/index.ts b/sdk/compute/arm-compute/src/classic/disks/index.ts new file mode 100644 index 000000000000..942f1f0671cf --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/disks/index.ts @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + revokeAccess, + grantAccess, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/disks/operations.js"; +import type { + DisksRevokeAccessOptionalParams, + DisksGrantAccessOptionalParams, + DisksListOptionalParams, + DisksListByResourceGroupOptionalParams, + DisksDeleteOptionalParams, + DisksUpdateOptionalParams, + DisksCreateOrUpdateOptionalParams, + DisksGetOptionalParams, +} from "../../api/disks/options.js"; +import type { + Disk, + DiskUpdate, + GrantAccessData, + AccessUri, +} from "../../models/computeDisk/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Disks operations. */ +export interface DisksOperations { + /** Revokes access to a disk. */ + revokeAccess: ( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ) => PollerLike, void>; + /** @deprecated use revokeAccess instead */ + beginRevokeAccess: ( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ) => Promise, void>>; + /** @deprecated use revokeAccess instead */ + beginRevokeAccessAndWait: ( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ) => Promise; + /** Grants access to a disk. */ + grantAccess: ( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ) => PollerLike, AccessUri>; + /** @deprecated use grantAccess instead */ + beginGrantAccess: ( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ) => Promise, AccessUri>>; + /** @deprecated use grantAccess instead */ + beginGrantAccessAndWait: ( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ) => Promise; + /** Lists all the disks under a subscription. */ + list: (options?: DisksListOptionalParams) => PagedAsyncIterableIterator; + /** Lists all the disks under a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: DisksListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a disk. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ) => Promise; + /** Updates (patches) a disk. */ + update: ( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ) => PollerLike, Disk>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ) => Promise, Disk>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ) => Promise; + /** Creates or updates a disk. */ + createOrUpdate: ( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ) => PollerLike, Disk>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ) => Promise, Disk>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about a disk. */ + get: ( + resourceGroupName: string, + diskName: string, + options?: DisksGetOptionalParams, + ) => Promise; +} + +function _getDisks(context: ComputeManagementContext) { + return { + revokeAccess: ( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ) => revokeAccess(context, resourceGroupName, diskName, options), + beginRevokeAccess: async ( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ) => { + const poller = revokeAccess(context, resourceGroupName, diskName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRevokeAccessAndWait: async ( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ) => { + return await revokeAccess(context, resourceGroupName, diskName, options); + }, + grantAccess: ( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ) => grantAccess(context, resourceGroupName, diskName, grantAccessData, options), + beginGrantAccess: async ( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ) => { + const poller = grantAccess(context, resourceGroupName, diskName, grantAccessData, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginGrantAccessAndWait: async ( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ) => { + return await grantAccess(context, resourceGroupName, diskName, grantAccessData, options); + }, + list: (options?: DisksListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: DisksListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: (resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams) => + $delete(context, resourceGroupName, diskName, options), + beginDelete: async ( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, diskName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, diskName, options); + }, + update: ( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ) => update(context, resourceGroupName, diskName, disk, options), + beginUpdate: async ( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, diskName, disk, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, diskName, disk, options); + }, + createOrUpdate: ( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, diskName, disk, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate(context, resourceGroupName, diskName, disk, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, diskName, disk, options); + }, + get: (resourceGroupName: string, diskName: string, options?: DisksGetOptionalParams) => + get(context, resourceGroupName, diskName, options), + }; +} + +export function _getDisksOperations(context: ComputeManagementContext): DisksOperations { + return { + ..._getDisks(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleries/index.ts b/sdk/compute/arm-compute/src/classic/galleries/index.ts new file mode 100644 index 000000000000..5146be478009 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleries/index.ts @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleries/operations.js"; +import type { + GalleriesListOptionalParams, + GalleriesListByResourceGroupOptionalParams, + GalleriesDeleteOptionalParams, + GalleriesUpdateOptionalParams, + GalleriesCreateOrUpdateOptionalParams, + GalleriesGetOptionalParams, +} from "../../api/galleries/options.js"; +import type { Gallery, GalleryUpdate } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Galleries operations. */ +export interface GalleriesOperations { + /** List galleries under a subscription. */ + list: (options?: GalleriesListOptionalParams) => PagedAsyncIterableIterator; + /** List galleries under a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: GalleriesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a Shared Image Gallery. */ + /** + * @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, + galleryName: string, + options?: GalleriesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams, + ) => Promise; + /** Update a Shared Image Gallery. */ + update: ( + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options?: GalleriesUpdateOptionalParams, + ) => PollerLike, Gallery>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options?: GalleriesUpdateOptionalParams, + ) => Promise, Gallery>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options?: GalleriesUpdateOptionalParams, + ) => Promise; + /** Create or update a Shared Image Gallery. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams, + ) => PollerLike, Gallery>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams, + ) => Promise, Gallery>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a Shared Image Gallery. */ + get: ( + resourceGroupName: string, + galleryName: string, + options?: GalleriesGetOptionalParams, + ) => Promise; +} + +function _getGalleries(context: ComputeManagementContext) { + return { + list: (options?: GalleriesListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: GalleriesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, galleryName, options), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, galleryName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + options?: GalleriesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, galleryName, options); + }, + update: ( + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options?: GalleriesUpdateOptionalParams, + ) => update(context, resourceGroupName, galleryName, gallery, options), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options?: GalleriesUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, galleryName, gallery, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + gallery: GalleryUpdate, + options?: GalleriesUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, galleryName, gallery, options); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, galleryName, gallery, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate(context, resourceGroupName, galleryName, gallery, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + gallery: Gallery, + options?: GalleriesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, galleryName, gallery, options); + }, + get: (resourceGroupName: string, galleryName: string, options?: GalleriesGetOptionalParams) => + get(context, resourceGroupName, galleryName, options), + }; +} + +export function _getGalleriesOperations(context: ComputeManagementContext): GalleriesOperations { + return { + ..._getGalleries(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryApplicationVersions/index.ts b/sdk/compute/arm-compute/src/classic/galleryApplicationVersions/index.ts new file mode 100644 index 000000000000..745f657ca344 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryApplicationVersions/index.ts @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGalleryApplication, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryApplicationVersions/operations.js"; +import type { + GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + GalleryApplicationVersionsDeleteOptionalParams, + GalleryApplicationVersionsUpdateOptionalParams, + GalleryApplicationVersionsCreateOrUpdateOptionalParams, + GalleryApplicationVersionsGetOptionalParams, +} from "../../api/galleryApplicationVersions/options.js"; +import type { + GalleryApplicationVersion, + GalleryApplicationVersionUpdate, +} from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryApplicationVersions operations. */ +export interface GalleryApplicationVersionsOperations { + /** List gallery Application Versions in a gallery Application Definition. */ + listByGalleryApplication: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery Application Version. */ + /** + * @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, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsDeleteOptionalParams, + ) => Promise; + /** Update a gallery Application Version. */ + update: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options?: GalleryApplicationVersionsUpdateOptionalParams, + ) => PollerLike, GalleryApplicationVersion>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options?: GalleryApplicationVersionsUpdateOptionalParams, + ) => Promise< + SimplePollerLike, GalleryApplicationVersion> + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options?: GalleryApplicationVersionsUpdateOptionalParams, + ) => Promise; + /** Create or update a gallery Application Version. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryApplicationVersion>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike, GalleryApplicationVersion> + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a gallery Application Version. */ + get: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsGetOptionalParams, + ) => Promise; +} + +function _getGalleryApplicationVersions(context: ComputeManagementContext) { + return { + listByGalleryApplication: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + ) => + listByGalleryApplication( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + options, + ), + delete: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options, + ); + }, + update: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options?: GalleryApplicationVersionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options?: GalleryApplicationVersionsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersionUpdate, + options?: GalleryApplicationVersionsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + galleryApplicationVersion: GalleryApplicationVersion, + options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplicationVersionName: string, + options?: GalleryApplicationVersionsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + options, + ), + }; +} + +export function _getGalleryApplicationVersionsOperations( + context: ComputeManagementContext, +): GalleryApplicationVersionsOperations { + return { + ..._getGalleryApplicationVersions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryApplications/index.ts b/sdk/compute/arm-compute/src/classic/galleryApplications/index.ts new file mode 100644 index 000000000000..8a3b0f0b59de --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryApplications/index.ts @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGallery, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryApplications/operations.js"; +import type { + GalleryApplicationsListByGalleryOptionalParams, + GalleryApplicationsDeleteOptionalParams, + GalleryApplicationsUpdateOptionalParams, + GalleryApplicationsCreateOrUpdateOptionalParams, + GalleryApplicationsGetOptionalParams, +} from "../../api/galleryApplications/options.js"; +import type { + GalleryApplication, + GalleryApplicationUpdate, +} from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryApplications operations. */ +export interface GalleryApplicationsOperations { + /** List gallery Application Definitions in a gallery. */ + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryApplicationsListByGalleryOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery Application. */ + /** + * @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, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsDeleteOptionalParams, + ) => Promise; + /** Update a gallery Application Definition. */ + update: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options?: GalleryApplicationsUpdateOptionalParams, + ) => PollerLike, GalleryApplication>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options?: GalleryApplicationsUpdateOptionalParams, + ) => Promise, GalleryApplication>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options?: GalleryApplicationsUpdateOptionalParams, + ) => Promise; + /** Create or update a gallery Application Definition. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options?: GalleryApplicationsCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryApplication>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options?: GalleryApplicationsCreateOrUpdateOptionalParams, + ) => Promise, GalleryApplication>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options?: GalleryApplicationsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a gallery Application Definition. */ + get: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsGetOptionalParams, + ) => Promise; +} + +function _getGalleryApplications(context: ComputeManagementContext) { + return { + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryApplicationsListByGalleryOptionalParams, + ) => listByGallery(context, resourceGroupName, galleryName, options), + delete: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, galleryName, galleryApplicationName, options), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + options, + ); + }, + update: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options?: GalleryApplicationsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options?: GalleryApplicationsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplicationUpdate, + options?: GalleryApplicationsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options?: GalleryApplicationsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options?: GalleryApplicationsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + galleryApplication: GalleryApplication, + options?: GalleryApplicationsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplication, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + galleryApplicationName: string, + options?: GalleryApplicationsGetOptionalParams, + ) => get(context, resourceGroupName, galleryName, galleryApplicationName, options), + }; +} + +export function _getGalleryApplicationsOperations( + context: ComputeManagementContext, +): GalleryApplicationsOperations { + return { + ..._getGalleryApplications(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryImageVersions/index.ts b/sdk/compute/arm-compute/src/classic/galleryImageVersions/index.ts new file mode 100644 index 000000000000..5c03d652bd00 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryImageVersions/index.ts @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGalleryImage, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryImageVersions/operations.js"; +import type { + GalleryImageVersionsListByGalleryImageOptionalParams, + GalleryImageVersionsDeleteOptionalParams, + GalleryImageVersionsUpdateOptionalParams, + GalleryImageVersionsCreateOrUpdateOptionalParams, + GalleryImageVersionsGetOptionalParams, +} from "../../api/galleryImageVersions/options.js"; +import type { + GalleryImageVersion, + GalleryImageVersionUpdate, +} from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryImageVersions operations. */ +export interface GalleryImageVersionsOperations { + /** List gallery image versions in a gallery image definition. */ + listByGalleryImage: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImageVersionsListByGalleryImageOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery image version. */ + /** + * @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, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsDeleteOptionalParams, + ) => Promise; + /** Update a gallery image version. */ + update: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options?: GalleryImageVersionsUpdateOptionalParams, + ) => PollerLike, GalleryImageVersion>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options?: GalleryImageVersionsUpdateOptionalParams, + ) => Promise, GalleryImageVersion>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options?: GalleryImageVersionsUpdateOptionalParams, + ) => Promise; + /** Create or update a gallery image version. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options?: GalleryImageVersionsCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryImageVersion>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options?: GalleryImageVersionsCreateOrUpdateOptionalParams, + ) => Promise, GalleryImageVersion>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options?: GalleryImageVersionsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a gallery image version. */ + get: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsGetOptionalParams, + ) => Promise; +} + +function _getGalleryImageVersions(context: ComputeManagementContext) { + return { + listByGalleryImage: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImageVersionsListByGalleryImageOptionalParams, + ) => listByGalleryImage(context, resourceGroupName, galleryName, galleryImageName, options), + delete: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options, + ); + }, + update: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options?: GalleryImageVersionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options?: GalleryImageVersionsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersionUpdate, + options?: GalleryImageVersionsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options?: GalleryImageVersionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options?: GalleryImageVersionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + galleryImageVersion: GalleryImageVersion, + options?: GalleryImageVersionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: GalleryImageVersionsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + options, + ), + }; +} + +export function _getGalleryImageVersionsOperations( + context: ComputeManagementContext, +): GalleryImageVersionsOperations { + return { + ..._getGalleryImageVersions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryImages/index.ts b/sdk/compute/arm-compute/src/classic/galleryImages/index.ts new file mode 100644 index 000000000000..8df09f9d7d2f --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryImages/index.ts @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGallery, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryImages/operations.js"; +import type { + GalleryImagesListByGalleryOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} from "../../api/galleryImages/options.js"; +import type { GalleryImage, GalleryImageUpdate } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryImages operations. */ +export interface GalleryImagesOperations { + /** List gallery image definitions in a gallery. */ + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryImagesListByGalleryOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery image. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => Promise; + /** Update a gallery image definition. */ + update: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => PollerLike, GalleryImage>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => Promise, GalleryImage>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => Promise; + /** Create or update a gallery image definition. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryImage>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => Promise, GalleryImage>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a gallery image definition. */ + get: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesGetOptionalParams, + ) => Promise; +} + +function _getGalleryImages(context: ComputeManagementContext) { + return { + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryImagesListByGalleryOptionalParams, + ) => listByGallery(context, resourceGroupName, galleryName, options), + delete: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, galleryName, galleryImageName, options), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, galleryName, galleryImageName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, galleryName, galleryImageName, options); + }, + update: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => update(context, resourceGroupName, galleryName, galleryImageName, galleryImage, options), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImage, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImageUpdate, + options?: GalleryImagesUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImage, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImage, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImage, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + galleryImage: GalleryImage, + options?: GalleryImagesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryImageName, + galleryImage, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImagesGetOptionalParams, + ) => get(context, resourceGroupName, galleryName, galleryImageName, options), + }; +} + +export function _getGalleryImagesOperations( + context: ComputeManagementContext, +): GalleryImagesOperations { + return { + ..._getGalleryImages(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfileVersions/index.ts b/sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfileVersions/index.ts new file mode 100644 index 000000000000..babce8ebdd2c --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfileVersions/index.ts @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGalleryInVMAccessControlProfile, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryInVMAccessControlProfileVersions/operations.js"; +import type { + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsGetOptionalParams, +} from "../../api/galleryInVMAccessControlProfileVersions/options.js"; +import type { + GalleryInVMAccessControlProfileVersion, + GalleryInVMAccessControlProfileVersionUpdate, +} from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryInVMAccessControlProfileVersions operations. */ +export interface GalleryInVMAccessControlProfileVersionsOperations { + /** List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile */ + listByGalleryInVMAccessControlProfile: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery inVMAccessControlProfile version. */ + /** + * @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, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ) => Promise; + /** Update a gallery inVMAccessControlProfile version. */ + update: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ) => PollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion + >; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion + > + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ) => Promise; + /** Create or update a gallery inVMAccessControlProfile version. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ) => PollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersion + > + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a gallery inVMAccessControlProfile version. */ + get: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams, + ) => Promise; +} + +function _getGalleryInVMAccessControlProfileVersions(context: ComputeManagementContext) { + return { + listByGalleryInVMAccessControlProfile: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + ) => + listByGalleryInVMAccessControlProfile( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + ), + delete: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + ); + }, + update: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + ), + }; +} + +export function _getGalleryInVMAccessControlProfileVersionsOperations( + context: ComputeManagementContext, +): GalleryInVMAccessControlProfileVersionsOperations { + return { + ..._getGalleryInVMAccessControlProfileVersions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfiles/index.ts b/sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfiles/index.ts new file mode 100644 index 000000000000..9294958d16ca --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryInVMAccessControlProfiles/index.ts @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGallery, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryInVMAccessControlProfiles/operations.js"; +import type { + GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + GalleryInVMAccessControlProfilesDeleteOptionalParams, + GalleryInVMAccessControlProfilesUpdateOptionalParams, + GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfilesGetOptionalParams, +} from "../../api/galleryInVMAccessControlProfiles/options.js"; +import type { + GalleryInVMAccessControlProfile, + GalleryInVMAccessControlProfileUpdate, +} from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryInVMAccessControlProfiles operations. */ +export interface GalleryInVMAccessControlProfilesOperations { + /** List gallery inVMAccessControlProfiles in a gallery. */ + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery inVMAccessControlProfile. */ + /** + * @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, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ) => Promise; + /** Update a gallery inVMAccessControlProfile. */ + update: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ) => PollerLike, GalleryInVMAccessControlProfile>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfile + > + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ) => Promise; + /** Create or update a gallery inVMAccessControlProfile. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryInVMAccessControlProfile>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfile + > + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a gallery inVMAccessControlProfile. */ + get: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesGetOptionalParams, + ) => Promise; +} + +function _getGalleryInVMAccessControlProfiles(context: ComputeManagementContext) { + return { + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + ) => listByGallery(context, resourceGroupName, galleryName, options), + delete: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, galleryName, inVMAccessControlProfileName, options), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + ); + }, + update: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesGetOptionalParams, + ) => get(context, resourceGroupName, galleryName, inVMAccessControlProfileName, options), + }; +} + +export function _getGalleryInVMAccessControlProfilesOperations( + context: ComputeManagementContext, +): GalleryInVMAccessControlProfilesOperations { + return { + ..._getGalleryInVMAccessControlProfiles(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryScriptVersions/index.ts b/sdk/compute/arm-compute/src/classic/galleryScriptVersions/index.ts new file mode 100644 index 000000000000..b0e06f6c1c69 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryScriptVersions/index.ts @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGalleryScript, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryScriptVersions/operations.js"; +import type { + GalleryScriptVersionsListByGalleryScriptOptionalParams, + GalleryScriptVersionsDeleteOptionalParams, + GalleryScriptVersionsUpdateOptionalParams, + GalleryScriptVersionsCreateOrUpdateOptionalParams, + GalleryScriptVersionsGetOptionalParams, +} from "../../api/galleryScriptVersions/options.js"; +import type { + GalleryScriptVersion, + GalleryScriptVersionUpdate, +} from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryScriptVersions operations. */ +export interface GalleryScriptVersionsOperations { + /** List gallery Script Versions in a gallery Script Definition. */ + listByGalleryScript: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptVersionsListByGalleryScriptOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery Script Version. */ + /** + * @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, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsDeleteOptionalParams, + ) => Promise; + /** Update a gallery Script Version. */ + update: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options?: GalleryScriptVersionsUpdateOptionalParams, + ) => PollerLike, GalleryScriptVersion>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options?: GalleryScriptVersionsUpdateOptionalParams, + ) => Promise, GalleryScriptVersion>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options?: GalleryScriptVersionsUpdateOptionalParams, + ) => Promise; + /** Create or update a gallery Script Version. */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryScriptVersion>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, + ) => Promise, GalleryScriptVersion>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, + ) => Promise; + /** Custom ArmResourceRead operation template with CloudError as Error */ + get: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsGetOptionalParams, + ) => Promise; +} + +function _getGalleryScriptVersions(context: ComputeManagementContext) { + return { + listByGalleryScript: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptVersionsListByGalleryScriptOptionalParams, + ) => listByGalleryScript(context, resourceGroupName, galleryName, galleryScriptName, options), + delete: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + options, + ); + }, + update: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options?: GalleryScriptVersionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options?: GalleryScriptVersionsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersionUpdate, + options?: GalleryScriptVersionsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + galleryScriptVersion: GalleryScriptVersion, + options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + galleryScriptVersion, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScriptVersionName: string, + options?: GalleryScriptVersionsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScriptVersionName, + options, + ), + }; +} + +export function _getGalleryScriptVersionsOperations( + context: ComputeManagementContext, +): GalleryScriptVersionsOperations { + return { + ..._getGalleryScriptVersions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/galleryScripts/index.ts b/sdk/compute/arm-compute/src/classic/galleryScripts/index.ts new file mode 100644 index 000000000000..16cbd9987f9a --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/galleryScripts/index.ts @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByGallery, + $delete, + update, + createOrUpdate, + get, +} from "../../api/galleryScripts/operations.js"; +import type { + GalleryScriptsListByGalleryOptionalParams, + GalleryScriptsDeleteOptionalParams, + GalleryScriptsUpdateOptionalParams, + GalleryScriptsCreateOrUpdateOptionalParams, + GalleryScriptsGetOptionalParams, +} from "../../api/galleryScripts/options.js"; +import type { GalleryScript, GalleryScriptUpdate } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GalleryScripts operations. */ +export interface GalleryScriptsOperations { + /** List gallery Script Definitions in a gallery. */ + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryScriptsListByGalleryOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a gallery Script Definition. */ + /** + * @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, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsDeleteOptionalParams, + ) => Promise; + /** Update a gallery Script Definition. */ + update: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options?: GalleryScriptsUpdateOptionalParams, + ) => PollerLike, GalleryScript>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options?: GalleryScriptsUpdateOptionalParams, + ) => Promise, GalleryScript>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options?: GalleryScriptsUpdateOptionalParams, + ) => Promise; + /** Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common scripts */ + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options?: GalleryScriptsCreateOrUpdateOptionalParams, + ) => PollerLike, GalleryScript>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options?: GalleryScriptsCreateOrUpdateOptionalParams, + ) => Promise, GalleryScript>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options?: GalleryScriptsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a gallery script definition. */ + get: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsGetOptionalParams, + ) => Promise; +} + +function _getGalleryScripts(context: ComputeManagementContext) { + return { + listByGallery: ( + resourceGroupName: string, + galleryName: string, + options?: GalleryScriptsListByGalleryOptionalParams, + ) => listByGallery(context, resourceGroupName, galleryName, options), + delete: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, galleryName, galleryScriptName, options), + beginDelete: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, galleryName, galleryScriptName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, galleryName, galleryScriptName, options); + }, + update: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options?: GalleryScriptsUpdateOptionalParams, + ) => update(context, resourceGroupName, galleryName, galleryScriptName, galleryScript, options), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options?: GalleryScriptsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScript, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScriptUpdate, + options?: GalleryScriptsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScript, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options?: GalleryScriptsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScript, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options?: GalleryScriptsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScript, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + galleryScript: GalleryScript, + options?: GalleryScriptsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + galleryName, + galleryScriptName, + galleryScript, + options, + ); + }, + get: ( + resourceGroupName: string, + galleryName: string, + galleryScriptName: string, + options?: GalleryScriptsGetOptionalParams, + ) => get(context, resourceGroupName, galleryName, galleryScriptName, options), + }; +} + +export function _getGalleryScriptsOperations( + context: ComputeManagementContext, +): GalleryScriptsOperations { + return { + ..._getGalleryScripts(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/gallerySharingProfile/index.ts b/sdk/compute/arm-compute/src/classic/gallerySharingProfile/index.ts new file mode 100644 index 000000000000..fdf8f08d9e22 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/gallerySharingProfile/index.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { update } from "../../api/gallerySharingProfile/operations.js"; +import type { GallerySharingProfileUpdateOptionalParams } from "../../api/gallerySharingProfile/options.js"; +import type { SharingUpdate } from "../../models/computeGallery/models.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a GallerySharingProfile operations. */ +export interface GallerySharingProfileOperations { + /** Update sharing profile of a gallery. */ + update: ( + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options?: GallerySharingProfileUpdateOptionalParams, + ) => PollerLike, SharingUpdate>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options?: GallerySharingProfileUpdateOptionalParams, + ) => Promise, SharingUpdate>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options?: GallerySharingProfileUpdateOptionalParams, + ) => Promise; +} + +function _getGallerySharingProfile(context: ComputeManagementContext) { + return { + update: ( + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options?: GallerySharingProfileUpdateOptionalParams, + ) => update(context, resourceGroupName, galleryName, sharingUpdate, options), + beginUpdate: async ( + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options?: GallerySharingProfileUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, galleryName, sharingUpdate, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + galleryName: string, + sharingUpdate: SharingUpdate, + options?: GallerySharingProfileUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, galleryName, sharingUpdate, options); + }, + }; +} + +export function _getGallerySharingProfileOperations( + context: ComputeManagementContext, +): GallerySharingProfileOperations { + return { + ..._getGallerySharingProfile(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/images/index.ts b/sdk/compute/arm-compute/src/classic/images/index.ts new file mode 100644 index 000000000000..c1e1f011434e --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/images/index.ts @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/images/operations.js"; +import type { + ImagesListOptionalParams, + ImagesListByResourceGroupOptionalParams, + ImagesDeleteOptionalParams, + ImagesUpdateOptionalParams, + ImagesCreateOrUpdateOptionalParams, + ImagesGetOptionalParams, +} from "../../api/images/options.js"; +import type { Image, ImageUpdate } from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Images operations. */ +export interface ImagesOperations { + /** Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. */ + list: (options?: ImagesListOptionalParams) => PagedAsyncIterableIterator; + /** Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: ImagesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes an Image. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + imageName: string, + options?: ImagesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + imageName: string, + options?: ImagesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + imageName: string, + options?: ImagesDeleteOptionalParams, + ) => Promise; + /** Update an image. */ + update: ( + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options?: ImagesUpdateOptionalParams, + ) => PollerLike, Image>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options?: ImagesUpdateOptionalParams, + ) => Promise, Image>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options?: ImagesUpdateOptionalParams, + ) => Promise; + /** Create or update an image. */ + createOrUpdate: ( + resourceGroupName: string, + imageName: string, + parameters: Image, + options?: ImagesCreateOrUpdateOptionalParams, + ) => PollerLike, Image>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + imageName: string, + parameters: Image, + options?: ImagesCreateOrUpdateOptionalParams, + ) => Promise, Image>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + imageName: string, + parameters: Image, + options?: ImagesCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets an image. */ + get: ( + resourceGroupName: string, + imageName: string, + options?: ImagesGetOptionalParams, + ) => Promise; +} + +function _getImages(context: ComputeManagementContext) { + return { + list: (options?: ImagesListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: ImagesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: (resourceGroupName: string, imageName: string, options?: ImagesDeleteOptionalParams) => + $delete(context, resourceGroupName, imageName, options), + beginDelete: async ( + resourceGroupName: string, + imageName: string, + options?: ImagesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, imageName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + imageName: string, + options?: ImagesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, imageName, options); + }, + update: ( + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options?: ImagesUpdateOptionalParams, + ) => update(context, resourceGroupName, imageName, parameters, options), + beginUpdate: async ( + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options?: ImagesUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, imageName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + imageName: string, + parameters: ImageUpdate, + options?: ImagesUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, imageName, parameters, options); + }, + createOrUpdate: ( + resourceGroupName: string, + imageName: string, + parameters: Image, + options?: ImagesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, imageName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + imageName: string, + parameters: Image, + options?: ImagesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate(context, resourceGroupName, imageName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + imageName: string, + parameters: Image, + options?: ImagesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, imageName, parameters, options); + }, + get: (resourceGroupName: string, imageName: string, options?: ImagesGetOptionalParams) => + get(context, resourceGroupName, imageName, options), + }; +} + +export function _getImagesOperations(context: ComputeManagementContext): ImagesOperations { + return { + ..._getImages(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/index.ts b/sdk/compute/arm-compute/src/classic/index.ts new file mode 100644 index 000000000000..ce6cb6669cbc --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/index.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { AvailabilitySetsOperations } from "./availabilitySets/index.js"; +export type { CapacityReservationGroupsOperations } from "./capacityReservationGroups/index.js"; +export type { CapacityReservationsOperations } from "./capacityReservations/index.js"; +export type { CommunityGalleriesOperations } from "./communityGalleries/index.js"; +export type { CommunityGalleryImagesOperations } from "./communityGalleryImages/index.js"; +export type { CommunityGalleryImageVersionsOperations } from "./communityGalleryImageVersions/index.js"; +export type { DedicatedHostGroupsOperations } from "./dedicatedHostGroups/index.js"; +export type { DedicatedHostsOperations } from "./dedicatedHosts/index.js"; +export type { DiskAccessesOperations } from "./diskAccesses/index.js"; +export type { DiskEncryptionSetsOperations } from "./diskEncryptionSets/index.js"; +export type { DiskRestorePointOperations } from "./diskRestorePoint/index.js"; +export type { DisksOperations } from "./disks/index.js"; +export type { GalleriesOperations } from "./galleries/index.js"; +export type { GalleryApplicationsOperations } from "./galleryApplications/index.js"; +export type { GalleryApplicationVersionsOperations } from "./galleryApplicationVersions/index.js"; +export type { GalleryImagesOperations } from "./galleryImages/index.js"; +export type { GalleryImageVersionsOperations } from "./galleryImageVersions/index.js"; +export type { GalleryInVMAccessControlProfilesOperations } from "./galleryInVMAccessControlProfiles/index.js"; +export type { GalleryInVMAccessControlProfileVersionsOperations } from "./galleryInVMAccessControlProfileVersions/index.js"; +export type { GalleryScriptsOperations } from "./galleryScripts/index.js"; +export type { GalleryScriptVersionsOperations } from "./galleryScriptVersions/index.js"; +export type { GallerySharingProfileOperations } from "./gallerySharingProfile/index.js"; +export type { ImagesOperations } from "./images/index.js"; +export type { LogAnalyticsOperations } from "./logAnalytics/index.js"; +export type { OperationsOperations } from "./operations/index.js"; +export type { ProximityPlacementGroupsOperations } from "./proximityPlacementGroups/index.js"; +export type { ResourceSkusOperations } from "./resourceSkus/index.js"; +export type { RestorePointCollectionsOperations } from "./restorePointCollections/index.js"; +export type { RestorePointsOperations } from "./restorePoints/index.js"; +export type { SharedGalleriesOperations } from "./sharedGalleries/index.js"; +export type { SharedGalleryImagesOperations } from "./sharedGalleryImages/index.js"; +export type { SharedGalleryImageVersionsOperations } from "./sharedGalleryImageVersions/index.js"; +export type { SnapshotsOperations } from "./snapshots/index.js"; +export type { SoftDeletedResourceOperations } from "./softDeletedResource/index.js"; +export type { SshPublicKeysOperations } from "./sshPublicKeys/index.js"; +export type { UsageOperations } from "./usage/index.js"; +export type { VirtualMachineExtensionImagesOperations } from "./virtualMachineExtensionImages/index.js"; +export type { VirtualMachineExtensionsOperations } from "./virtualMachineExtensions/index.js"; +export type { VirtualMachineImagesOperations } from "./virtualMachineImages/index.js"; +export type { VirtualMachineImagesEdgeZoneOperations } from "./virtualMachineImagesEdgeZone/index.js"; +export type { VirtualMachineRunCommandsOperations } from "./virtualMachineRunCommands/index.js"; +export type { VirtualMachinesOperations } from "./virtualMachines/index.js"; +export type { VirtualMachineScaleSetExtensionsOperations } from "./virtualMachineScaleSetExtensions/index.js"; +export type { VirtualMachineScaleSetLifeCycleHookEventsOperations } from "./virtualMachineScaleSetLifeCycleHookEvents/index.js"; +export type { VirtualMachineScaleSetRollingUpgradesOperations } from "./virtualMachineScaleSetRollingUpgrades/index.js"; +export type { VirtualMachineScaleSetsOperations } from "./virtualMachineScaleSets/index.js"; +export type { VirtualMachineScaleSetVMExtensionsOperations } from "./virtualMachineScaleSetVMExtensions/index.js"; +export type { VirtualMachineScaleSetVMRunCommandsOperations } from "./virtualMachineScaleSetVMRunCommands/index.js"; +export type { VirtualMachineScaleSetVMsOperations } from "./virtualMachineScaleSetVMs/index.js"; +export type { VirtualMachineSizesOperations } from "./virtualMachineSizes/index.js"; diff --git a/sdk/compute/arm-compute/src/classic/logAnalytics/index.ts b/sdk/compute/arm-compute/src/classic/logAnalytics/index.ts new file mode 100644 index 000000000000..844311e3299e --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/logAnalytics/index.ts @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + exportThrottledRequests, + exportRequestRateByInterval, +} from "../../api/logAnalytics/operations.js"; +import type { + LogAnalyticsExportThrottledRequestsOptionalParams, + LogAnalyticsExportRequestRateByIntervalOptionalParams, +} from "../../api/logAnalytics/options.js"; +import type { + RequestRateByIntervalInput, + LogAnalyticsOperationResult, + ThrottledRequestsInput, +} from "../../models/compute/models.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a LogAnalytics operations. */ +export interface LogAnalyticsOperations { + /** Export logs that show total throttled Api requests for this subscription in the given time window. */ + exportThrottledRequests: ( + location: string, + parameters: ThrottledRequestsInput, + options?: LogAnalyticsExportThrottledRequestsOptionalParams, + ) => PollerLike, LogAnalyticsOperationResult>; + /** @deprecated use exportThrottledRequests instead */ + beginExportThrottledRequests: ( + location: string, + parameters: ThrottledRequestsInput, + options?: LogAnalyticsExportThrottledRequestsOptionalParams, + ) => Promise< + SimplePollerLike, LogAnalyticsOperationResult> + >; + /** @deprecated use exportThrottledRequests instead */ + beginExportThrottledRequestsAndWait: ( + location: string, + parameters: ThrottledRequestsInput, + options?: LogAnalyticsExportThrottledRequestsOptionalParams, + ) => Promise; + /** Export logs that show Api requests made by this subscription in the given time window to show throttling activities. */ + exportRequestRateByInterval: ( + location: string, + parameters: RequestRateByIntervalInput, + options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, + ) => PollerLike, LogAnalyticsOperationResult>; + /** @deprecated use exportRequestRateByInterval instead */ + beginExportRequestRateByInterval: ( + location: string, + parameters: RequestRateByIntervalInput, + options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, + ) => Promise< + SimplePollerLike, LogAnalyticsOperationResult> + >; + /** @deprecated use exportRequestRateByInterval instead */ + beginExportRequestRateByIntervalAndWait: ( + location: string, + parameters: RequestRateByIntervalInput, + options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, + ) => Promise; +} + +function _getLogAnalytics(context: ComputeManagementContext) { + return { + exportThrottledRequests: ( + location: string, + parameters: ThrottledRequestsInput, + options?: LogAnalyticsExportThrottledRequestsOptionalParams, + ) => exportThrottledRequests(context, location, parameters, options), + beginExportThrottledRequests: async ( + location: string, + parameters: ThrottledRequestsInput, + options?: LogAnalyticsExportThrottledRequestsOptionalParams, + ) => { + const poller = exportThrottledRequests(context, location, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginExportThrottledRequestsAndWait: async ( + location: string, + parameters: ThrottledRequestsInput, + options?: LogAnalyticsExportThrottledRequestsOptionalParams, + ) => { + return await exportThrottledRequests(context, location, parameters, options); + }, + exportRequestRateByInterval: ( + location: string, + parameters: RequestRateByIntervalInput, + options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, + ) => exportRequestRateByInterval(context, location, parameters, options), + beginExportRequestRateByInterval: async ( + location: string, + parameters: RequestRateByIntervalInput, + options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, + ) => { + const poller = exportRequestRateByInterval(context, location, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginExportRequestRateByIntervalAndWait: async ( + location: string, + parameters: RequestRateByIntervalInput, + options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, + ) => { + return await exportRequestRateByInterval(context, location, parameters, options); + }, + }; +} + +export function _getLogAnalyticsOperations( + context: ComputeManagementContext, +): LogAnalyticsOperations { + return { + ..._getLogAnalytics(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/operations/index.ts b/sdk/compute/arm-compute/src/classic/operations/index.ts new file mode 100644 index 000000000000..7b7f632a0981 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.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: ComputeManagementContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: ComputeManagementContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/proximityPlacementGroups/index.ts b/sdk/compute/arm-compute/src/classic/proximityPlacementGroups/index.ts new file mode 100644 index 000000000000..4bfa000dfcf5 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/proximityPlacementGroups/index.ts @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/proximityPlacementGroups/operations.js"; +import type { + ProximityPlacementGroupsListBySubscriptionOptionalParams, + ProximityPlacementGroupsListByResourceGroupOptionalParams, + ProximityPlacementGroupsDeleteOptionalParams, + ProximityPlacementGroupsUpdateOptionalParams, + ProximityPlacementGroupsCreateOrUpdateOptionalParams, + ProximityPlacementGroupsGetOptionalParams, +} from "../../api/proximityPlacementGroups/options.js"; +import type { + ProximityPlacementGroup, + ProximityPlacementGroupUpdate, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ProximityPlacementGroups operations. */ +export interface ProximityPlacementGroupsOperations { + /** Lists all proximity placement groups in a subscription. */ + listBySubscription: ( + options?: ProximityPlacementGroupsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all proximity placement groups in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a proximity placement group. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + options?: ProximityPlacementGroupsDeleteOptionalParams, + ) => Promise; + /** Update a proximity placement group. */ + update: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroupUpdate, + options?: ProximityPlacementGroupsUpdateOptionalParams, + ) => Promise; + /** Create or update a proximity placement group. */ + createOrUpdate: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroup, + options?: ProximityPlacementGroupsCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about a proximity placement group . */ + get: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + options?: ProximityPlacementGroupsGetOptionalParams, + ) => Promise; +} + +function _getProximityPlacementGroups(context: ComputeManagementContext) { + return { + listBySubscription: (options?: ProximityPlacementGroupsListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + options?: ProximityPlacementGroupsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, proximityPlacementGroupName, options), + update: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroupUpdate, + options?: ProximityPlacementGroupsUpdateOptionalParams, + ) => update(context, resourceGroupName, proximityPlacementGroupName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + parameters: ProximityPlacementGroup, + options?: ProximityPlacementGroupsCreateOrUpdateOptionalParams, + ) => + createOrUpdate(context, resourceGroupName, proximityPlacementGroupName, parameters, options), + get: ( + resourceGroupName: string, + proximityPlacementGroupName: string, + options?: ProximityPlacementGroupsGetOptionalParams, + ) => get(context, resourceGroupName, proximityPlacementGroupName, options), + }; +} + +export function _getProximityPlacementGroupsOperations( + context: ComputeManagementContext, +): ProximityPlacementGroupsOperations { + return { + ..._getProximityPlacementGroups(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/resourceSkus/index.ts b/sdk/compute/arm-compute/src/classic/resourceSkus/index.ts new file mode 100644 index 000000000000..7545e3a66639 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/resourceSkus/index.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list } from "../../api/resourceSkus/operations.js"; +import type { ResourceSkusListOptionalParams } from "../../api/resourceSkus/options.js"; +import type { ResourceSku } from "../../models/computeSku/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ResourceSkus operations. */ +export interface ResourceSkusOperations { + /** Gets the list of Microsoft.Compute SKUs available for your Subscription. */ + list: (options?: ResourceSkusListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getResourceSkus(context: ComputeManagementContext) { + return { + list: (options?: ResourceSkusListOptionalParams) => list(context, options), + }; +} + +export function _getResourceSkusOperations( + context: ComputeManagementContext, +): ResourceSkusOperations { + return { + ..._getResourceSkus(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/restorePointCollections/index.ts b/sdk/compute/arm-compute/src/classic/restorePointCollections/index.ts new file mode 100644 index 000000000000..63864d3ba782 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/restorePointCollections/index.ts @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listAll, + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/restorePointCollections/operations.js"; +import type { + RestorePointCollectionsListAllOptionalParams, + RestorePointCollectionsListOptionalParams, + RestorePointCollectionsDeleteOptionalParams, + RestorePointCollectionsUpdateOptionalParams, + RestorePointCollectionsCreateOrUpdateOptionalParams, + RestorePointCollectionsGetOptionalParams, +} from "../../api/restorePointCollections/options.js"; +import type { + RestorePointCollection, + RestorePointCollectionUpdate, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a RestorePointCollections operations. */ +export interface RestorePointCollectionsOperations { + /** Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections. */ + listAll: ( + options?: RestorePointCollectionsListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the list of restore point collections in a resource group. */ + list: ( + resourceGroupName: string, + options?: RestorePointCollectionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete the restore point collection. This operation will also delete all the contained restore points. */ + /** + * @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, + restorePointCollectionName: string, + options?: RestorePointCollectionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + restorePointCollectionName: string, + options?: RestorePointCollectionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + restorePointCollectionName: string, + options?: RestorePointCollectionsDeleteOptionalParams, + ) => Promise; + /** The operation to update the restore point collection. */ + update: ( + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollectionUpdate, + options?: RestorePointCollectionsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. */ + createOrUpdate: ( + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollection, + options?: RestorePointCollectionsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation to get the restore point collection. */ + get: ( + resourceGroupName: string, + restorePointCollectionName: string, + options?: RestorePointCollectionsGetOptionalParams, + ) => Promise; +} + +function _getRestorePointCollections(context: ComputeManagementContext) { + return { + listAll: (options?: RestorePointCollectionsListAllOptionalParams) => listAll(context, options), + list: (resourceGroupName: string, options?: RestorePointCollectionsListOptionalParams) => + list(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + restorePointCollectionName: string, + options?: RestorePointCollectionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, restorePointCollectionName, options), + beginDelete: async ( + resourceGroupName: string, + restorePointCollectionName: string, + options?: RestorePointCollectionsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, restorePointCollectionName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + restorePointCollectionName: string, + options?: RestorePointCollectionsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, restorePointCollectionName, options); + }, + update: ( + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollectionUpdate, + options?: RestorePointCollectionsUpdateOptionalParams, + ) => update(context, resourceGroupName, restorePointCollectionName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + restorePointCollectionName: string, + parameters: RestorePointCollection, + options?: RestorePointCollectionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate(context, resourceGroupName, restorePointCollectionName, parameters, options), + get: ( + resourceGroupName: string, + restorePointCollectionName: string, + options?: RestorePointCollectionsGetOptionalParams, + ) => get(context, resourceGroupName, restorePointCollectionName, options), + }; +} + +export function _getRestorePointCollectionsOperations( + context: ComputeManagementContext, +): RestorePointCollectionsOperations { + return { + ..._getRestorePointCollections(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/restorePoints/index.ts b/sdk/compute/arm-compute/src/classic/restorePoints/index.ts new file mode 100644 index 000000000000..e598fa25dba1 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/restorePoints/index.ts @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { $delete, create, get } from "../../api/restorePoints/operations.js"; +import type { + RestorePointsDeleteOptionalParams, + RestorePointsCreateOptionalParams, + RestorePointsGetOptionalParams, +} from "../../api/restorePoints/options.js"; +import type { RestorePoint } from "../../models/compute/models.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a RestorePoints operations. */ +export interface RestorePointsOperations { + /** The operation to delete the restore point. */ + /** + * @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, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsDeleteOptionalParams, + ) => Promise; + /** The operation to create the restore point. Updating properties of an existing restore point is not allowed */ + create: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options?: RestorePointsCreateOptionalParams, + ) => PollerLike, RestorePoint>; + /** @deprecated use create instead */ + beginCreate: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options?: RestorePointsCreateOptionalParams, + ) => Promise, RestorePoint>>; + /** @deprecated use create instead */ + beginCreateAndWait: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options?: RestorePointsCreateOptionalParams, + ) => Promise; + /** The operation to get the restore point. */ + get: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsGetOptionalParams, + ) => Promise; +} + +function _getRestorePoints(context: ComputeManagementContext) { + return { + delete: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, restorePointCollectionName, restorePointName, options), + beginDelete: async ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + options, + ); + }, + create: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options?: RestorePointsCreateOptionalParams, + ) => + create( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters, + options, + ), + beginCreate: async ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options?: RestorePointsCreateOptionalParams, + ) => { + const poller = create( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateAndWait: async ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + parameters: RestorePoint, + options?: RestorePointsCreateOptionalParams, + ) => { + return await create( + context, + resourceGroupName, + restorePointCollectionName, + restorePointName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + restorePointCollectionName: string, + restorePointName: string, + options?: RestorePointsGetOptionalParams, + ) => get(context, resourceGroupName, restorePointCollectionName, restorePointName, options), + }; +} + +export function _getRestorePointsOperations( + context: ComputeManagementContext, +): RestorePointsOperations { + return { + ..._getRestorePoints(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/sharedGalleries/index.ts b/sdk/compute/arm-compute/src/classic/sharedGalleries/index.ts new file mode 100644 index 000000000000..4820c3d149fe --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/sharedGalleries/index.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list, get } from "../../api/sharedGalleries/operations.js"; +import type { + SharedGalleriesListOptionalParams, + SharedGalleriesGetOptionalParams, +} from "../../api/sharedGalleries/options.js"; +import type { SharedGallery } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a SharedGalleries operations. */ +export interface SharedGalleriesOperations { + /** List shared galleries by subscription id or tenant id. */ + list: ( + location: string, + options?: SharedGalleriesListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a shared gallery by subscription id or tenant id. */ + get: ( + location: string, + galleryUniqueName: string, + options?: SharedGalleriesGetOptionalParams, + ) => Promise; +} + +function _getSharedGalleries(context: ComputeManagementContext) { + return { + list: (location: string, options?: SharedGalleriesListOptionalParams) => + list(context, location, options), + get: ( + location: string, + galleryUniqueName: string, + options?: SharedGalleriesGetOptionalParams, + ) => get(context, location, galleryUniqueName, options), + }; +} + +export function _getSharedGalleriesOperations( + context: ComputeManagementContext, +): SharedGalleriesOperations { + return { + ..._getSharedGalleries(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/sharedGalleryImageVersions/index.ts b/sdk/compute/arm-compute/src/classic/sharedGalleryImageVersions/index.ts new file mode 100644 index 000000000000..69fe5a8ec170 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/sharedGalleryImageVersions/index.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list, get } from "../../api/sharedGalleryImageVersions/operations.js"; +import type { + SharedGalleryImageVersionsListOptionalParams, + SharedGalleryImageVersionsGetOptionalParams, +} from "../../api/sharedGalleryImageVersions/options.js"; +import type { SharedGalleryImageVersion } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a SharedGalleryImageVersions operations. */ +export interface SharedGalleryImageVersionsOperations { + /** List shared gallery image versions by subscription id or tenant id. */ + list: ( + location: string, + galleryUniqueName: string, + galleryImageName: string, + options?: SharedGalleryImageVersionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a shared gallery image version by subscription id or tenant id. */ + get: ( + location: string, + galleryUniqueName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: SharedGalleryImageVersionsGetOptionalParams, + ) => Promise; +} + +function _getSharedGalleryImageVersions(context: ComputeManagementContext) { + return { + list: ( + location: string, + galleryUniqueName: string, + galleryImageName: string, + options?: SharedGalleryImageVersionsListOptionalParams, + ) => list(context, location, galleryUniqueName, galleryImageName, options), + get: ( + location: string, + galleryUniqueName: string, + galleryImageName: string, + galleryImageVersionName: string, + options?: SharedGalleryImageVersionsGetOptionalParams, + ) => + get(context, location, galleryUniqueName, galleryImageName, galleryImageVersionName, options), + }; +} + +export function _getSharedGalleryImageVersionsOperations( + context: ComputeManagementContext, +): SharedGalleryImageVersionsOperations { + return { + ..._getSharedGalleryImageVersions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/sharedGalleryImages/index.ts b/sdk/compute/arm-compute/src/classic/sharedGalleryImages/index.ts new file mode 100644 index 000000000000..a6d87dda3c0a --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/sharedGalleryImages/index.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list, get } from "../../api/sharedGalleryImages/operations.js"; +import type { + SharedGalleryImagesListOptionalParams, + SharedGalleryImagesGetOptionalParams, +} from "../../api/sharedGalleryImages/options.js"; +import type { SharedGalleryImage } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a SharedGalleryImages operations. */ +export interface SharedGalleryImagesOperations { + /** List shared gallery images by subscription id or tenant id. */ + list: ( + location: string, + galleryUniqueName: string, + options?: SharedGalleryImagesListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a shared gallery image by subscription id or tenant id. */ + get: ( + location: string, + galleryUniqueName: string, + galleryImageName: string, + options?: SharedGalleryImagesGetOptionalParams, + ) => Promise; +} + +function _getSharedGalleryImages(context: ComputeManagementContext) { + return { + list: ( + location: string, + galleryUniqueName: string, + options?: SharedGalleryImagesListOptionalParams, + ) => list(context, location, galleryUniqueName, options), + get: ( + location: string, + galleryUniqueName: string, + galleryImageName: string, + options?: SharedGalleryImagesGetOptionalParams, + ) => get(context, location, galleryUniqueName, galleryImageName, options), + }; +} + +export function _getSharedGalleryImagesOperations( + context: ComputeManagementContext, +): SharedGalleryImagesOperations { + return { + ..._getSharedGalleryImages(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/snapshots/index.ts b/sdk/compute/arm-compute/src/classic/snapshots/index.ts new file mode 100644 index 000000000000..1dfdaa46da15 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/snapshots/index.ts @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + revokeAccess, + grantAccess, + list, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/snapshots/operations.js"; +import type { + SnapshotsRevokeAccessOptionalParams, + SnapshotsGrantAccessOptionalParams, + SnapshotsListOptionalParams, + SnapshotsListByResourceGroupOptionalParams, + SnapshotsDeleteOptionalParams, + SnapshotsUpdateOptionalParams, + SnapshotsCreateOrUpdateOptionalParams, + SnapshotsGetOptionalParams, +} from "../../api/snapshots/options.js"; +import type { + GrantAccessData, + AccessUri, + Snapshot, + SnapshotUpdate, +} from "../../models/computeDisk/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Snapshots operations. */ +export interface SnapshotsOperations { + /** Revokes access to a snapshot. */ + revokeAccess: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ) => PollerLike, void>; + /** @deprecated use revokeAccess instead */ + beginRevokeAccess: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ) => Promise, void>>; + /** @deprecated use revokeAccess instead */ + beginRevokeAccessAndWait: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ) => Promise; + /** Grants access to a snapshot. */ + grantAccess: ( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ) => PollerLike, AccessUri>; + /** @deprecated use grantAccess instead */ + beginGrantAccess: ( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ) => Promise, AccessUri>>; + /** @deprecated use grantAccess instead */ + beginGrantAccessAndWait: ( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ) => Promise; + /** Lists snapshots under a subscription. */ + list: (options?: SnapshotsListOptionalParams) => PagedAsyncIterableIterator; + /** Lists snapshots under a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: SnapshotsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a snapshot. */ + /** + * @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, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ) => Promise; + /** Updates (patches) a snapshot. */ + update: ( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ) => PollerLike, Snapshot>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ) => Promise, Snapshot>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ) => Promise; + /** Creates or updates a snapshot. */ + createOrUpdate: ( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ) => PollerLike, Snapshot>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ) => Promise, Snapshot>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about a snapshot. */ + get: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsGetOptionalParams, + ) => Promise; +} + +function _getSnapshots(context: ComputeManagementContext) { + return { + revokeAccess: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ) => revokeAccess(context, resourceGroupName, snapshotName, options), + beginRevokeAccess: async ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ) => { + const poller = revokeAccess(context, resourceGroupName, snapshotName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRevokeAccessAndWait: async ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ) => { + return await revokeAccess(context, resourceGroupName, snapshotName, options); + }, + grantAccess: ( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ) => grantAccess(context, resourceGroupName, snapshotName, grantAccessData, options), + beginGrantAccess: async ( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ) => { + const poller = grantAccess( + context, + resourceGroupName, + snapshotName, + grantAccessData, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginGrantAccessAndWait: async ( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ) => { + return await grantAccess(context, resourceGroupName, snapshotName, grantAccessData, options); + }, + list: (options?: SnapshotsListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: SnapshotsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, snapshotName, options), + beginDelete: async ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, snapshotName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, snapshotName, options); + }, + update: ( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ) => update(context, resourceGroupName, snapshotName, snapshot, options), + beginUpdate: async ( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, snapshotName, snapshot, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, snapshotName, snapshot, options); + }, + createOrUpdate: ( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, snapshotName, snapshot, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate(context, resourceGroupName, snapshotName, snapshot, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, snapshotName, snapshot, options); + }, + get: (resourceGroupName: string, snapshotName: string, options?: SnapshotsGetOptionalParams) => + get(context, resourceGroupName, snapshotName, options), + }; +} + +export function _getSnapshotsOperations(context: ComputeManagementContext): SnapshotsOperations { + return { + ..._getSnapshots(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/softDeletedResource/index.ts b/sdk/compute/arm-compute/src/classic/softDeletedResource/index.ts new file mode 100644 index 000000000000..54ffec7c86be --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/softDeletedResource/index.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { listByArtifactName } from "../../api/softDeletedResource/operations.js"; +import type { SoftDeletedResourceListByArtifactNameOptionalParams } from "../../api/softDeletedResource/options.js"; +import type { GallerySoftDeletedResource } from "../../models/computeGallery/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a SoftDeletedResource operations. */ +export interface SoftDeletedResourceOperations { + /** List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image version of an image. */ + listByArtifactName: ( + resourceGroupName: string, + galleryName: string, + artifactType: string, + artifactName: string, + options?: SoftDeletedResourceListByArtifactNameOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getSoftDeletedResource(context: ComputeManagementContext) { + return { + listByArtifactName: ( + resourceGroupName: string, + galleryName: string, + artifactType: string, + artifactName: string, + options?: SoftDeletedResourceListByArtifactNameOptionalParams, + ) => + listByArtifactName( + context, + resourceGroupName, + galleryName, + artifactType, + artifactName, + options, + ), + }; +} + +export function _getSoftDeletedResourceOperations( + context: ComputeManagementContext, +): SoftDeletedResourceOperations { + return { + ..._getSoftDeletedResource(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/sshPublicKeys/index.ts b/sdk/compute/arm-compute/src/classic/sshPublicKeys/index.ts new file mode 100644 index 000000000000..8da4cffed1f1 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/sshPublicKeys/index.ts @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + generateKeyPair, + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/sshPublicKeys/operations.js"; +import type { + SshPublicKeysGenerateKeyPairOptionalParams, + SshPublicKeysListBySubscriptionOptionalParams, + SshPublicKeysListByResourceGroupOptionalParams, + SshPublicKeysDeleteOptionalParams, + SshPublicKeysUpdateOptionalParams, + SshPublicKeysCreateOptionalParams, + SshPublicKeysGetOptionalParams, +} from "../../api/sshPublicKeys/options.js"; +import type { + SshPublicKeyResource, + SshPublicKeyUpdateResource, + SshPublicKeyGenerateKeyPairResult, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a SshPublicKeys operations. */ +export interface SshPublicKeysOperations { + /** Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. */ + generateKeyPair: ( + resourceGroupName: string, + sshPublicKeyName: string, + options?: SshPublicKeysGenerateKeyPairOptionalParams, + ) => Promise; + /** Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. */ + listBySubscription: ( + options?: SshPublicKeysListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: SshPublicKeysListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete an SSH public key. */ + /** + * @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, + sshPublicKeyName: string, + options?: SshPublicKeysDeleteOptionalParams, + ) => Promise; + /** Updates a new SSH public key resource. */ + update: ( + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyUpdateResource, + options?: SshPublicKeysUpdateOptionalParams, + ) => Promise; + /** Creates a new SSH public key resource. */ + create: ( + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyResource, + options?: SshPublicKeysCreateOptionalParams, + ) => Promise; + /** Retrieves information about an SSH public key. */ + get: ( + resourceGroupName: string, + sshPublicKeyName: string, + options?: SshPublicKeysGetOptionalParams, + ) => Promise; +} + +function _getSshPublicKeys(context: ComputeManagementContext) { + return { + generateKeyPair: ( + resourceGroupName: string, + sshPublicKeyName: string, + options?: SshPublicKeysGenerateKeyPairOptionalParams, + ) => generateKeyPair(context, resourceGroupName, sshPublicKeyName, options), + listBySubscription: (options?: SshPublicKeysListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: SshPublicKeysListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + sshPublicKeyName: string, + options?: SshPublicKeysDeleteOptionalParams, + ) => $delete(context, resourceGroupName, sshPublicKeyName, options), + update: ( + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyUpdateResource, + options?: SshPublicKeysUpdateOptionalParams, + ) => update(context, resourceGroupName, sshPublicKeyName, parameters, options), + create: ( + resourceGroupName: string, + sshPublicKeyName: string, + parameters: SshPublicKeyResource, + options?: SshPublicKeysCreateOptionalParams, + ) => create(context, resourceGroupName, sshPublicKeyName, parameters, options), + get: ( + resourceGroupName: string, + sshPublicKeyName: string, + options?: SshPublicKeysGetOptionalParams, + ) => get(context, resourceGroupName, sshPublicKeyName, options), + }; +} + +export function _getSshPublicKeysOperations( + context: ComputeManagementContext, +): SshPublicKeysOperations { + return { + ..._getSshPublicKeys(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/usage/index.ts b/sdk/compute/arm-compute/src/classic/usage/index.ts new file mode 100644 index 000000000000..665fe43530a0 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/usage/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list } from "../../api/usage/operations.js"; +import type { UsageListOptionalParams } from "../../api/usage/options.js"; +import type { Usage } from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Usage operations. */ +export interface UsageOperations { + /** Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. */ + list: (location: string, options?: UsageListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getUsage(context: ComputeManagementContext) { + return { + list: (location: string, options?: UsageListOptionalParams) => list(context, location, options), + }; +} + +export function _getUsageOperations(context: ComputeManagementContext): UsageOperations { + return { + ..._getUsage(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineExtensionImages/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineExtensionImages/index.ts new file mode 100644 index 000000000000..b01a674074d3 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineExtensionImages/index.ts @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listVersions, + listTypes, + get, +} from "../../api/virtualMachineExtensionImages/operations.js"; +import type { + VirtualMachineExtensionImagesListVersionsOptionalParams, + VirtualMachineExtensionImagesListTypesOptionalParams, + VirtualMachineExtensionImagesGetOptionalParams, +} from "../../api/virtualMachineExtensionImages/options.js"; +import type { VirtualMachineExtensionImage } from "../../models/compute/models.js"; + +/** Interface representing a VirtualMachineExtensionImages operations. */ +export interface VirtualMachineExtensionImagesOperations { + /** Gets a list of virtual machine extension image versions. */ + listVersions: ( + location: string, + publisherName: string, + typeParam: string, + options?: VirtualMachineExtensionImagesListVersionsOptionalParams, + ) => Promise; + /** Gets a list of virtual machine extension image types. */ + listTypes: ( + location: string, + publisherName: string, + options?: VirtualMachineExtensionImagesListTypesOptionalParams, + ) => Promise; + /** Gets a virtual machine extension image. */ + get: ( + location: string, + publisherName: string, + typeParam: string, + version: string, + options?: VirtualMachineExtensionImagesGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineExtensionImages(context: ComputeManagementContext) { + return { + listVersions: ( + location: string, + publisherName: string, + typeParam: string, + options?: VirtualMachineExtensionImagesListVersionsOptionalParams, + ) => listVersions(context, location, publisherName, typeParam, options), + listTypes: ( + location: string, + publisherName: string, + options?: VirtualMachineExtensionImagesListTypesOptionalParams, + ) => listTypes(context, location, publisherName, options), + get: ( + location: string, + publisherName: string, + typeParam: string, + version: string, + options?: VirtualMachineExtensionImagesGetOptionalParams, + ) => get(context, location, publisherName, typeParam, version, options), + }; +} + +export function _getVirtualMachineExtensionImagesOperations( + context: ComputeManagementContext, +): VirtualMachineExtensionImagesOperations { + return { + ..._getVirtualMachineExtensionImages(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineExtensions/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineExtensions/index.ts new file mode 100644 index 000000000000..9dce67ee5081 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineExtensions/index.ts @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualMachineExtensions/operations.js"; +import type { + VirtualMachineExtensionsListOptionalParams, + VirtualMachineExtensionsDeleteOptionalParams, + VirtualMachineExtensionsUpdateOptionalParams, + VirtualMachineExtensionsCreateOrUpdateOptionalParams, + VirtualMachineExtensionsGetOptionalParams, +} from "../../api/virtualMachineExtensions/options.js"; +import type { + VirtualMachineExtension, + VirtualMachineExtensionUpdate, + VirtualMachineExtensionsListResult, +} from "../../models/compute/models.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineExtensions operations. */ +export interface VirtualMachineExtensionsOperations { + /** The operation to get all extensions of a Virtual Machine. */ + list: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachineExtensionsListOptionalParams, + ) => Promise; + /** The operation to delete the extension. */ + /** + * @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, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsDeleteOptionalParams, + ) => Promise; + /** The operation to update the extension. */ + update: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options?: VirtualMachineExtensionsUpdateOptionalParams, + ) => PollerLike, VirtualMachineExtension>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options?: VirtualMachineExtensionsUpdateOptionalParams, + ) => Promise, VirtualMachineExtension>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options?: VirtualMachineExtensionsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update the extension. */ + createOrUpdate: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualMachineExtension>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, + ) => Promise, VirtualMachineExtension>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation to get the extension. */ + get: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineExtensions(context: ComputeManagementContext) { + return { + list: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachineExtensionsListOptionalParams, + ) => list(context, resourceGroupName, vmName, options), + delete: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmName, vmExtensionName, options), + beginDelete: async ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, vmName, vmExtensionName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, vmName, vmExtensionName, options); + }, + update: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options?: VirtualMachineExtensionsUpdateOptionalParams, + ) => update(context, resourceGroupName, vmName, vmExtensionName, extensionParameters, options), + beginUpdate: async ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options?: VirtualMachineExtensionsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtensionUpdate, + options?: VirtualMachineExtensionsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + extensionParameters: VirtualMachineExtension, + options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + vmName, + vmExtensionName, + extensionParameters, + options, + ); + }, + get: ( + resourceGroupName: string, + vmName: string, + vmExtensionName: string, + options?: VirtualMachineExtensionsGetOptionalParams, + ) => get(context, resourceGroupName, vmName, vmExtensionName, options), + }; +} + +export function _getVirtualMachineExtensionsOperations( + context: ComputeManagementContext, +): VirtualMachineExtensionsOperations { + return { + ..._getVirtualMachineExtensions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineImages/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineImages/index.ts new file mode 100644 index 000000000000..b39ef1a011cd --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineImages/index.ts @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + get, + listWithProperties, + list, + listSkus, + listOffers, + listPublishers, + listByEdgeZone, +} from "../../api/virtualMachineImages/operations.js"; +import type { + VirtualMachineImagesGetOptionalParams, + VirtualMachineImagesListWithPropertiesOptionalParams, + VirtualMachineImagesListOptionalParams, + VirtualMachineImagesListSkusOptionalParams, + VirtualMachineImagesListOffersOptionalParams, + VirtualMachineImagesListPublishersOptionalParams, + VirtualMachineImagesListByEdgeZoneOptionalParams, +} from "../../api/virtualMachineImages/options.js"; +import type { + VirtualMachineImageResource, + VirtualMachineImage, + VmImagesInEdgeZoneListResult, +} from "../../models/compute/models.js"; + +/** Interface representing a VirtualMachineImages operations. */ +export interface VirtualMachineImagesOperations { + /** Gets a virtual machine image. */ + get: ( + location: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options?: VirtualMachineImagesGetOptionalParams, + ) => Promise; + listWithProperties: ( + location: string, + publisherName: string, + offer: string, + skus: string, + expand: string, + options?: VirtualMachineImagesListWithPropertiesOptionalParams, + ) => Promise; + /** Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. */ + list: ( + location: string, + publisherName: string, + offer: string, + skus: string, + options?: VirtualMachineImagesListOptionalParams, + ) => Promise; + /** Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. */ + listSkus: ( + location: string, + publisherName: string, + offer: string, + options?: VirtualMachineImagesListSkusOptionalParams, + ) => Promise; + /** Gets a list of virtual machine image offers for the specified location and publisher. */ + listOffers: ( + location: string, + publisherName: string, + options?: VirtualMachineImagesListOffersOptionalParams, + ) => Promise; + /** Gets a list of virtual machine image publishers for the specified Azure location. */ + listPublishers: ( + location: string, + options?: VirtualMachineImagesListPublishersOptionalParams, + ) => Promise; + /** Gets a list of all virtual machine image versions for the specified edge zone */ + listByEdgeZone: ( + location: string, + edgeZone: string, + options?: VirtualMachineImagesListByEdgeZoneOptionalParams, + ) => Promise; +} + +function _getVirtualMachineImages(context: ComputeManagementContext) { + return { + get: ( + location: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options?: VirtualMachineImagesGetOptionalParams, + ) => get(context, location, publisherName, offer, skus, version, options), + listWithProperties: ( + location: string, + publisherName: string, + offer: string, + skus: string, + expand: string, + options?: VirtualMachineImagesListWithPropertiesOptionalParams, + ) => listWithProperties(context, location, publisherName, offer, skus, expand, options), + list: ( + location: string, + publisherName: string, + offer: string, + skus: string, + options?: VirtualMachineImagesListOptionalParams, + ) => list(context, location, publisherName, offer, skus, options), + listSkus: ( + location: string, + publisherName: string, + offer: string, + options?: VirtualMachineImagesListSkusOptionalParams, + ) => listSkus(context, location, publisherName, offer, options), + listOffers: ( + location: string, + publisherName: string, + options?: VirtualMachineImagesListOffersOptionalParams, + ) => listOffers(context, location, publisherName, options), + listPublishers: ( + location: string, + options?: VirtualMachineImagesListPublishersOptionalParams, + ) => listPublishers(context, location, options), + listByEdgeZone: ( + location: string, + edgeZone: string, + options?: VirtualMachineImagesListByEdgeZoneOptionalParams, + ) => listByEdgeZone(context, location, edgeZone, options), + }; +} + +export function _getVirtualMachineImagesOperations( + context: ComputeManagementContext, +): VirtualMachineImagesOperations { + return { + ..._getVirtualMachineImages(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineImagesEdgeZone/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineImagesEdgeZone/index.ts new file mode 100644 index 000000000000..ff5aaa28ba3f --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineImagesEdgeZone/index.ts @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + get, + list, + listSkus, + listOffers, + listPublishers, +} from "../../api/virtualMachineImagesEdgeZone/operations.js"; +import type { + VirtualMachineImagesEdgeZoneGetOptionalParams, + VirtualMachineImagesEdgeZoneListOptionalParams, + VirtualMachineImagesEdgeZoneListSkusOptionalParams, + VirtualMachineImagesEdgeZoneListOffersOptionalParams, + VirtualMachineImagesEdgeZoneListPublishersOptionalParams, +} from "../../api/virtualMachineImagesEdgeZone/options.js"; +import type { + VirtualMachineImageResource, + VirtualMachineImage, +} from "../../models/compute/models.js"; + +/** Interface representing a VirtualMachineImagesEdgeZone operations. */ +export interface VirtualMachineImagesEdgeZoneOperations { + /** Gets a virtual machine image in an edge zone. */ + get: ( + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options?: VirtualMachineImagesEdgeZoneGetOptionalParams, + ) => Promise; + /** Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. */ + list: ( + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + options?: VirtualMachineImagesEdgeZoneListOptionalParams, + ) => Promise; + /** Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. */ + listSkus: ( + location: string, + edgeZone: string, + publisherName: string, + offer: string, + options?: VirtualMachineImagesEdgeZoneListSkusOptionalParams, + ) => Promise; + /** Gets a list of virtual machine image offers for the specified location, edge zone and publisher. */ + listOffers: ( + location: string, + edgeZone: string, + publisherName: string, + options?: VirtualMachineImagesEdgeZoneListOffersOptionalParams, + ) => Promise; + /** Gets a list of virtual machine image publishers for the specified Azure location and edge zone. */ + listPublishers: ( + location: string, + edgeZone: string, + options?: VirtualMachineImagesEdgeZoneListPublishersOptionalParams, + ) => Promise; +} + +function _getVirtualMachineImagesEdgeZone(context: ComputeManagementContext) { + return { + get: ( + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + version: string, + options?: VirtualMachineImagesEdgeZoneGetOptionalParams, + ) => get(context, location, edgeZone, publisherName, offer, skus, version, options), + list: ( + location: string, + edgeZone: string, + publisherName: string, + offer: string, + skus: string, + options?: VirtualMachineImagesEdgeZoneListOptionalParams, + ) => list(context, location, edgeZone, publisherName, offer, skus, options), + listSkus: ( + location: string, + edgeZone: string, + publisherName: string, + offer: string, + options?: VirtualMachineImagesEdgeZoneListSkusOptionalParams, + ) => listSkus(context, location, edgeZone, publisherName, offer, options), + listOffers: ( + location: string, + edgeZone: string, + publisherName: string, + options?: VirtualMachineImagesEdgeZoneListOffersOptionalParams, + ) => listOffers(context, location, edgeZone, publisherName, options), + listPublishers: ( + location: string, + edgeZone: string, + options?: VirtualMachineImagesEdgeZoneListPublishersOptionalParams, + ) => listPublishers(context, location, edgeZone, options), + }; +} + +export function _getVirtualMachineImagesEdgeZoneOperations( + context: ComputeManagementContext, +): VirtualMachineImagesEdgeZoneOperations { + return { + ..._getVirtualMachineImagesEdgeZone(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineRunCommands/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineRunCommands/index.ts new file mode 100644 index 000000000000..70850f9351e0 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineRunCommands/index.ts @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + get, + list, + listByVirtualMachine, + $delete, + update, + createOrUpdate, + getByVirtualMachine, +} from "../../api/virtualMachineRunCommands/operations.js"; +import type { + VirtualMachineRunCommandsGetOptionalParams, + VirtualMachineRunCommandsListOptionalParams, + VirtualMachineRunCommandsListByVirtualMachineOptionalParams, + VirtualMachineRunCommandsDeleteOptionalParams, + VirtualMachineRunCommandsUpdateOptionalParams, + VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, +} from "../../api/virtualMachineRunCommands/options.js"; +import type { + VirtualMachineRunCommand, + VirtualMachineRunCommandUpdate, + RunCommandDocumentBase, + RunCommandDocument, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineRunCommands operations. */ +export interface VirtualMachineRunCommandsOperations { + /** Gets specific run command for a subscription in a location. */ + get: ( + location: string, + commandId: string, + options?: VirtualMachineRunCommandsGetOptionalParams, + ) => Promise; + /** Lists all available run commands for a subscription in a location. */ + list: ( + location: string, + options?: VirtualMachineRunCommandsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to get all run commands of a Virtual Machine. */ + listByVirtualMachine: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete the run command. */ + /** + * @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, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsDeleteOptionalParams, + ) => Promise; + /** The operation to update the run command. */ + update: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineRunCommandsUpdateOptionalParams, + ) => PollerLike, VirtualMachineRunCommand>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineRunCommandsUpdateOptionalParams, + ) => Promise< + SimplePollerLike, VirtualMachineRunCommand> + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineRunCommandsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update the run command. */ + createOrUpdate: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualMachineRunCommand>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike, VirtualMachineRunCommand> + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation to get the run command. */ + getByVirtualMachine: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, + ) => Promise; +} + +function _getVirtualMachineRunCommands(context: ComputeManagementContext) { + return { + get: ( + location: string, + commandId: string, + options?: VirtualMachineRunCommandsGetOptionalParams, + ) => get(context, location, commandId, options), + list: (location: string, options?: VirtualMachineRunCommandsListOptionalParams) => + list(context, location, options), + listByVirtualMachine: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, + ) => listByVirtualMachine(context, resourceGroupName, vmName, options), + delete: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmName, runCommandName, options), + beginDelete: async ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, vmName, runCommandName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, vmName, runCommandName, options); + }, + update: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineRunCommandsUpdateOptionalParams, + ) => update(context, resourceGroupName, vmName, runCommandName, runCommand, options), + beginUpdate: async ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineRunCommandsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + vmName, + runCommandName, + runCommand, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineRunCommandsUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, vmName, runCommandName, runCommand, options); + }, + createOrUpdate: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, vmName, runCommandName, runCommand, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + vmName, + runCommandName, + runCommand, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + vmName, + runCommandName, + runCommand, + options, + ); + }, + getByVirtualMachine: ( + resourceGroupName: string, + vmName: string, + runCommandName: string, + options?: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, + ) => getByVirtualMachine(context, resourceGroupName, vmName, runCommandName, options), + }; +} + +export function _getVirtualMachineRunCommandsOperations( + context: ComputeManagementContext, +): VirtualMachineRunCommandsOperations { + return { + ..._getVirtualMachineRunCommands(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetExtensions/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetExtensions/index.ts new file mode 100644 index 000000000000..a75bfe91e90e --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetExtensions/index.ts @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualMachineScaleSetExtensions/operations.js"; +import type { + VirtualMachineScaleSetExtensionsListOptionalParams, + VirtualMachineScaleSetExtensionsDeleteOptionalParams, + VirtualMachineScaleSetExtensionsUpdateOptionalParams, + VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetExtensionsGetOptionalParams, +} from "../../api/virtualMachineScaleSetExtensions/options.js"; +import type { + VirtualMachineScaleSetExtension, + VirtualMachineScaleSetExtensionUpdate, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineScaleSetExtensions operations. */ +export interface VirtualMachineScaleSetExtensionsOperations { + /** Gets a list of all extensions in a VM scale set. */ + list: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetExtensionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete the extension. */ + /** + * @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, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, + ) => Promise; + /** The operation to update an extension. */ + update: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, + ) => PollerLike, VirtualMachineScaleSetExtension>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + VirtualMachineScaleSetExtension + > + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update an extension. */ + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualMachineScaleSetExtension>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + VirtualMachineScaleSetExtension + > + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation to get the extension. */ + get: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineScaleSetExtensions(context: ComputeManagementContext) { + return { + list: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetExtensionsListOptionalParams, + ) => list(context, resourceGroupName, vmScaleSetName, options), + delete: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmScaleSetName, vmssExtensionName, options), + beginDelete: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, vmScaleSetName, vmssExtensionName, options); + }, + update: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtensionUpdate, + options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + extensionParameters: VirtualMachineScaleSetExtension, + options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + extensionParameters, + options, + ); + }, + get: ( + resourceGroupName: string, + vmScaleSetName: string, + vmssExtensionName: string, + options?: VirtualMachineScaleSetExtensionsGetOptionalParams, + ) => get(context, resourceGroupName, vmScaleSetName, vmssExtensionName, options), + }; +} + +export function _getVirtualMachineScaleSetExtensionsOperations( + context: ComputeManagementContext, +): VirtualMachineScaleSetExtensionsOperations { + return { + ..._getVirtualMachineScaleSetExtensions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetLifeCycleHookEvents/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetLifeCycleHookEvents/index.ts new file mode 100644 index 000000000000..59df5c036756 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetLifeCycleHookEvents/index.ts @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + list, + update, + get, +} from "../../api/virtualMachineScaleSetLifeCycleHookEvents/operations.js"; +import type { + VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams, +} from "../../api/virtualMachineScaleSetLifeCycleHookEvents/options.js"; +import type { + VMScaleSetLifecycleHookEvent, + VMScaleSetLifecycleHookEventUpdate, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a VirtualMachineScaleSetLifeCycleHookEvents operations. */ +export interface VirtualMachineScaleSetLifeCycleHookEventsOperations { + /** Gets a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. */ + list: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to update a virtual machine scale set lifecycle hook event. */ + update: ( + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + properties: VMScaleSetLifecycleHookEventUpdate, + options?: VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams, + ) => Promise; + /** Gets a virtual machine scale set lifecycle hook event. */ + get: ( + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + options?: VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineScaleSetLifeCycleHookEvents(context: ComputeManagementContext) { + return { + list: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams, + ) => list(context, resourceGroupName, vmScaleSetName, options), + update: ( + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + properties: VMScaleSetLifecycleHookEventUpdate, + options?: VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + vmScaleSetName, + lifecycleHookEventName, + properties, + options, + ), + get: ( + resourceGroupName: string, + vmScaleSetName: string, + lifecycleHookEventName: string, + options?: VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams, + ) => get(context, resourceGroupName, vmScaleSetName, lifecycleHookEventName, options), + }; +} + +export function _getVirtualMachineScaleSetLifeCycleHookEventsOperations( + context: ComputeManagementContext, +): VirtualMachineScaleSetLifeCycleHookEventsOperations { + return { + ..._getVirtualMachineScaleSetLifeCycleHookEvents(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetRollingUpgrades/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetRollingUpgrades/index.ts new file mode 100644 index 000000000000..7dd76b6162d9 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetRollingUpgrades/index.ts @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + getLatest, + cancel, + startOSUpgrade, + startExtensionUpgrade, +} from "../../api/virtualMachineScaleSetRollingUpgrades/operations.js"; +import type { + VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, + VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, +} from "../../api/virtualMachineScaleSetRollingUpgrades/options.js"; +import type { RollingUpgradeStatusInfo } from "../../models/compute/models.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineScaleSetRollingUpgrades operations. */ +export interface VirtualMachineScaleSetRollingUpgradesOperations { + /** Gets the status of the latest virtual machine scale set rolling upgrade. */ + getLatest: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, + ) => Promise; + /** Cancels the current virtual machine scale set rolling upgrade. */ + cancel: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + ) => PollerLike, void>; + /** @deprecated use cancel instead */ + beginCancel: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + ) => Promise, void>>; + /** @deprecated use cancel instead */ + beginCancelAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + ) => Promise; + /** Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. */ + startOSUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + ) => PollerLike, void>; + /** @deprecated use startOSUpgrade instead */ + beginStartOSUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + ) => Promise, void>>; + /** @deprecated use startOSUpgrade instead */ + beginStartOSUpgradeAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + ) => Promise; + /** Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. */ + startExtensionUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, + ) => PollerLike, void>; + /** @deprecated use startExtensionUpgrade instead */ + beginStartExtensionUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, + ) => Promise, void>>; + /** @deprecated use startExtensionUpgrade instead */ + beginStartExtensionUpgradeAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, + ) => Promise; +} + +function _getVirtualMachineScaleSetRollingUpgrades(context: ComputeManagementContext) { + return { + getLatest: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, + ) => getLatest(context, resourceGroupName, vmScaleSetName, options), + cancel: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + ) => cancel(context, resourceGroupName, vmScaleSetName, options), + beginCancel: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + ) => { + const poller = cancel(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCancelAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + ) => { + return await cancel(context, resourceGroupName, vmScaleSetName, options); + }, + startOSUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + ) => startOSUpgrade(context, resourceGroupName, vmScaleSetName, options), + beginStartOSUpgrade: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + ) => { + const poller = startOSUpgrade(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginStartOSUpgradeAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + ) => { + return await startOSUpgrade(context, resourceGroupName, vmScaleSetName, options); + }, + startExtensionUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, + ) => startExtensionUpgrade(context, resourceGroupName, vmScaleSetName, options), + beginStartExtensionUpgrade: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, + ) => { + const poller = startExtensionUpgrade(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginStartExtensionUpgradeAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, + ) => { + return await startExtensionUpgrade(context, resourceGroupName, vmScaleSetName, options); + }, + }; +} + +export function _getVirtualMachineScaleSetRollingUpgradesOperations( + context: ComputeManagementContext, +): VirtualMachineScaleSetRollingUpgradesOperations { + return { + ..._getVirtualMachineScaleSetRollingUpgrades(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMExtensions/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMExtensions/index.ts new file mode 100644 index 000000000000..e2bd43fd04d7 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMExtensions/index.ts @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualMachineScaleSetVMExtensions/operations.js"; +import type { + VirtualMachineScaleSetVMExtensionsListOptionalParams, + VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsGetOptionalParams, +} from "../../api/virtualMachineScaleSetVMExtensions/options.js"; +import type { + VirtualMachineScaleSetVMExtension, + VirtualMachineScaleSetVMExtensionUpdate, + VirtualMachineScaleSetVMExtensionsListResult, +} from "../../models/compute/models.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineScaleSetVMExtensions operations. */ +export interface VirtualMachineScaleSetVMExtensionsOperations { + /** The operation to get all extensions of an instance in Virtual Machine Scaleset. */ + list: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMExtensionsListOptionalParams, + ) => Promise; + /** The operation to delete the VMSS VM extension. */ + /** + * @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, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + ) => Promise; + /** The operation to update the VMSS VM extension. */ + update: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineScaleSetVMExtension + >; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + VirtualMachineScaleSetVMExtension + > + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update the VMSS VM extension. */ + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineScaleSetVMExtension + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + VirtualMachineScaleSetVMExtension + > + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation to get the VMSS VM extension. */ + get: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineScaleSetVMExtensions(context: ComputeManagementContext) { + return { + list: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMExtensionsListOptionalParams, + ) => list(context, resourceGroupName, vmScaleSetName, instanceId, options), + delete: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, options), + beginDelete: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + options, + ); + }, + update: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, + options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + extensionParameters: VirtualMachineScaleSetVMExtension, + options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + vmExtensionName, + extensionParameters, + options, + ); + }, + get: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + vmExtensionName: string, + options?: VirtualMachineScaleSetVMExtensionsGetOptionalParams, + ) => get(context, resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, options), + }; +} + +export function _getVirtualMachineScaleSetVMExtensionsOperations( + context: ComputeManagementContext, +): VirtualMachineScaleSetVMExtensionsOperations { + return { + ..._getVirtualMachineScaleSetVMExtensions(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMRunCommands/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMRunCommands/index.ts new file mode 100644 index 000000000000..b6b18bfed202 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMRunCommands/index.ts @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualMachineScaleSetVMRunCommands/operations.js"; +import type { + VirtualMachineScaleSetVMRunCommandsListOptionalParams, + VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsGetOptionalParams, +} from "../../api/virtualMachineScaleSetVMRunCommands/options.js"; +import type { + VirtualMachineRunCommand, + VirtualMachineRunCommandUpdate, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineScaleSetVMRunCommands operations. */ +export interface VirtualMachineScaleSetVMRunCommandsOperations { + /** The operation to get all run commands of an instance in Virtual Machine Scaleset. */ + list: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete the VMSS VM run command. */ + /** + * @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, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + ) => Promise; + /** The operation to update the VMSS VM run command. */ + update: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + ) => PollerLike, VirtualMachineRunCommand>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + ) => Promise< + SimplePollerLike, VirtualMachineRunCommand> + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + ) => Promise; + /** The operation to create or update the VMSS VM run command. */ + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualMachineRunCommand>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike, VirtualMachineRunCommand> + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + ) => Promise; + /** The operation to get the VMSS VM run command. */ + get: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineScaleSetVMRunCommands(context: ComputeManagementContext) { + return { + list: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, + ) => list(context, resourceGroupName, vmScaleSetName, instanceId, options), + delete: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmScaleSetName, instanceId, runCommandName, options), + beginDelete: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + options, + ); + }, + update: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommandUpdate, + options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ); + }, + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + runCommand: VirtualMachineRunCommand, + options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + runCommandName, + runCommand, + options, + ); + }, + get: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + runCommandName: string, + options?: VirtualMachineScaleSetVMRunCommandsGetOptionalParams, + ) => get(context, resourceGroupName, vmScaleSetName, instanceId, runCommandName, options), + }; +} + +export function _getVirtualMachineScaleSetVMRunCommandsOperations( + context: ComputeManagementContext, +): VirtualMachineScaleSetVMRunCommandsOperations { + return { + ..._getVirtualMachineScaleSetVMRunCommands(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMs/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMs/index.ts new file mode 100644 index 000000000000..8f5ef6124b14 --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSetVMs/index.ts @@ -0,0 +1,822 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + runCommand, + start, + retrieveBootDiagnosticsData, + restart, + redeploy, + powerOff, + performMaintenance, + attachDetachDataDisks, + simulateEviction, + reimageAll, + reimage, + getInstanceView, + deallocate, + approveRollingUpgrade, + list, + $delete, + update, + get, +} from "../../api/virtualMachineScaleSetVMs/operations.js"; +import type { + VirtualMachineScaleSetVMsRunCommandOptionalParams, + VirtualMachineScaleSetVMsStartOptionalParams, + VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachineScaleSetVMsRestartOptionalParams, + VirtualMachineScaleSetVMsRedeployOptionalParams, + VirtualMachineScaleSetVMsPowerOffOptionalParams, + VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, + VirtualMachineScaleSetVMsReimageAllOptionalParams, + VirtualMachineScaleSetVMsReimageOptionalParams, + VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, + VirtualMachineScaleSetVMsDeallocateOptionalParams, + VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetVMsListOptionalParams, + VirtualMachineScaleSetVMsDeleteOptionalParams, + VirtualMachineScaleSetVMsUpdateOptionalParams, + VirtualMachineScaleSetVMsGetOptionalParams, +} from "../../api/virtualMachineScaleSetVMs/options.js"; +import type { + StorageProfile, + AttachDetachDataDisksRequest, + RetrieveBootDiagnosticsDataResult, + RunCommandInput, + RunCommandResult, + VirtualMachineScaleSetVM, + VirtualMachineScaleSetVMInstanceView, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineScaleSetVMs operations. */ +export interface VirtualMachineScaleSetVMsOperations { + /** Run command on a virtual machine in a VM scale set. */ + runCommand: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, + ) => PollerLike, RunCommandResult>; + /** @deprecated use runCommand instead */ + beginRunCommand: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, + ) => Promise, RunCommandResult>>; + /** @deprecated use runCommand instead */ + beginRunCommandAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, + ) => Promise; + /** Starts a virtual machine in a VM scale set. */ + start: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsStartOptionalParams, + ) => PollerLike, void>; + /** @deprecated use start instead */ + beginStart: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsStartOptionalParams, + ) => Promise, void>>; + /** @deprecated use start instead */ + beginStartAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsStartOptionalParams, + ) => Promise; + /** The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. */ + retrieveBootDiagnosticsData: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + ) => Promise; + /** Restarts a virtual machine in a VM scale set. */ + restart: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRestartOptionalParams, + ) => PollerLike, void>; + /** @deprecated use restart instead */ + beginRestart: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRestartOptionalParams, + ) => Promise, void>>; + /** @deprecated use restart instead */ + beginRestartAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRestartOptionalParams, + ) => Promise; + /** Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. */ + redeploy: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRedeployOptionalParams, + ) => PollerLike, void>; + /** @deprecated use redeploy instead */ + beginRedeploy: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRedeployOptionalParams, + ) => Promise, void>>; + /** @deprecated use redeploy instead */ + beginRedeployAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRedeployOptionalParams, + ) => Promise; + /** Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. */ + powerOff: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, + ) => PollerLike, void>; + /** @deprecated use powerOff instead */ + beginPowerOff: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, + ) => Promise, void>>; + /** @deprecated use powerOff instead */ + beginPowerOffAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, + ) => Promise; + /** Performs maintenance on a virtual machine in a VM scale set. */ + performMaintenance: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + ) => PollerLike, void>; + /** @deprecated use performMaintenance instead */ + beginPerformMaintenance: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + ) => Promise, void>>; + /** @deprecated use performMaintenance instead */ + beginPerformMaintenanceAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + ) => Promise; + /** Attach and detach data disks to/from a virtual machine in a VM scale set. */ + attachDetachDataDisks: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + ) => PollerLike, StorageProfile>; + /** @deprecated use attachDetachDataDisks instead */ + beginAttachDetachDataDisks: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + ) => Promise, StorageProfile>>; + /** @deprecated use attachDetachDataDisks instead */ + beginAttachDetachDataDisksAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + ) => Promise; + /** The operation to simulate the eviction of spot virtual machine in a VM scale set. */ + simulateEviction: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, + ) => Promise; + /** Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. */ + reimageAll: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reimageAll instead */ + beginReimageAll: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, + ) => Promise, void>>; + /** @deprecated use reimageAll instead */ + beginReimageAllAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, + ) => Promise; + /** Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. */ + reimage: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reimage instead */ + beginReimage: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageOptionalParams, + ) => Promise, void>>; + /** @deprecated use reimage instead */ + beginReimageAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageOptionalParams, + ) => Promise; + /** Gets the status of a virtual machine from a VM scale set. */ + getInstanceView: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, + ) => Promise; + /** Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. */ + deallocate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, + ) => PollerLike, void>; + /** @deprecated use deallocate instead */ + beginDeallocate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, + ) => Promise, void>>; + /** @deprecated use deallocate instead */ + beginDeallocateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, + ) => Promise; + /** Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. */ + approveRollingUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + ) => PollerLike, void>; + /** @deprecated use approveRollingUpgrade instead */ + beginApproveRollingUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + ) => Promise, void>>; + /** @deprecated use approveRollingUpgrade instead */ + beginApproveRollingUpgradeAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + ) => Promise; + /** Gets a list of all virtual machines in a VM scale sets. */ + list: ( + resourceGroupName: string, + virtualMachineScaleSetName: string, + options?: VirtualMachineScaleSetVMsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a virtual machine from a VM scale set. */ + /** + * @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, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeleteOptionalParams, + ) => Promise; + /** Updates a virtual machine of a VM scale set. */ + update: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options?: VirtualMachineScaleSetVMsUpdateOptionalParams, + ) => PollerLike, VirtualMachineScaleSetVM>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options?: VirtualMachineScaleSetVMsUpdateOptionalParams, + ) => Promise< + SimplePollerLike, VirtualMachineScaleSetVM> + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options?: VirtualMachineScaleSetVMsUpdateOptionalParams, + ) => Promise; + /** Gets a virtual machine from a VM scale set. */ + get: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineScaleSetVMs(context: ComputeManagementContext) { + return { + runCommand: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, + ) => runCommand(context, resourceGroupName, vmScaleSetName, instanceId, parameters, options), + beginRunCommand: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, + ) => { + const poller = runCommand( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRunCommandAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: RunCommandInput, + options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, + ) => { + return await runCommand( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ); + }, + start: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsStartOptionalParams, + ) => start(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginStart: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsStartOptionalParams, + ) => { + const poller = start(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginStartAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsStartOptionalParams, + ) => { + return await start(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + retrieveBootDiagnosticsData: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + ) => + retrieveBootDiagnosticsData(context, resourceGroupName, vmScaleSetName, instanceId, options), + restart: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRestartOptionalParams, + ) => restart(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginRestart: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRestartOptionalParams, + ) => { + const poller = restart(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRestartAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRestartOptionalParams, + ) => { + return await restart(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + redeploy: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRedeployOptionalParams, + ) => redeploy(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginRedeploy: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRedeployOptionalParams, + ) => { + const poller = redeploy(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRedeployAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsRedeployOptionalParams, + ) => { + return await redeploy(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + powerOff: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, + ) => powerOff(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginPowerOff: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, + ) => { + const poller = powerOff(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPowerOffAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, + ) => { + return await powerOff(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + performMaintenance: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + ) => performMaintenance(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginPerformMaintenance: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + ) => { + const poller = performMaintenance( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPerformMaintenanceAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + ) => { + return await performMaintenance( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + options, + ); + }, + attachDetachDataDisks: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + ) => + attachDetachDataDisks( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ), + beginAttachDetachDataDisks: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + ) => { + const poller = attachDetachDataDisks( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginAttachDetachDataDisksAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + ) => { + return await attachDetachDataDisks( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ); + }, + simulateEviction: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, + ) => simulateEviction(context, resourceGroupName, vmScaleSetName, instanceId, options), + reimageAll: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, + ) => reimageAll(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginReimageAll: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, + ) => { + const poller = reimageAll(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReimageAllAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, + ) => { + return await reimageAll(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + reimage: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageOptionalParams, + ) => reimage(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginReimage: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageOptionalParams, + ) => { + const poller = reimage(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReimageAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsReimageOptionalParams, + ) => { + return await reimage(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + getInstanceView: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, + ) => getInstanceView(context, resourceGroupName, vmScaleSetName, instanceId, options), + deallocate: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, + ) => deallocate(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginDeallocate: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, + ) => { + const poller = deallocate(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeallocateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, + ) => { + return await deallocate(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + approveRollingUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + ) => approveRollingUpgrade(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginApproveRollingUpgrade: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + ) => { + const poller = approveRollingUpgrade( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginApproveRollingUpgradeAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + ) => { + return await approveRollingUpgrade( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + options, + ); + }, + list: ( + resourceGroupName: string, + virtualMachineScaleSetName: string, + options?: VirtualMachineScaleSetVMsListOptionalParams, + ) => list(context, resourceGroupName, virtualMachineScaleSetName, options), + delete: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmScaleSetName, instanceId, options), + beginDelete: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, vmScaleSetName, instanceId, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, vmScaleSetName, instanceId, options); + }, + update: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options?: VirtualMachineScaleSetVMsUpdateOptionalParams, + ) => update(context, resourceGroupName, vmScaleSetName, instanceId, parameters, options), + beginUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options?: VirtualMachineScaleSetVMsUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + parameters: VirtualMachineScaleSetVM, + options?: VirtualMachineScaleSetVMsUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + vmScaleSetName, + instanceId, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + vmScaleSetName: string, + instanceId: string, + options?: VirtualMachineScaleSetVMsGetOptionalParams, + ) => get(context, resourceGroupName, vmScaleSetName, instanceId, options), + }; +} + +export function _getVirtualMachineScaleSetVMsOperations( + context: ComputeManagementContext, +): VirtualMachineScaleSetVMsOperations { + return { + ..._getVirtualMachineScaleSetVMs(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineScaleSets/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSets/index.ts new file mode 100644 index 000000000000..8f84eef62b9c --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineScaleSets/index.ts @@ -0,0 +1,945 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByLocation, + scaleOut, + start, + listSkus, + setOrchestrationServiceState, + restart, + reimageAll, + reimage, + redeploy, + reapply, + powerOff, + performMaintenance, + getOSUpgradeHistory, + updateInstances, + getInstanceView, + forceRecoveryServiceFabricPlatformUpdateDomainWalk, + deleteInstances, + deallocate, + convertToSinglePlacementGroup, + approveRollingUpgrade, + listAll, + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualMachineScaleSets/operations.js"; +import type { + VirtualMachineScaleSetsListByLocationOptionalParams, + VirtualMachineScaleSetsScaleOutOptionalParams, + VirtualMachineScaleSetsStartOptionalParams, + VirtualMachineScaleSetsListSkusOptionalParams, + VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + VirtualMachineScaleSetsRestartOptionalParams, + VirtualMachineScaleSetsReimageAllOptionalParams, + VirtualMachineScaleSetsReimageOptionalParams, + VirtualMachineScaleSetsRedeployOptionalParams, + VirtualMachineScaleSetsReapplyOptionalParams, + VirtualMachineScaleSetsPowerOffOptionalParams, + VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, + VirtualMachineScaleSetsUpdateInstancesOptionalParams, + VirtualMachineScaleSetsGetInstanceViewOptionalParams, + VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, + VirtualMachineScaleSetsDeleteInstancesOptionalParams, + VirtualMachineScaleSetsDeallocateOptionalParams, + VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, + VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetsListAllOptionalParams, + VirtualMachineScaleSetsListOptionalParams, + VirtualMachineScaleSetsDeleteOptionalParams, + VirtualMachineScaleSetsUpdateOptionalParams, + VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetsGetOptionalParams, +} from "../../api/virtualMachineScaleSets/options.js"; +import type { + VirtualMachineScaleSet, + VirtualMachineScaleSetUpdate, + VMScaleSetConvertToSinglePlacementGroupInput, + VirtualMachineScaleSetVMInstanceRequiredIDs, + RecoveryWalkResponse, + VirtualMachineScaleSetInstanceView, + UpgradeOperationHistoricalStatusInfo, + OrchestrationServiceStateInput, + VirtualMachineScaleSetSku, + VMScaleSetScaleOutInput, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachineScaleSets operations. */ +export interface VirtualMachineScaleSetsOperations { + /** Gets all the VM scale sets under the specified subscription for the specified location. */ + listByLocation: ( + location: string, + options?: VirtualMachineScaleSetsListByLocationOptionalParams, + ) => PagedAsyncIterableIterator; + /** Scales out one or more virtual machines in a VM scale set. */ + scaleOut: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options?: VirtualMachineScaleSetsScaleOutOptionalParams, + ) => PollerLike, void>; + /** @deprecated use scaleOut instead */ + beginScaleOut: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options?: VirtualMachineScaleSetsScaleOutOptionalParams, + ) => Promise, void>>; + /** @deprecated use scaleOut instead */ + beginScaleOutAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options?: VirtualMachineScaleSetsScaleOutOptionalParams, + ) => Promise; + /** Starts one or more virtual machines in a VM scale set. */ + start: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsStartOptionalParams, + ) => PollerLike, void>; + /** @deprecated use start instead */ + beginStart: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsStartOptionalParams, + ) => Promise, void>>; + /** @deprecated use start instead */ + beginStartAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsStartOptionalParams, + ) => Promise; + /** Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. */ + listSkus: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsListSkusOptionalParams, + ) => PagedAsyncIterableIterator; + /** Changes ServiceState property for a given service */ + setOrchestrationServiceState: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + ) => PollerLike, void>; + /** @deprecated use setOrchestrationServiceState instead */ + beginSetOrchestrationServiceState: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + ) => Promise, void>>; + /** @deprecated use setOrchestrationServiceState instead */ + beginSetOrchestrationServiceStateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + ) => Promise; + /** Restarts one or more virtual machines in a VM scale set. */ + restart: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRestartOptionalParams, + ) => PollerLike, void>; + /** @deprecated use restart instead */ + beginRestart: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRestartOptionalParams, + ) => Promise, void>>; + /** @deprecated use restart instead */ + beginRestartAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRestartOptionalParams, + ) => Promise; + /** Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. */ + reimageAll: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageAllOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reimageAll instead */ + beginReimageAll: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageAllOptionalParams, + ) => Promise, void>>; + /** @deprecated use reimageAll instead */ + beginReimageAllAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageAllOptionalParams, + ) => Promise; + /** Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. */ + reimage: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reimage instead */ + beginReimage: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageOptionalParams, + ) => Promise, void>>; + /** @deprecated use reimage instead */ + beginReimageAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageOptionalParams, + ) => Promise; + /** Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. */ + redeploy: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRedeployOptionalParams, + ) => PollerLike, void>; + /** @deprecated use redeploy instead */ + beginRedeploy: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRedeployOptionalParams, + ) => Promise, void>>; + /** @deprecated use redeploy instead */ + beginRedeployAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRedeployOptionalParams, + ) => Promise; + /** Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances */ + reapply: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReapplyOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reapply instead */ + beginReapply: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReapplyOptionalParams, + ) => Promise, void>>; + /** @deprecated use reapply instead */ + beginReapplyAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReapplyOptionalParams, + ) => Promise; + /** Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. */ + powerOff: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPowerOffOptionalParams, + ) => PollerLike, void>; + /** @deprecated use powerOff instead */ + beginPowerOff: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPowerOffOptionalParams, + ) => Promise, void>>; + /** @deprecated use powerOff instead */ + beginPowerOffAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPowerOffOptionalParams, + ) => Promise; + /** Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications */ + performMaintenance: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ) => PollerLike, void>; + /** @deprecated use performMaintenance instead */ + beginPerformMaintenance: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ) => Promise, void>>; + /** @deprecated use performMaintenance instead */ + beginPerformMaintenanceAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ) => Promise; + /** Gets list of OS upgrades on a VM scale set instance. */ + getOSUpgradeHistory: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, + ) => PagedAsyncIterableIterator; + /** Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. */ + updateInstances: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, + ) => PollerLike, void>; + /** @deprecated use updateInstances instead */ + beginUpdateInstances: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, + ) => Promise, void>>; + /** @deprecated use updateInstances instead */ + beginUpdateInstancesAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, + ) => Promise; + /** Gets the status of a VM scale set instance. */ + getInstanceView: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsGetInstanceViewOptionalParams, + ) => Promise; + /** Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. */ + forceRecoveryServiceFabricPlatformUpdateDomainWalk: ( + resourceGroupName: string, + vmScaleSetName: string, + platformUpdateDomain: number, + options?: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, + ) => Promise; + /** Deletes virtual machines in a VM scale set. */ + deleteInstances: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ) => PollerLike, void>; + /** @deprecated use deleteInstances instead */ + beginDeleteInstances: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ) => Promise, void>>; + /** @deprecated use deleteInstances instead */ + beginDeleteInstancesAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ) => Promise; + /** Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. */ + deallocate: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeallocateOptionalParams, + ) => PollerLike, void>; + /** @deprecated use deallocate instead */ + beginDeallocate: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeallocateOptionalParams, + ) => Promise, void>>; + /** @deprecated use deallocate instead */ + beginDeallocateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeallocateOptionalParams, + ) => Promise; + /** Converts SinglePlacementGroup property to false for a existing virtual machine scale set. */ + convertToSinglePlacementGroup: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetConvertToSinglePlacementGroupInput, + options?: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, + ) => Promise; + /** Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. */ + approveRollingUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + ) => PollerLike, void>; + /** @deprecated use approveRollingUpgrade instead */ + beginApproveRollingUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + ) => Promise, void>>; + /** @deprecated use approveRollingUpgrade instead */ + beginApproveRollingUpgradeAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + ) => Promise; + /** Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. */ + listAll: ( + options?: VirtualMachineScaleSetsListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets a list of all VM scale sets under a resource group. */ + list: ( + resourceGroupName: string, + options?: VirtualMachineScaleSetsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a VM scale set. */ + /** + * @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, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeleteOptionalParams, + ) => Promise; + /** Update a VM scale set. */ + update: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options?: VirtualMachineScaleSetsUpdateOptionalParams, + ) => PollerLike, VirtualMachineScaleSet>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options?: VirtualMachineScaleSetsUpdateOptionalParams, + ) => Promise, VirtualMachineScaleSet>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options?: VirtualMachineScaleSetsUpdateOptionalParams, + ) => Promise; + /** Create or update a VM scale set. */ + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualMachineScaleSet>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + ) => Promise, VirtualMachineScaleSet>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + ) => Promise; + /** Display information about a virtual machine scale set. */ + get: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachineScaleSets(context: ComputeManagementContext) { + return { + listByLocation: ( + location: string, + options?: VirtualMachineScaleSetsListByLocationOptionalParams, + ) => listByLocation(context, location, options), + scaleOut: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options?: VirtualMachineScaleSetsScaleOutOptionalParams, + ) => scaleOut(context, resourceGroupName, vmScaleSetName, parameters, options), + beginScaleOut: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options?: VirtualMachineScaleSetsScaleOutOptionalParams, + ) => { + const poller = scaleOut(context, resourceGroupName, vmScaleSetName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginScaleOutAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetScaleOutInput, + options?: VirtualMachineScaleSetsScaleOutOptionalParams, + ) => { + return await scaleOut(context, resourceGroupName, vmScaleSetName, parameters, options); + }, + start: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsStartOptionalParams, + ) => start(context, resourceGroupName, vmScaleSetName, options), + beginStart: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsStartOptionalParams, + ) => { + const poller = start(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginStartAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsStartOptionalParams, + ) => { + return await start(context, resourceGroupName, vmScaleSetName, options); + }, + listSkus: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsListSkusOptionalParams, + ) => listSkus(context, resourceGroupName, vmScaleSetName, options), + setOrchestrationServiceState: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + ) => + setOrchestrationServiceState(context, resourceGroupName, vmScaleSetName, parameters, options), + beginSetOrchestrationServiceState: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + ) => { + const poller = setOrchestrationServiceState( + context, + resourceGroupName, + vmScaleSetName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginSetOrchestrationServiceStateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: OrchestrationServiceStateInput, + options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + ) => { + return await setOrchestrationServiceState( + context, + resourceGroupName, + vmScaleSetName, + parameters, + options, + ); + }, + restart: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRestartOptionalParams, + ) => restart(context, resourceGroupName, vmScaleSetName, options), + beginRestart: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRestartOptionalParams, + ) => { + const poller = restart(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRestartAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRestartOptionalParams, + ) => { + return await restart(context, resourceGroupName, vmScaleSetName, options); + }, + reimageAll: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageAllOptionalParams, + ) => reimageAll(context, resourceGroupName, vmScaleSetName, options), + beginReimageAll: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageAllOptionalParams, + ) => { + const poller = reimageAll(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReimageAllAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageAllOptionalParams, + ) => { + return await reimageAll(context, resourceGroupName, vmScaleSetName, options); + }, + reimage: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageOptionalParams, + ) => reimage(context, resourceGroupName, vmScaleSetName, options), + beginReimage: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageOptionalParams, + ) => { + const poller = reimage(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReimageAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReimageOptionalParams, + ) => { + return await reimage(context, resourceGroupName, vmScaleSetName, options); + }, + redeploy: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRedeployOptionalParams, + ) => redeploy(context, resourceGroupName, vmScaleSetName, options), + beginRedeploy: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRedeployOptionalParams, + ) => { + const poller = redeploy(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRedeployAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsRedeployOptionalParams, + ) => { + return await redeploy(context, resourceGroupName, vmScaleSetName, options); + }, + reapply: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReapplyOptionalParams, + ) => reapply(context, resourceGroupName, vmScaleSetName, options), + beginReapply: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReapplyOptionalParams, + ) => { + const poller = reapply(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReapplyAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsReapplyOptionalParams, + ) => { + return await reapply(context, resourceGroupName, vmScaleSetName, options); + }, + powerOff: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPowerOffOptionalParams, + ) => powerOff(context, resourceGroupName, vmScaleSetName, options), + beginPowerOff: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPowerOffOptionalParams, + ) => { + const poller = powerOff(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPowerOffAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPowerOffOptionalParams, + ) => { + return await powerOff(context, resourceGroupName, vmScaleSetName, options); + }, + performMaintenance: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ) => performMaintenance(context, resourceGroupName, vmScaleSetName, options), + beginPerformMaintenance: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ) => { + const poller = performMaintenance(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPerformMaintenanceAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + ) => { + return await performMaintenance(context, resourceGroupName, vmScaleSetName, options); + }, + getOSUpgradeHistory: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, + ) => getOSUpgradeHistory(context, resourceGroupName, vmScaleSetName, options), + updateInstances: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, + ) => updateInstances(context, resourceGroupName, vmScaleSetName, vmInstanceIDs, options), + beginUpdateInstances: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, + ) => { + const poller = updateInstances( + context, + resourceGroupName, + vmScaleSetName, + vmInstanceIDs, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateInstancesAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, + ) => { + return await updateInstances( + context, + resourceGroupName, + vmScaleSetName, + vmInstanceIDs, + options, + ); + }, + getInstanceView: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsGetInstanceViewOptionalParams, + ) => getInstanceView(context, resourceGroupName, vmScaleSetName, options), + forceRecoveryServiceFabricPlatformUpdateDomainWalk: ( + resourceGroupName: string, + vmScaleSetName: string, + platformUpdateDomain: number, + options?: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, + ) => + forceRecoveryServiceFabricPlatformUpdateDomainWalk( + context, + resourceGroupName, + vmScaleSetName, + platformUpdateDomain, + options, + ), + deleteInstances: ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ) => deleteInstances(context, resourceGroupName, vmScaleSetName, vmInstanceIDs, options), + beginDeleteInstances: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ) => { + const poller = deleteInstances( + context, + resourceGroupName, + vmScaleSetName, + vmInstanceIDs, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteInstancesAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, + options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, + ) => { + return await deleteInstances( + context, + resourceGroupName, + vmScaleSetName, + vmInstanceIDs, + options, + ); + }, + deallocate: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeallocateOptionalParams, + ) => deallocate(context, resourceGroupName, vmScaleSetName, options), + beginDeallocate: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeallocateOptionalParams, + ) => { + const poller = deallocate(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeallocateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeallocateOptionalParams, + ) => { + return await deallocate(context, resourceGroupName, vmScaleSetName, options); + }, + convertToSinglePlacementGroup: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VMScaleSetConvertToSinglePlacementGroupInput, + options?: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, + ) => + convertToSinglePlacementGroup( + context, + resourceGroupName, + vmScaleSetName, + parameters, + options, + ), + approveRollingUpgrade: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + ) => approveRollingUpgrade(context, resourceGroupName, vmScaleSetName, options), + beginApproveRollingUpgrade: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + ) => { + const poller = approveRollingUpgrade(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginApproveRollingUpgradeAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + ) => { + return await approveRollingUpgrade(context, resourceGroupName, vmScaleSetName, options); + }, + listAll: (options?: VirtualMachineScaleSetsListAllOptionalParams) => listAll(context, options), + list: (resourceGroupName: string, options?: VirtualMachineScaleSetsListOptionalParams) => + list(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmScaleSetName, options), + beginDelete: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, vmScaleSetName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, vmScaleSetName, options); + }, + update: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options?: VirtualMachineScaleSetsUpdateOptionalParams, + ) => update(context, resourceGroupName, vmScaleSetName, parameters, options), + beginUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options?: VirtualMachineScaleSetsUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, vmScaleSetName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSetUpdate, + options?: VirtualMachineScaleSetsUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, vmScaleSetName, parameters, options); + }, + createOrUpdate: ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, vmScaleSetName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + vmScaleSetName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + vmScaleSetName: string, + parameters: VirtualMachineScaleSet, + options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, vmScaleSetName, parameters, options); + }, + get: ( + resourceGroupName: string, + vmScaleSetName: string, + options?: VirtualMachineScaleSetsGetOptionalParams, + ) => get(context, resourceGroupName, vmScaleSetName, options), + }; +} + +export function _getVirtualMachineScaleSetsOperations( + context: ComputeManagementContext, +): VirtualMachineScaleSetsOperations { + return { + ..._getVirtualMachineScaleSets(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachineSizes/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachineSizes/index.ts new file mode 100644 index 000000000000..46443fa00dad --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachineSizes/index.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { list } from "../../api/virtualMachineSizes/operations.js"; +import type { VirtualMachineSizesListOptionalParams } from "../../api/virtualMachineSizes/options.js"; +import type { VirtualMachineSize } from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a VirtualMachineSizes operations. */ +export interface VirtualMachineSizesOperations { + /** This API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) */ + list: ( + location: string, + options?: VirtualMachineSizesListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getVirtualMachineSizes(context: ComputeManagementContext) { + return { + list: (location: string, options?: VirtualMachineSizesListOptionalParams) => + list(context, location, options), + }; +} + +export function _getVirtualMachineSizesOperations( + context: ComputeManagementContext, +): VirtualMachineSizesOperations { + return { + ..._getVirtualMachineSizes(context), + }; +} diff --git a/sdk/compute/arm-compute/src/classic/virtualMachines/index.ts b/sdk/compute/arm-compute/src/classic/virtualMachines/index.ts new file mode 100644 index 000000000000..79da7ae6afbf --- /dev/null +++ b/sdk/compute/arm-compute/src/classic/virtualMachines/index.ts @@ -0,0 +1,948 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementContext } from "../../api/computeManagementContext.js"; +import { + listByLocation, + migrateToVMScaleSet, + runCommand, + listAvailableSizes, + start, + simulateEviction, + retrieveBootDiagnosticsData, + restart, + reimage, + redeploy, + reapply, + powerOff, + performMaintenance, + instanceView, + installPatches, + generalize, + deallocate, + convertToManagedDisks, + capture, + attachDetachDataDisks, + assessPatches, + listAll, + list, + $delete, + update, + createOrUpdate, + get, +} from "../../api/virtualMachines/operations.js"; +import type { + VirtualMachinesListByLocationOptionalParams, + VirtualMachinesMigrateToVMScaleSetOptionalParams, + VirtualMachinesRunCommandOptionalParams, + VirtualMachinesListAvailableSizesOptionalParams, + VirtualMachinesStartOptionalParams, + VirtualMachinesSimulateEvictionOptionalParams, + VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachinesRestartOptionalParams, + VirtualMachinesReimageOptionalParams, + VirtualMachinesRedeployOptionalParams, + VirtualMachinesReapplyOptionalParams, + VirtualMachinesPowerOffOptionalParams, + VirtualMachinesPerformMaintenanceOptionalParams, + VirtualMachinesInstanceViewOptionalParams, + VirtualMachinesInstallPatchesOptionalParams, + VirtualMachinesGeneralizeOptionalParams, + VirtualMachinesDeallocateOptionalParams, + VirtualMachinesConvertToManagedDisksOptionalParams, + VirtualMachinesCaptureOptionalParams, + VirtualMachinesAttachDetachDataDisksOptionalParams, + VirtualMachinesAssessPatchesOptionalParams, + VirtualMachinesListAllOptionalParams, + VirtualMachinesListOptionalParams, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesGetOptionalParams, +} from "../../api/virtualMachines/options.js"; +import type { + VirtualMachine, + StorageProfile, + VirtualMachineInstanceView, + VirtualMachineUpdate, + VirtualMachineAssessPatchesResult, + AttachDetachDataDisksRequest, + VirtualMachineCaptureParameters, + VirtualMachineCaptureResult, + VirtualMachineInstallPatchesParameters, + VirtualMachineInstallPatchesResult, + RetrieveBootDiagnosticsDataResult, + VirtualMachineSize, + RunCommandInput, + RunCommandResult, +} from "../../models/compute/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { SimplePollerLike } from "../../static-helpers/simplePollerHelpers.js"; +import { getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a VirtualMachines operations. */ +export interface VirtualMachinesOperations { + /** Gets all the virtual machines under the specified subscription for the specified location. */ + listByLocation: ( + location: string, + options?: VirtualMachinesListByLocationOptionalParams, + ) => PagedAsyncIterableIterator; + /** Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. */ + migrateToVMScaleSet: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, + ) => PollerLike, void>; + /** @deprecated use migrateToVMScaleSet instead */ + beginMigrateToVMScaleSet: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, + ) => Promise, void>>; + /** @deprecated use migrateToVMScaleSet instead */ + beginMigrateToVMScaleSetAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, + ) => Promise; + /** Run command on the VM. */ + runCommand: ( + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options?: VirtualMachinesRunCommandOptionalParams, + ) => PollerLike, RunCommandResult>; + /** @deprecated use runCommand instead */ + beginRunCommand: ( + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options?: VirtualMachinesRunCommandOptionalParams, + ) => Promise, RunCommandResult>>; + /** @deprecated use runCommand instead */ + beginRunCommandAndWait: ( + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options?: VirtualMachinesRunCommandOptionalParams, + ) => Promise; + /** Lists all available virtual machine sizes to which the specified virtual machine can be resized. */ + listAvailableSizes: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesListAvailableSizesOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to start a virtual machine. */ + start: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesStartOptionalParams, + ) => PollerLike, void>; + /** @deprecated use start instead */ + beginStart: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesStartOptionalParams, + ) => Promise, void>>; + /** @deprecated use start instead */ + beginStartAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesStartOptionalParams, + ) => Promise; + /** The operation to simulate the eviction of spot virtual machine. */ + simulateEviction: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesSimulateEvictionOptionalParams, + ) => Promise; + /** The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. */ + retrieveBootDiagnosticsData: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + ) => Promise; + /** The operation to restart a virtual machine. */ + restart: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRestartOptionalParams, + ) => PollerLike, void>; + /** @deprecated use restart instead */ + beginRestart: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRestartOptionalParams, + ) => Promise, void>>; + /** @deprecated use restart instead */ + beginRestartAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRestartOptionalParams, + ) => Promise; + /** Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. */ + reimage: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReimageOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reimage instead */ + beginReimage: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReimageOptionalParams, + ) => Promise, void>>; + /** @deprecated use reimage instead */ + beginReimageAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReimageOptionalParams, + ) => Promise; + /** Shuts down the virtual machine, moves it to a new node, and powers it back on. */ + redeploy: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRedeployOptionalParams, + ) => PollerLike, void>; + /** @deprecated use redeploy instead */ + beginRedeploy: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRedeployOptionalParams, + ) => Promise, void>>; + /** @deprecated use redeploy instead */ + beginRedeployAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRedeployOptionalParams, + ) => Promise; + /** The operation to reapply a virtual machine's state. */ + reapply: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReapplyOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reapply instead */ + beginReapply: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReapplyOptionalParams, + ) => Promise, void>>; + /** @deprecated use reapply instead */ + beginReapplyAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReapplyOptionalParams, + ) => Promise; + /** The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. */ + powerOff: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPowerOffOptionalParams, + ) => PollerLike, void>; + /** @deprecated use powerOff instead */ + beginPowerOff: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPowerOffOptionalParams, + ) => Promise, void>>; + /** @deprecated use powerOff instead */ + beginPowerOffAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPowerOffOptionalParams, + ) => Promise; + /** The operation to perform maintenance on a virtual machine. */ + performMaintenance: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPerformMaintenanceOptionalParams, + ) => PollerLike, void>; + /** @deprecated use performMaintenance instead */ + beginPerformMaintenance: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPerformMaintenanceOptionalParams, + ) => Promise, void>>; + /** @deprecated use performMaintenance instead */ + beginPerformMaintenanceAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPerformMaintenanceOptionalParams, + ) => Promise; + /** Retrieves information about the run-time state of a virtual machine. */ + instanceView: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesInstanceViewOptionalParams, + ) => Promise; + /** Installs patches on the VM. */ + installPatches: ( + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineInstallPatchesResult + >; + /** @deprecated use installPatches instead */ + beginInstallPatches: ( + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + VirtualMachineInstallPatchesResult + > + >; + /** @deprecated use installPatches instead */ + beginInstallPatchesAndWait: ( + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams, + ) => Promise; + /** Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to [Create a managed image of a generalized VM in Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, please refer to [How to create an image of a virtual machine or VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). */ + generalize: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesGeneralizeOptionalParams, + ) => Promise; + /** Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. */ + deallocate: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeallocateOptionalParams, + ) => PollerLike, void>; + /** @deprecated use deallocate instead */ + beginDeallocate: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeallocateOptionalParams, + ) => Promise, void>>; + /** @deprecated use deallocate instead */ + beginDeallocateAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeallocateOptionalParams, + ) => Promise; + /** Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. */ + convertToManagedDisks: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesConvertToManagedDisksOptionalParams, + ) => PollerLike, void>; + /** @deprecated use convertToManagedDisks instead */ + beginConvertToManagedDisks: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesConvertToManagedDisksOptionalParams, + ) => Promise, void>>; + /** @deprecated use convertToManagedDisks instead */ + beginConvertToManagedDisksAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesConvertToManagedDisksOptionalParams, + ) => Promise; + /** Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. */ + capture: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options?: VirtualMachinesCaptureOptionalParams, + ) => PollerLike, VirtualMachineCaptureResult>; + /** @deprecated use capture instead */ + beginCapture: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options?: VirtualMachinesCaptureOptionalParams, + ) => Promise< + SimplePollerLike, VirtualMachineCaptureResult> + >; + /** @deprecated use capture instead */ + beginCaptureAndWait: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options?: VirtualMachinesCaptureOptionalParams, + ) => Promise; + /** Attach and detach data disks to/from the virtual machine. */ + attachDetachDataDisks: ( + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachinesAttachDetachDataDisksOptionalParams, + ) => PollerLike, StorageProfile>; + /** @deprecated use attachDetachDataDisks instead */ + beginAttachDetachDataDisks: ( + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachinesAttachDetachDataDisksOptionalParams, + ) => Promise, StorageProfile>>; + /** @deprecated use attachDetachDataDisks instead */ + beginAttachDetachDataDisksAndWait: ( + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachinesAttachDetachDataDisksOptionalParams, + ) => Promise; + /** Assess patches on the VM. */ + assessPatches: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesAssessPatchesOptionalParams, + ) => PollerLike< + OperationState, + VirtualMachineAssessPatchesResult + >; + /** @deprecated use assessPatches instead */ + beginAssessPatches: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesAssessPatchesOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + VirtualMachineAssessPatchesResult + > + >; + /** @deprecated use assessPatches instead */ + beginAssessPatchesAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesAssessPatchesOptionalParams, + ) => Promise; + /** Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. */ + listAll: ( + options?: VirtualMachinesListAllOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. */ + list: ( + resourceGroupName: string, + options?: VirtualMachinesListOptionalParams, + ) => PagedAsyncIterableIterator; + /** The operation to delete a virtual machine. */ + /** + * @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, + vmName: string, + options?: VirtualMachinesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeleteOptionalParams, + ) => Promise; + /** The operation to update a virtual machine. */ + update: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options?: VirtualMachinesUpdateOptionalParams, + ) => PollerLike, VirtualMachine>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options?: VirtualMachinesUpdateOptionalParams, + ) => Promise, VirtualMachine>>; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options?: VirtualMachinesUpdateOptionalParams, + ) => Promise; + /** The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. */ + createOrUpdate: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams, + ) => PollerLike, VirtualMachine>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams, + ) => Promise, VirtualMachine>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams, + ) => Promise; + /** Retrieves information about the model view or the instance view of a virtual machine. */ + get: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesGetOptionalParams, + ) => Promise; +} + +function _getVirtualMachines(context: ComputeManagementContext) { + return { + listByLocation: (location: string, options?: VirtualMachinesListByLocationOptionalParams) => + listByLocation(context, location, options), + migrateToVMScaleSet: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, + ) => migrateToVMScaleSet(context, resourceGroupName, vmName, options), + beginMigrateToVMScaleSet: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, + ) => { + const poller = migrateToVMScaleSet(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginMigrateToVMScaleSetAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, + ) => { + return await migrateToVMScaleSet(context, resourceGroupName, vmName, options); + }, + runCommand: ( + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options?: VirtualMachinesRunCommandOptionalParams, + ) => runCommand(context, resourceGroupName, vmName, parameters, options), + beginRunCommand: async ( + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options?: VirtualMachinesRunCommandOptionalParams, + ) => { + const poller = runCommand(context, resourceGroupName, vmName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRunCommandAndWait: async ( + resourceGroupName: string, + vmName: string, + parameters: RunCommandInput, + options?: VirtualMachinesRunCommandOptionalParams, + ) => { + return await runCommand(context, resourceGroupName, vmName, parameters, options); + }, + listAvailableSizes: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesListAvailableSizesOptionalParams, + ) => listAvailableSizes(context, resourceGroupName, vmName, options), + start: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesStartOptionalParams, + ) => start(context, resourceGroupName, vmName, options), + beginStart: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesStartOptionalParams, + ) => { + const poller = start(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginStartAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesStartOptionalParams, + ) => { + return await start(context, resourceGroupName, vmName, options); + }, + simulateEviction: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesSimulateEvictionOptionalParams, + ) => simulateEviction(context, resourceGroupName, vmName, options), + retrieveBootDiagnosticsData: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + ) => retrieveBootDiagnosticsData(context, resourceGroupName, vmName, options), + restart: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRestartOptionalParams, + ) => restart(context, resourceGroupName, vmName, options), + beginRestart: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRestartOptionalParams, + ) => { + const poller = restart(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRestartAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRestartOptionalParams, + ) => { + return await restart(context, resourceGroupName, vmName, options); + }, + reimage: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReimageOptionalParams, + ) => reimage(context, resourceGroupName, vmName, options), + beginReimage: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReimageOptionalParams, + ) => { + const poller = reimage(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReimageAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReimageOptionalParams, + ) => { + return await reimage(context, resourceGroupName, vmName, options); + }, + redeploy: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRedeployOptionalParams, + ) => redeploy(context, resourceGroupName, vmName, options), + beginRedeploy: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRedeployOptionalParams, + ) => { + const poller = redeploy(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRedeployAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesRedeployOptionalParams, + ) => { + return await redeploy(context, resourceGroupName, vmName, options); + }, + reapply: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReapplyOptionalParams, + ) => reapply(context, resourceGroupName, vmName, options), + beginReapply: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReapplyOptionalParams, + ) => { + const poller = reapply(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReapplyAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesReapplyOptionalParams, + ) => { + return await reapply(context, resourceGroupName, vmName, options); + }, + powerOff: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPowerOffOptionalParams, + ) => powerOff(context, resourceGroupName, vmName, options), + beginPowerOff: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPowerOffOptionalParams, + ) => { + const poller = powerOff(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPowerOffAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPowerOffOptionalParams, + ) => { + return await powerOff(context, resourceGroupName, vmName, options); + }, + performMaintenance: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPerformMaintenanceOptionalParams, + ) => performMaintenance(context, resourceGroupName, vmName, options), + beginPerformMaintenance: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPerformMaintenanceOptionalParams, + ) => { + const poller = performMaintenance(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginPerformMaintenanceAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesPerformMaintenanceOptionalParams, + ) => { + return await performMaintenance(context, resourceGroupName, vmName, options); + }, + instanceView: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesInstanceViewOptionalParams, + ) => instanceView(context, resourceGroupName, vmName, options), + installPatches: ( + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams, + ) => installPatches(context, resourceGroupName, vmName, installPatchesInput, options), + beginInstallPatches: async ( + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams, + ) => { + const poller = installPatches( + context, + resourceGroupName, + vmName, + installPatchesInput, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginInstallPatchesAndWait: async ( + resourceGroupName: string, + vmName: string, + installPatchesInput: VirtualMachineInstallPatchesParameters, + options?: VirtualMachinesInstallPatchesOptionalParams, + ) => { + return await installPatches(context, resourceGroupName, vmName, installPatchesInput, options); + }, + generalize: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesGeneralizeOptionalParams, + ) => generalize(context, resourceGroupName, vmName, options), + deallocate: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeallocateOptionalParams, + ) => deallocate(context, resourceGroupName, vmName, options), + beginDeallocate: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeallocateOptionalParams, + ) => { + const poller = deallocate(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeallocateAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeallocateOptionalParams, + ) => { + return await deallocate(context, resourceGroupName, vmName, options); + }, + convertToManagedDisks: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesConvertToManagedDisksOptionalParams, + ) => convertToManagedDisks(context, resourceGroupName, vmName, options), + beginConvertToManagedDisks: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesConvertToManagedDisksOptionalParams, + ) => { + const poller = convertToManagedDisks(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginConvertToManagedDisksAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesConvertToManagedDisksOptionalParams, + ) => { + return await convertToManagedDisks(context, resourceGroupName, vmName, options); + }, + capture: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options?: VirtualMachinesCaptureOptionalParams, + ) => capture(context, resourceGroupName, vmName, parameters, options), + beginCapture: async ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options?: VirtualMachinesCaptureOptionalParams, + ) => { + const poller = capture(context, resourceGroupName, vmName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCaptureAndWait: async ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineCaptureParameters, + options?: VirtualMachinesCaptureOptionalParams, + ) => { + return await capture(context, resourceGroupName, vmName, parameters, options); + }, + attachDetachDataDisks: ( + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachinesAttachDetachDataDisksOptionalParams, + ) => attachDetachDataDisks(context, resourceGroupName, vmName, parameters, options), + beginAttachDetachDataDisks: async ( + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachinesAttachDetachDataDisksOptionalParams, + ) => { + const poller = attachDetachDataDisks(context, resourceGroupName, vmName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginAttachDetachDataDisksAndWait: async ( + resourceGroupName: string, + vmName: string, + parameters: AttachDetachDataDisksRequest, + options?: VirtualMachinesAttachDetachDataDisksOptionalParams, + ) => { + return await attachDetachDataDisks(context, resourceGroupName, vmName, parameters, options); + }, + assessPatches: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesAssessPatchesOptionalParams, + ) => assessPatches(context, resourceGroupName, vmName, options), + beginAssessPatches: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesAssessPatchesOptionalParams, + ) => { + const poller = assessPatches(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginAssessPatchesAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesAssessPatchesOptionalParams, + ) => { + return await assessPatches(context, resourceGroupName, vmName, options); + }, + listAll: (options?: VirtualMachinesListAllOptionalParams) => listAll(context, options), + list: (resourceGroupName: string, options?: VirtualMachinesListOptionalParams) => + list(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, vmName, options), + beginDelete: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, vmName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + vmName: string, + options?: VirtualMachinesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, vmName, options); + }, + update: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options?: VirtualMachinesUpdateOptionalParams, + ) => update(context, resourceGroupName, vmName, parameters, options), + beginUpdate: async ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options?: VirtualMachinesUpdateOptionalParams, + ) => { + const poller = update(context, resourceGroupName, vmName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachineUpdate, + options?: VirtualMachinesUpdateOptionalParams, + ) => { + return await update(context, resourceGroupName, vmName, parameters, options); + }, + createOrUpdate: ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, vmName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate(context, resourceGroupName, vmName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + vmName: string, + parameters: VirtualMachine, + options?: VirtualMachinesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, vmName, parameters, options); + }, + get: (resourceGroupName: string, vmName: string, options?: VirtualMachinesGetOptionalParams) => + get(context, resourceGroupName, vmName, options), + }; +} + +export function _getVirtualMachinesOperations( + context: ComputeManagementContext, +): VirtualMachinesOperations { + return { + ..._getVirtualMachines(context), + }; +} diff --git a/sdk/compute/arm-compute/src/computeManagementClient.ts b/sdk/compute/arm-compute/src/computeManagementClient.ts index dfd47c1f7aac..f36441b04702 100644 --- a/sdk/compute/arm-compute/src/computeManagementClient.ts +++ b/sdk/compute/arm-compute/src/computeManagementClient.ts @@ -1,319 +1,312 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import type * as coreAuth from "@azure/core-auth"; -import { - OperationsImpl, - AvailabilitySetsImpl, - CapacityReservationGroupsImpl, - DedicatedHostGroupsImpl, - ImagesImpl, - VirtualMachineImagesEdgeZoneImpl, - VirtualMachineImagesImpl, - LogAnalyticsImpl, - VirtualMachineExtensionImagesImpl, - VirtualMachineRunCommandsImpl, - UsageOperationsImpl, - VirtualMachineScaleSetsImpl, - VirtualMachinesImpl, - VirtualMachineSizesImpl, - ProximityPlacementGroupsImpl, - RestorePointCollectionsImpl, - SshPublicKeysImpl, - CapacityReservationsImpl, - DedicatedHostsImpl, - RestorePointsImpl, - VirtualMachineScaleSetRollingUpgradesImpl, - VirtualMachineScaleSetExtensionsImpl, - VirtualMachineScaleSetVMsImpl, - VirtualMachineScaleSetVMExtensionsImpl, - VirtualMachineScaleSetVMRunCommandsImpl, - VirtualMachineExtensionsImpl, - DiskAccessesImpl, - DiskEncryptionSetsImpl, - DisksImpl, - SnapshotsImpl, - DiskRestorePointOperationsImpl, - ResourceSkusImpl, - GalleriesImpl, - CommunityGalleriesImpl, - CommunityGalleryImagesImpl, - CommunityGalleryImageVersionsImpl, - SharedGalleriesImpl, - SharedGalleryImagesImpl, - SharedGalleryImageVersionsImpl, - GalleryApplicationsImpl, - GalleryApplicationVersionsImpl, - GalleryImagesImpl, - GalleryImageVersionsImpl, - GalleryInVMAccessControlProfilesImpl, - GalleryInVMAccessControlProfileVersionsImpl, - GalleryScriptsImpl, - GalleryScriptVersionsImpl, - GallerySharingProfileImpl, - SoftDeletedResourceImpl, - CloudServiceRoleInstancesImpl, - CloudServiceRolesImpl, - CloudServicesImpl, - CloudServicesUpdateDomainImpl, - CloudServiceOperatingSystemsImpl, -} from "./operations/index.js"; import type { - Operations, - AvailabilitySets, - CapacityReservationGroups, - DedicatedHostGroups, - Images, - VirtualMachineImagesEdgeZone, - VirtualMachineImages, - LogAnalytics, - VirtualMachineExtensionImages, - VirtualMachineRunCommands, - UsageOperations, - VirtualMachineScaleSets, - VirtualMachines, - VirtualMachineSizes, - ProximityPlacementGroups, - RestorePointCollections, - SshPublicKeys, - CapacityReservations, - DedicatedHosts, - RestorePoints, - VirtualMachineScaleSetRollingUpgrades, - VirtualMachineScaleSetExtensions, - VirtualMachineScaleSetVMs, - VirtualMachineScaleSetVMExtensions, - VirtualMachineScaleSetVMRunCommands, - VirtualMachineExtensions, - DiskAccesses, - DiskEncryptionSets, - Disks, - Snapshots, - DiskRestorePointOperations, - ResourceSkus, - Galleries, - CommunityGalleries, - CommunityGalleryImages, - CommunityGalleryImageVersions, - SharedGalleries, - SharedGalleryImages, - SharedGalleryImageVersions, - GalleryApplications, - GalleryApplicationVersions, - GalleryImages, - GalleryImageVersions, - GalleryInVMAccessControlProfiles, - GalleryInVMAccessControlProfileVersions, - GalleryScripts, - GalleryScriptVersions, - GallerySharingProfile, - SoftDeletedResource, - CloudServiceRoleInstances, - CloudServiceRoles, - CloudServices, - CloudServicesUpdateDomain, - CloudServiceOperatingSystems, -} from "./operationsInterfaces/index.js"; -import type { ComputeManagementClientOptionalParams } from "./models/index.js"; + ComputeManagementContext, + ComputeManagementClientOptionalParams, +} from "./api/index.js"; +import { createComputeManagement } from "./api/index.js"; +import type { AvailabilitySetsOperations } from "./classic/availabilitySets/index.js"; +import { _getAvailabilitySetsOperations } from "./classic/availabilitySets/index.js"; +import type { CapacityReservationGroupsOperations } from "./classic/capacityReservationGroups/index.js"; +import { _getCapacityReservationGroupsOperations } from "./classic/capacityReservationGroups/index.js"; +import type { CapacityReservationsOperations } from "./classic/capacityReservations/index.js"; +import { _getCapacityReservationsOperations } from "./classic/capacityReservations/index.js"; +import type { CommunityGalleriesOperations } from "./classic/communityGalleries/index.js"; +import { _getCommunityGalleriesOperations } from "./classic/communityGalleries/index.js"; +import type { CommunityGalleryImageVersionsOperations } from "./classic/communityGalleryImageVersions/index.js"; +import { _getCommunityGalleryImageVersionsOperations } from "./classic/communityGalleryImageVersions/index.js"; +import type { CommunityGalleryImagesOperations } from "./classic/communityGalleryImages/index.js"; +import { _getCommunityGalleryImagesOperations } from "./classic/communityGalleryImages/index.js"; +import type { DedicatedHostGroupsOperations } from "./classic/dedicatedHostGroups/index.js"; +import { _getDedicatedHostGroupsOperations } from "./classic/dedicatedHostGroups/index.js"; +import type { DedicatedHostsOperations } from "./classic/dedicatedHosts/index.js"; +import { _getDedicatedHostsOperations } from "./classic/dedicatedHosts/index.js"; +import type { DiskAccessesOperations } from "./classic/diskAccesses/index.js"; +import { _getDiskAccessesOperations } from "./classic/diskAccesses/index.js"; +import type { DiskEncryptionSetsOperations } from "./classic/diskEncryptionSets/index.js"; +import { _getDiskEncryptionSetsOperations } from "./classic/diskEncryptionSets/index.js"; +import type { DiskRestorePointOperations } from "./classic/diskRestorePoint/index.js"; +import { _getDiskRestorePointOperations } from "./classic/diskRestorePoint/index.js"; +import type { DisksOperations } from "./classic/disks/index.js"; +import { _getDisksOperations } from "./classic/disks/index.js"; +import type { GalleriesOperations } from "./classic/galleries/index.js"; +import { _getGalleriesOperations } from "./classic/galleries/index.js"; +import type { GalleryApplicationVersionsOperations } from "./classic/galleryApplicationVersions/index.js"; +import { _getGalleryApplicationVersionsOperations } from "./classic/galleryApplicationVersions/index.js"; +import type { GalleryApplicationsOperations } from "./classic/galleryApplications/index.js"; +import { _getGalleryApplicationsOperations } from "./classic/galleryApplications/index.js"; +import type { GalleryImageVersionsOperations } from "./classic/galleryImageVersions/index.js"; +import { _getGalleryImageVersionsOperations } from "./classic/galleryImageVersions/index.js"; +import type { GalleryImagesOperations } from "./classic/galleryImages/index.js"; +import { _getGalleryImagesOperations } from "./classic/galleryImages/index.js"; +import type { GalleryInVMAccessControlProfileVersionsOperations } from "./classic/galleryInVMAccessControlProfileVersions/index.js"; +import { _getGalleryInVMAccessControlProfileVersionsOperations } from "./classic/galleryInVMAccessControlProfileVersions/index.js"; +import type { GalleryInVMAccessControlProfilesOperations } from "./classic/galleryInVMAccessControlProfiles/index.js"; +import { _getGalleryInVMAccessControlProfilesOperations } from "./classic/galleryInVMAccessControlProfiles/index.js"; +import type { GalleryScriptVersionsOperations } from "./classic/galleryScriptVersions/index.js"; +import { _getGalleryScriptVersionsOperations } from "./classic/galleryScriptVersions/index.js"; +import type { GalleryScriptsOperations } from "./classic/galleryScripts/index.js"; +import { _getGalleryScriptsOperations } from "./classic/galleryScripts/index.js"; +import type { GallerySharingProfileOperations } from "./classic/gallerySharingProfile/index.js"; +import { _getGallerySharingProfileOperations } from "./classic/gallerySharingProfile/index.js"; +import type { ImagesOperations } from "./classic/images/index.js"; +import { _getImagesOperations } from "./classic/images/index.js"; +import type { LogAnalyticsOperations } from "./classic/logAnalytics/index.js"; +import { _getLogAnalyticsOperations } from "./classic/logAnalytics/index.js"; +import type { OperationsOperations } from "./classic/operations/index.js"; +import { _getOperationsOperations } from "./classic/operations/index.js"; +import type { ProximityPlacementGroupsOperations } from "./classic/proximityPlacementGroups/index.js"; +import { _getProximityPlacementGroupsOperations } from "./classic/proximityPlacementGroups/index.js"; +import type { ResourceSkusOperations } from "./classic/resourceSkus/index.js"; +import { _getResourceSkusOperations } from "./classic/resourceSkus/index.js"; +import type { RestorePointCollectionsOperations } from "./classic/restorePointCollections/index.js"; +import { _getRestorePointCollectionsOperations } from "./classic/restorePointCollections/index.js"; +import type { RestorePointsOperations } from "./classic/restorePoints/index.js"; +import { _getRestorePointsOperations } from "./classic/restorePoints/index.js"; +import type { SharedGalleriesOperations } from "./classic/sharedGalleries/index.js"; +import { _getSharedGalleriesOperations } from "./classic/sharedGalleries/index.js"; +import type { SharedGalleryImageVersionsOperations } from "./classic/sharedGalleryImageVersions/index.js"; +import { _getSharedGalleryImageVersionsOperations } from "./classic/sharedGalleryImageVersions/index.js"; +import type { SharedGalleryImagesOperations } from "./classic/sharedGalleryImages/index.js"; +import { _getSharedGalleryImagesOperations } from "./classic/sharedGalleryImages/index.js"; +import type { SnapshotsOperations } from "./classic/snapshots/index.js"; +import { _getSnapshotsOperations } from "./classic/snapshots/index.js"; +import type { SoftDeletedResourceOperations } from "./classic/softDeletedResource/index.js"; +import { _getSoftDeletedResourceOperations } from "./classic/softDeletedResource/index.js"; +import type { SshPublicKeysOperations } from "./classic/sshPublicKeys/index.js"; +import { _getSshPublicKeysOperations } from "./classic/sshPublicKeys/index.js"; +import type { UsageOperations } from "./classic/usage/index.js"; +import { _getUsageOperations } from "./classic/usage/index.js"; +import type { VirtualMachineExtensionImagesOperations } from "./classic/virtualMachineExtensionImages/index.js"; +import { _getVirtualMachineExtensionImagesOperations } from "./classic/virtualMachineExtensionImages/index.js"; +import type { VirtualMachineExtensionsOperations } from "./classic/virtualMachineExtensions/index.js"; +import { _getVirtualMachineExtensionsOperations } from "./classic/virtualMachineExtensions/index.js"; +import type { VirtualMachineImagesOperations } from "./classic/virtualMachineImages/index.js"; +import { _getVirtualMachineImagesOperations } from "./classic/virtualMachineImages/index.js"; +import type { VirtualMachineImagesEdgeZoneOperations } from "./classic/virtualMachineImagesEdgeZone/index.js"; +import { _getVirtualMachineImagesEdgeZoneOperations } from "./classic/virtualMachineImagesEdgeZone/index.js"; +import type { VirtualMachineRunCommandsOperations } from "./classic/virtualMachineRunCommands/index.js"; +import { _getVirtualMachineRunCommandsOperations } from "./classic/virtualMachineRunCommands/index.js"; +import type { VirtualMachineScaleSetExtensionsOperations } from "./classic/virtualMachineScaleSetExtensions/index.js"; +import { _getVirtualMachineScaleSetExtensionsOperations } from "./classic/virtualMachineScaleSetExtensions/index.js"; +import type { VirtualMachineScaleSetLifeCycleHookEventsOperations } from "./classic/virtualMachineScaleSetLifeCycleHookEvents/index.js"; +import { _getVirtualMachineScaleSetLifeCycleHookEventsOperations } from "./classic/virtualMachineScaleSetLifeCycleHookEvents/index.js"; +import type { VirtualMachineScaleSetRollingUpgradesOperations } from "./classic/virtualMachineScaleSetRollingUpgrades/index.js"; +import { _getVirtualMachineScaleSetRollingUpgradesOperations } from "./classic/virtualMachineScaleSetRollingUpgrades/index.js"; +import type { VirtualMachineScaleSetVMExtensionsOperations } from "./classic/virtualMachineScaleSetVMExtensions/index.js"; +import { _getVirtualMachineScaleSetVMExtensionsOperations } from "./classic/virtualMachineScaleSetVMExtensions/index.js"; +import type { VirtualMachineScaleSetVMRunCommandsOperations } from "./classic/virtualMachineScaleSetVMRunCommands/index.js"; +import { _getVirtualMachineScaleSetVMRunCommandsOperations } from "./classic/virtualMachineScaleSetVMRunCommands/index.js"; +import type { VirtualMachineScaleSetVMsOperations } from "./classic/virtualMachineScaleSetVMs/index.js"; +import { _getVirtualMachineScaleSetVMsOperations } from "./classic/virtualMachineScaleSetVMs/index.js"; +import type { VirtualMachineScaleSetsOperations } from "./classic/virtualMachineScaleSets/index.js"; +import { _getVirtualMachineScaleSetsOperations } from "./classic/virtualMachineScaleSets/index.js"; +import type { VirtualMachineSizesOperations } from "./classic/virtualMachineSizes/index.js"; +import { _getVirtualMachineSizesOperations } from "./classic/virtualMachineSizes/index.js"; +import type { VirtualMachinesOperations } from "./classic/virtualMachines/index.js"; +import { _getVirtualMachinesOperations } from "./classic/virtualMachines/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; + +export type { ComputeManagementClientOptionalParams } from "./api/computeManagementContext.js"; -export class ComputeManagementClient extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; +export class ComputeManagementClient { + private _client: ComputeManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; - /** - * Initializes a new instance of the ComputeManagementClient class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. - * @param options The parameter options - */ + constructor(credential: TokenCredential, options?: ComputeManagementClientOptionalParams); constructor( - credentials: coreAuth.TokenCredential, + credential: TokenCredential, subscriptionId: string, options?: ComputeManagementClientOptionalParams, + ); + /** Compute Client */ + constructor( + credential: TokenCredential, + subscriptionIdOrOptions?: string | ComputeManagementClientOptionalParams, + options?: ComputeManagementClientOptionalParams, ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } + let subscriptionId: string | undefined; - // Initializing default values for options - if (!options) { - options = {}; + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } - const defaults: ComputeManagementClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - - const packageDetails = `azsdk-js-arm-compute/23.3.0`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - const optionsWithDefaults = { - ...defaults, + options = options ?? {}; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createComputeManagement(credential, subscriptionId ?? "", { ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = - options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName, - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, - }, - }), - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.operations = new OperationsImpl(this); - this.availabilitySets = new AvailabilitySetsImpl(this); - this.capacityReservationGroups = new CapacityReservationGroupsImpl(this); - this.dedicatedHostGroups = new DedicatedHostGroupsImpl(this); - this.images = new ImagesImpl(this); - this.virtualMachineImagesEdgeZone = new VirtualMachineImagesEdgeZoneImpl(this); - this.virtualMachineImages = new VirtualMachineImagesImpl(this); - this.logAnalytics = new LogAnalyticsImpl(this); - this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesImpl(this); - this.virtualMachineRunCommands = new VirtualMachineRunCommandsImpl(this); - this.usageOperations = new UsageOperationsImpl(this); - this.virtualMachineScaleSets = new VirtualMachineScaleSetsImpl(this); - this.virtualMachines = new VirtualMachinesImpl(this); - this.virtualMachineSizes = new VirtualMachineSizesImpl(this); - this.proximityPlacementGroups = new ProximityPlacementGroupsImpl(this); - this.restorePointCollections = new RestorePointCollectionsImpl(this); - this.sshPublicKeys = new SshPublicKeysImpl(this); - this.capacityReservations = new CapacityReservationsImpl(this); - this.dedicatedHosts = new DedicatedHostsImpl(this); - this.restorePoints = new RestorePointsImpl(this); - this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesImpl( - this, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.gallerySharingProfile = _getGallerySharingProfileOperations(this._client); + this.softDeletedResource = _getSoftDeletedResourceOperations(this._client); + this.diskRestorePoint = _getDiskRestorePointOperations(this._client); + this.logAnalytics = _getLogAnalyticsOperations(this._client); + this.virtualMachineImages = _getVirtualMachineImagesOperations(this._client); + this.virtualMachineImagesEdgeZone = _getVirtualMachineImagesEdgeZoneOperations(this._client); + this.virtualMachineSizes = _getVirtualMachineSizesOperations(this._client); + this.usage = _getUsageOperations(this._client); + this.sshPublicKeys = _getSshPublicKeysOperations(this._client); + this.virtualMachineScaleSetVMs = _getVirtualMachineScaleSetVMsOperations(this._client); + this.virtualMachineScaleSetRollingUpgrades = + _getVirtualMachineScaleSetRollingUpgradesOperations(this._client); + this.resourceSkus = _getResourceSkusOperations(this._client); + this.communityGalleryImageVersions = _getCommunityGalleryImageVersionsOperations(this._client); + this.communityGalleryImages = _getCommunityGalleryImagesOperations(this._client); + this.communityGalleries = _getCommunityGalleriesOperations(this._client); + this.sharedGalleryImageVersions = _getSharedGalleryImageVersionsOperations(this._client); + this.sharedGalleryImages = _getSharedGalleryImagesOperations(this._client); + this.sharedGalleries = _getSharedGalleriesOperations(this._client); + this.galleryInVMAccessControlProfileVersions = + _getGalleryInVMAccessControlProfileVersionsOperations(this._client); + this.galleryInVMAccessControlProfiles = _getGalleryInVMAccessControlProfilesOperations( + this._client, + ); + this.galleryScriptVersions = _getGalleryScriptVersionsOperations(this._client); + this.galleryScripts = _getGalleryScriptsOperations(this._client); + this.galleryApplicationVersions = _getGalleryApplicationVersionsOperations(this._client); + this.galleryApplications = _getGalleryApplicationsOperations(this._client); + this.galleryImageVersions = _getGalleryImageVersionsOperations(this._client); + this.galleryImages = _getGalleryImagesOperations(this._client); + this.galleries = _getGalleriesOperations(this._client); + this.snapshots = _getSnapshotsOperations(this._client); + this.diskEncryptionSets = _getDiskEncryptionSetsOperations(this._client); + this.diskAccesses = _getDiskAccessesOperations(this._client); + this.disks = _getDisksOperations(this._client); + this.virtualMachineScaleSetVMRunCommands = _getVirtualMachineScaleSetVMRunCommandsOperations( + this._client, + ); + this.virtualMachineRunCommands = _getVirtualMachineRunCommandsOperations(this._client); + this.capacityReservations = _getCapacityReservationsOperations(this._client); + this.capacityReservationGroups = _getCapacityReservationGroupsOperations(this._client); + this.restorePoints = _getRestorePointsOperations(this._client); + this.restorePointCollections = _getRestorePointCollectionsOperations(this._client); + this.images = _getImagesOperations(this._client); + this.dedicatedHosts = _getDedicatedHostsOperations(this._client); + this.dedicatedHostGroups = _getDedicatedHostGroupsOperations(this._client); + this.proximityPlacementGroups = _getProximityPlacementGroupsOperations(this._client); + this.availabilitySets = _getAvailabilitySetsOperations(this._client); + this.virtualMachineExtensionImages = _getVirtualMachineExtensionImagesOperations(this._client); + this.virtualMachineExtensions = _getVirtualMachineExtensionsOperations(this._client); + this.virtualMachines = _getVirtualMachinesOperations(this._client); + this.virtualMachineScaleSetVMExtensions = _getVirtualMachineScaleSetVMExtensionsOperations( + this._client, ); - this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsImpl(this); - this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsImpl(this); - this.virtualMachineScaleSetVMExtensions = new VirtualMachineScaleSetVMExtensionsImpl(this); - this.virtualMachineScaleSetVMRunCommands = new VirtualMachineScaleSetVMRunCommandsImpl(this); - this.virtualMachineExtensions = new VirtualMachineExtensionsImpl(this); - this.diskAccesses = new DiskAccessesImpl(this); - this.diskEncryptionSets = new DiskEncryptionSetsImpl(this); - this.disks = new DisksImpl(this); - this.snapshots = new SnapshotsImpl(this); - this.diskRestorePointOperations = new DiskRestorePointOperationsImpl(this); - this.resourceSkus = new ResourceSkusImpl(this); - this.galleries = new GalleriesImpl(this); - this.communityGalleries = new CommunityGalleriesImpl(this); - this.communityGalleryImages = new CommunityGalleryImagesImpl(this); - this.communityGalleryImageVersions = new CommunityGalleryImageVersionsImpl(this); - this.sharedGalleries = new SharedGalleriesImpl(this); - this.sharedGalleryImages = new SharedGalleryImagesImpl(this); - this.sharedGalleryImageVersions = new SharedGalleryImageVersionsImpl(this); - this.galleryApplications = new GalleryApplicationsImpl(this); - this.galleryApplicationVersions = new GalleryApplicationVersionsImpl(this); - this.galleryImages = new GalleryImagesImpl(this); - this.galleryImageVersions = new GalleryImageVersionsImpl(this); - this.galleryInVMAccessControlProfiles = new GalleryInVMAccessControlProfilesImpl(this); - this.galleryInVMAccessControlProfileVersions = new GalleryInVMAccessControlProfileVersionsImpl( - this, + this.virtualMachineScaleSetLifeCycleHookEvents = + _getVirtualMachineScaleSetLifeCycleHookEventsOperations(this._client); + this.virtualMachineScaleSetExtensions = _getVirtualMachineScaleSetExtensionsOperations( + this._client, ); - this.galleryScripts = new GalleryScriptsImpl(this); - this.galleryScriptVersions = new GalleryScriptVersionsImpl(this); - this.gallerySharingProfile = new GallerySharingProfileImpl(this); - this.softDeletedResource = new SoftDeletedResourceImpl(this); - this.cloudServiceRoleInstances = new CloudServiceRoleInstancesImpl(this); - this.cloudServiceRoles = new CloudServiceRolesImpl(this); - this.cloudServices = new CloudServicesImpl(this); - this.cloudServicesUpdateDomain = new CloudServicesUpdateDomainImpl(this); - this.cloudServiceOperatingSystems = new CloudServiceOperatingSystemsImpl(this); + this.virtualMachineScaleSets = _getVirtualMachineScaleSetsOperations(this._client); + this.operations = _getOperationsOperations(this._client); } - operations: Operations; - availabilitySets: AvailabilitySets; - capacityReservationGroups: CapacityReservationGroups; - dedicatedHostGroups: DedicatedHostGroups; - images: Images; - virtualMachineImagesEdgeZone: VirtualMachineImagesEdgeZone; - virtualMachineImages: VirtualMachineImages; - logAnalytics: LogAnalytics; - virtualMachineExtensionImages: VirtualMachineExtensionImages; - virtualMachineRunCommands: VirtualMachineRunCommands; - usageOperations: UsageOperations; - virtualMachineScaleSets: VirtualMachineScaleSets; - virtualMachines: VirtualMachines; - virtualMachineSizes: VirtualMachineSizes; - proximityPlacementGroups: ProximityPlacementGroups; - restorePointCollections: RestorePointCollections; - sshPublicKeys: SshPublicKeys; - capacityReservations: CapacityReservations; - dedicatedHosts: DedicatedHosts; - restorePoints: RestorePoints; - virtualMachineScaleSetRollingUpgrades: VirtualMachineScaleSetRollingUpgrades; - virtualMachineScaleSetExtensions: VirtualMachineScaleSetExtensions; - virtualMachineScaleSetVMs: VirtualMachineScaleSetVMs; - virtualMachineScaleSetVMExtensions: VirtualMachineScaleSetVMExtensions; - virtualMachineScaleSetVMRunCommands: VirtualMachineScaleSetVMRunCommands; - virtualMachineExtensions: VirtualMachineExtensions; - diskAccesses: DiskAccesses; - diskEncryptionSets: DiskEncryptionSets; - disks: Disks; - snapshots: Snapshots; - diskRestorePointOperations: DiskRestorePointOperations; - resourceSkus: ResourceSkus; - galleries: Galleries; - communityGalleries: CommunityGalleries; - communityGalleryImages: CommunityGalleryImages; - communityGalleryImageVersions: CommunityGalleryImageVersions; - sharedGalleries: SharedGalleries; - sharedGalleryImages: SharedGalleryImages; - sharedGalleryImageVersions: SharedGalleryImageVersions; - galleryApplications: GalleryApplications; - galleryApplicationVersions: GalleryApplicationVersions; - galleryImages: GalleryImages; - galleryImageVersions: GalleryImageVersions; - galleryInVMAccessControlProfiles: GalleryInVMAccessControlProfiles; - galleryInVMAccessControlProfileVersions: GalleryInVMAccessControlProfileVersions; - galleryScripts: GalleryScripts; - galleryScriptVersions: GalleryScriptVersions; - gallerySharingProfile: GallerySharingProfile; - softDeletedResource: SoftDeletedResource; - cloudServiceRoleInstances: CloudServiceRoleInstances; - cloudServiceRoles: CloudServiceRoles; - cloudServices: CloudServices; - cloudServicesUpdateDomain: CloudServicesUpdateDomain; - cloudServiceOperatingSystems: CloudServiceOperatingSystems; + /** The operation groups for gallerySharingProfile */ + public readonly gallerySharingProfile: GallerySharingProfileOperations; + /** The operation groups for softDeletedResource */ + public readonly softDeletedResource: SoftDeletedResourceOperations; + /** The operation groups for diskRestorePoint */ + public readonly diskRestorePoint: DiskRestorePointOperations; + /** The operation groups for logAnalytics */ + public readonly logAnalytics: LogAnalyticsOperations; + /** The operation groups for virtualMachineImages */ + public readonly virtualMachineImages: VirtualMachineImagesOperations; + /** The operation groups for virtualMachineImagesEdgeZone */ + public readonly virtualMachineImagesEdgeZone: VirtualMachineImagesEdgeZoneOperations; + /** The operation groups for virtualMachineSizes */ + public readonly virtualMachineSizes: VirtualMachineSizesOperations; + /** The operation groups for usage */ + public readonly usage: UsageOperations; + /** The operation groups for sshPublicKeys */ + public readonly sshPublicKeys: SshPublicKeysOperations; + /** The operation groups for virtualMachineScaleSetVMs */ + public readonly virtualMachineScaleSetVMs: VirtualMachineScaleSetVMsOperations; + /** The operation groups for virtualMachineScaleSetRollingUpgrades */ + public readonly virtualMachineScaleSetRollingUpgrades: VirtualMachineScaleSetRollingUpgradesOperations; + /** The operation groups for resourceSkus */ + public readonly resourceSkus: ResourceSkusOperations; + /** The operation groups for communityGalleryImageVersions */ + public readonly communityGalleryImageVersions: CommunityGalleryImageVersionsOperations; + /** The operation groups for communityGalleryImages */ + public readonly communityGalleryImages: CommunityGalleryImagesOperations; + /** The operation groups for communityGalleries */ + public readonly communityGalleries: CommunityGalleriesOperations; + /** The operation groups for sharedGalleryImageVersions */ + public readonly sharedGalleryImageVersions: SharedGalleryImageVersionsOperations; + /** The operation groups for sharedGalleryImages */ + public readonly sharedGalleryImages: SharedGalleryImagesOperations; + /** The operation groups for sharedGalleries */ + public readonly sharedGalleries: SharedGalleriesOperations; + /** The operation groups for galleryInVMAccessControlProfileVersions */ + public readonly galleryInVMAccessControlProfileVersions: GalleryInVMAccessControlProfileVersionsOperations; + /** The operation groups for galleryInVMAccessControlProfiles */ + public readonly galleryInVMAccessControlProfiles: GalleryInVMAccessControlProfilesOperations; + /** The operation groups for galleryScriptVersions */ + public readonly galleryScriptVersions: GalleryScriptVersionsOperations; + /** The operation groups for galleryScripts */ + public readonly galleryScripts: GalleryScriptsOperations; + /** The operation groups for galleryApplicationVersions */ + public readonly galleryApplicationVersions: GalleryApplicationVersionsOperations; + /** The operation groups for galleryApplications */ + public readonly galleryApplications: GalleryApplicationsOperations; + /** The operation groups for galleryImageVersions */ + public readonly galleryImageVersions: GalleryImageVersionsOperations; + /** The operation groups for galleryImages */ + public readonly galleryImages: GalleryImagesOperations; + /** The operation groups for galleries */ + public readonly galleries: GalleriesOperations; + /** The operation groups for snapshots */ + public readonly snapshots: SnapshotsOperations; + /** The operation groups for diskEncryptionSets */ + public readonly diskEncryptionSets: DiskEncryptionSetsOperations; + /** The operation groups for diskAccesses */ + public readonly diskAccesses: DiskAccessesOperations; + /** The operation groups for disks */ + public readonly disks: DisksOperations; + /** The operation groups for virtualMachineScaleSetVMRunCommands */ + public readonly virtualMachineScaleSetVMRunCommands: VirtualMachineScaleSetVMRunCommandsOperations; + /** The operation groups for virtualMachineRunCommands */ + public readonly virtualMachineRunCommands: VirtualMachineRunCommandsOperations; + /** The operation groups for capacityReservations */ + public readonly capacityReservations: CapacityReservationsOperations; + /** The operation groups for capacityReservationGroups */ + public readonly capacityReservationGroups: CapacityReservationGroupsOperations; + /** The operation groups for restorePoints */ + public readonly restorePoints: RestorePointsOperations; + /** The operation groups for restorePointCollections */ + public readonly restorePointCollections: RestorePointCollectionsOperations; + /** The operation groups for images */ + public readonly images: ImagesOperations; + /** The operation groups for dedicatedHosts */ + public readonly dedicatedHosts: DedicatedHostsOperations; + /** The operation groups for dedicatedHostGroups */ + public readonly dedicatedHostGroups: DedicatedHostGroupsOperations; + /** The operation groups for proximityPlacementGroups */ + public readonly proximityPlacementGroups: ProximityPlacementGroupsOperations; + /** The operation groups for availabilitySets */ + public readonly availabilitySets: AvailabilitySetsOperations; + /** The operation groups for virtualMachineExtensionImages */ + public readonly virtualMachineExtensionImages: VirtualMachineExtensionImagesOperations; + /** The operation groups for virtualMachineExtensions */ + public readonly virtualMachineExtensions: VirtualMachineExtensionsOperations; + /** The operation groups for virtualMachines */ + public readonly virtualMachines: VirtualMachinesOperations; + /** The operation groups for virtualMachineScaleSetVMExtensions */ + public readonly virtualMachineScaleSetVMExtensions: VirtualMachineScaleSetVMExtensionsOperations; + /** The operation groups for virtualMachineScaleSetLifeCycleHookEvents */ + public readonly virtualMachineScaleSetLifeCycleHookEvents: VirtualMachineScaleSetLifeCycleHookEventsOperations; + /** The operation groups for virtualMachineScaleSetExtensions */ + public readonly virtualMachineScaleSetExtensions: VirtualMachineScaleSetExtensionsOperations; + /** The operation groups for virtualMachineScaleSets */ + public readonly virtualMachineScaleSets: VirtualMachineScaleSetsOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; } diff --git a/sdk/compute/arm-compute/src/index.ts b/sdk/compute/arm-compute/src/index.ts index c42e217075de..99e7f1706e0e 100644 --- a/sdk/compute/arm-compute/src/index.ts +++ b/sdk/compute/arm-compute/src/index.ts @@ -1,11 +1,1246 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +import type { AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { AzureClouds } from "./static-helpers/cloudSettingHelpers.js"; +import type { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; -/// -export { getContinuationToken } from "./pagingHelper.js"; -export * from "./models/index.js"; export { ComputeManagementClient } from "./computeManagementClient.js"; -export * from "./operationsInterfaces/index.js"; +export type { SimplePollerLike } from "./static-helpers/simplePollerHelpers.js"; +export type { RestorePollerOptions } from "./restorePollerHelpers.js"; +export { restorePoller } from "./restorePollerHelpers.js"; +export type { + Operation, + OperationDisplay, + Origin, + ActionType, + TrackedResource, + Resource, + SystemData, + CreatedByType, + ErrorDetail, + ErrorAdditionalInfo, + ProxyResource, + ErrorResponse, +} from "./models/index.js"; +export { KnownOrigin, KnownActionType, KnownCreatedByType } from "./models/index.js"; +export type { + CloudError, + ApiError, + ApiErrorBase, + InnerError, + SubResource, + OperatingSystemTypes, + ResourceIdentityType, + UserAssignedIdentitiesValue, + ExtendedLocation, + ExtendedLocationTypes, + SubResourceReadOnly, + OperatingSystemStateTypes, + SnapshotAccessState, + HyperVGeneration, + Architecture, +} from "./models/common/index.js"; +export { + KnownExtendedLocationTypes, + KnownSnapshotAccessState, + KnownHyperVGeneration, + KnownArchitecture, +} from "./models/common/index.js"; +export type { + VirtualMachineScaleSet, + Sku, + Plan, + VirtualMachineScaleSetProperties, + UpgradePolicy, + UpgradeMode, + RollingUpgradePolicy, + AutomaticOSUpgradePolicy, + ScheduledEventsPolicy, + UserInitiatedRedeploy, + UserInitiatedReboot, + ScheduledEventsAdditionalPublishingTargets, + EventGridAndResourceGraph, + AllInstancesDown, + AutomaticRepairsPolicy, + RepairAction, + VirtualMachineScaleSetVMProfile, + VirtualMachineScaleSetOSProfile, + WindowsConfiguration, + AdditionalUnattendContent, + PassNames, + ComponentNames, + SettingNames, + PatchSettings, + WindowsVMGuestPatchMode, + WindowsPatchAssessmentMode, + WindowsVMGuestPatchAutomaticByPlatformSettings, + WindowsVMGuestPatchAutomaticByPlatformRebootSetting, + WinRMConfiguration, + WinRMListener, + ProtocolTypes, + LinuxConfiguration, + SshConfiguration, + SshPublicKey, + LinuxPatchSettings, + LinuxVMGuestPatchMode, + LinuxPatchAssessmentMode, + LinuxVMGuestPatchAutomaticByPlatformSettings, + LinuxVMGuestPatchAutomaticByPlatformRebootSetting, + VaultSecretGroup, + VaultCertificate, + VirtualMachineScaleSetStorageProfile, + ImageReference, + VirtualMachineScaleSetOSDisk, + CachingTypes, + DiskCreateOptionTypes, + DiffDiskSettings, + DiffDiskOptions, + DiffDiskPlacement, + StorageFaultDomainAlignmentType, + VirtualHardDisk, + VirtualMachineScaleSetManagedDiskParameters, + StorageAccountTypes, + DiskEncryptionSetParameters, + VMDiskSecurityProfile, + SecurityEncryptionTypes, + DiskDeleteOptionTypes, + VirtualMachineScaleSetDataDisk, + DiskControllerTypes, + VirtualMachineScaleSetNetworkProfile, + ApiEntityReference, + VirtualMachineScaleSetNetworkConfiguration, + VirtualMachineScaleSetNetworkConfigurationProperties, + VirtualMachineScaleSetNetworkConfigurationDnsSettings, + VirtualMachineScaleSetIPConfiguration, + VirtualMachineScaleSetIPConfigurationProperties, + VirtualMachineScaleSetPublicIPAddressConfiguration, + VirtualMachineScaleSetPublicIPAddressConfigurationProperties, + VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, + DomainNameLabelScopeTypes, + VirtualMachineScaleSetIpTag, + IPVersion, + DeleteOptions, + PublicIPAddressSku, + PublicIPAddressSkuName, + PublicIPAddressSkuTier, + NetworkInterfaceAuxiliaryMode, + NetworkInterfaceAuxiliarySku, + NetworkApiVersion, + SecurityProfile, + UefiSettings, + SecurityTypes, + EncryptionIdentity, + ProxyAgentSettings, + Mode, + HostEndpointSettings, + Modes, + DiagnosticsProfile, + BootDiagnostics, + VirtualMachineScaleSetExtensionProfile, + VirtualMachineScaleSetExtension, + VirtualMachineScaleSetExtensionProperties, + KeyVaultSecretReference, + VirtualMachinePriorityTypes, + VirtualMachineEvictionPolicyTypes, + BillingProfile, + ScheduledEventsProfile, + TerminateNotificationProfile, + OSImageNotificationProfile, + CapacityReservationProfile, + ApplicationProfile, + VMGalleryApplication, + VirtualMachineScaleSetHardwareProfile, + VMSizeProperties, + ServiceArtifactReference, + SecurityPostureReference, + AdditionalCapabilities, + ScaleInPolicy, + VirtualMachineScaleSetScaleInRules, + OrchestrationMode, + SpotRestorePolicy, + PriorityMixPolicy, + ResiliencyPolicy, + ResilientVMCreationPolicy, + ResilientVMDeletionPolicy, + AutomaticZoneRebalancingPolicy, + RebalanceStrategy, + RebalanceBehavior, + ZoneAllocationPolicy, + MaxInstancePercentPerZonePolicy, + OperationRecoverySettings, + RestartRecoveryPolicy, + StartRecoveryPolicy, + ReimageRecoveryPolicy, + ZonalPlatformFaultDomainAlignMode, + SkuProfile, + SkuProfileVMSize, + AllocationStrategy, + HighSpeedInterconnectPlacement, + LifecycleHooksProfile, + LifecycleHook, + VMScaleSetLifecycleHookEventType, + LifecycleHookAction, + ExternalHealthPolicy, + VirtualMachineScaleSetIdentity, + Placement, + ZonePlacementPolicyType, + VirtualMachineScaleSetUpdate, + VirtualMachineScaleSetUpdateProperties, + VirtualMachineScaleSetUpdateVMProfile, + VirtualMachineScaleSetUpdateOSProfile, + VirtualMachineScaleSetUpdateStorageProfile, + VirtualMachineScaleSetUpdateOSDisk, + VirtualMachineScaleSetUpdateNetworkProfile, + VirtualMachineScaleSetUpdateNetworkConfiguration, + VirtualMachineScaleSetUpdateNetworkConfigurationProperties, + VirtualMachineScaleSetUpdateIPConfiguration, + VirtualMachineScaleSetUpdateIPConfigurationProperties, + VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, + VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties, + SecurityPostureReferenceUpdate, + UpdateResource, + VirtualMachineScaleSetVMInstanceIDs, + VMScaleSetConvertToSinglePlacementGroupInput, + VirtualMachineScaleSetVMInstanceRequiredIDs, + RecoveryWalkResponse, + VirtualMachineScaleSetInstanceView, + VirtualMachineScaleSetInstanceViewStatusesSummary, + VirtualMachineStatusCodeCount, + VirtualMachineScaleSetVMExtensionsSummary, + InstanceViewStatus, + StatusLevelTypes, + OrchestrationServiceSummary, + OrchestrationServiceNames, + OrchestrationServiceState, + OrchestrationServiceOperationStatus, + UpgradeOperationHistoricalStatusInfo, + UpgradeOperationHistoricalStatusInfoProperties, + UpgradeOperationHistoryStatus, + UpgradeState, + RollingUpgradeProgressInfo, + UpgradeOperationInvoker, + RollbackStatusInfo, + VirtualMachineScaleSetReimageParameters, + VirtualMachineScaleSetVMReimageParameters, + VirtualMachineReimageParameters, + OSProfileProvisioningData, + OrchestrationServiceStateInput, + OrchestrationServiceStateAction, + VirtualMachineScaleSetSku, + VirtualMachineScaleSetSkuCapacity, + VirtualMachineScaleSetSkuScaleType, + VMScaleSetScaleOutInput, + VMScaleSetScaleOutInputProperties, + VirtualMachineScaleSetExtensionUpdate, + VMScaleSetLifecycleHookEvent, + VMScaleSetLifecycleHookEventProperties, + VMScaleSetLifecycleHookEventTargetResource, + LifecycleHookActionState, + VMScaleSetLifecycleHookEventAdditionalContext, + VMScaleSetLifecycleHookEventState, + VMScaleSetLifecycleHookEventUpdate, + VirtualMachineScaleSetVMExtension, + VirtualMachineExtensionProperties, + VirtualMachineExtensionInstanceView, + VirtualMachineScaleSetVMExtensionUpdate, + VirtualMachineExtensionUpdateProperties, + VirtualMachineScaleSetVMExtensionsListResult, + VirtualMachine, + VirtualMachineProperties, + HardwareProfile, + VirtualMachineSizeTypes, + StorageProfile, + OSDisk, + DiskEncryptionSettings, + KeyVaultKeyReference, + ManagedDiskParameters, + DataDisk, + DiskDetachOptionTypes, + OSProfile, + NetworkProfile, + NetworkInterfaceReference, + NetworkInterfaceReferenceProperties, + VirtualMachineNetworkInterfaceConfiguration, + VirtualMachineNetworkInterfaceConfigurationProperties, + VirtualMachineNetworkInterfaceDnsSettingsConfiguration, + VirtualMachineNetworkInterfaceIPConfiguration, + VirtualMachineNetworkInterfaceIPConfigurationProperties, + VirtualMachinePublicIPAddressConfiguration, + VirtualMachinePublicIPAddressConfigurationProperties, + VirtualMachinePublicIPAddressDnsSettingsConfiguration, + VirtualMachineIpTag, + IPVersions, + PublicIPAllocationMethod, + VirtualMachineInstanceView, + HyperVGenerationType, + VirtualMachineAgentInstanceView, + VirtualMachineExtensionHandlerInstanceView, + MaintenanceRedeployStatus, + MaintenanceOperationResultCodeTypes, + DiskInstanceView, + StorageAlignmentStatus, + VirtualMachineHealthStatus, + BootDiagnosticsInstanceView, + VirtualMachinePatchStatus, + AvailablePatchSummary, + PatchOperationStatus, + LastPatchInstallationSummary, + ResiliencyProfile, + ZoneMovement, + VirtualMachineExtension, + VirtualMachineIdentity, + VirtualMachineUpdate, + VirtualMachineAssessPatchesResult, + VirtualMachineSoftwarePatchProperties, + VMGuestPatchRebootBehavior, + PatchAssessmentState, + AttachDetachDataDisksRequest, + DataDisksToAttach, + DataDisksToDetach, + VirtualMachineCaptureParameters, + VirtualMachineCaptureResult, + VirtualMachineInstallPatchesParameters, + VMGuestPatchRebootSetting, + WindowsParameters, + VMGuestPatchClassificationWindows, + LinuxParameters, + VMGuestPatchClassificationLinux, + VirtualMachineInstallPatchesResult, + VMGuestPatchRebootStatus, + PatchInstallationDetail, + PatchInstallationState, + RetrieveBootDiagnosticsDataResult, + VirtualMachineSize, + RunCommandInput, + RunCommandInputParameter, + RunCommandResult, + MigrateVMToVirtualMachineScaleSetInput, + VirtualMachineExtensionUpdate, + VirtualMachineExtensionsListResult, + VirtualMachineExtensionImage, + VirtualMachineExtensionImageProperties, + AvailabilitySet, + AvailabilitySetProperties, + VirtualMachineScaleSetMigrationInfo, + DefaultVirtualMachineScaleSetInfo, + AvailabilitySetUpdate, + MigrateToVirtualMachineScaleSetInput, + ConvertToVirtualMachineScaleSetInput, + ProximityPlacementGroup, + ProximityPlacementGroupProperties, + ProximityPlacementGroupType, + SubResourceWithColocationStatus, + ProximityPlacementGroupPropertiesIntent, + ProximityPlacementGroupUpdate, + DedicatedHostGroup, + DedicatedHostGroupProperties, + DedicatedHostGroupInstanceView, + DedicatedHostInstanceViewWithName, + DedicatedHostGroupPropertiesAdditionalCapabilities, + DedicatedHostInstanceView, + DedicatedHostAvailableCapacity, + DedicatedHostAllocatableVM, + DedicatedHostGroupUpdate, + DedicatedHost, + DedicatedHostProperties, + DedicatedHostLicenseTypes, + DedicatedHostUpdate, + Image, + ImageProperties, + ImageStorageProfile, + ImageOSDisk, + ImageDataDisk, + HyperVGenerationTypes, + ImageDisk, + ImageUpdate, + RestorePointCollection, + RestorePointCollectionProperties, + RestorePointCollectionSourceProperties, + RestorePoint, + RestorePointProperties, + RestorePointSourceMetadata, + RestorePointSourceVMStorageProfile, + RestorePointSourceVmosDisk, + OperatingSystemType, + DiskRestorePointAttributes, + RestorePointEncryption, + RestorePointEncryptionType, + RestorePointSourceVMDataDisk, + ConsistencyModeTypes, + RestorePointInstanceView, + DiskRestorePointInstanceView, + DiskRestorePointReplicationStatus, + RestorePointCollectionUpdate, + CapacityReservationGroup, + CapacityReservationGroupProperties, + CapacityReservationGroupInstanceView, + CapacityReservationInstanceViewWithName, + ResourceSharingProfile, + ReservationType, + CapacityReservationInstanceView, + CapacityReservationUtilization, + CapacityReservationGroupUpdate, + CapacityReservation, + CapacityReservationProperties, + ScheduleProfile, + CapacityReservationUpdate, + VirtualMachineRunCommand, + VirtualMachineRunCommandProperties, + VirtualMachineRunCommandScriptSource, + RunCommandManagedIdentity, + ScriptShellTypes, + VirtualMachineRunCommandInstanceView, + ExecutionState, + VirtualMachineRunCommandUpdate, + RunCommandDocumentBase, + RunCommandDocument, + RunCommandParameterDefinition, + RollingUpgradeStatusInfo, + RollingUpgradeStatusInfoProperties, + RollingUpgradeRunningStatus, + RollingUpgradeStatusCode, + RollingUpgradeActionType, + VirtualMachineScaleSetVM, + VirtualMachineScaleSetVMProperties, + VirtualMachineScaleSetVMInstanceView, + ResilientVMDeletionStatus, + VirtualMachineScaleSetVMNetworkProfileConfiguration, + VirtualMachineScaleSetVMProtectionPolicy, + SshPublicKeyResource, + SshPublicKeyResourceProperties, + SshPublicKeyUpdateResource, + SshGenerateKeyPairInputParameters, + SshEncryptionTypes, + SshPublicKeyGenerateKeyPairResult, + Usage, + UsageName, + VirtualMachineImageResource, + VirtualMachineImage, + VirtualMachineImageProperties, + PurchasePlan, + OSDiskImage, + DataDiskImage, + AutomaticOSUpgradeProperties, + DisallowedConfiguration, + VmDiskTypes, + VirtualMachineImageFeature, + ArchitectureTypes, + ImageDeprecationStatus, + ImageState, + AlternativeOption, + AlternativeType, + VmImagesInEdgeZoneListResult, + RequestRateByIntervalInput, + IntervalInMins, + LogAnalyticsInputBase, + LogAnalyticsOperationResult, + LogAnalyticsOutput, + ThrottledRequestsInput, + ExpandTypesForGetVMScaleSets, + InstanceViewTypes, + ExpandTypeForListVMs, + ExpandTypesForListVMs, + RestorePointCollectionExpandOptions, + RestorePointExpandOptions, + CapacityReservationGroupInstanceViewTypes, + ExpandTypesForGetCapacityReservationGroups, + ResourceIdOptionsForGetCapacityReservationGroups, + CapacityReservationInstanceViewTypes, +} from "./models/compute/index.js"; +export { + KnownRepairAction, + KnownWindowsVMGuestPatchMode, + KnownWindowsPatchAssessmentMode, + KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting, + KnownLinuxVMGuestPatchMode, + KnownLinuxPatchAssessmentMode, + KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting, + KnownDiskCreateOptionTypes, + KnownDiffDiskOptions, + KnownDiffDiskPlacement, + KnownStorageFaultDomainAlignmentType, + KnownStorageAccountTypes, + KnownSecurityEncryptionTypes, + KnownDiskDeleteOptionTypes, + KnownDiskControllerTypes, + KnownDomainNameLabelScopeTypes, + KnownIPVersion, + KnownDeleteOptions, + KnownPublicIPAddressSkuName, + KnownPublicIPAddressSkuTier, + KnownNetworkInterfaceAuxiliaryMode, + KnownNetworkInterfaceAuxiliarySku, + KnownNetworkApiVersion, + KnownSecurityTypes, + KnownMode, + KnownModes, + KnownVirtualMachinePriorityTypes, + KnownVirtualMachineEvictionPolicyTypes, + KnownVirtualMachineScaleSetScaleInRules, + KnownOrchestrationMode, + KnownRebalanceStrategy, + KnownRebalanceBehavior, + KnownZonalPlatformFaultDomainAlignMode, + KnownAllocationStrategy, + KnownHighSpeedInterconnectPlacement, + KnownVMScaleSetLifecycleHookEventType, + KnownLifecycleHookAction, + KnownZonePlacementPolicyType, + KnownOrchestrationServiceNames, + KnownOrchestrationServiceState, + KnownOrchestrationServiceOperationStatus, + KnownOrchestrationServiceStateAction, + KnownLifecycleHookActionState, + KnownVMScaleSetLifecycleHookEventState, + KnownVirtualMachineSizeTypes, + KnownDiskDetachOptionTypes, + KnownIPVersions, + KnownPublicIPAllocationMethod, + KnownHyperVGenerationType, + KnownStorageAlignmentStatus, + KnownPatchOperationStatus, + KnownVMGuestPatchRebootBehavior, + KnownPatchAssessmentState, + KnownVMGuestPatchRebootSetting, + KnownVMGuestPatchClassificationWindows, + KnownVMGuestPatchClassificationLinux, + KnownVMGuestPatchRebootStatus, + KnownPatchInstallationState, + KnownProximityPlacementGroupType, + KnownHyperVGenerationTypes, + KnownOperatingSystemType, + KnownRestorePointEncryptionType, + KnownConsistencyModeTypes, + KnownReservationType, + KnownScriptShellTypes, + KnownExecutionState, + KnownResilientVMDeletionStatus, + KnownSshEncryptionTypes, + KnownVmDiskTypes, + KnownArchitectureTypes, + KnownImageState, + KnownAlternativeType, + KnownExpandTypesForGetVMScaleSets, + KnownExpandTypeForListVMs, + KnownExpandTypesForListVMs, + KnownRestorePointCollectionExpandOptions, + KnownRestorePointExpandOptions, + KnownCapacityReservationGroupInstanceViewTypes, + KnownExpandTypesForGetCapacityReservationGroups, + KnownResourceIdOptionsForGetCapacityReservationGroups, + KnownCapacityReservationInstanceViewTypes, +} from "./models/compute/index.js"; +export type { + Disk, + DiskProperties, + DiskPurchasePlan, + SupportedCapabilities, + SupportedSecurityOption, + CreationData, + DiskCreateOption, + ImageDiskReference, + ProvisionedBandwidthCopyOption, + EncryptionSettingsCollection, + EncryptionSettingsElement, + KeyVaultAndSecretReference, + SourceVault, + KeyVaultAndKeyReference, + DiskState, + Encryption, + EncryptionType, + ShareInfoElement, + NetworkAccessPolicy, + PropertyUpdatesInProgress, + DiskSecurityProfile, + DiskSecurityTypes, + PublicNetworkAccess, + DataAccessAuthMode, + AvailabilityPolicy, + AvailabilityPolicyDiskDelay, + DiskSku, + DiskStorageAccountTypes, + DiskUpdate, + DiskUpdateProperties, + GrantAccessData, + AccessLevel, + FileFormat, + AccessUri, + DiskAccess, + DiskAccessProperties, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, + DiskAccessUpdate, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + DiskEncryptionSet, + EncryptionSetProperties, + DiskEncryptionSetType, + KeyForDiskEncryptionSet, + EncryptionSetIdentity, + DiskEncryptionSetIdentityType, + DiskEncryptionSetUpdate, + DiskEncryptionSetUpdateProperties, + Snapshot, + SnapshotProperties, + CopyCompletionError, + CopyCompletionErrorReason, + SnapshotSku, + SnapshotStorageAccountTypes, + SnapshotUpdate, + SnapshotUpdateProperties, + DiskRestorePoint, + DiskRestorePointProperties, +} from "./models/computeDisk/index.js"; +export { + KnownSupportedSecurityOption, + KnownDiskCreateOption, + KnownProvisionedBandwidthCopyOption, + KnownDiskState, + KnownEncryptionType, + KnownNetworkAccessPolicy, + KnownDiskSecurityTypes, + KnownPublicNetworkAccess, + KnownDataAccessAuthMode, + KnownAvailabilityPolicyDiskDelay, + KnownDiskStorageAccountTypes, + KnownAccessLevel, + KnownFileFormat, + KnownPrivateEndpointServiceConnectionStatus, + KnownPrivateEndpointConnectionProvisioningState, + KnownDiskEncryptionSetType, + KnownDiskEncryptionSetIdentityType, + KnownCopyCompletionErrorReason, + KnownSnapshotStorageAccountTypes, +} from "./models/computeDisk/index.js"; +export type { + Gallery, + GalleryProperties, + GalleryIdentifier, + GalleryProvisioningState, + SharingProfile, + GallerySharingPermissionTypes, + SharingProfileGroup, + SharingProfileGroupTypes, + CommunityGalleryInfo, + SoftDeletePolicy, + SharingStatus, + SharingState, + RegionalSharingStatus, + GalleryIdentity, + GalleryUpdate, + UpdateResourceDefinition, + ImageVersionSecurityProfile, + GalleryImageVersionUefiSettings, + UefiSignatureTemplateName, + UefiKeySignatures, + UefiKey, + UefiKeyType, + GalleryImage, + GalleryImageProperties, + GalleryImageIdentifier, + RecommendedMachineConfiguration, + ResourceRange, + Disallowed, + ImagePurchasePlan, + GalleryImageFeature, + GalleryImageUpdate, + GalleryImageVersion, + GalleryImageVersionProperties, + GalleryImageVersionPublishingProfile, + GalleryImageVersionStorageProfile, + GalleryArtifactVersionFullSource, + GalleryOSDiskImage, + GalleryDataDiskImage, + GalleryImageVersionSafetyProfile, + PolicyViolation, + PolicyViolationCategory, + ReplicationStatus, + AggregatedReplicationState, + RegionalReplicationStatus, + ReplicationState, + ValidationsProfile, + ExecutedValidation, + ValidationStatus, + PlatformAttribute, + GalleryArtifactPublishingProfileBase, + TargetRegion, + StorageAccountType, + EncryptionImages, + OSDiskImageEncryption, + OSDiskImageSecurityProfile, + ConfidentialVMEncryptionType, + DataDiskImageEncryption, + AdditionalReplicaSet, + ReplicationMode, + GalleryTargetExtendedLocation, + GalleryExtendedLocation, + GalleryExtendedLocationType, + EdgeZoneStorageAccountType, + StorageAccountStrategy, + DiskImageEncryption, + GalleryArtifactVersionSource, + GalleryDiskImage, + HostCaching, + GalleryDiskImageSource, + GalleryArtifactSafetyProfileBase, + GalleryImageVersionUpdate, + GalleryApplication, + GalleryApplicationProperties, + GalleryApplicationCustomAction, + GalleryApplicationCustomActionParameter, + GalleryApplicationCustomActionParameterType, + GalleryApplicationUpdate, + GalleryApplicationVersion, + GalleryApplicationVersionProperties, + GalleryApplicationVersionPublishingProfile, + UserArtifactSource, + UserArtifactManage, + UserArtifactSettings, + GalleryApplicationScriptRebootBehavior, + GalleryApplicationVersionSafetyProfile, + GalleryApplicationVersionUpdate, + GalleryScript, + GalleryScriptProperties, + GalleryScriptUpdate, + GalleryScriptVersion, + GalleryScriptVersionProperties, + GalleryScriptVersionPublishingProfile, + ScriptSource, + GalleryScriptParameter, + GalleryScriptParameterType, + GalleryScriptVersionSafetyProfile, + GenericGalleryParameter, + GalleryScriptVersionUpdate, + GalleryInVMAccessControlProfile, + GalleryInVMAccessControlProfileProperties, + EndpointTypes, + GalleryResourceProfilePropertiesBase, + GalleryInVMAccessControlProfileUpdate, + GalleryInVMAccessControlProfileVersion, + GalleryInVMAccessControlProfileVersionProperties, + AccessControlRulesMode, + EndpointAccess, + AccessControlRules, + AccessControlRulesPrivilege, + AccessControlRulesRole, + AccessControlRulesIdentity, + AccessControlRulesRoleAssignment, + GalleryResourceProfileVersionPropertiesBase, + GalleryInVMAccessControlProfileVersionUpdate, + SharedGallery, + SharedGalleryProperties, + PirSharedGalleryResource, + SharedGalleryIdentifier, + PirResource, + SharedGalleryImage, + SharedGalleryImageProperties, + SharedGalleryImageVersion, + SharedGalleryImageVersionProperties, + SharedGalleryImageVersionStorageProfile, + SharedGalleryOSDiskImage, + SharedGalleryDataDiskImage, + SharedGalleryDiskImage, + SharedGalleryHostCaching, + CommunityGallery, + CommunityGalleryProperties, + CommunityGalleryMetadata, + PirCommunityGalleryResource, + CommunityGalleryIdentifier, + CommunityGalleryImage, + CommunityGalleryImageProperties, + CommunityGalleryImageIdentifier, + CommunityGalleryImageVersion, + CommunityGalleryImageVersionProperties, + GallerySoftDeletedResource, + GallerySoftDeletedResourceProperties, + SoftDeletedArtifactTypes, + SharingUpdate, + SharingUpdateOperationTypes, + SelectPermissions, + GalleryExpandParams, + ReplicationStatusTypes, + SharedToValues, +} from "./models/computeGallery/index.js"; +export { + KnownGalleryProvisioningState, + KnownGallerySharingPermissionTypes, + KnownSharingProfileGroupTypes, + KnownSharingState, + KnownUefiSignatureTemplateName, + KnownUefiKeyType, + KnownPolicyViolationCategory, + KnownAggregatedReplicationState, + KnownReplicationState, + KnownValidationStatus, + KnownStorageAccountType, + KnownConfidentialVMEncryptionType, + KnownReplicationMode, + KnownGalleryExtendedLocationType, + KnownEdgeZoneStorageAccountType, + KnownStorageAccountStrategy, + KnownGalleryApplicationScriptRebootBehavior, + KnownGalleryScriptParameterType, + KnownAccessControlRulesMode, + KnownEndpointAccess, + KnownSharedGalleryHostCaching, + KnownSoftDeletedArtifactTypes, + KnownSharingUpdateOperationTypes, + KnownSelectPermissions, + KnownGalleryExpandParams, + KnownReplicationStatusTypes, + KnownSharedToValues, +} from "./models/computeGallery/index.js"; +export type { + ResourceSku, + ResourceSkuCapacity, + ResourceSkuCapacityScaleType, + ResourceSkuLocationInfo, + ResourceSkuZoneDetails, + ResourceSkuCapabilities, + ExtendedLocationType, + ResourceSkuCosts, + ResourceSkuRestrictions, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionInfo, + ResourceSkuRestrictionsReasonCode, +} from "./models/computeSku/index.js"; +export { KnownExtendedLocationType } from "./models/computeSku/index.js"; +export type { ComputeManagementClientOptionalParams } from "./api/index.js"; +export type { + AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, + AvailabilitySetsListAvailableSizesOptionalParams, + AvailabilitySetsListBySubscriptionOptionalParams, + AvailabilitySetsListOptionalParams, + AvailabilitySetsDeleteOptionalParams, + AvailabilitySetsUpdateOptionalParams, + AvailabilitySetsCreateOrUpdateOptionalParams, + AvailabilitySetsGetOptionalParams, +} from "./api/availabilitySets/index.js"; +export type { + CapacityReservationGroupsListBySubscriptionOptionalParams, + CapacityReservationGroupsListByResourceGroupOptionalParams, + CapacityReservationGroupsDeleteOptionalParams, + CapacityReservationGroupsUpdateOptionalParams, + CapacityReservationGroupsCreateOrUpdateOptionalParams, + CapacityReservationGroupsGetOptionalParams, +} from "./api/capacityReservationGroups/index.js"; +export type { + CapacityReservationsListByCapacityReservationGroupOptionalParams, + CapacityReservationsDeleteOptionalParams, + CapacityReservationsUpdateOptionalParams, + CapacityReservationsCreateOrUpdateOptionalParams, + CapacityReservationsGetOptionalParams, +} from "./api/capacityReservations/index.js"; +export type { CommunityGalleriesGetOptionalParams } from "./api/communityGalleries/index.js"; +export type { + CommunityGalleryImagesListOptionalParams, + CommunityGalleryImagesGetOptionalParams, +} from "./api/communityGalleryImages/index.js"; +export type { + CommunityGalleryImageVersionsListOptionalParams, + CommunityGalleryImageVersionsGetOptionalParams, +} from "./api/communityGalleryImageVersions/index.js"; +export type { + DedicatedHostGroupsListBySubscriptionOptionalParams, + DedicatedHostGroupsListByResourceGroupOptionalParams, + DedicatedHostGroupsDeleteOptionalParams, + DedicatedHostGroupsUpdateOptionalParams, + DedicatedHostGroupsCreateOrUpdateOptionalParams, + DedicatedHostGroupsGetOptionalParams, +} from "./api/dedicatedHostGroups/index.js"; +export type { + DedicatedHostsRestartOptionalParams, + DedicatedHostsRedeployOptionalParams, + DedicatedHostsListAvailableSizesOptionalParams, + DedicatedHostsListByHostGroupOptionalParams, + DedicatedHostsDeleteOptionalParams, + DedicatedHostsUpdateOptionalParams, + DedicatedHostsCreateOrUpdateOptionalParams, + DedicatedHostsGetOptionalParams, +} from "./api/dedicatedHosts/index.js"; +export type { + DiskAccessesListPrivateEndpointConnectionsOptionalParams, + DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetPrivateLinkResourcesOptionalParams, + DiskAccessesListOptionalParams, + DiskAccessesListByResourceGroupOptionalParams, + DiskAccessesDeleteOptionalParams, + DiskAccessesUpdateOptionalParams, + DiskAccessesCreateOrUpdateOptionalParams, + DiskAccessesGetOptionalParams, +} from "./api/diskAccesses/index.js"; +export type { + DiskEncryptionSetsListAssociatedResourcesOptionalParams, + DiskEncryptionSetsListOptionalParams, + DiskEncryptionSetsListByResourceGroupOptionalParams, + DiskEncryptionSetsDeleteOptionalParams, + DiskEncryptionSetsUpdateOptionalParams, + DiskEncryptionSetsCreateOrUpdateOptionalParams, + DiskEncryptionSetsGetOptionalParams, +} from "./api/diskEncryptionSets/index.js"; +export type { + DiskRestorePointRevokeAccessOptionalParams, + DiskRestorePointGrantAccessOptionalParams, + DiskRestorePointListByRestorePointOptionalParams, + DiskRestorePointGetOptionalParams, +} from "./api/diskRestorePoint/index.js"; +export type { + DisksRevokeAccessOptionalParams, + DisksGrantAccessOptionalParams, + DisksListOptionalParams, + DisksListByResourceGroupOptionalParams, + DisksDeleteOptionalParams, + DisksUpdateOptionalParams, + DisksCreateOrUpdateOptionalParams, + DisksGetOptionalParams, +} from "./api/disks/index.js"; +export type { + GalleriesListOptionalParams, + GalleriesListByResourceGroupOptionalParams, + GalleriesDeleteOptionalParams, + GalleriesUpdateOptionalParams, + GalleriesCreateOrUpdateOptionalParams, + GalleriesGetOptionalParams, +} from "./api/galleries/index.js"; +export type { + GalleryApplicationsListByGalleryOptionalParams, + GalleryApplicationsDeleteOptionalParams, + GalleryApplicationsUpdateOptionalParams, + GalleryApplicationsCreateOrUpdateOptionalParams, + GalleryApplicationsGetOptionalParams, +} from "./api/galleryApplications/index.js"; +export type { + GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + GalleryApplicationVersionsDeleteOptionalParams, + GalleryApplicationVersionsUpdateOptionalParams, + GalleryApplicationVersionsCreateOrUpdateOptionalParams, + GalleryApplicationVersionsGetOptionalParams, +} from "./api/galleryApplicationVersions/index.js"; +export type { + GalleryImagesListByGalleryOptionalParams, + GalleryImagesDeleteOptionalParams, + GalleryImagesUpdateOptionalParams, + GalleryImagesCreateOrUpdateOptionalParams, + GalleryImagesGetOptionalParams, +} from "./api/galleryImages/index.js"; +export type { + GalleryImageVersionsListByGalleryImageOptionalParams, + GalleryImageVersionsDeleteOptionalParams, + GalleryImageVersionsUpdateOptionalParams, + GalleryImageVersionsCreateOrUpdateOptionalParams, + GalleryImageVersionsGetOptionalParams, +} from "./api/galleryImageVersions/index.js"; +export type { + GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + GalleryInVMAccessControlProfilesDeleteOptionalParams, + GalleryInVMAccessControlProfilesUpdateOptionalParams, + GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfilesGetOptionalParams, +} from "./api/galleryInVMAccessControlProfiles/index.js"; +export type { + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsGetOptionalParams, +} from "./api/galleryInVMAccessControlProfileVersions/index.js"; +export type { + GalleryScriptsListByGalleryOptionalParams, + GalleryScriptsDeleteOptionalParams, + GalleryScriptsUpdateOptionalParams, + GalleryScriptsCreateOrUpdateOptionalParams, + GalleryScriptsGetOptionalParams, +} from "./api/galleryScripts/index.js"; +export type { + GalleryScriptVersionsListByGalleryScriptOptionalParams, + GalleryScriptVersionsDeleteOptionalParams, + GalleryScriptVersionsUpdateOptionalParams, + GalleryScriptVersionsCreateOrUpdateOptionalParams, + GalleryScriptVersionsGetOptionalParams, +} from "./api/galleryScriptVersions/index.js"; +export type { GallerySharingProfileUpdateOptionalParams } from "./api/gallerySharingProfile/index.js"; +export type { + ImagesListOptionalParams, + ImagesListByResourceGroupOptionalParams, + ImagesDeleteOptionalParams, + ImagesUpdateOptionalParams, + ImagesCreateOrUpdateOptionalParams, + ImagesGetOptionalParams, +} from "./api/images/index.js"; +export type { + LogAnalyticsExportThrottledRequestsOptionalParams, + LogAnalyticsExportRequestRateByIntervalOptionalParams, +} from "./api/logAnalytics/index.js"; +export type { OperationsListOptionalParams } from "./api/operations/index.js"; +export type { + ProximityPlacementGroupsListBySubscriptionOptionalParams, + ProximityPlacementGroupsListByResourceGroupOptionalParams, + ProximityPlacementGroupsDeleteOptionalParams, + ProximityPlacementGroupsUpdateOptionalParams, + ProximityPlacementGroupsCreateOrUpdateOptionalParams, + ProximityPlacementGroupsGetOptionalParams, +} from "./api/proximityPlacementGroups/index.js"; +export type { ResourceSkusListOptionalParams } from "./api/resourceSkus/index.js"; +export type { + RestorePointCollectionsListAllOptionalParams, + RestorePointCollectionsListOptionalParams, + RestorePointCollectionsDeleteOptionalParams, + RestorePointCollectionsUpdateOptionalParams, + RestorePointCollectionsCreateOrUpdateOptionalParams, + RestorePointCollectionsGetOptionalParams, +} from "./api/restorePointCollections/index.js"; +export type { + RestorePointsDeleteOptionalParams, + RestorePointsCreateOptionalParams, + RestorePointsGetOptionalParams, +} from "./api/restorePoints/index.js"; +export type { + SharedGalleriesListOptionalParams, + SharedGalleriesGetOptionalParams, +} from "./api/sharedGalleries/index.js"; +export type { + SharedGalleryImagesListOptionalParams, + SharedGalleryImagesGetOptionalParams, +} from "./api/sharedGalleryImages/index.js"; +export type { + SharedGalleryImageVersionsListOptionalParams, + SharedGalleryImageVersionsGetOptionalParams, +} from "./api/sharedGalleryImageVersions/index.js"; +export type { + SnapshotsRevokeAccessOptionalParams, + SnapshotsGrantAccessOptionalParams, + SnapshotsListOptionalParams, + SnapshotsListByResourceGroupOptionalParams, + SnapshotsDeleteOptionalParams, + SnapshotsUpdateOptionalParams, + SnapshotsCreateOrUpdateOptionalParams, + SnapshotsGetOptionalParams, +} from "./api/snapshots/index.js"; +export type { SoftDeletedResourceListByArtifactNameOptionalParams } from "./api/softDeletedResource/index.js"; +export type { + SshPublicKeysGenerateKeyPairOptionalParams, + SshPublicKeysListBySubscriptionOptionalParams, + SshPublicKeysListByResourceGroupOptionalParams, + SshPublicKeysDeleteOptionalParams, + SshPublicKeysUpdateOptionalParams, + SshPublicKeysCreateOptionalParams, + SshPublicKeysGetOptionalParams, +} from "./api/sshPublicKeys/index.js"; +export type { UsageListOptionalParams } from "./api/usage/index.js"; +export type { + VirtualMachineExtensionImagesListVersionsOptionalParams, + VirtualMachineExtensionImagesListTypesOptionalParams, + VirtualMachineExtensionImagesGetOptionalParams, +} from "./api/virtualMachineExtensionImages/index.js"; +export type { + VirtualMachineExtensionsListOptionalParams, + VirtualMachineExtensionsDeleteOptionalParams, + VirtualMachineExtensionsUpdateOptionalParams, + VirtualMachineExtensionsCreateOrUpdateOptionalParams, + VirtualMachineExtensionsGetOptionalParams, +} from "./api/virtualMachineExtensions/index.js"; +export type { + VirtualMachineImagesGetOptionalParams, + VirtualMachineImagesListWithPropertiesOptionalParams, + VirtualMachineImagesListOptionalParams, + VirtualMachineImagesListSkusOptionalParams, + VirtualMachineImagesListOffersOptionalParams, + VirtualMachineImagesListPublishersOptionalParams, + VirtualMachineImagesListByEdgeZoneOptionalParams, +} from "./api/virtualMachineImages/index.js"; +export type { + VirtualMachineImagesEdgeZoneGetOptionalParams, + VirtualMachineImagesEdgeZoneListOptionalParams, + VirtualMachineImagesEdgeZoneListSkusOptionalParams, + VirtualMachineImagesEdgeZoneListOffersOptionalParams, + VirtualMachineImagesEdgeZoneListPublishersOptionalParams, +} from "./api/virtualMachineImagesEdgeZone/index.js"; +export type { + VirtualMachineRunCommandsGetOptionalParams, + VirtualMachineRunCommandsListOptionalParams, + VirtualMachineRunCommandsListByVirtualMachineOptionalParams, + VirtualMachineRunCommandsDeleteOptionalParams, + VirtualMachineRunCommandsUpdateOptionalParams, + VirtualMachineRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, +} from "./api/virtualMachineRunCommands/index.js"; +export type { + VirtualMachinesListByLocationOptionalParams, + VirtualMachinesMigrateToVMScaleSetOptionalParams, + VirtualMachinesRunCommandOptionalParams, + VirtualMachinesListAvailableSizesOptionalParams, + VirtualMachinesStartOptionalParams, + VirtualMachinesSimulateEvictionOptionalParams, + VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachinesRestartOptionalParams, + VirtualMachinesReimageOptionalParams, + VirtualMachinesRedeployOptionalParams, + VirtualMachinesReapplyOptionalParams, + VirtualMachinesPowerOffOptionalParams, + VirtualMachinesPerformMaintenanceOptionalParams, + VirtualMachinesInstanceViewOptionalParams, + VirtualMachinesInstallPatchesOptionalParams, + VirtualMachinesGeneralizeOptionalParams, + VirtualMachinesDeallocateOptionalParams, + VirtualMachinesConvertToManagedDisksOptionalParams, + VirtualMachinesCaptureOptionalParams, + VirtualMachinesAttachDetachDataDisksOptionalParams, + VirtualMachinesAssessPatchesOptionalParams, + VirtualMachinesListAllOptionalParams, + VirtualMachinesListOptionalParams, + VirtualMachinesDeleteOptionalParams, + VirtualMachinesUpdateOptionalParams, + VirtualMachinesCreateOrUpdateOptionalParams, + VirtualMachinesGetOptionalParams, +} from "./api/virtualMachines/index.js"; +export type { + VirtualMachineScaleSetExtensionsListOptionalParams, + VirtualMachineScaleSetExtensionsDeleteOptionalParams, + VirtualMachineScaleSetExtensionsUpdateOptionalParams, + VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetExtensionsGetOptionalParams, +} from "./api/virtualMachineScaleSetExtensions/index.js"; +export type { + VirtualMachineScaleSetLifeCycleHookEventsListOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsUpdateOptionalParams, + VirtualMachineScaleSetLifeCycleHookEventsGetOptionalParams, +} from "./api/virtualMachineScaleSetLifeCycleHookEvents/index.js"; +export type { + VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, + VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, + VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, +} from "./api/virtualMachineScaleSetRollingUpgrades/index.js"; +export type { + VirtualMachineScaleSetsListByLocationOptionalParams, + VirtualMachineScaleSetsScaleOutOptionalParams, + VirtualMachineScaleSetsStartOptionalParams, + VirtualMachineScaleSetsListSkusOptionalParams, + VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, + VirtualMachineScaleSetsRestartOptionalParams, + VirtualMachineScaleSetsReimageAllOptionalParams, + VirtualMachineScaleSetsReimageOptionalParams, + VirtualMachineScaleSetsRedeployOptionalParams, + VirtualMachineScaleSetsReapplyOptionalParams, + VirtualMachineScaleSetsPowerOffOptionalParams, + VirtualMachineScaleSetsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, + VirtualMachineScaleSetsUpdateInstancesOptionalParams, + VirtualMachineScaleSetsGetInstanceViewOptionalParams, + VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, + VirtualMachineScaleSetsDeleteInstancesOptionalParams, + VirtualMachineScaleSetsDeallocateOptionalParams, + VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, + VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetsListAllOptionalParams, + VirtualMachineScaleSetsListOptionalParams, + VirtualMachineScaleSetsDeleteOptionalParams, + VirtualMachineScaleSetsUpdateOptionalParams, + VirtualMachineScaleSetsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetsGetOptionalParams, +} from "./api/virtualMachineScaleSets/index.js"; +export type { + VirtualMachineScaleSetVMExtensionsListOptionalParams, + VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, + VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMExtensionsGetOptionalParams, +} from "./api/virtualMachineScaleSetVMExtensions/index.js"; +export type { + VirtualMachineScaleSetVMRunCommandsListOptionalParams, + VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, + VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, + VirtualMachineScaleSetVMRunCommandsGetOptionalParams, +} from "./api/virtualMachineScaleSetVMRunCommands/index.js"; +export type { + VirtualMachineScaleSetVMsRunCommandOptionalParams, + VirtualMachineScaleSetVMsStartOptionalParams, + VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + VirtualMachineScaleSetVMsRestartOptionalParams, + VirtualMachineScaleSetVMsRedeployOptionalParams, + VirtualMachineScaleSetVMsPowerOffOptionalParams, + VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, + VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, + VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, + VirtualMachineScaleSetVMsReimageAllOptionalParams, + VirtualMachineScaleSetVMsReimageOptionalParams, + VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, + VirtualMachineScaleSetVMsDeallocateOptionalParams, + VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, + VirtualMachineScaleSetVMsListOptionalParams, + VirtualMachineScaleSetVMsDeleteOptionalParams, + VirtualMachineScaleSetVMsUpdateOptionalParams, + VirtualMachineScaleSetVMsGetOptionalParams, +} from "./api/virtualMachineScaleSetVMs/index.js"; +export type { VirtualMachineSizesListOptionalParams } from "./api/virtualMachineSizes/index.js"; +export type { + AvailabilitySetsOperations, + CapacityReservationGroupsOperations, + CapacityReservationsOperations, + CommunityGalleriesOperations, + CommunityGalleryImagesOperations, + CommunityGalleryImageVersionsOperations, + DedicatedHostGroupsOperations, + DedicatedHostsOperations, + DiskAccessesOperations, + DiskEncryptionSetsOperations, + DiskRestorePointOperations, + DisksOperations, + GalleriesOperations, + GalleryApplicationsOperations, + GalleryApplicationVersionsOperations, + GalleryImagesOperations, + GalleryImageVersionsOperations, + GalleryInVMAccessControlProfilesOperations, + GalleryInVMAccessControlProfileVersionsOperations, + GalleryScriptsOperations, + GalleryScriptVersionsOperations, + GallerySharingProfileOperations, + ImagesOperations, + LogAnalyticsOperations, + OperationsOperations, + ProximityPlacementGroupsOperations, + ResourceSkusOperations, + RestorePointCollectionsOperations, + RestorePointsOperations, + SharedGalleriesOperations, + SharedGalleryImagesOperations, + SharedGalleryImageVersionsOperations, + SnapshotsOperations, + SoftDeletedResourceOperations, + SshPublicKeysOperations, + UsageOperations, + VirtualMachineExtensionImagesOperations, + VirtualMachineExtensionsOperations, + VirtualMachineImagesOperations, + VirtualMachineImagesEdgeZoneOperations, + VirtualMachineRunCommandsOperations, + VirtualMachinesOperations, + VirtualMachineScaleSetExtensionsOperations, + VirtualMachineScaleSetLifeCycleHookEventsOperations, + VirtualMachineScaleSetRollingUpgradesOperations, + VirtualMachineScaleSetsOperations, + VirtualMachineScaleSetVMExtensionsOperations, + VirtualMachineScaleSetVMRunCommandsOperations, + VirtualMachineScaleSetVMsOperations, + VirtualMachineSizesOperations, +} from "./classic/index.js"; +export type { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds }; +export type { AzureSupportedClouds }; diff --git a/sdk/compute/arm-compute/src/logger.ts b/sdk/compute/arm-compute/src/logger.ts new file mode 100644 index 000000000000..9d6b7aa92c6c --- /dev/null +++ b/sdk/compute/arm-compute/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-compute"); diff --git a/sdk/compute/arm-compute/src/lroImpl.ts b/sdk/compute/arm-compute/src/lroImpl.ts deleted file mode 100644 index 064aab0f7c7f..000000000000 --- a/sdk/compute/arm-compute/src/lroImpl.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { AbortSignalLike } from "@azure/abort-controller"; -import type { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/compute/arm-compute/src/models/common/index.ts b/sdk/compute/arm-compute/src/models/common/index.ts new file mode 100644 index 000000000000..8786d3572339 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/common/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + CloudError, + ApiError, + ApiErrorBase, + InnerError, + SubResource, + OperatingSystemTypes, + ResourceIdentityType, + UserAssignedIdentitiesValue, + ExtendedLocation, + ExtendedLocationTypes, + SubResourceReadOnly, + OperatingSystemStateTypes, + SnapshotAccessState, + HyperVGeneration, + Architecture, +} from "./models.js"; +export { + KnownExtendedLocationTypes, + KnownSnapshotAccessState, + KnownHyperVGeneration, + KnownArchitecture, +} from "./models.js"; diff --git a/sdk/compute/arm-compute/src/models/common/models.ts b/sdk/compute/arm-compute/src/models/common/models.ts new file mode 100644 index 000000000000..e17e4e1625a3 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/common/models.ts @@ -0,0 +1,290 @@ +// 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 */ +/** An error response from the Compute service. */ +export interface CloudError { + /** Api error. */ + error?: ApiError; +} + +export function cloudErrorDeserializer(item: any): CloudError { + return { + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +/** Api error. */ +export interface ApiError { + /** The Api error details */ + details?: ApiErrorBase[]; + /** The Api inner error */ + innererror?: InnerError; + /** The error code. */ + code?: string; + /** The target of the particular error. */ + target?: string; + /** The error message. */ + message?: string; +} + +export function apiErrorDeserializer(item: any): ApiError { + return { + details: !item["details"] ? item["details"] : apiErrorBaseArrayDeserializer(item["details"]), + innererror: !item["innererror"] + ? item["innererror"] + : innerErrorDeserializer(item["innererror"]), + code: item["code"], + target: item["target"], + message: item["message"], + }; +} + +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"], + }; +} + +/** model interface SubResource */ +export interface SubResource { + /** Resource Id */ + id?: string; +} + +export function subResourceSerializer(item: SubResource): any { + return { id: item["id"] }; +} + +export function subResourceDeserializer(item: any): SubResource { + return { + id: item["id"], + }; +} + +/** 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.** */ +export type OperatingSystemTypes = "Windows" | "Linux"; + +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); + }); +} + +/** The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. */ +export type ResourceIdentityType = + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned, UserAssigned" + | "None"; + +export function userAssignedIdentitiesValueRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitiesValueSerializer(item[key]); + }); + return result; +} + +export function userAssignedIdentitiesValueRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitiesValueDeserializer(item[key]); + }); + return result; +} + +/** model interface UserAssignedIdentitiesValue */ +export interface UserAssignedIdentitiesValue { + /** The principal id of user assigned identity. */ + readonly principalId?: string; + /** The client id of user assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitiesValueSerializer(_item: UserAssignedIdentitiesValue): any { + return {}; +} + +export function userAssignedIdentitiesValueDeserializer(item: any): UserAssignedIdentitiesValue { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** The complex type of the extended location. */ +export interface ExtendedLocation { + /** The name of the extended location. */ + name?: string; + /** The type of the extended location. */ + type?: ExtendedLocationTypes; +} + +export function extendedLocationSerializer(item: ExtendedLocation): any { + return { name: item["name"], type: item["type"] }; +} + +export function extendedLocationDeserializer(item: any): ExtendedLocation { + return { + name: item["name"], + type: item["type"], + }; +} + +/** The type of extendedLocation. */ +export enum KnownExtendedLocationTypes { + /** EdgeZone */ + EdgeZone = "EdgeZone", +} + +/** + * The type of extendedLocation. \ + * {@link KnownExtendedLocationTypes} can be used interchangeably with ExtendedLocationTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EdgeZone** + */ +export type ExtendedLocationTypes = string; + +/** model interface SubResourceReadOnly */ +export interface SubResourceReadOnly { + /** Resource Id */ + readonly id?: string; +} + +export function subResourceReadOnlySerializer(_item: SubResourceReadOnly): any { + return {}; +} + +export function subResourceReadOnlyDeserializer(item: any): SubResourceReadOnly { + return { + id: item["id"], + }; +} + +export function subResourceReadOnlyArraySerializer(result: Array): any[] { + return result.map((item) => { + return subResourceReadOnlySerializer(item); + }); +} + +export function subResourceReadOnlyArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return subResourceReadOnlyDeserializer(item); + }); +} + +/** The OS State. For managed images, use Generalized. */ +export type OperatingSystemStateTypes = "Generalized" | "Specialized"; + +/** The state of snapshot which determines the access availability of the snapshot. */ +export enum KnownSnapshotAccessState { + /** Default value. */ + Unknown = "Unknown", + /** The snapshot cannot be used for restore, copy or download to offline. */ + Pending = "Pending", + /** The snapshot can be used for restore, copy to different region, and download to offline. */ + Available = "Available", + /** The snapshot can be used for restoring disks with fast performance but cannot be copied or downloaded. */ + InstantAccess = "InstantAccess", + /** The snapshot can be used for restoring disks with fast performance, copied and downloaded. */ + AvailableWithInstantAccess = "AvailableWithInstantAccess", +} + +/** + * The state of snapshot which determines the access availability of the snapshot. \ + * {@link KnownSnapshotAccessState} can be used interchangeably with SnapshotAccessState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: Default value. \ + * **Pending**: The snapshot cannot be used for restore, copy or download to offline. \ + * **Available**: The snapshot can be used for restore, copy to different region, and download to offline. \ + * **InstantAccess**: The snapshot can be used for restoring disks with fast performance but cannot be copied or downloaded. \ + * **AvailableWithInstantAccess**: The snapshot can be used for restoring disks with fast performance, copied and downloaded. + */ +export type SnapshotAccessState = string; + +/** The hypervisor generation of the Virtual Machine. */ +export enum KnownHyperVGeneration { + /** V1 */ + V1 = "V1", + /** V2 */ + V2 = "V2", +} + +/** + * The hypervisor generation of the Virtual Machine. \ + * {@link KnownHyperVGeneration} can be used interchangeably with HyperVGeneration, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **V1** \ + * **V2** + */ +export type HyperVGeneration = string; + +/** CPU architecture supported by an OS disk. */ +export enum KnownArchitecture { + /** x64 */ + X64 = "x64", + /** Arm64 */ + Arm64 = "Arm64", +} + +/** + * CPU architecture supported by an OS disk. \ + * {@link KnownArchitecture} can be used interchangeably with Architecture, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **x64** \ + * **Arm64** + */ +export type Architecture = string; diff --git a/sdk/compute/arm-compute/src/models/compute/index.ts b/sdk/compute/arm-compute/src/models/compute/index.ts new file mode 100644 index 000000000000..8a8cbbd59153 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/compute/index.ts @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + VirtualMachineScaleSet, + Sku, + Plan, + VirtualMachineScaleSetProperties, + UpgradePolicy, + UpgradeMode, + RollingUpgradePolicy, + AutomaticOSUpgradePolicy, + ScheduledEventsPolicy, + UserInitiatedRedeploy, + UserInitiatedReboot, + ScheduledEventsAdditionalPublishingTargets, + EventGridAndResourceGraph, + AllInstancesDown, + AutomaticRepairsPolicy, + RepairAction, + VirtualMachineScaleSetVMProfile, + VirtualMachineScaleSetOSProfile, + WindowsConfiguration, + AdditionalUnattendContent, + PassNames, + ComponentNames, + SettingNames, + PatchSettings, + WindowsVMGuestPatchMode, + WindowsPatchAssessmentMode, + WindowsVMGuestPatchAutomaticByPlatformSettings, + WindowsVMGuestPatchAutomaticByPlatformRebootSetting, + WinRMConfiguration, + WinRMListener, + ProtocolTypes, + LinuxConfiguration, + SshConfiguration, + SshPublicKey, + LinuxPatchSettings, + LinuxVMGuestPatchMode, + LinuxPatchAssessmentMode, + LinuxVMGuestPatchAutomaticByPlatformSettings, + LinuxVMGuestPatchAutomaticByPlatformRebootSetting, + VaultSecretGroup, + VaultCertificate, + VirtualMachineScaleSetStorageProfile, + ImageReference, + VirtualMachineScaleSetOSDisk, + CachingTypes, + DiskCreateOptionTypes, + DiffDiskSettings, + DiffDiskOptions, + DiffDiskPlacement, + StorageFaultDomainAlignmentType, + VirtualHardDisk, + VirtualMachineScaleSetManagedDiskParameters, + StorageAccountTypes, + DiskEncryptionSetParameters, + VMDiskSecurityProfile, + SecurityEncryptionTypes, + DiskDeleteOptionTypes, + VirtualMachineScaleSetDataDisk, + DiskControllerTypes, + VirtualMachineScaleSetNetworkProfile, + ApiEntityReference, + VirtualMachineScaleSetNetworkConfiguration, + VirtualMachineScaleSetNetworkConfigurationProperties, + VirtualMachineScaleSetNetworkConfigurationDnsSettings, + VirtualMachineScaleSetIPConfiguration, + VirtualMachineScaleSetIPConfigurationProperties, + VirtualMachineScaleSetPublicIPAddressConfiguration, + VirtualMachineScaleSetPublicIPAddressConfigurationProperties, + VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, + DomainNameLabelScopeTypes, + VirtualMachineScaleSetIpTag, + IPVersion, + DeleteOptions, + PublicIPAddressSku, + PublicIPAddressSkuName, + PublicIPAddressSkuTier, + NetworkInterfaceAuxiliaryMode, + NetworkInterfaceAuxiliarySku, + NetworkApiVersion, + SecurityProfile, + UefiSettings, + SecurityTypes, + EncryptionIdentity, + ProxyAgentSettings, + Mode, + HostEndpointSettings, + Modes, + DiagnosticsProfile, + BootDiagnostics, + VirtualMachineScaleSetExtensionProfile, + VirtualMachineScaleSetExtension, + VirtualMachineScaleSetExtensionProperties, + KeyVaultSecretReference, + VirtualMachinePriorityTypes, + VirtualMachineEvictionPolicyTypes, + BillingProfile, + ScheduledEventsProfile, + TerminateNotificationProfile, + OSImageNotificationProfile, + CapacityReservationProfile, + ApplicationProfile, + VMGalleryApplication, + VirtualMachineScaleSetHardwareProfile, + VMSizeProperties, + ServiceArtifactReference, + SecurityPostureReference, + AdditionalCapabilities, + ScaleInPolicy, + VirtualMachineScaleSetScaleInRules, + OrchestrationMode, + SpotRestorePolicy, + PriorityMixPolicy, + ResiliencyPolicy, + ResilientVMCreationPolicy, + ResilientVMDeletionPolicy, + AutomaticZoneRebalancingPolicy, + RebalanceStrategy, + RebalanceBehavior, + ZoneAllocationPolicy, + MaxInstancePercentPerZonePolicy, + OperationRecoverySettings, + RestartRecoveryPolicy, + StartRecoveryPolicy, + ReimageRecoveryPolicy, + ZonalPlatformFaultDomainAlignMode, + SkuProfile, + SkuProfileVMSize, + AllocationStrategy, + HighSpeedInterconnectPlacement, + LifecycleHooksProfile, + LifecycleHook, + VMScaleSetLifecycleHookEventType, + LifecycleHookAction, + ExternalHealthPolicy, + VirtualMachineScaleSetIdentity, + Placement, + ZonePlacementPolicyType, + VirtualMachineScaleSetUpdate, + VirtualMachineScaleSetUpdateProperties, + VirtualMachineScaleSetUpdateVMProfile, + VirtualMachineScaleSetUpdateOSProfile, + VirtualMachineScaleSetUpdateStorageProfile, + VirtualMachineScaleSetUpdateOSDisk, + VirtualMachineScaleSetUpdateNetworkProfile, + VirtualMachineScaleSetUpdateNetworkConfiguration, + VirtualMachineScaleSetUpdateNetworkConfigurationProperties, + VirtualMachineScaleSetUpdateIPConfiguration, + VirtualMachineScaleSetUpdateIPConfigurationProperties, + VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, + VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties, + SecurityPostureReferenceUpdate, + UpdateResource, + VirtualMachineScaleSetVMInstanceIDs, + VMScaleSetConvertToSinglePlacementGroupInput, + VirtualMachineScaleSetVMInstanceRequiredIDs, + RecoveryWalkResponse, + VirtualMachineScaleSetInstanceView, + VirtualMachineScaleSetInstanceViewStatusesSummary, + VirtualMachineStatusCodeCount, + VirtualMachineScaleSetVMExtensionsSummary, + InstanceViewStatus, + StatusLevelTypes, + OrchestrationServiceSummary, + OrchestrationServiceNames, + OrchestrationServiceState, + OrchestrationServiceOperationStatus, + UpgradeOperationHistoricalStatusInfo, + UpgradeOperationHistoricalStatusInfoProperties, + UpgradeOperationHistoryStatus, + UpgradeState, + RollingUpgradeProgressInfo, + UpgradeOperationInvoker, + RollbackStatusInfo, + VirtualMachineScaleSetReimageParameters, + VirtualMachineScaleSetVMReimageParameters, + VirtualMachineReimageParameters, + OSProfileProvisioningData, + OrchestrationServiceStateInput, + OrchestrationServiceStateAction, + VirtualMachineScaleSetSku, + VirtualMachineScaleSetSkuCapacity, + VirtualMachineScaleSetSkuScaleType, + VMScaleSetScaleOutInput, + VMScaleSetScaleOutInputProperties, + VirtualMachineScaleSetExtensionUpdate, + VMScaleSetLifecycleHookEvent, + VMScaleSetLifecycleHookEventProperties, + VMScaleSetLifecycleHookEventTargetResource, + LifecycleHookActionState, + VMScaleSetLifecycleHookEventAdditionalContext, + VMScaleSetLifecycleHookEventState, + VMScaleSetLifecycleHookEventUpdate, + VirtualMachineScaleSetVMExtension, + VirtualMachineExtensionProperties, + VirtualMachineExtensionInstanceView, + VirtualMachineScaleSetVMExtensionUpdate, + VirtualMachineExtensionUpdateProperties, + VirtualMachineScaleSetVMExtensionsListResult, + VirtualMachine, + VirtualMachineProperties, + HardwareProfile, + VirtualMachineSizeTypes, + StorageProfile, + OSDisk, + DiskEncryptionSettings, + KeyVaultKeyReference, + ManagedDiskParameters, + DataDisk, + DiskDetachOptionTypes, + OSProfile, + NetworkProfile, + NetworkInterfaceReference, + NetworkInterfaceReferenceProperties, + VirtualMachineNetworkInterfaceConfiguration, + VirtualMachineNetworkInterfaceConfigurationProperties, + VirtualMachineNetworkInterfaceDnsSettingsConfiguration, + VirtualMachineNetworkInterfaceIPConfiguration, + VirtualMachineNetworkInterfaceIPConfigurationProperties, + VirtualMachinePublicIPAddressConfiguration, + VirtualMachinePublicIPAddressConfigurationProperties, + VirtualMachinePublicIPAddressDnsSettingsConfiguration, + VirtualMachineIpTag, + IPVersions, + PublicIPAllocationMethod, + VirtualMachineInstanceView, + HyperVGenerationType, + VirtualMachineAgentInstanceView, + VirtualMachineExtensionHandlerInstanceView, + MaintenanceRedeployStatus, + MaintenanceOperationResultCodeTypes, + DiskInstanceView, + StorageAlignmentStatus, + VirtualMachineHealthStatus, + BootDiagnosticsInstanceView, + VirtualMachinePatchStatus, + AvailablePatchSummary, + PatchOperationStatus, + LastPatchInstallationSummary, + ResiliencyProfile, + ZoneMovement, + VirtualMachineExtension, + VirtualMachineIdentity, + VirtualMachineUpdate, + VirtualMachineAssessPatchesResult, + VirtualMachineSoftwarePatchProperties, + VMGuestPatchRebootBehavior, + PatchAssessmentState, + AttachDetachDataDisksRequest, + DataDisksToAttach, + DataDisksToDetach, + VirtualMachineCaptureParameters, + VirtualMachineCaptureResult, + VirtualMachineInstallPatchesParameters, + VMGuestPatchRebootSetting, + WindowsParameters, + VMGuestPatchClassificationWindows, + LinuxParameters, + VMGuestPatchClassificationLinux, + VirtualMachineInstallPatchesResult, + VMGuestPatchRebootStatus, + PatchInstallationDetail, + PatchInstallationState, + RetrieveBootDiagnosticsDataResult, + VirtualMachineSize, + RunCommandInput, + RunCommandInputParameter, + RunCommandResult, + MigrateVMToVirtualMachineScaleSetInput, + VirtualMachineExtensionUpdate, + VirtualMachineExtensionsListResult, + VirtualMachineExtensionImage, + VirtualMachineExtensionImageProperties, + AvailabilitySet, + AvailabilitySetProperties, + VirtualMachineScaleSetMigrationInfo, + DefaultVirtualMachineScaleSetInfo, + AvailabilitySetUpdate, + MigrateToVirtualMachineScaleSetInput, + ConvertToVirtualMachineScaleSetInput, + ProximityPlacementGroup, + ProximityPlacementGroupProperties, + ProximityPlacementGroupType, + SubResourceWithColocationStatus, + ProximityPlacementGroupPropertiesIntent, + ProximityPlacementGroupUpdate, + DedicatedHostGroup, + DedicatedHostGroupProperties, + DedicatedHostGroupInstanceView, + DedicatedHostInstanceViewWithName, + DedicatedHostGroupPropertiesAdditionalCapabilities, + DedicatedHostInstanceView, + DedicatedHostAvailableCapacity, + DedicatedHostAllocatableVM, + DedicatedHostGroupUpdate, + DedicatedHost, + DedicatedHostProperties, + DedicatedHostLicenseTypes, + DedicatedHostUpdate, + Image, + ImageProperties, + ImageStorageProfile, + ImageOSDisk, + ImageDataDisk, + HyperVGenerationTypes, + ImageDisk, + ImageUpdate, + RestorePointCollection, + RestorePointCollectionProperties, + RestorePointCollectionSourceProperties, + RestorePoint, + RestorePointProperties, + RestorePointSourceMetadata, + RestorePointSourceVMStorageProfile, + RestorePointSourceVmosDisk, + OperatingSystemType, + DiskRestorePointAttributes, + RestorePointEncryption, + RestorePointEncryptionType, + RestorePointSourceVMDataDisk, + ConsistencyModeTypes, + RestorePointInstanceView, + DiskRestorePointInstanceView, + DiskRestorePointReplicationStatus, + RestorePointCollectionUpdate, + CapacityReservationGroup, + CapacityReservationGroupProperties, + CapacityReservationGroupInstanceView, + CapacityReservationInstanceViewWithName, + ResourceSharingProfile, + ReservationType, + CapacityReservationInstanceView, + CapacityReservationUtilization, + CapacityReservationGroupUpdate, + CapacityReservation, + CapacityReservationProperties, + ScheduleProfile, + CapacityReservationUpdate, + VirtualMachineRunCommand, + VirtualMachineRunCommandProperties, + VirtualMachineRunCommandScriptSource, + RunCommandManagedIdentity, + ScriptShellTypes, + VirtualMachineRunCommandInstanceView, + ExecutionState, + VirtualMachineRunCommandUpdate, + RunCommandDocumentBase, + RunCommandDocument, + RunCommandParameterDefinition, + RollingUpgradeStatusInfo, + RollingUpgradeStatusInfoProperties, + RollingUpgradeRunningStatus, + RollingUpgradeStatusCode, + RollingUpgradeActionType, + VirtualMachineScaleSetVM, + VirtualMachineScaleSetVMProperties, + VirtualMachineScaleSetVMInstanceView, + ResilientVMDeletionStatus, + VirtualMachineScaleSetVMNetworkProfileConfiguration, + VirtualMachineScaleSetVMProtectionPolicy, + SshPublicKeyResource, + SshPublicKeyResourceProperties, + SshPublicKeyUpdateResource, + SshGenerateKeyPairInputParameters, + SshEncryptionTypes, + SshPublicKeyGenerateKeyPairResult, + Usage, + UsageName, + VirtualMachineImageResource, + VirtualMachineImage, + VirtualMachineImageProperties, + PurchasePlan, + OSDiskImage, + DataDiskImage, + AutomaticOSUpgradeProperties, + DisallowedConfiguration, + VmDiskTypes, + VirtualMachineImageFeature, + ArchitectureTypes, + ImageDeprecationStatus, + ImageState, + AlternativeOption, + AlternativeType, + VmImagesInEdgeZoneListResult, + RequestRateByIntervalInput, + IntervalInMins, + LogAnalyticsInputBase, + LogAnalyticsOperationResult, + LogAnalyticsOutput, + ThrottledRequestsInput, + ExpandTypesForGetVMScaleSets, + InstanceViewTypes, + ExpandTypeForListVMs, + ExpandTypesForListVMs, + RestorePointCollectionExpandOptions, + RestorePointExpandOptions, + CapacityReservationGroupInstanceViewTypes, + ExpandTypesForGetCapacityReservationGroups, + ResourceIdOptionsForGetCapacityReservationGroups, + CapacityReservationInstanceViewTypes, +} from "./models.js"; +export { + KnownRepairAction, + KnownWindowsVMGuestPatchMode, + KnownWindowsPatchAssessmentMode, + KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting, + KnownLinuxVMGuestPatchMode, + KnownLinuxPatchAssessmentMode, + KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting, + KnownDiskCreateOptionTypes, + KnownDiffDiskOptions, + KnownDiffDiskPlacement, + KnownStorageFaultDomainAlignmentType, + KnownStorageAccountTypes, + KnownSecurityEncryptionTypes, + KnownDiskDeleteOptionTypes, + KnownDiskControllerTypes, + KnownDomainNameLabelScopeTypes, + KnownIPVersion, + KnownDeleteOptions, + KnownPublicIPAddressSkuName, + KnownPublicIPAddressSkuTier, + KnownNetworkInterfaceAuxiliaryMode, + KnownNetworkInterfaceAuxiliarySku, + KnownNetworkApiVersion, + KnownSecurityTypes, + KnownMode, + KnownModes, + KnownVirtualMachinePriorityTypes, + KnownVirtualMachineEvictionPolicyTypes, + KnownVirtualMachineScaleSetScaleInRules, + KnownOrchestrationMode, + KnownRebalanceStrategy, + KnownRebalanceBehavior, + KnownZonalPlatformFaultDomainAlignMode, + KnownAllocationStrategy, + KnownHighSpeedInterconnectPlacement, + KnownVMScaleSetLifecycleHookEventType, + KnownLifecycleHookAction, + KnownZonePlacementPolicyType, + KnownOrchestrationServiceNames, + KnownOrchestrationServiceState, + KnownOrchestrationServiceOperationStatus, + KnownOrchestrationServiceStateAction, + KnownLifecycleHookActionState, + KnownVMScaleSetLifecycleHookEventState, + KnownVirtualMachineSizeTypes, + KnownDiskDetachOptionTypes, + KnownIPVersions, + KnownPublicIPAllocationMethod, + KnownHyperVGenerationType, + KnownStorageAlignmentStatus, + KnownPatchOperationStatus, + KnownVMGuestPatchRebootBehavior, + KnownPatchAssessmentState, + KnownVMGuestPatchRebootSetting, + KnownVMGuestPatchClassificationWindows, + KnownVMGuestPatchClassificationLinux, + KnownVMGuestPatchRebootStatus, + KnownPatchInstallationState, + KnownProximityPlacementGroupType, + KnownHyperVGenerationTypes, + KnownOperatingSystemType, + KnownRestorePointEncryptionType, + KnownConsistencyModeTypes, + KnownReservationType, + KnownScriptShellTypes, + KnownExecutionState, + KnownResilientVMDeletionStatus, + KnownSshEncryptionTypes, + KnownVmDiskTypes, + KnownArchitectureTypes, + KnownImageState, + KnownAlternativeType, + KnownExpandTypesForGetVMScaleSets, + KnownExpandTypeForListVMs, + KnownExpandTypesForListVMs, + KnownRestorePointCollectionExpandOptions, + KnownRestorePointExpandOptions, + KnownCapacityReservationGroupInstanceViewTypes, + KnownExpandTypesForGetCapacityReservationGroups, + KnownResourceIdOptionsForGetCapacityReservationGroups, + KnownCapacityReservationInstanceViewTypes, +} from "./models.js"; diff --git a/sdk/compute/arm-compute/src/models/compute/models.ts b/sdk/compute/arm-compute/src/models/compute/models.ts new file mode 100644 index 000000000000..1053107b3e14 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/compute/models.ts @@ -0,0 +1,15773 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { areAllPropsUndefined } from "../../static-helpers/serialization/check-prop-undefined.js"; +import type { + ApiError, + SubResource, + OperatingSystemTypes, + ResourceIdentityType, + UserAssignedIdentitiesValue, + ExtendedLocation, + SubResourceReadOnly, + OperatingSystemStateTypes, + SnapshotAccessState, + HyperVGeneration, +} from "../common/models.js"; +import { + apiErrorDeserializer, + subResourceSerializer, + subResourceDeserializer, + subResourceArraySerializer, + subResourceArrayDeserializer, + userAssignedIdentitiesValueRecordSerializer, + userAssignedIdentitiesValueRecordDeserializer, + extendedLocationSerializer, + extendedLocationDeserializer, + subResourceReadOnlyArrayDeserializer, +} from "../common/models.js"; +import type { TrackedResource, ProxyResource } from "../models.js"; +import { systemDataDeserializer } from "../models.js"; + +/** + * 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 */ +/** Describes a Virtual Machine Scale Set. */ +export interface VirtualMachineScaleSet extends TrackedResource { + /** The virtual machine scale set sku. */ + sku?: Sku; + /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ + plan?: Plan; + /** The identity of the virtual machine scale set, if configured. */ + identity?: VirtualMachineScaleSetIdentity; + /** The availability zones. */ + zones?: string[]; + /** The extended location of the Virtual Machine Scale Set. */ + extendedLocation?: ExtendedLocation; + /** Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates */ + readonly etag?: string; + /** Placement section specifies the user-defined constraints for virtual machine scale set hardware placement. Minimum api-version: 2025-04-01. */ + placement?: Placement; + /** The upgrade policy. */ + upgradePolicy?: UpgradePolicy; + /** The ScheduledEventsPolicy. */ + scheduledEventsPolicy?: ScheduledEventsPolicy; + /** Policy for automatic repairs. */ + automaticRepairsPolicy?: AutomaticRepairsPolicy; + /** The virtual machine profile. */ + virtualMachineProfile?: VirtualMachineScaleSetVMProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** Specifies whether the Virtual Machine Scale Set should be overprovisioned. */ + overprovision?: boolean; + /** When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. */ + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + /** Specifies the ID which uniquely identifies a Virtual Machine Scale Set. */ + readonly uniqueId?: string; + /** When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. */ + singlePlacementGroup?: boolean; + /** Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. */ + zoneBalance?: boolean; + /** Fault Domain count for each placement group. */ + platformFaultDomainCount?: number; + /** Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: 2020-06-01. */ + hostGroup?: SubResource; + /** Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ + additionalCapabilities?: AdditionalCapabilities; + /** Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. */ + scaleInPolicy?: ScaleInPolicy; + /** Specifies the orchestration mode for the virtual machine scale set. */ + orchestrationMode?: OrchestrationMode; + /** Specifies the Spot Restore properties for the virtual machine scale set. */ + spotRestorePolicy?: SpotRestorePolicy; + /** Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. */ + priorityMixPolicy?: PriorityMixPolicy; + /** Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Optional property which must either be set to True or omitted. */ + constrainedMaximumCapacity?: boolean; + /** Policy for Resiliency */ + resiliencyPolicy?: ResiliencyPolicy; + /** Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. */ + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + /** Specifies the sku profile for the virtual machine scale set. */ + skuProfile?: SkuProfile; + /** Specifies the high speed interconnect placement for the virtual machine scale set. */ + highSpeedInterconnectPlacement?: HighSpeedInterconnectPlacement; + /** Specifies the lifecycle hooks profile for the virtual machine scale set. */ + lifecycleHooksProfile?: LifecycleHooksProfile; + /** Specifies the external health policy for the virtual machine scale set. */ + externalHealthPolicy?: ExternalHealthPolicy; +} + +export function virtualMachineScaleSetSerializer(item: VirtualMachineScaleSet): any { + return { + tags: item["tags"], + location: item["location"], + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + plan: !item["plan"] ? item["plan"] : planSerializer(item["plan"]), + properties: areAllPropsUndefined(item, [ + "upgradePolicy", + "scheduledEventsPolicy", + "automaticRepairsPolicy", + "virtualMachineProfile", + "overprovision", + "doNotRunExtensionsOnOverprovisionedVMs", + "singlePlacementGroup", + "zoneBalance", + "platformFaultDomainCount", + "proximityPlacementGroup", + "hostGroup", + "additionalCapabilities", + "scaleInPolicy", + "orchestrationMode", + "spotRestorePolicy", + "priorityMixPolicy", + "constrainedMaximumCapacity", + "resiliencyPolicy", + "zonalPlatformFaultDomainAlignMode", + "skuProfile", + "highSpeedInterconnectPlacement", + "lifecycleHooksProfile", + "externalHealthPolicy", + ]) + ? undefined + : _virtualMachineScaleSetPropertiesSerializer(item), + identity: !item["identity"] + ? item["identity"] + : virtualMachineScaleSetIdentitySerializer(item["identity"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + placement: !item["placement"] ? item["placement"] : placementSerializer(item["placement"]), + }; +} + +export function virtualMachineScaleSetDeserializer(item: any): VirtualMachineScaleSet { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + plan: !item["plan"] ? item["plan"] : planDeserializer(item["plan"]), + ...(!item["properties"] + ? item["properties"] + : _virtualMachineScaleSetPropertiesDeserializer(item["properties"])), + identity: !item["identity"] + ? item["identity"] + : virtualMachineScaleSetIdentityDeserializer(item["identity"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + etag: item["etag"], + placement: !item["placement"] ? item["placement"] : placementDeserializer(item["placement"]), + }; +} + +/** Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. */ +export interface Sku { + /** The sku name. */ + name?: string; + /** Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** */ + tier?: string; + /** Specifies the number of virtual machines in the scale set. */ + capacity?: number; +} + +export function skuSerializer(item: Sku): any { + return { name: item["name"], tier: item["tier"], capacity: item["capacity"] }; +} + +export function skuDeserializer(item: any): Sku { + return { + name: item["name"], + tier: item["tier"], + capacity: item["capacity"], + }; +} + +/** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ +export interface Plan { + /** The plan ID. */ + name?: string; + /** The publisher ID. */ + publisher?: string; + /** Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. */ + product?: string; + /** The promotion code. */ + promotionCode?: string; +} + +export function planSerializer(item: Plan): any { + return { + name: item["name"], + publisher: item["publisher"], + product: item["product"], + promotionCode: item["promotionCode"], + }; +} + +export function planDeserializer(item: any): Plan { + return { + name: item["name"], + publisher: item["publisher"], + product: item["product"], + promotionCode: item["promotionCode"], + }; +} + +/** Describes the properties of a Virtual Machine Scale Set. */ +export interface VirtualMachineScaleSetProperties { + /** The upgrade policy. */ + upgradePolicy?: UpgradePolicy; + /** The ScheduledEventsPolicy. */ + scheduledEventsPolicy?: ScheduledEventsPolicy; + /** Policy for automatic repairs. */ + automaticRepairsPolicy?: AutomaticRepairsPolicy; + /** The virtual machine profile. */ + virtualMachineProfile?: VirtualMachineScaleSetVMProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** Specifies whether the Virtual Machine Scale Set should be overprovisioned. */ + overprovision?: boolean; + /** When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. */ + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + /** Specifies the ID which uniquely identifies a Virtual Machine Scale Set. */ + readonly uniqueId?: string; + /** When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. */ + singlePlacementGroup?: boolean; + /** Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. */ + zoneBalance?: boolean; + /** Fault Domain count for each placement group. */ + platformFaultDomainCount?: number; + /** Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: 2020-06-01. */ + hostGroup?: SubResource; + /** Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ + additionalCapabilities?: AdditionalCapabilities; + /** Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. */ + scaleInPolicy?: ScaleInPolicy; + /** Specifies the orchestration mode for the virtual machine scale set. */ + orchestrationMode?: OrchestrationMode; + /** Specifies the Spot Restore properties for the virtual machine scale set. */ + spotRestorePolicy?: SpotRestorePolicy; + /** Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. */ + priorityMixPolicy?: PriorityMixPolicy; + /** Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Optional property which must either be set to True or omitted. */ + constrainedMaximumCapacity?: boolean; + /** Policy for Resiliency */ + resiliencyPolicy?: ResiliencyPolicy; + /** Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. */ + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + /** Specifies the sku profile for the virtual machine scale set. */ + skuProfile?: SkuProfile; + /** Specifies the high speed interconnect placement for the virtual machine scale set. */ + highSpeedInterconnectPlacement?: HighSpeedInterconnectPlacement; + /** Specifies the lifecycle hooks profile for the virtual machine scale set. */ + lifecycleHooksProfile?: LifecycleHooksProfile; + /** Specifies the external health policy for the virtual machine scale set. */ + externalHealthPolicy?: ExternalHealthPolicy; +} + +export function virtualMachineScaleSetPropertiesSerializer( + item: VirtualMachineScaleSetProperties, +): any { + return { + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicySerializer(item["upgradePolicy"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicySerializer(item["scheduledEventsPolicy"]), + automaticRepairsPolicy: !item["automaticRepairsPolicy"] + ? item["automaticRepairsPolicy"] + : automaticRepairsPolicySerializer(item["automaticRepairsPolicy"]), + virtualMachineProfile: !item["virtualMachineProfile"] + ? item["virtualMachineProfile"] + : virtualMachineScaleSetVMProfileSerializer(item["virtualMachineProfile"]), + overprovision: item["overprovision"], + doNotRunExtensionsOnOverprovisionedVMs: item["doNotRunExtensionsOnOverprovisionedVMs"], + singlePlacementGroup: item["singlePlacementGroup"], + zoneBalance: item["zoneBalance"], + platformFaultDomainCount: item["platformFaultDomainCount"], + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceSerializer(item["hostGroup"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesSerializer(item["additionalCapabilities"]), + scaleInPolicy: !item["scaleInPolicy"] + ? item["scaleInPolicy"] + : scaleInPolicySerializer(item["scaleInPolicy"]), + orchestrationMode: item["orchestrationMode"], + spotRestorePolicy: !item["spotRestorePolicy"] + ? item["spotRestorePolicy"] + : spotRestorePolicySerializer(item["spotRestorePolicy"]), + priorityMixPolicy: !item["priorityMixPolicy"] + ? item["priorityMixPolicy"] + : priorityMixPolicySerializer(item["priorityMixPolicy"]), + constrainedMaximumCapacity: item["constrainedMaximumCapacity"], + resiliencyPolicy: !item["resiliencyPolicy"] + ? item["resiliencyPolicy"] + : resiliencyPolicySerializer(item["resiliencyPolicy"]), + zonalPlatformFaultDomainAlignMode: item["zonalPlatformFaultDomainAlignMode"], + skuProfile: !item["skuProfile"] ? item["skuProfile"] : skuProfileSerializer(item["skuProfile"]), + highSpeedInterconnectPlacement: item["highSpeedInterconnectPlacement"], + lifecycleHooksProfile: !item["lifecycleHooksProfile"] + ? item["lifecycleHooksProfile"] + : lifecycleHooksProfileSerializer(item["lifecycleHooksProfile"]), + externalHealthPolicy: !item["externalHealthPolicy"] + ? item["externalHealthPolicy"] + : externalHealthPolicySerializer(item["externalHealthPolicy"]), + }; +} + +export function virtualMachineScaleSetPropertiesDeserializer( + item: any, +): VirtualMachineScaleSetProperties { + return { + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicyDeserializer(item["upgradePolicy"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicyDeserializer(item["scheduledEventsPolicy"]), + automaticRepairsPolicy: !item["automaticRepairsPolicy"] + ? item["automaticRepairsPolicy"] + : automaticRepairsPolicyDeserializer(item["automaticRepairsPolicy"]), + virtualMachineProfile: !item["virtualMachineProfile"] + ? item["virtualMachineProfile"] + : virtualMachineScaleSetVMProfileDeserializer(item["virtualMachineProfile"]), + provisioningState: item["provisioningState"], + overprovision: item["overprovision"], + doNotRunExtensionsOnOverprovisionedVMs: item["doNotRunExtensionsOnOverprovisionedVMs"], + uniqueId: item["uniqueId"], + singlePlacementGroup: item["singlePlacementGroup"], + zoneBalance: item["zoneBalance"], + platformFaultDomainCount: item["platformFaultDomainCount"], + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceDeserializer(item["hostGroup"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesDeserializer(item["additionalCapabilities"]), + scaleInPolicy: !item["scaleInPolicy"] + ? item["scaleInPolicy"] + : scaleInPolicyDeserializer(item["scaleInPolicy"]), + orchestrationMode: item["orchestrationMode"], + spotRestorePolicy: !item["spotRestorePolicy"] + ? item["spotRestorePolicy"] + : spotRestorePolicyDeserializer(item["spotRestorePolicy"]), + priorityMixPolicy: !item["priorityMixPolicy"] + ? item["priorityMixPolicy"] + : priorityMixPolicyDeserializer(item["priorityMixPolicy"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + constrainedMaximumCapacity: item["constrainedMaximumCapacity"], + resiliencyPolicy: !item["resiliencyPolicy"] + ? item["resiliencyPolicy"] + : resiliencyPolicyDeserializer(item["resiliencyPolicy"]), + zonalPlatformFaultDomainAlignMode: item["zonalPlatformFaultDomainAlignMode"], + skuProfile: !item["skuProfile"] + ? item["skuProfile"] + : skuProfileDeserializer(item["skuProfile"]), + highSpeedInterconnectPlacement: item["highSpeedInterconnectPlacement"], + lifecycleHooksProfile: !item["lifecycleHooksProfile"] + ? item["lifecycleHooksProfile"] + : lifecycleHooksProfileDeserializer(item["lifecycleHooksProfile"]), + externalHealthPolicy: !item["externalHealthPolicy"] + ? item["externalHealthPolicy"] + : externalHealthPolicyDeserializer(item["externalHealthPolicy"]), + }; +} + +/** Describes an upgrade policy - automatic, manual, or rolling. */ +export interface UpgradePolicy { + /** Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time. */ + mode?: UpgradeMode; + /** The configuration parameters used while performing a rolling upgrade. */ + rollingUpgradePolicy?: RollingUpgradePolicy; + /** Configuration parameters used for performing automatic OS Upgrade. */ + automaticOSUpgradePolicy?: AutomaticOSUpgradePolicy; +} + +export function upgradePolicySerializer(item: UpgradePolicy): any { + return { + mode: item["mode"], + rollingUpgradePolicy: !item["rollingUpgradePolicy"] + ? item["rollingUpgradePolicy"] + : rollingUpgradePolicySerializer(item["rollingUpgradePolicy"]), + automaticOSUpgradePolicy: !item["automaticOSUpgradePolicy"] + ? item["automaticOSUpgradePolicy"] + : automaticOSUpgradePolicySerializer(item["automaticOSUpgradePolicy"]), + }; +} + +export function upgradePolicyDeserializer(item: any): UpgradePolicy { + return { + mode: item["mode"], + rollingUpgradePolicy: !item["rollingUpgradePolicy"] + ? item["rollingUpgradePolicy"] + : rollingUpgradePolicyDeserializer(item["rollingUpgradePolicy"]), + automaticOSUpgradePolicy: !item["automaticOSUpgradePolicy"] + ? item["automaticOSUpgradePolicy"] + : automaticOSUpgradePolicyDeserializer(item["automaticOSUpgradePolicy"]), + }; +} + +/** Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time. */ +export type UpgradeMode = "Automatic" | "Manual" | "Rolling"; + +/** The configuration parameters used while performing a rolling upgrade. */ +export interface RollingUpgradePolicy { + /** The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. */ + maxBatchInstancePercent?: number; + /** The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. */ + maxUnhealthyInstancePercent?: number; + /** The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. */ + maxUnhealthyUpgradedInstancePercent?: number; + /** The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). */ + pauseTimeBetweenBatches?: string; + /** Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. */ + enableCrossZoneUpgrade?: boolean; + /** Upgrade all unhealthy instances in a scale set before any healthy instances. */ + prioritizeUnhealthyInstances?: boolean; + /** Rollback failed instances to previous model if the Rolling Upgrade policy is violated. */ + rollbackFailedInstancesOnPolicyBreach?: boolean; + /** Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch. */ + maxSurge?: boolean; +} + +export function rollingUpgradePolicySerializer(item: RollingUpgradePolicy): any { + return { + maxBatchInstancePercent: item["maxBatchInstancePercent"], + maxUnhealthyInstancePercent: item["maxUnhealthyInstancePercent"], + maxUnhealthyUpgradedInstancePercent: item["maxUnhealthyUpgradedInstancePercent"], + pauseTimeBetweenBatches: item["pauseTimeBetweenBatches"], + enableCrossZoneUpgrade: item["enableCrossZoneUpgrade"], + prioritizeUnhealthyInstances: item["prioritizeUnhealthyInstances"], + rollbackFailedInstancesOnPolicyBreach: item["rollbackFailedInstancesOnPolicyBreach"], + maxSurge: item["maxSurge"], + }; +} + +export function rollingUpgradePolicyDeserializer(item: any): RollingUpgradePolicy { + return { + maxBatchInstancePercent: item["maxBatchInstancePercent"], + maxUnhealthyInstancePercent: item["maxUnhealthyInstancePercent"], + maxUnhealthyUpgradedInstancePercent: item["maxUnhealthyUpgradedInstancePercent"], + pauseTimeBetweenBatches: item["pauseTimeBetweenBatches"], + enableCrossZoneUpgrade: item["enableCrossZoneUpgrade"], + prioritizeUnhealthyInstances: item["prioritizeUnhealthyInstances"], + rollbackFailedInstancesOnPolicyBreach: item["rollbackFailedInstancesOnPolicyBreach"], + maxSurge: item["maxSurge"], + }; +} + +/** The configuration parameters used for performing automatic OS upgrade. */ +export interface AutomaticOSUpgradePolicy { + /** Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false. If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. */ + enableAutomaticOSUpgrade?: boolean; + /** Whether OS image rollback feature should be disabled. Default value is false. */ + disableAutomaticRollback?: boolean; + /** Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. */ + useRollingUpgradePolicy?: boolean; + /** Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS upgrades will send advanced notifications on a per-VM basis that an OS upgrade from rolling upgrades is incoming, via the IMDS tag 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is approved via an ApproveRollingUpgrade call. */ + osRollingUpgradeDeferral?: boolean; +} + +export function automaticOSUpgradePolicySerializer(item: AutomaticOSUpgradePolicy): any { + return { + enableAutomaticOSUpgrade: item["enableAutomaticOSUpgrade"], + disableAutomaticRollback: item["disableAutomaticRollback"], + useRollingUpgradePolicy: item["useRollingUpgradePolicy"], + osRollingUpgradeDeferral: item["osRollingUpgradeDeferral"], + }; +} + +export function automaticOSUpgradePolicyDeserializer(item: any): AutomaticOSUpgradePolicy { + return { + enableAutomaticOSUpgrade: item["enableAutomaticOSUpgrade"], + disableAutomaticRollback: item["disableAutomaticRollback"], + useRollingUpgradePolicy: item["useRollingUpgradePolicy"], + osRollingUpgradeDeferral: item["osRollingUpgradeDeferral"], + }; +} + +/** 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"], + }; +} + +/** model interface ScheduledEventsAdditionalPublishingTargets */ +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 configuration parameters for automatic repairs on the virtual machine scale set. */ +export interface AutomaticRepairsPolicy { + /** Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. */ + enabled?: boolean; + /** The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). */ + gracePeriod?: string; + /** Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace. */ + repairAction?: RepairAction; +} + +export function automaticRepairsPolicySerializer(item: AutomaticRepairsPolicy): any { + return { + enabled: item["enabled"], + gracePeriod: item["gracePeriod"], + repairAction: item["repairAction"], + }; +} + +export function automaticRepairsPolicyDeserializer(item: any): AutomaticRepairsPolicy { + return { + enabled: item["enabled"], + gracePeriod: item["gracePeriod"], + repairAction: item["repairAction"], + }; +} + +/** Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace. */ +export enum KnownRepairAction { + /** Replace */ + Replace = "Replace", + /** Restart */ + Restart = "Restart", + /** Reimage */ + Reimage = "Reimage", +} + +/** + * Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace. \ + * {@link KnownRepairAction} can be used interchangeably with RepairAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Replace** \ + * **Restart** \ + * **Reimage** + */ +export type RepairAction = string; + +/** Describes a virtual machine scale set virtual machine profile. */ +export interface VirtualMachineScaleSetVMProfile { + /** Specifies the operating system settings for the virtual machines in the scale set. */ + osProfile?: VirtualMachineScaleSetOSProfile; + /** Specifies the storage settings for the virtual machine disks. */ + storageProfile?: VirtualMachineScaleSetStorageProfile; + /** Specifies properties of the network interfaces of the virtual machines in the scale set. */ + networkProfile?: VirtualMachineScaleSetNetworkProfile; + /** Specifies the Security related profile settings for the virtual machines in the scale set. */ + securityProfile?: SecurityProfile; + /** Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. */ + diagnosticsProfile?: DiagnosticsProfile; + /** Specifies a collection of settings for extensions installed on virtual machines in the scale set. */ + extensionProfile?: VirtualMachineScaleSetExtensionProfile; + /** 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 priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview. */ + priority?: VirtualMachinePriorityTypes; + /** Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. */ + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + /** Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. */ + billingProfile?: BillingProfile; + /** Specifies Scheduled Event related configurations. */ + scheduledEventsProfile?: ScheduledEventsProfile; + /** UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. */ + userData?: string; + /** Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01. */ + capacityReservation?: CapacityReservationProfile; + /** Specifies the gallery applications that should be made available to the VM/VMSS */ + applicationProfile?: ApplicationProfile; + /** Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. */ + hardwareProfile?: VirtualMachineScaleSetHardwareProfile; + /** Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01 */ + serviceArtifactReference?: ServiceArtifactReference; + /** Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01 */ + securityPostureReference?: SecurityPostureReference; + /** Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. */ + readonly timeCreated?: Date; +} + +export function virtualMachineScaleSetVMProfileSerializer( + item: VirtualMachineScaleSetVMProfile, +): any { + return { + osProfile: !item["osProfile"] + ? item["osProfile"] + : virtualMachineScaleSetOSProfileSerializer(item["osProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : virtualMachineScaleSetStorageProfileSerializer(item["storageProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : virtualMachineScaleSetNetworkProfileSerializer(item["networkProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileSerializer(item["securityProfile"]), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileSerializer(item["diagnosticsProfile"]), + extensionProfile: !item["extensionProfile"] + ? item["extensionProfile"] + : virtualMachineScaleSetExtensionProfileSerializer(item["extensionProfile"]), + licenseType: item["licenseType"], + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileSerializer(item["billingProfile"]), + 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"]), + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : virtualMachineScaleSetHardwareProfileSerializer(item["hardwareProfile"]), + serviceArtifactReference: !item["serviceArtifactReference"] + ? item["serviceArtifactReference"] + : serviceArtifactReferenceSerializer(item["serviceArtifactReference"]), + securityPostureReference: !item["securityPostureReference"] + ? item["securityPostureReference"] + : securityPostureReferenceSerializer(item["securityPostureReference"]), + }; +} + +export function virtualMachineScaleSetVMProfileDeserializer( + item: any, +): VirtualMachineScaleSetVMProfile { + return { + osProfile: !item["osProfile"] + ? item["osProfile"] + : virtualMachineScaleSetOSProfileDeserializer(item["osProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : virtualMachineScaleSetStorageProfileDeserializer(item["storageProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : virtualMachineScaleSetNetworkProfileDeserializer(item["networkProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileDeserializer(item["securityProfile"]), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileDeserializer(item["diagnosticsProfile"]), + extensionProfile: !item["extensionProfile"] + ? item["extensionProfile"] + : virtualMachineScaleSetExtensionProfileDeserializer(item["extensionProfile"]), + licenseType: item["licenseType"], + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileDeserializer(item["billingProfile"]), + 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"]), + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : virtualMachineScaleSetHardwareProfileDeserializer(item["hardwareProfile"]), + serviceArtifactReference: !item["serviceArtifactReference"] + ? item["serviceArtifactReference"] + : serviceArtifactReferenceDeserializer(item["serviceArtifactReference"]), + securityPostureReference: !item["securityPostureReference"] + ? item["securityPostureReference"] + : securityPostureReferenceDeserializer(item["securityPostureReference"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + }; +} + +/** Describes a virtual machine scale set OS profile. */ +export interface VirtualMachineScaleSetOSProfile { + /** Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. */ + computerNamePrefix?: string; + /** Specifies the name of the administrator account.

**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. For using cloud-init for your 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 machines in the scale set. 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 scale set. This may only be set to False when no extensions are present on the virtual machine scale set. */ + allowExtensionOperations?: boolean; + /** Optional property which must either be set to True or omitted. */ + requireGuestProvisionSignal?: boolean; +} + +export function virtualMachineScaleSetOSProfileSerializer( + item: VirtualMachineScaleSetOSProfile, +): any { + return { + computerNamePrefix: item["computerNamePrefix"], + 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 virtualMachineScaleSetOSProfileDeserializer( + item: any, +): VirtualMachineScaleSetOSProfile { + return { + computerNamePrefix: item["computerNamePrefix"], + 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; + /** Indicates whether VMAgent Platform Updates are enabled for the Windows Virtual Machine. */ + readonly enableVMAgentPlatformUpdates?: boolean; +} + +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"]), + enableVMAgentPlatformUpdates: item["enableVMAgentPlatformUpdates"], + }; +} + +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?: PassNames; + /** The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. */ + componentName?: ComponentNames; + /** 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"], + }; +} + +/** Type of PassNames */ +export type PassNames = "OobeSystem"; +/** The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. */ +export type ComponentNames = "Microsoft-Windows-Shell-Setup"; +/** Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. */ +export type SettingNames = "AutoLogon" | "FirstLogonCommands"; + +/** 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 */ + Manual = "Manual", + /** AutomaticByOS */ + AutomaticByOS = "AutomaticByOS", + /** AutomaticByPlatform */ + 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** \ + * **AutomaticByOS** \ + * **AutomaticByPlatform** + */ +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 */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform */ + 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** \ + * **AutomaticByPlatform** + */ +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 { + /** Unknown */ + Unknown = "Unknown", + /** IfRequired */ + IfRequired = "IfRequired", + /** Never */ + Never = "Never", + /** 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** \ + * **IfRequired** \ + * **Never** \ + * **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 type ProtocolTypes = "Http" | "Https"; + +/** 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 */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform */ + 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** \ + * **AutomaticByPlatform** + */ +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 */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform */ + 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** \ + * **AutomaticByPlatform** + */ +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 */ + Unknown = "Unknown", + /** IfRequired */ + IfRequired = "IfRequired", + /** Never */ + Never = "Never", + /** Always */ + 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** \ + * **IfRequired** \ + * **Never** \ + * **Always** + */ +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 <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.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"], + }; +} + +/** Describes a virtual machine scale set storage profile. */ +export interface VirtualMachineScaleSetStorageProfile { + /** 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 machines in the scale set. 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?: VirtualMachineScaleSetOSDisk; + /** Specifies the parameters that are used to add data disks to the virtual machines in the scale set. 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?: VirtualMachineScaleSetDataDisk[]; + /** Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01 */ + diskControllerType?: DiskControllerTypes; +} + +export function virtualMachineScaleSetStorageProfileSerializer( + item: VirtualMachineScaleSetStorageProfile, +): any { + return { + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageReferenceSerializer(item["imageReference"]), + osDisk: !item["osDisk"] + ? item["osDisk"] + : virtualMachineScaleSetOSDiskSerializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : virtualMachineScaleSetDataDiskArraySerializer(item["dataDisks"]), + diskControllerType: item["diskControllerType"], + }; +} + +export function virtualMachineScaleSetStorageProfileDeserializer( + item: any, +): VirtualMachineScaleSetStorageProfile { + return { + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageReferenceDeserializer(item["imageReference"]), + osDisk: !item["osDisk"] + ? item["osDisk"] + : virtualMachineScaleSetOSDiskDeserializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : virtualMachineScaleSetDataDiskArrayDeserializer(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; + /** Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. */ + readonly exactVersion?: 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"], + exactVersion: item["exactVersion"], + sharedGalleryImageId: item["sharedGalleryImageId"], + communityGalleryImageId: item["communityGalleryImageId"], + }; +} + +/** Describes a virtual machine scale set operating system disk. */ +export interface VirtualMachineScaleSetOSDisk { + /** The disk name. */ + name?: string; + /** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **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 machines in the scale set should be created. The only allowed value is: **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. */ + createOption: DiskCreateOptionTypes; + /** Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. */ + diffDiskSettings?: DiffDiskSettings; + /** 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; + /** Specifies the storage fault domain alignment type for the disk. */ + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + /** 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 information about the unmanaged user image to base the scale set on. */ + image?: VirtualHardDisk; + /** Specifies the container urls that are used to store operating system disks for the scale set. */ + vhdContainers?: string[]; + /** The managed disk parameters. */ + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; + /** Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

**Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.

**Detach** If this value is used, the OS disk is retained after VMSS Flex VM is deleted.

The default value is set to **Delete**. For an Ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. */ + deleteOption?: DiskDeleteOptionTypes; +} + +export function virtualMachineScaleSetOSDiskSerializer(item: VirtualMachineScaleSetOSDisk): any { + return { + name: item["name"], + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + createOption: item["createOption"], + diffDiskSettings: !item["diffDiskSettings"] + ? item["diffDiskSettings"] + : diffDiskSettingsSerializer(item["diffDiskSettings"]), + diskSizeGB: item["diskSizeGB"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + osType: item["osType"], + image: !item["image"] ? item["image"] : virtualHardDiskSerializer(item["image"]), + vhdContainers: !item["vhdContainers"] + ? item["vhdContainers"] + : item["vhdContainers"].map((p: any) => { + return p; + }), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : virtualMachineScaleSetManagedDiskParametersSerializer(item["managedDisk"]), + deleteOption: item["deleteOption"], + }; +} + +export function virtualMachineScaleSetOSDiskDeserializer(item: any): VirtualMachineScaleSetOSDisk { + return { + name: item["name"], + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + createOption: item["createOption"], + diffDiskSettings: !item["diffDiskSettings"] + ? item["diffDiskSettings"] + : diffDiskSettingsDeserializer(item["diffDiskSettings"]), + diskSizeGB: item["diskSizeGB"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + osType: item["osType"], + image: !item["image"] ? item["image"] : virtualHardDiskDeserializer(item["image"]), + vhdContainers: !item["vhdContainers"] + ? item["vhdContainers"] + : item["vhdContainers"].map((p: any) => { + return p; + }), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : virtualMachineScaleSetManagedDiskParametersDeserializer(item["managedDisk"]), + deleteOption: item["deleteOption"], + }; +} + +/** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage** */ +export type CachingTypes = "None" | "ReadOnly" | "ReadWrite"; + +/** 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 { + /** FromImage */ + FromImage = "FromImage", + /** Empty */ + Empty = "Empty", + /** Attach */ + Attach = "Attach", + /** Copy */ + Copy = "Copy", + /** 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** \ + * **Empty** \ + * **Attach** \ + * **Copy** \ + * **Restore** + */ +export type DiskCreateOptionTypes = 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. Refer to the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Minimum api-version for NvmeDisk: 2024-03-01. */ + placement?: DiffDiskPlacement; + /** Specifies whether or not to enable full caching for this VM which will cache the OS disk locally on the host and make this VM more resilient to storage outages */ + enableFullCaching?: boolean; +} + +export function diffDiskSettingsSerializer(item: DiffDiskSettings): any { + return { + option: item["option"], + placement: item["placement"], + enableFullCaching: item["enableFullCaching"], + }; +} + +export function diffDiskSettingsDeserializer(item: any): DiffDiskSettings { + return { + option: item["option"], + placement: item["placement"], + enableFullCaching: item["enableFullCaching"], + }; +} + +/** Specifies the ephemeral disk option for operating system disk. */ +export enum KnownDiffDiskOptions { + /** 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** + */ +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 */ + CacheDisk = "CacheDisk", + /** ResourceDisk */ + ResourceDisk = "ResourceDisk", + /** NvmeDisk */ + 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** \ + * **ResourceDisk** \ + * **NvmeDisk** + */ +export type DiffDiskPlacement = string; + +/** Specifies the storage fault domain alignment type for the disk. */ +export enum KnownStorageFaultDomainAlignmentType { + /** Disk Storage Fault Domains are mapped to Compute Fault Domains. Deployment fails if disk does not support enough Fault Domains. */ + Aligned = "Aligned", + /** Attempt to map Storage Fault Domains to Compute Fault Domains. Disks are unaligned if disk does not support enough Fault Domains. */ + BestEffortAligned = "BestEffortAligned", +} + +/** + * Specifies the storage fault domain alignment type for the disk. \ + * {@link KnownStorageFaultDomainAlignmentType} can be used interchangeably with StorageFaultDomainAlignmentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Aligned**: Disk Storage Fault Domains are mapped to Compute Fault Domains. Deployment fails if disk does not support enough Fault Domains. \ + * **BestEffortAligned**: Attempt to map Storage Fault Domains to Compute Fault Domains. Disks are unaligned if disk does not support enough Fault Domains. + */ +export type StorageFaultDomainAlignmentType = string; + +/** 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"], + }; +} + +/** Describes the parameters of a ScaleSet managed disk. */ +export interface VirtualMachineScaleSetManagedDiskParameters { + /** 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 virtualMachineScaleSetManagedDiskParametersSerializer( + item: VirtualMachineScaleSetManagedDiskParameters, +): any { + return { + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : vmDiskSecurityProfileSerializer(item["securityProfile"]), + }; +} + +export function virtualMachineScaleSetManagedDiskParametersDeserializer( + item: any, +): VirtualMachineScaleSetManagedDiskParameters { + return { + 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 */ + StandardLRS = "Standard_LRS", + /** Premium_LRS */ + PremiumLRS = "Premium_LRS", + /** StandardSSD_LRS */ + StandardSSDLRS = "StandardSSD_LRS", + /** UltraSSD_LRS */ + UltraSSDLRS = "UltraSSD_LRS", + /** Premium_ZRS */ + PremiumZRS = "Premium_ZRS", + /** StandardSSD_ZRS */ + StandardSSDZRS = "StandardSSD_ZRS", + /** PremiumV2_LRS */ + 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** \ + * **Premium_LRS** \ + * **StandardSSD_LRS** \ + * **UltraSSD_LRS** \ + * **Premium_ZRS** \ + * **StandardSSD_ZRS** \ + * **PremiumV2_LRS** + */ +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 */ + VMGuestStateOnly = "VMGuestStateOnly", + /** DiskWithVMGuestState */ + DiskWithVMGuestState = "DiskWithVMGuestState", + /** NonPersistedTPM */ + 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** \ + * **DiskWithVMGuestState** \ + * **NonPersistedTPM** + */ +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 */ + Delete = "Delete", + /** Detach */ + 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** \ + * **Detach** + */ +export type DiskDeleteOptionTypes = string; + +export function virtualMachineScaleSetDataDiskArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetDataDiskSerializer(item); + }); +} + +export function virtualMachineScaleSetDataDiskArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetDataDiskDeserializer(item); + }); +} + +/** Describes a virtual machine scale set data disk. */ +export interface VirtualMachineScaleSetDataDisk { + /** The disk name. */ + name?: string; + /** 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; + /** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.** */ + caching?: CachingTypes; + /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ + writeAcceleratorEnabled?: boolean; + /** The create option. */ + 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; + /** Specifies the storage fault domain alignment type for the disk. */ + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + /** The managed disk parameters. */ + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; + /** Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. */ + diskIopsReadWrite?: number; + /** Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. */ + diskMBpsReadWrite?: number; + /** Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

**Delete** If this value is used, the data disk is deleted when the VMSS Flex VM is deleted.

**Detach** If this value is used, the data disk is retained after VMSS Flex VM is deleted.

The default value is set to **Delete**. */ + deleteOption?: DiskDeleteOptionTypes; +} + +export function virtualMachineScaleSetDataDiskSerializer( + item: VirtualMachineScaleSetDataDisk, +): any { + return { + name: item["name"], + lun: item["lun"], + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + createOption: item["createOption"], + diskSizeGB: item["diskSizeGB"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : virtualMachineScaleSetManagedDiskParametersSerializer(item["managedDisk"]), + diskIOPSReadWrite: item["diskIopsReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + deleteOption: item["deleteOption"], + }; +} + +export function virtualMachineScaleSetDataDiskDeserializer( + item: any, +): VirtualMachineScaleSetDataDisk { + return { + name: item["name"], + lun: item["lun"], + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + createOption: item["createOption"], + diskSizeGB: item["diskSizeGB"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : virtualMachineScaleSetManagedDiskParametersDeserializer(item["managedDisk"]), + diskIopsReadWrite: item["diskIOPSReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + deleteOption: item["deleteOption"], + }; +} + +/** 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 */ + Scsi = "SCSI", + /** NVMe */ + 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** \ + * **NVMe** + */ +export type DiskControllerTypes = string; + +/** Describes a virtual machine scale set network profile. */ +export interface VirtualMachineScaleSetNetworkProfile { + /** A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. */ + healthProbe?: ApiEntityReference; + /** The list of network configurations. */ + networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; + /** specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible' */ + networkApiVersion?: NetworkApiVersion; +} + +export function virtualMachineScaleSetNetworkProfileSerializer( + item: VirtualMachineScaleSetNetworkProfile, +): any { + return { + healthProbe: !item["healthProbe"] + ? item["healthProbe"] + : apiEntityReferenceSerializer(item["healthProbe"]), + networkInterfaceConfigurations: !item["networkInterfaceConfigurations"] + ? item["networkInterfaceConfigurations"] + : virtualMachineScaleSetNetworkConfigurationArraySerializer( + item["networkInterfaceConfigurations"], + ), + networkApiVersion: item["networkApiVersion"], + }; +} + +export function virtualMachineScaleSetNetworkProfileDeserializer( + item: any, +): VirtualMachineScaleSetNetworkProfile { + return { + healthProbe: !item["healthProbe"] + ? item["healthProbe"] + : apiEntityReferenceDeserializer(item["healthProbe"]), + networkInterfaceConfigurations: !item["networkInterfaceConfigurations"] + ? item["networkInterfaceConfigurations"] + : virtualMachineScaleSetNetworkConfigurationArrayDeserializer( + item["networkInterfaceConfigurations"], + ), + networkApiVersion: item["networkApiVersion"], + }; +} + +/** 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"], + }; +} + +export function virtualMachineScaleSetNetworkConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetNetworkConfigurationSerializer(item); + }); +} + +export function virtualMachineScaleSetNetworkConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetNetworkConfigurationDeserializer(item); + }); +} + +/** Describes a virtual machine scale set network profile's network configurations. */ +export interface VirtualMachineScaleSetNetworkConfiguration { + /** The network configuration name. */ + name: string; + /** Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration */ + tags?: Record; + /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ + primary?: boolean; + /** 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; + /** The network security group. */ + networkSecurityGroup?: SubResource; + /** The dns settings to be applied on the network interfaces. */ + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + /** Specifies the IP configurations of the network interface. */ + ipConfigurations?: VirtualMachineScaleSetIPConfiguration[]; + /** Whether IP forwarding enabled on this NIC. */ + enableIPForwarding?: boolean; + /** Specify what happens to the network interface when the VM is deleted */ + deleteOption?: DeleteOptions; + /** 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 virtualMachineScaleSetNetworkConfigurationSerializer( + item: VirtualMachineScaleSetNetworkConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "primary", + "enableAcceleratedNetworking", + "disableTcpStateTracking", + "enableFpga", + "networkSecurityGroup", + "dnsSettings", + "ipConfigurations", + "enableIPForwarding", + "deleteOption", + "auxiliaryMode", + "auxiliarySku", + ]) + ? undefined + : _virtualMachineScaleSetNetworkConfigurationPropertiesSerializer(item), + tags: item["tags"], + }; +} + +export function virtualMachineScaleSetNetworkConfigurationDeserializer( + item: any, +): VirtualMachineScaleSetNetworkConfiguration { + return { + name: item["name"], + ...(!item["properties"] + ? item["properties"] + : _virtualMachineScaleSetNetworkConfigurationPropertiesDeserializer(item["properties"])), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Describes a virtual machine scale set network profile's IP configuration. */ +export interface VirtualMachineScaleSetNetworkConfigurationProperties { + /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ + primary?: boolean; + /** 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; + /** The network security group. */ + networkSecurityGroup?: SubResource; + /** The dns settings to be applied on the network interfaces. */ + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + /** Specifies the IP configurations of the network interface. */ + ipConfigurations: VirtualMachineScaleSetIPConfiguration[]; + /** Whether IP forwarding enabled on this NIC. */ + enableIPForwarding?: boolean; + /** Specify what happens to the network interface when the VM is deleted */ + deleteOption?: DeleteOptions; + /** 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 virtualMachineScaleSetNetworkConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetNetworkConfigurationProperties, +): any { + return { + primary: item["primary"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceSerializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetNetworkConfigurationDnsSettingsSerializer(item["dnsSettings"]), + ipConfigurations: virtualMachineScaleSetIPConfigurationArraySerializer( + item["ipConfigurations"], + ), + enableIPForwarding: item["enableIPForwarding"], + deleteOption: item["deleteOption"], + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function virtualMachineScaleSetNetworkConfigurationPropertiesDeserializer( + item: any, +): VirtualMachineScaleSetNetworkConfigurationProperties { + return { + primary: item["primary"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceDeserializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetNetworkConfigurationDnsSettingsDeserializer(item["dnsSettings"]), + ipConfigurations: virtualMachineScaleSetIPConfigurationArrayDeserializer( + item["ipConfigurations"], + ), + enableIPForwarding: item["enableIPForwarding"], + deleteOption: item["deleteOption"], + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +/** Describes a virtual machines scale sets network configuration's DNS settings. */ +export interface VirtualMachineScaleSetNetworkConfigurationDnsSettings { + /** List of DNS servers IP addresses */ + dnsServers?: string[]; +} + +export function virtualMachineScaleSetNetworkConfigurationDnsSettingsSerializer( + item: VirtualMachineScaleSetNetworkConfigurationDnsSettings, +): any { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +export function virtualMachineScaleSetNetworkConfigurationDnsSettingsDeserializer( + item: any, +): VirtualMachineScaleSetNetworkConfigurationDnsSettings { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + }; +} + +export function virtualMachineScaleSetIPConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetIPConfigurationSerializer(item); + }); +} + +export function virtualMachineScaleSetIPConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetIPConfigurationDeserializer(item); + }); +} + +/** Describes a virtual machine scale set network profile's IP configuration. */ +export interface VirtualMachineScaleSetIPConfiguration { + /** The IP configuration name. */ + name: string; + /** Specifies the identifier of the subnet. */ + subnet?: ApiEntityReference; + /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ + primary?: boolean; + /** The publicIPAddressConfiguration. */ + publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; + /** 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?: IPVersion; + /** Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. */ + applicationGatewayBackendAddressPools?: SubResource[]; + /** Specifies an array of references to application security group. */ + applicationSecurityGroups?: SubResource[]; + /** Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. */ + loadBalancerBackendAddressPools?: SubResource[]; + /** Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. */ + loadBalancerInboundNatPools?: SubResource[]; +} + +export function virtualMachineScaleSetIPConfigurationSerializer( + item: VirtualMachineScaleSetIPConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "subnet", + "primary", + "publicIPAddressConfiguration", + "privateIPAddressVersion", + "applicationGatewayBackendAddressPools", + "applicationSecurityGroups", + "loadBalancerBackendAddressPools", + "loadBalancerInboundNatPools", + ]) + ? undefined + : _virtualMachineScaleSetIPConfigurationPropertiesSerializer(item), + }; +} + +export function virtualMachineScaleSetIPConfigurationDeserializer( + item: any, +): VirtualMachineScaleSetIPConfiguration { + return { + name: item["name"], + ...(!item["properties"] + ? item["properties"] + : _virtualMachineScaleSetIPConfigurationPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes a virtual machine scale set network profile's IP configuration properties. */ +export interface VirtualMachineScaleSetIPConfigurationProperties { + /** Specifies the identifier of the subnet. */ + subnet?: ApiEntityReference; + /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ + primary?: boolean; + /** The publicIPAddressConfiguration. */ + publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; + /** 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?: IPVersion; + /** Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. */ + applicationGatewayBackendAddressPools?: SubResource[]; + /** Specifies an array of references to application security group. */ + applicationSecurityGroups?: SubResource[]; + /** Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. */ + loadBalancerBackendAddressPools?: SubResource[]; + /** Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. */ + loadBalancerInboundNatPools?: SubResource[]; +} + +export function virtualMachineScaleSetIPConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetIPConfigurationProperties, +): any { + return { + subnet: !item["subnet"] ? item["subnet"] : apiEntityReferenceSerializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachineScaleSetPublicIPAddressConfigurationSerializer( + item["publicIPAddressConfiguration"], + ), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArraySerializer(item["applicationGatewayBackendAddressPools"]), + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArraySerializer(item["applicationSecurityGroups"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArraySerializer(item["loadBalancerBackendAddressPools"]), + loadBalancerInboundNatPools: !item["loadBalancerInboundNatPools"] + ? item["loadBalancerInboundNatPools"] + : subResourceArraySerializer(item["loadBalancerInboundNatPools"]), + }; +} + +export function virtualMachineScaleSetIPConfigurationPropertiesDeserializer( + item: any, +): VirtualMachineScaleSetIPConfigurationProperties { + return { + subnet: !item["subnet"] ? item["subnet"] : apiEntityReferenceDeserializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachineScaleSetPublicIPAddressConfigurationDeserializer( + item["publicIPAddressConfiguration"], + ), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArrayDeserializer(item["applicationGatewayBackendAddressPools"]), + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArrayDeserializer(item["applicationSecurityGroups"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArrayDeserializer(item["loadBalancerBackendAddressPools"]), + loadBalancerInboundNatPools: !item["loadBalancerInboundNatPools"] + ? item["loadBalancerInboundNatPools"] + : subResourceArrayDeserializer(item["loadBalancerInboundNatPools"]), + }; +} + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ +export interface VirtualMachineScaleSetPublicIPAddressConfiguration { + /** The publicIP address configuration name. */ + name: string; + /** 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; + /** The idle timeout of the public IP address. */ + idleTimeoutInMinutes?: number; + /** The dns settings to be applied on the publicIP addresses . */ + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + /** The list of IP tags associated with the public IP address. */ + ipTags?: VirtualMachineScaleSetIpTag[]; + /** 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?: IPVersion; + /** Specify what happens to the public IP when the VM is deleted */ + deleteOption?: DeleteOptions; +} + +export function virtualMachineScaleSetPublicIPAddressConfigurationSerializer( + item: VirtualMachineScaleSetPublicIPAddressConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "idleTimeoutInMinutes", + "dnsSettings", + "ipTags", + "publicIPPrefix", + "publicIPAddressVersion", + "deleteOption", + ]) + ? undefined + : _virtualMachineScaleSetPublicIPAddressConfigurationPropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : publicIPAddressSkuSerializer(item["sku"]), + tags: item["tags"], + }; +} + +export function virtualMachineScaleSetPublicIPAddressConfigurationDeserializer( + item: any, +): VirtualMachineScaleSetPublicIPAddressConfiguration { + return { + name: item["name"], + ...(!item["properties"] + ? item["properties"] + : _virtualMachineScaleSetPublicIPAddressConfigurationPropertiesDeserializer( + 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 scale set IP Configuration's PublicIPAddress configuration */ +export interface VirtualMachineScaleSetPublicIPAddressConfigurationProperties { + /** The idle timeout of the public IP address. */ + idleTimeoutInMinutes?: number; + /** The dns settings to be applied on the publicIP addresses . */ + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + /** The list of IP tags associated with the public IP address. */ + ipTags?: VirtualMachineScaleSetIpTag[]; + /** 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?: IPVersion; + /** Specify what happens to the public IP when the VM is deleted */ + deleteOption?: DeleteOptions; +} + +export function virtualMachineScaleSetPublicIPAddressConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetPublicIPAddressConfigurationProperties, +): any { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsSerializer( + item["dnsSettings"], + ), + ipTags: !item["ipTags"] + ? item["ipTags"] + : virtualMachineScaleSetIpTagArraySerializer(item["ipTags"]), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceSerializer(item["publicIPPrefix"]), + publicIPAddressVersion: item["publicIPAddressVersion"], + deleteOption: item["deleteOption"], + }; +} + +export function virtualMachineScaleSetPublicIPAddressConfigurationPropertiesDeserializer( + item: any, +): VirtualMachineScaleSetPublicIPAddressConfigurationProperties { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsDeserializer( + item["dnsSettings"], + ), + ipTags: !item["ipTags"] + ? item["ipTags"] + : virtualMachineScaleSetIpTagArrayDeserializer(item["ipTags"]), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceDeserializer(item["publicIPPrefix"]), + publicIPAddressVersion: item["publicIPAddressVersion"], + deleteOption: item["deleteOption"], + }; +} + +/** Describes a virtual machines scale sets network configuration's DNS settings. */ +export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { + /** The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created */ + domainNameLabel: string; + /** 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 */ + domainNameLabelScope?: DomainNameLabelScopeTypes; +} + +export function virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsSerializer( + item: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings, +): any { + return { + domainNameLabel: item["domainNameLabel"], + domainNameLabelScope: item["domainNameLabelScope"], + }; +} + +export function virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsDeserializer( + item: any, +): VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { + 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 */ + TenantReuse = "TenantReuse", + /** SubscriptionReuse */ + SubscriptionReuse = "SubscriptionReuse", + /** ResourceGroupReuse */ + ResourceGroupReuse = "ResourceGroupReuse", + /** NoReuse */ + 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** \ + * **SubscriptionReuse** \ + * **ResourceGroupReuse** \ + * **NoReuse** + */ +export type DomainNameLabelScopeTypes = string; + +export function virtualMachineScaleSetIpTagArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetIpTagSerializer(item); + }); +} + +export function virtualMachineScaleSetIpTagArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetIpTagDeserializer(item); + }); +} + +/** Contains the IP tag associated with the public IP address. */ +export interface VirtualMachineScaleSetIpTag { + /** IP tag type. Example: FirstPartyUsage. */ + ipTagType?: string; + /** IP tag associated with the public IP. Example: SQL, Storage etc. */ + tag?: string; +} + +export function virtualMachineScaleSetIpTagSerializer(item: VirtualMachineScaleSetIpTag): any { + return { ipTagType: item["ipTagType"], tag: item["tag"] }; +} + +export function virtualMachineScaleSetIpTagDeserializer(item: any): VirtualMachineScaleSetIpTag { + return { + ipTagType: item["ipTagType"], + tag: item["tag"], + }; +} + +/** 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'. */ +export enum KnownIPVersion { + /** IPv4 */ + IPv4 = "IPv4", + /** IPv6 */ + IPv6 = "IPv6", +} + +/** + * 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'. \ + * {@link KnownIPVersion} can be used interchangeably with IPVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IPv4** \ + * **IPv6** + */ +export type IPVersion = string; + +/** Specify what happens to the network interface when the VM is deleted */ +export enum KnownDeleteOptions { + /** Delete */ + Delete = "Delete", + /** Detach */ + 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** \ + * **Detach** + */ +export type DeleteOptions = 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 */ + Basic = "Basic", + /** Standard */ + 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** \ + * **Standard** + */ +export type PublicIPAddressSkuName = string; + +/** Specify public IP sku tier */ +export enum KnownPublicIPAddressSkuTier { + /** Regional */ + Regional = "Regional", + /** Global */ + 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** \ + * **Global** + */ +export type PublicIPAddressSkuTier = string; + +/** Specifies whether the Auxiliary mode is enabled for the Network Interface resource. */ +export enum KnownNetworkInterfaceAuxiliaryMode { + /** None */ + None = "None", + /** AcceleratedConnections */ + AcceleratedConnections = "AcceleratedConnections", + /** Floating */ + 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** \ + * **AcceleratedConnections** \ + * **Floating** + */ +export type NetworkInterfaceAuxiliaryMode = string; + +/** Specifies whether the Auxiliary sku is enabled for the Network Interface resource. */ +export enum KnownNetworkInterfaceAuxiliarySku { + /** None */ + None = "None", + /** A1 */ + A1 = "A1", + /** A2 */ + A2 = "A2", + /** A4 */ + A4 = "A4", + /** A8 */ + 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** \ + * **A1** \ + * **A2** \ + * **A4** \ + * **A8** + */ +export type NetworkInterfaceAuxiliarySku = string; + +/** specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations */ +export enum KnownNetworkApiVersion { + /** 2020-11-01 */ + NetworkApiVersion20201101 = "2020-11-01", + /** 2022-11-01 */ + NetworkApiVersion20221101 = "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** \ + * **2022-11-01** + */ +export type NetworkApiVersion = 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 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 and is not Standard. If not specified, Standard will be returned starting api version 2025-11-01. */ + 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 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 api-version: 2020-12-01. */ + secureBootEnabled?: boolean; + /** Specifies whether vTPM should be enabled on the virtual machine. Minimum 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 VM securityType; UefiSettings are enabled only when set to TrustedLaunch or ConfidentialVM, and returns a Standard value starting API version 2025-11-01. */ +export enum KnownSecurityTypes { + /** Indicates a VM without UEFI features such as SecureBoot or vTPM; returned as the default value when securityType is not specified. */ + Standard = "Standard", + /** TrustedLaunch */ + TrustedLaunch = "TrustedLaunch", + /** ConfidentialVM */ + ConfidentialVM = "ConfidentialVM", +} + +/** + * Specifies the VM securityType; UefiSettings are enabled only when set to TrustedLaunch or ConfidentialVM, and returns a Standard value starting API version 2025-11-01. \ + * {@link KnownSecurityTypes} can be used interchangeably with SecurityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard**: Indicates a VM without UEFI features such as SecureBoot or vTPM; returned as the default value when securityType is not specified. \ + * **TrustedLaunch** \ + * **ConfidentialVM** + */ +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 */ + Audit = "Audit", + /** Enforce */ + 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** \ + * **Enforce** + */ +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 */ + Audit = "Audit", + /** Enforce */ + Enforce = "Enforce", + /** Disabled */ + 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** \ + * **Enforce** \ + * **Disabled** + */ +export type Modes = string; + +/** Specifies the boot diagnostic settings state. Minimum 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"], + }; +} + +/** Describes a virtual machine scale set extension profile. */ +export interface VirtualMachineScaleSetExtensionProfile { + /** The virtual machine scale set child extension resources. */ + extensions?: VirtualMachineScaleSetExtension[]; + /** 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 api-version: 2020-06-01. */ + extensionsTimeBudget?: string; +} + +export function virtualMachineScaleSetExtensionProfileSerializer( + item: VirtualMachineScaleSetExtensionProfile, +): any { + return { + extensions: !item["extensions"] + ? item["extensions"] + : virtualMachineScaleSetExtensionArraySerializer(item["extensions"]), + extensionsTimeBudget: item["extensionsTimeBudget"], + }; +} + +export function virtualMachineScaleSetExtensionProfileDeserializer( + item: any, +): VirtualMachineScaleSetExtensionProfile { + return { + extensions: !item["extensions"] + ? item["extensions"] + : virtualMachineScaleSetExtensionArrayDeserializer(item["extensions"]), + extensionsTimeBudget: item["extensionsTimeBudget"], + }; +} + +export function virtualMachineScaleSetExtensionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetExtensionSerializer(item); + }); +} + +export function virtualMachineScaleSetExtensionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetExtensionDeserializer(item); + }); +} + +/** Describes a Virtual Machine Scale Set Extension. */ +export interface VirtualMachineScaleSetExtension extends SubResourceReadOnly { + /** Resource type */ + readonly type?: string; + /** Resource name */ + name?: string; + /** If a value is provided and is different from the previous value, the extension handler will 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". */ + typePropertiesType?: 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** Collection of extension names after which this extension needs to be provisioned. */ + provisionAfterExtensions?: string[]; + /** 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; +} + +export function virtualMachineScaleSetExtensionSerializer( + item: VirtualMachineScaleSetExtension, +): any { + return { + properties: areAllPropsUndefined(item, [ + "forceUpdateTag", + "publisher", + "type", + "typeHandlerVersion", + "autoUpgradeMinorVersion", + "enableAutomaticUpgrade", + "settings", + "protectedSettings", + "provisionAfterExtensions", + "suppressFailures", + "protectedSettingsFromKeyVault", + ]) + ? undefined + : _virtualMachineScaleSetExtensionPropertiesSerializer(item), + name: item["name"], + }; +} + +export function virtualMachineScaleSetExtensionDeserializer( + item: any, +): VirtualMachineScaleSetExtension { + return { + id: item["id"], + ...(!item["properties"] + ? item["properties"] + : _virtualMachineScaleSetExtensionPropertiesDeserializer(item["properties"])), + type: item["type"], + name: item["name"], + }; +} + +/** Describes the properties of a Virtual Machine Scale Set Extension. */ +export interface VirtualMachineScaleSetExtensionProperties { + /** If a value is provided and is different from the previous value, the extension handler will 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** Collection of extension names after which this extension needs to be provisioned. */ + provisionAfterExtensions?: string[]; + /** 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; +} + +export function virtualMachineScaleSetExtensionPropertiesSerializer( + item: VirtualMachineScaleSetExtensionProperties, +): 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"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceSerializer(item["protectedSettingsFromKeyVault"]), + }; +} + +export function virtualMachineScaleSetExtensionPropertiesDeserializer( + item: any, +): VirtualMachineScaleSetExtensionProperties { + 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"], + provisioningState: item["provisioningState"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceDeserializer(item["protectedSettingsFromKeyVault"]), + }; +} + +/** 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"]), + }; +} + +/** Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. */ +export enum KnownVirtualMachinePriorityTypes { + /** Regular */ + Regular = "Regular", + /** Low */ + Low = "Low", + /** Spot */ + Spot = "Spot", +} + +/** + * Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. \ + * {@link KnownVirtualMachinePriorityTypes} can be used interchangeably with VirtualMachinePriorityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Regular** \ + * **Low** \ + * **Spot** + */ +export type VirtualMachinePriorityTypes = string; + +/** Specifies the eviction policy for the Azure Spot VM/VMSS */ +export enum KnownVirtualMachineEvictionPolicyTypes { + /** Deallocate */ + Deallocate = "Deallocate", + /** Delete */ + Delete = "Delete", +} + +/** + * Specifies the eviction policy for the Azure Spot VM/VMSS \ + * {@link KnownVirtualMachineEvictionPolicyTypes} can be used interchangeably with VirtualMachineEvictionPolicyTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Deallocate** \ + * **Delete** + */ +export type VirtualMachineEvictionPolicyTypes = string; + +/** Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01. */ +export interface BillingProfile { + /** Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price.

The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS.

Possible values are:

- Any decimal value greater than zero. Example: 0.01538

-1 – indicates default price to be up-to on-demand.

You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

Minimum api-version: 2019-03-01. */ + maxPrice?: number; +} + +export function billingProfileSerializer(item: BillingProfile): any { + return { maxPrice: item["maxPrice"] }; +} + +export function billingProfileDeserializer(item: any): BillingProfile { + return { + maxPrice: item["maxPrice"], + }; +} + +/** model interface ScheduledEventsProfile */ +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"]), + }; +} + +/** model interface TerminateNotificationProfile */ +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"], + }; +} + +/** model interface OSImageNotificationProfile */ +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 or scaleset vm instances 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/VMSS */ +export interface ApplicationProfile { + /** Specifies the gallery applications that should be made available to the VM/VMSS */ + 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"], + }; +} + +/** Specifies the hardware settings for the virtual machine scale set. */ +export interface VirtualMachineScaleSetHardwareProfile { + /** Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. */ + vmSizeProperties?: VMSizeProperties; +} + +export function virtualMachineScaleSetHardwareProfileSerializer( + item: VirtualMachineScaleSetHardwareProfile, +): any { + return { + vmSizeProperties: !item["vmSizeProperties"] + ? item["vmSizeProperties"] + : vmSizePropertiesSerializer(item["vmSizeProperties"]), + }; +} + +export function virtualMachineScaleSetHardwareProfileDeserializer( + item: any, +): VirtualMachineScaleSetHardwareProfile { + return { + vmSizeProperties: !item["vmSizeProperties"] + ? item["vmSizeProperties"] + : vmSizePropertiesDeserializer(item["vmSizeProperties"]), + }; +} + +/** Specifies VM Size Property settings on the virtual machine. */ +export interface VMSizeProperties { + /** Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). */ + vCPUsAvailable?: number; + /** Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). **Setting this property to 1 also means that hyper-threading is disabled.** */ + vCPUsPerCore?: number; +} + +export function vmSizePropertiesSerializer(item: VMSizeProperties): any { + return { vCPUsAvailable: item["vCPUsAvailable"], vCPUsPerCore: item["vCPUsPerCore"] }; +} + +export function vmSizePropertiesDeserializer(item: any): VMSizeProperties { + return { + vCPUsAvailable: item["vCPUsAvailable"], + vCPUsPerCore: item["vCPUsPerCore"], + }; +} + +/** Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01 */ +export interface ServiceArtifactReference { + /** The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} */ + id?: string; +} + +export function serviceArtifactReferenceSerializer(item: ServiceArtifactReference): any { + return { id: item["id"] }; +} + +export function serviceArtifactReferenceDeserializer(item: any): ServiceArtifactReference { + return { + id: item["id"], + }; +} + +/** Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01 */ +export interface SecurityPostureReference { + /** The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest */ + id: string; + /** The list of virtual machine extension names to exclude when applying the security posture. */ + excludeExtensions?: string[]; + /** Whether the security posture can be overridden by the user. */ + isOverridable?: boolean; +} + +export function securityPostureReferenceSerializer(item: SecurityPostureReference): any { + return { + id: item["id"], + excludeExtensions: !item["excludeExtensions"] + ? item["excludeExtensions"] + : item["excludeExtensions"].map((p: any) => { + return p; + }), + isOverridable: item["isOverridable"], + }; +} + +export function securityPostureReferenceDeserializer(item: any): SecurityPostureReference { + return { + id: item["id"], + excludeExtensions: !item["excludeExtensions"] + ? item["excludeExtensions"] + : item["excludeExtensions"].map((p: any) => { + return p; + }), + isOverridable: item["isOverridable"], + }; +} + +/** 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; + /** The flag enables the usage of FIPS 140-3 compliant cryptography on the protectedSettings of an extension. Learn more at: https://aka.ms/linuxagentfipssupport. */ + enableFips1403Encryption?: boolean; +} + +export function additionalCapabilitiesSerializer(item: AdditionalCapabilities): any { + return { + ultraSSDEnabled: item["ultraSSDEnabled"], + hibernationEnabled: item["hibernationEnabled"], + enableFips1403Encryption: item["enableFips1403Encryption"], + }; +} + +export function additionalCapabilitiesDeserializer(item: any): AdditionalCapabilities { + return { + ultraSSDEnabled: item["ultraSSDEnabled"], + hibernationEnabled: item["hibernationEnabled"], + enableFips1403Encryption: item["enableFips1403Encryption"], + }; +} + +/** Describes a scale-in policy for a virtual machine scale set. */ +export interface ScaleInPolicy { + /** The rules to be followed when scaling-in a virtual machine scale set.

Possible values are:

**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

*/ + rules?: VirtualMachineScaleSetScaleInRules[]; + /** This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview) */ + forceDeletion?: boolean; + /** This property allows you to prioritize the deletion of unhealthy and inactive VMs when a virtual machine scale set is being scaled-in.(Feature in Preview) */ + prioritizeUnhealthyVMs?: boolean; +} + +export function scaleInPolicySerializer(item: ScaleInPolicy): any { + return { + rules: !item["rules"] + ? item["rules"] + : item["rules"].map((p: any) => { + return p; + }), + forceDeletion: item["forceDeletion"], + prioritizeUnhealthyVMs: item["prioritizeUnhealthyVMs"], + }; +} + +export function scaleInPolicyDeserializer(item: any): ScaleInPolicy { + return { + rules: !item["rules"] + ? item["rules"] + : item["rules"].map((p: any) => { + return p; + }), + forceDeletion: item["forceDeletion"], + prioritizeUnhealthyVMs: item["prioritizeUnhealthyVMs"], + }; +} + +/** Known values of {@link VirtualMachineScaleSetScaleInRules} that the service accepts. */ +export enum KnownVirtualMachineScaleSetScaleInRules { + /** Default */ + Default = "Default", + /** OldestVM */ + OldestVM = "OldestVM", + /** NewestVM */ + NewestVM = "NewestVM", +} + +/** Type of VirtualMachineScaleSetScaleInRules */ +export type VirtualMachineScaleSetScaleInRules = string; + +/** Specifies the orchestration mode for the virtual machine scale set. */ +export enum KnownOrchestrationMode { + /** Uniform */ + Uniform = "Uniform", + /** Flexible */ + Flexible = "Flexible", +} + +/** + * Specifies the orchestration mode for the virtual machine scale set. \ + * {@link KnownOrchestrationMode} can be used interchangeably with OrchestrationMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Uniform** \ + * **Flexible** + */ +export type OrchestrationMode = string; + +/** Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability and pricing constraint. */ +export interface SpotRestorePolicy { + /** Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints */ + enabled?: boolean; + /** Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances */ + restoreTimeout?: string; +} + +export function spotRestorePolicySerializer(item: SpotRestorePolicy): any { + return { enabled: item["enabled"], restoreTimeout: item["restoreTimeout"] }; +} + +export function spotRestorePolicyDeserializer(item: any): SpotRestorePolicy { + return { + enabled: item["enabled"], + restoreTimeout: item["restoreTimeout"], + }; +} + +/** Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration mode. With this property the customer is able to specify the base number of regular priority VMs created as the VMSS flex instance scales out and the split between Spot and Regular priority VMs after this base target has been reached. */ +export interface PriorityMixPolicy { + /** The base number of regular priority VMs that will be created in this scale set as it scales out. */ + baseRegularPriorityCount?: number; + /** The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular priority. */ + regularPriorityPercentageAboveBase?: number; +} + +export function priorityMixPolicySerializer(item: PriorityMixPolicy): any { + return { + baseRegularPriorityCount: item["baseRegularPriorityCount"], + regularPriorityPercentageAboveBase: item["regularPriorityPercentageAboveBase"], + }; +} + +export function priorityMixPolicyDeserializer(item: any): PriorityMixPolicy { + return { + baseRegularPriorityCount: item["baseRegularPriorityCount"], + regularPriorityPercentageAboveBase: item["regularPriorityPercentageAboveBase"], + }; +} + +/** Describes an resiliency policy - AutomaticZoneRebalancingPolicy, ResilientVMCreationPolicy, ResilientVMDeletionPolicy and OperationRecoverySettings (version > 2025-11-01). */ +export interface ResiliencyPolicy { + /** The configuration parameters used while performing resilient VM creation. */ + resilientVMCreationPolicy?: ResilientVMCreationPolicy; + /** The configuration parameters used while performing resilient VM deletion. */ + resilientVMDeletionPolicy?: ResilientVMDeletionPolicy; + /** The configuration parameters used while performing automatic AZ balancing. */ + automaticZoneRebalancingPolicy?: AutomaticZoneRebalancingPolicy; + /** The configuration parameters used while performing zone allocation. */ + zoneAllocationPolicy?: ZoneAllocationPolicy; + /** The configuration parameters used for operation recovery settings. */ + operationRecoverySettings?: OperationRecoverySettings; +} + +export function resiliencyPolicySerializer(item: ResiliencyPolicy): any { + return { + resilientVMCreationPolicy: !item["resilientVMCreationPolicy"] + ? item["resilientVMCreationPolicy"] + : resilientVMCreationPolicySerializer(item["resilientVMCreationPolicy"]), + resilientVMDeletionPolicy: !item["resilientVMDeletionPolicy"] + ? item["resilientVMDeletionPolicy"] + : resilientVMDeletionPolicySerializer(item["resilientVMDeletionPolicy"]), + automaticZoneRebalancingPolicy: !item["automaticZoneRebalancingPolicy"] + ? item["automaticZoneRebalancingPolicy"] + : automaticZoneRebalancingPolicySerializer(item["automaticZoneRebalancingPolicy"]), + zoneAllocationPolicy: !item["zoneAllocationPolicy"] + ? item["zoneAllocationPolicy"] + : zoneAllocationPolicySerializer(item["zoneAllocationPolicy"]), + operationRecoverySettings: !item["operationRecoverySettings"] + ? item["operationRecoverySettings"] + : operationRecoverySettingsSerializer(item["operationRecoverySettings"]), + }; +} + +export function resiliencyPolicyDeserializer(item: any): ResiliencyPolicy { + return { + resilientVMCreationPolicy: !item["resilientVMCreationPolicy"] + ? item["resilientVMCreationPolicy"] + : resilientVMCreationPolicyDeserializer(item["resilientVMCreationPolicy"]), + resilientVMDeletionPolicy: !item["resilientVMDeletionPolicy"] + ? item["resilientVMDeletionPolicy"] + : resilientVMDeletionPolicyDeserializer(item["resilientVMDeletionPolicy"]), + automaticZoneRebalancingPolicy: !item["automaticZoneRebalancingPolicy"] + ? item["automaticZoneRebalancingPolicy"] + : automaticZoneRebalancingPolicyDeserializer(item["automaticZoneRebalancingPolicy"]), + zoneAllocationPolicy: !item["zoneAllocationPolicy"] + ? item["zoneAllocationPolicy"] + : zoneAllocationPolicyDeserializer(item["zoneAllocationPolicy"]), + operationRecoverySettings: !item["operationRecoverySettings"] + ? item["operationRecoverySettings"] + : operationRecoverySettingsDeserializer(item["operationRecoverySettings"]), + }; +} + +/** The configuration parameters used while performing resilient VM creation. */ +export interface ResilientVMCreationPolicy { + /** Specifies whether resilient VM creation should be enabled on the virtual machine scale set. The default value is false. */ + enabled?: boolean; +} + +export function resilientVMCreationPolicySerializer(item: ResilientVMCreationPolicy): any { + return { enabled: item["enabled"] }; +} + +export function resilientVMCreationPolicyDeserializer(item: any): ResilientVMCreationPolicy { + return { + enabled: item["enabled"], + }; +} + +/** The configuration parameters used while performing resilient VM deletion. */ +export interface ResilientVMDeletionPolicy { + /** Specifies whether resilient VM deletion should be enabled on the virtual machine scale set. The default value is false. */ + enabled?: boolean; +} + +export function resilientVMDeletionPolicySerializer(item: ResilientVMDeletionPolicy): any { + return { enabled: item["enabled"] }; +} + +export function resilientVMDeletionPolicyDeserializer(item: any): ResilientVMDeletionPolicy { + return { + enabled: item["enabled"], + }; +} + +/** The configuration parameters used while performing automatic AZ balancing. */ +export interface AutomaticZoneRebalancingPolicy { + /** Specifies whether Automatic AZ Balancing should be enabled on the virtual machine scale set. The default value is false. */ + enabled?: boolean; + /** Type of rebalance strategy that will be used for rebalancing virtual machines in the scale set across availability zones. Default and only supported value for now is Recreate. */ + rebalanceStrategy?: RebalanceStrategy; + /** Type of rebalance behavior that will be used for recreating virtual machines in the scale set across availability zones. Default and only supported value for now is CreateBeforeDelete. */ + rebalanceBehavior?: RebalanceBehavior; +} + +export function automaticZoneRebalancingPolicySerializer( + item: AutomaticZoneRebalancingPolicy, +): any { + return { + enabled: item["enabled"], + rebalanceStrategy: item["rebalanceStrategy"], + rebalanceBehavior: item["rebalanceBehavior"], + }; +} + +export function automaticZoneRebalancingPolicyDeserializer( + item: any, +): AutomaticZoneRebalancingPolicy { + return { + enabled: item["enabled"], + rebalanceStrategy: item["rebalanceStrategy"], + rebalanceBehavior: item["rebalanceBehavior"], + }; +} + +/** Type of rebalance strategy that will be used for rebalancing virtual machines in the scale set across availability zones. Default and only supported value for now is Recreate. */ +export enum KnownRebalanceStrategy { + /** Recreate */ + Recreate = "Recreate", +} + +/** + * Type of rebalance strategy that will be used for rebalancing virtual machines in the scale set across availability zones. Default and only supported value for now is Recreate. \ + * {@link KnownRebalanceStrategy} can be used interchangeably with RebalanceStrategy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Recreate** + */ +export type RebalanceStrategy = string; + +/** Type of rebalance behavior that will be used for recreating virtual machines in the scale set across availability zones. Default and only supported value for now is CreateBeforeDelete. */ +export enum KnownRebalanceBehavior { + /** CreateBeforeDelete */ + CreateBeforeDelete = "CreateBeforeDelete", +} + +/** + * Type of rebalance behavior that will be used for recreating virtual machines in the scale set across availability zones. Default and only supported value for now is CreateBeforeDelete. \ + * {@link KnownRebalanceBehavior} can be used interchangeably with RebalanceBehavior, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CreateBeforeDelete** + */ +export type RebalanceBehavior = string; + +/** The configuration parameters for zone allocation of a virtual machine scale set. */ +export interface ZoneAllocationPolicy { + /** The maximum number of availability zones to use if the ZonePlacementPolicy is 'Auto'. If not specified, all availability zones will be used. */ + maxZoneCount?: number; + /** The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set. */ + maxInstancePercentPerZonePolicy?: MaxInstancePercentPerZonePolicy; +} + +export function zoneAllocationPolicySerializer(item: ZoneAllocationPolicy): any { + return { + maxZoneCount: item["maxZoneCount"], + maxInstancePercentPerZonePolicy: !item["maxInstancePercentPerZonePolicy"] + ? item["maxInstancePercentPerZonePolicy"] + : maxInstancePercentPerZonePolicySerializer(item["maxInstancePercentPerZonePolicy"]), + }; +} + +export function zoneAllocationPolicyDeserializer(item: any): ZoneAllocationPolicy { + return { + maxZoneCount: item["maxZoneCount"], + maxInstancePercentPerZonePolicy: !item["maxInstancePercentPerZonePolicy"] + ? item["maxInstancePercentPerZonePolicy"] + : maxInstancePercentPerZonePolicyDeserializer(item["maxInstancePercentPerZonePolicy"]), + }; +} + +/** The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set. */ +export interface MaxInstancePercentPerZonePolicy { + /** Specifies whether maxInstancePercentPerZonePolicy should be enabled on the virtual machine scale set. */ + enabled?: boolean; + /** Limit on the number of instances in each zone as a percentage of the total capacity of the virtual machine scale set. */ + value?: number; +} + +export function maxInstancePercentPerZonePolicySerializer( + item: MaxInstancePercentPerZonePolicy, +): any { + return { enabled: item["enabled"], value: item["value"] }; +} + +export function maxInstancePercentPerZonePolicyDeserializer( + item: any, +): MaxInstancePercentPerZonePolicy { + return { + enabled: item["enabled"], + value: item["value"], + }; +} + +/** The configuration parameters used for operation recovery settings on a virtual machine scale set. */ +export interface OperationRecoverySettings { + /** The configuration parameters used for restart recovery policy. */ + restartRecoveryPolicy?: RestartRecoveryPolicy; + /** The configuration parameters used for start recovery policy. */ + startRecoveryPolicy?: StartRecoveryPolicy; + /** The configuration parameters used for reimage recovery policy. */ + reimageRecoveryPolicy?: ReimageRecoveryPolicy; +} + +export function operationRecoverySettingsSerializer(item: OperationRecoverySettings): any { + return { + restartRecoveryPolicy: !item["restartRecoveryPolicy"] + ? item["restartRecoveryPolicy"] + : restartRecoveryPolicySerializer(item["restartRecoveryPolicy"]), + startRecoveryPolicy: !item["startRecoveryPolicy"] + ? item["startRecoveryPolicy"] + : startRecoveryPolicySerializer(item["startRecoveryPolicy"]), + reimageRecoveryPolicy: !item["reimageRecoveryPolicy"] + ? item["reimageRecoveryPolicy"] + : reimageRecoveryPolicySerializer(item["reimageRecoveryPolicy"]), + }; +} + +export function operationRecoverySettingsDeserializer(item: any): OperationRecoverySettings { + return { + restartRecoveryPolicy: !item["restartRecoveryPolicy"] + ? item["restartRecoveryPolicy"] + : restartRecoveryPolicyDeserializer(item["restartRecoveryPolicy"]), + startRecoveryPolicy: !item["startRecoveryPolicy"] + ? item["startRecoveryPolicy"] + : startRecoveryPolicyDeserializer(item["startRecoveryPolicy"]), + reimageRecoveryPolicy: !item["reimageRecoveryPolicy"] + ? item["reimageRecoveryPolicy"] + : reimageRecoveryPolicyDeserializer(item["reimageRecoveryPolicy"]), + }; +} + +/** The configuration parameters used while performing restart recovery. */ +export interface RestartRecoveryPolicy { + /** Specifies whether restart recovery should be enabled. The default value is false. */ + enabled?: boolean; +} + +export function restartRecoveryPolicySerializer(item: RestartRecoveryPolicy): any { + return { enabled: item["enabled"] }; +} + +export function restartRecoveryPolicyDeserializer(item: any): RestartRecoveryPolicy { + return { + enabled: item["enabled"], + }; +} + +/** The configuration parameters used while performing start recovery. */ +export interface StartRecoveryPolicy { + /** Specifies whether start recovery should be enabled. The default value is false. */ + enabled?: boolean; +} + +export function startRecoveryPolicySerializer(item: StartRecoveryPolicy): any { + return { enabled: item["enabled"] }; +} + +export function startRecoveryPolicyDeserializer(item: any): StartRecoveryPolicy { + return { + enabled: item["enabled"], + }; +} + +/** The configuration parameters used while performing reimage recovery. */ +export interface ReimageRecoveryPolicy { + /** Specifies whether reimage recovery should be enabled. The default value is false. */ + enabled?: boolean; +} + +export function reimageRecoveryPolicySerializer(item: ReimageRecoveryPolicy): any { + return { enabled: item["enabled"] }; +} + +export function reimageRecoveryPolicyDeserializer(item: any): ReimageRecoveryPolicy { + return { + enabled: item["enabled"], + }; +} + +/** Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. */ +export enum KnownZonalPlatformFaultDomainAlignMode { + /** Aligned */ + Aligned = "Aligned", + /** Unaligned */ + Unaligned = "Unaligned", + /** Offload Alignment to VMSS. VMSS aligns disks that support enough Storage Fault Domains, while keeping others unaligned. */ + BestEffortAligned = "BestEffortAligned", +} + +/** + * Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. \ + * {@link KnownZonalPlatformFaultDomainAlignMode} can be used interchangeably with ZonalPlatformFaultDomainAlignMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Aligned** \ + * **Unaligned** \ + * **BestEffortAligned**: Offload Alignment to VMSS. VMSS aligns disks that support enough Storage Fault Domains, while keeping others unaligned. + */ +export type ZonalPlatformFaultDomainAlignMode = string; + +/** Specifies the sku profile for the virtual machine scale set. With this property the customer is able to specify a list of VM sizes and an allocation strategy. */ +export interface SkuProfile { + /** Specifies the VM sizes for the virtual machine scale set. */ + vmSizes?: SkuProfileVMSize[]; + /** Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. */ + allocationStrategy?: AllocationStrategy; +} + +export function skuProfileSerializer(item: SkuProfile): any { + return { + vmSizes: !item["vmSizes"] ? item["vmSizes"] : skuProfileVMSizeArraySerializer(item["vmSizes"]), + allocationStrategy: item["allocationStrategy"], + }; +} + +export function skuProfileDeserializer(item: any): SkuProfile { + return { + vmSizes: !item["vmSizes"] + ? item["vmSizes"] + : skuProfileVMSizeArrayDeserializer(item["vmSizes"]), + allocationStrategy: item["allocationStrategy"], + }; +} + +export function skuProfileVMSizeArraySerializer(result: Array): any[] { + return result.map((item) => { + return skuProfileVMSizeSerializer(item); + }); +} + +export function skuProfileVMSizeArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuProfileVMSizeDeserializer(item); + }); +} + +/** Specifies the VM Size. */ +export interface SkuProfileVMSize { + /** Specifies the name of the VM Size. */ + name?: string; + /** Specifies the rank (a.k.a priority) associated with the VM Size. */ + rank?: number; +} + +export function skuProfileVMSizeSerializer(item: SkuProfileVMSize): any { + return { name: item["name"], rank: item["rank"] }; +} + +export function skuProfileVMSizeDeserializer(item: any): SkuProfileVMSize { + return { + name: item["name"], + rank: item["rank"], + }; +} + +/** Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. */ +export enum KnownAllocationStrategy { + /** LowestPrice */ + LowestPrice = "LowestPrice", + /** CapacityOptimized */ + CapacityOptimized = "CapacityOptimized", + /** Prioritized */ + Prioritized = "Prioritized", +} + +/** + * Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. \ + * {@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** \ + * **CapacityOptimized** \ + * **Prioritized** + */ +export type AllocationStrategy = string; + +/** Specifies the high speed interconnect placement for the virtual machine scale set. */ +export enum KnownHighSpeedInterconnectPlacement { + /** No high speed interconnect placement */ + None = "None", + /** Trunk high speed interconnect placement */ + Trunk = "Trunk", +} + +/** + * Specifies the high speed interconnect placement for the virtual machine scale set. \ + * {@link KnownHighSpeedInterconnectPlacement} can be used interchangeably with HighSpeedInterconnectPlacement, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No high speed interconnect placement \ + * **Trunk**: Trunk high speed interconnect placement + */ +export type HighSpeedInterconnectPlacement = string; + +/** Specifies the lifecycle hooks profile for the virtual machine scale set. */ +export interface LifecycleHooksProfile { + /** Specifies the lifecycle hooks configured for the virtual machine scale set. */ + lifecycleHooks?: LifecycleHook[]; +} + +export function lifecycleHooksProfileSerializer(item: LifecycleHooksProfile): any { + return { + lifecycleHooks: !item["lifecycleHooks"] + ? item["lifecycleHooks"] + : lifecycleHookArraySerializer(item["lifecycleHooks"]), + }; +} + +export function lifecycleHooksProfileDeserializer(item: any): LifecycleHooksProfile { + return { + lifecycleHooks: !item["lifecycleHooks"] + ? item["lifecycleHooks"] + : lifecycleHookArrayDeserializer(item["lifecycleHooks"]), + }; +} + +export function lifecycleHookArraySerializer(result: Array): any[] { + return result.map((item) => { + return lifecycleHookSerializer(item); + }); +} + +export function lifecycleHookArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return lifecycleHookDeserializer(item); + }); +} + +/** Describes a lifecycle hook. */ +export interface LifecycleHook { + /** Specifies the type of the lifecycle hook. */ + type?: VMScaleSetLifecycleHookEventType; + /** Specifies the time duration a virtual machine scale set lifecycle hook event sent to the customer waits for a response from the customer. It should be in ISO 8601 format. */ + waitDuration?: string; + /** Specifies the action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil. */ + defaultAction?: LifecycleHookAction; +} + +export function lifecycleHookSerializer(item: LifecycleHook): any { + return { + type: item["type"], + waitDuration: item["waitDuration"], + defaultAction: item["defaultAction"], + }; +} + +export function lifecycleHookDeserializer(item: any): LifecycleHook { + return { + type: item["type"], + waitDuration: item["waitDuration"], + defaultAction: item["defaultAction"], + }; +} + +/** Specifies the scenario for which the customer is interested in receiving virtual machine scale set lifecycle hook events. */ +export enum KnownVMScaleSetLifecycleHookEventType { + /** Lifecycle hook event sent to the customer before an Auto OS Upgrade operation starts on the virtual machine scale set. */ + UpgradeAutoOSScheduling = "UpgradeAutoOSScheduling", + /** Lifecycle hook event sent to the customer before upgrade starts on a batch of virtual machines belonging to a virtual machine scale set during an Auto OS Upgrade operation. */ + UpgradeAutoOSRollingBatchStarting = "UpgradeAutoOSRollingBatchStarting", +} + +/** + * Specifies the scenario for which the customer is interested in receiving virtual machine scale set lifecycle hook events. \ + * {@link KnownVMScaleSetLifecycleHookEventType} can be used interchangeably with VMScaleSetLifecycleHookEventType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **UpgradeAutoOSScheduling**: Lifecycle hook event sent to the customer before an Auto OS Upgrade operation starts on the virtual machine scale set. \ + * **UpgradeAutoOSRollingBatchStarting**: Lifecycle hook event sent to the customer before upgrade starts on a batch of virtual machines belonging to a virtual machine scale set during an Auto OS Upgrade operation. + */ +export type VMScaleSetLifecycleHookEventType = string; + +/** The action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil. */ +export enum KnownLifecycleHookAction { + /** The lifecycle hook of a target resource in a lifecycle hook event will be approved. */ + Approve = "Approve", + /** The lifecycle hook of a target resource in a lifecycle hook event will be rejected. */ + Reject = "Reject", +} + +/** + * The action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil. \ + * {@link KnownLifecycleHookAction} can be used interchangeably with LifecycleHookAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approve**: The lifecycle hook of a target resource in a lifecycle hook event will be approved. \ + * **Reject**: The lifecycle hook of a target resource in a lifecycle hook event will be rejected. + */ +export type LifecycleHookAction = string; + +/** Specifies the external health policy for the virtual machine scale set. */ +export interface ExternalHealthPolicy { + /** If true, external health is enabled for this scale set. Cannot be set to true on instances where another health monitoring source is active (ApplicationHealth extension or SLB). Defaults to false. */ + enabled?: boolean; + /** Defines how long the health status set by External Health API will last on the VM. If a signal is not received/updated within this time, the VM Health will be marked as "unknown". Uses the ISO 8601 format. Minimum: 5 minutes (PT5M), Maximum: 3 hours (PT3H). */ + expiryDuration?: string; + /** Grace period for newly created VMs or when the External Health policy is first applied on VMSS. Uses the ISO 8601 format. Minimum: 5 minutes (PT5M), Maximum: 4 hours (PT4H). */ + gracePeriod?: string; +} + +export function externalHealthPolicySerializer(item: ExternalHealthPolicy): any { + return { + enabled: item["enabled"], + expiryDuration: item["expiryDuration"], + gracePeriod: item["gracePeriod"], + }; +} + +export function externalHealthPolicyDeserializer(item: any): ExternalHealthPolicy { + return { + enabled: item["enabled"], + expiryDuration: item["expiryDuration"], + gracePeriod: item["gracePeriod"], + }; +} + +/** Identity for the virtual machine scale set. */ +export interface VirtualMachineScaleSetIdentity { + /** The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. */ + readonly principalId?: string; + /** The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. */ + type?: ResourceIdentityType; + /** The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: Record; +} + +export function virtualMachineScaleSetIdentitySerializer( + item: VirtualMachineScaleSetIdentity, +): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function virtualMachineScaleSetIdentityDeserializer( + item: any, +): VirtualMachineScaleSetIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** Describes the user-defined constraints for resource hardware placement. */ +export interface Placement { + /** Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation. */ + zonePlacementPolicy?: ZonePlacementPolicyType; + /** This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection. */ + includeZones?: string[]; + /** This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection. */ + excludeZones?: string[]; +} + +export function placementSerializer(item: Placement): any { + return { + zonePlacementPolicy: item["zonePlacementPolicy"], + includeZones: !item["includeZones"] + ? item["includeZones"] + : item["includeZones"].map((p: any) => { + return p; + }), + excludeZones: !item["excludeZones"] + ? item["excludeZones"] + : item["excludeZones"].map((p: any) => { + return p; + }), + }; +} + +export function placementDeserializer(item: any): Placement { + return { + zonePlacementPolicy: item["zonePlacementPolicy"], + includeZones: !item["includeZones"] + ? item["includeZones"] + : item["includeZones"].map((p: any) => { + return p; + }), + excludeZones: !item["excludeZones"] + ? item["excludeZones"] + : item["excludeZones"].map((p: any) => { + return p; + }), + }; +} + +/** Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation. */ +export enum KnownZonePlacementPolicyType { + /** Any */ + Any = "Any", + /** Automatic zone placement in a Virtual Machine Scale Set. */ + Auto = "Auto", +} + +/** + * Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation. \ + * {@link KnownZonePlacementPolicyType} can be used interchangeably with ZonePlacementPolicyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Any** \ + * **Auto**: Automatic zone placement in a Virtual Machine Scale Set. + */ +export type ZonePlacementPolicyType = string; + +/** Describes a Virtual Machine Scale Set. */ +export interface VirtualMachineScaleSetUpdate extends UpdateResource { + /** The virtual machine scale set sku. */ + sku?: Sku; + /** The purchase plan when deploying a virtual machine scale set from VM Marketplace images. */ + plan?: Plan; + /** The identity of the virtual machine scale set, if configured. */ + identity?: VirtualMachineScaleSetIdentity; + /** The virtual machine scale set zones. */ + zones?: string[]; + /** User-defined constraints for virtual machine scale set hardware placement. */ + placement?: Placement; + /** The upgrade policy. */ + upgradePolicy?: UpgradePolicy; + /** Policy for automatic repairs. */ + automaticRepairsPolicy?: AutomaticRepairsPolicy; + /** The virtual machine profile. */ + virtualMachineProfile?: VirtualMachineScaleSetUpdateVMProfile; + /** Specifies whether the Virtual Machine Scale Set should be overprovisioned. */ + overprovision?: boolean; + /** When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. */ + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + /** When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. */ + singlePlacementGroup?: boolean; + /** Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ + additionalCapabilities?: AdditionalCapabilities; + /** Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. */ + scaleInPolicy?: ScaleInPolicy; + /** Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. */ + priorityMixPolicy?: PriorityMixPolicy; + /** Specifies the Spot Restore properties for the virtual machine scale set. */ + spotRestorePolicy?: SpotRestorePolicy; + /** Policy for Resiliency */ + resiliencyPolicy?: ResiliencyPolicy; + /** Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. */ + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + /** Specifies the sku profile for the virtual machine scale set. */ + skuProfile?: SkuProfile; + /** Specifies the lifecycle hooks profile for the virtual machine scale set. */ + lifecycleHooksProfile?: LifecycleHooksProfile; +} + +export function virtualMachineScaleSetUpdateSerializer(item: VirtualMachineScaleSetUpdate): any { + return { + tags: item["tags"], + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + plan: !item["plan"] ? item["plan"] : planSerializer(item["plan"]), + properties: areAllPropsUndefined(item, [ + "upgradePolicy", + "automaticRepairsPolicy", + "virtualMachineProfile", + "overprovision", + "doNotRunExtensionsOnOverprovisionedVMs", + "singlePlacementGroup", + "additionalCapabilities", + "scaleInPolicy", + "proximityPlacementGroup", + "priorityMixPolicy", + "spotRestorePolicy", + "resiliencyPolicy", + "zonalPlatformFaultDomainAlignMode", + "skuProfile", + "lifecycleHooksProfile", + ]) + ? undefined + : _virtualMachineScaleSetUpdatePropertiesSerializer(item), + identity: !item["identity"] + ? item["identity"] + : virtualMachineScaleSetIdentitySerializer(item["identity"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + placement: !item["placement"] ? item["placement"] : placementSerializer(item["placement"]), + }; +} + +/** Describes the properties of a Virtual Machine Scale Set. */ +export interface VirtualMachineScaleSetUpdateProperties { + /** The upgrade policy. */ + upgradePolicy?: UpgradePolicy; + /** Policy for automatic repairs. */ + automaticRepairsPolicy?: AutomaticRepairsPolicy; + /** The virtual machine profile. */ + virtualMachineProfile?: VirtualMachineScaleSetUpdateVMProfile; + /** Specifies whether the Virtual Machine Scale Set should be overprovisioned. */ + overprovision?: boolean; + /** When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. */ + doNotRunExtensionsOnOverprovisionedVMs?: boolean; + /** When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. */ + singlePlacementGroup?: boolean; + /** Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ + additionalCapabilities?: AdditionalCapabilities; + /** Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. */ + scaleInPolicy?: ScaleInPolicy; + /** Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. */ + priorityMixPolicy?: PriorityMixPolicy; + /** Specifies the Spot Restore properties for the virtual machine scale set. */ + spotRestorePolicy?: SpotRestorePolicy; + /** Policy for Resiliency */ + resiliencyPolicy?: ResiliencyPolicy; + /** Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. */ + zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; + /** Specifies the sku profile for the virtual machine scale set. */ + skuProfile?: SkuProfile; + /** Specifies the lifecycle hooks profile for the virtual machine scale set. */ + lifecycleHooksProfile?: LifecycleHooksProfile; +} + +export function virtualMachineScaleSetUpdatePropertiesSerializer( + item: VirtualMachineScaleSetUpdateProperties, +): any { + return { + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicySerializer(item["upgradePolicy"]), + automaticRepairsPolicy: !item["automaticRepairsPolicy"] + ? item["automaticRepairsPolicy"] + : automaticRepairsPolicySerializer(item["automaticRepairsPolicy"]), + virtualMachineProfile: !item["virtualMachineProfile"] + ? item["virtualMachineProfile"] + : virtualMachineScaleSetUpdateVMProfileSerializer(item["virtualMachineProfile"]), + overprovision: item["overprovision"], + doNotRunExtensionsOnOverprovisionedVMs: item["doNotRunExtensionsOnOverprovisionedVMs"], + singlePlacementGroup: item["singlePlacementGroup"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesSerializer(item["additionalCapabilities"]), + scaleInPolicy: !item["scaleInPolicy"] + ? item["scaleInPolicy"] + : scaleInPolicySerializer(item["scaleInPolicy"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + priorityMixPolicy: !item["priorityMixPolicy"] + ? item["priorityMixPolicy"] + : priorityMixPolicySerializer(item["priorityMixPolicy"]), + spotRestorePolicy: !item["spotRestorePolicy"] + ? item["spotRestorePolicy"] + : spotRestorePolicySerializer(item["spotRestorePolicy"]), + resiliencyPolicy: !item["resiliencyPolicy"] + ? item["resiliencyPolicy"] + : resiliencyPolicySerializer(item["resiliencyPolicy"]), + zonalPlatformFaultDomainAlignMode: item["zonalPlatformFaultDomainAlignMode"], + skuProfile: !item["skuProfile"] ? item["skuProfile"] : skuProfileSerializer(item["skuProfile"]), + lifecycleHooksProfile: !item["lifecycleHooksProfile"] + ? item["lifecycleHooksProfile"] + : lifecycleHooksProfileSerializer(item["lifecycleHooksProfile"]), + }; +} + +/** Describes a virtual machine scale set virtual machine profile. */ +export interface VirtualMachineScaleSetUpdateVMProfile { + /** The virtual machine scale set OS profile. */ + osProfile?: VirtualMachineScaleSetUpdateOSProfile; + /** The virtual machine scale set storage profile. */ + storageProfile?: VirtualMachineScaleSetUpdateStorageProfile; + /** The virtual machine scale set network profile. */ + networkProfile?: VirtualMachineScaleSetUpdateNetworkProfile; + /** The virtual machine scale set security posture reference. */ + securityPostureReference?: SecurityPostureReferenceUpdate; + /** The virtual machine scale set Security profile */ + securityProfile?: SecurityProfile; + /** The virtual machine scale set diagnostics profile. */ + diagnosticsProfile?: DiagnosticsProfile; + /** The virtual machine scale set extension profile. */ + extensionProfile?: VirtualMachineScaleSetExtensionProfile; + /** The license type, which is for bring your own license scenario. */ + licenseType?: string; + /** Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. */ + billingProfile?: BillingProfile; + /** 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 api-version: 2021-03-01 */ + userData?: string; + /** Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. */ + hardwareProfile?: VirtualMachineScaleSetHardwareProfile; +} + +export function virtualMachineScaleSetUpdateVMProfileSerializer( + item: VirtualMachineScaleSetUpdateVMProfile, +): any { + return { + osProfile: !item["osProfile"] + ? item["osProfile"] + : virtualMachineScaleSetUpdateOSProfileSerializer(item["osProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : virtualMachineScaleSetUpdateStorageProfileSerializer(item["storageProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : virtualMachineScaleSetUpdateNetworkProfileSerializer(item["networkProfile"]), + securityPostureReference: !item["securityPostureReference"] + ? item["securityPostureReference"] + : securityPostureReferenceUpdateSerializer(item["securityPostureReference"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileSerializer(item["securityProfile"]), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileSerializer(item["diagnosticsProfile"]), + extensionProfile: !item["extensionProfile"] + ? item["extensionProfile"] + : virtualMachineScaleSetExtensionProfileSerializer(item["extensionProfile"]), + licenseType: item["licenseType"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileSerializer(item["billingProfile"]), + scheduledEventsProfile: !item["scheduledEventsProfile"] + ? item["scheduledEventsProfile"] + : scheduledEventsProfileSerializer(item["scheduledEventsProfile"]), + userData: item["userData"], + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : virtualMachineScaleSetHardwareProfileSerializer(item["hardwareProfile"]), + }; +} + +/** Describes a virtual machine scale set OS profile. */ +export interface VirtualMachineScaleSetUpdateOSProfile { + /** A base-64 encoded string of custom data. */ + customData?: string; + /** The Windows Configuration of the OS profile. */ + windowsConfiguration?: WindowsConfiguration; + /** The Linux Configuration of the OS profile. */ + linuxConfiguration?: LinuxConfiguration; + /** The List of certificates for addition to the VM. */ + secrets?: VaultSecretGroup[]; +} + +export function virtualMachineScaleSetUpdateOSProfileSerializer( + item: VirtualMachineScaleSetUpdateOSProfile, +): any { + return { + 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"]), + }; +} + +/** Describes a virtual machine scale set storage profile. */ +export interface VirtualMachineScaleSetUpdateStorageProfile { + /** The image reference. */ + imageReference?: ImageReference; + /** The OS disk. */ + osDisk?: VirtualMachineScaleSetUpdateOSDisk; + /** The data disks. */ + dataDisks?: VirtualMachineScaleSetDataDisk[]; + /** Specifies the disk controller type configured for the virtual machines in the scale set. **Note:** You need to deallocate the virtual machines in the scale set before updating its disk controller type based on the upgrade mode configured for the scale set. Minimum api-version: 2022-08-01 */ + diskControllerType?: DiskControllerTypes; +} + +export function virtualMachineScaleSetUpdateStorageProfileSerializer( + item: VirtualMachineScaleSetUpdateStorageProfile, +): any { + return { + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageReferenceSerializer(item["imageReference"]), + osDisk: !item["osDisk"] + ? item["osDisk"] + : virtualMachineScaleSetUpdateOSDiskSerializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : virtualMachineScaleSetDataDiskArraySerializer(item["dataDisks"]), + diskControllerType: item["diskControllerType"], + }; +} + +/** Describes virtual machine scale set operating system disk Update Object. This should be used for Updating VMSS OS Disk. */ +export interface VirtualMachineScaleSetUpdateOSDisk { + /** The caching type. */ + 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 scale set. */ + diffDiskSettings?: DiffDiskSettings; + /** 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.

diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 */ + diskSizeGB?: number; + /** Specifies the storage fault domain alignment type for the disk. */ + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + /** The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. */ + image?: VirtualHardDisk; + /** The list of virtual hard disk container uris. */ + vhdContainers?: string[]; + /** The managed disk parameters. */ + managedDisk?: VirtualMachineScaleSetManagedDiskParameters; + /** Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

**Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.

**Detach** If this value is used, the OS disk is retained after VMSS Flex VM is deleted.

The default value is set to **Delete**. For an Ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. */ + deleteOption?: DiskDeleteOptionTypes; +} + +export function virtualMachineScaleSetUpdateOSDiskSerializer( + item: VirtualMachineScaleSetUpdateOSDisk, +): any { + return { + caching: item["caching"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + diffDiskSettings: !item["diffDiskSettings"] + ? item["diffDiskSettings"] + : diffDiskSettingsSerializer(item["diffDiskSettings"]), + diskSizeGB: item["diskSizeGB"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + image: !item["image"] ? item["image"] : virtualHardDiskSerializer(item["image"]), + vhdContainers: !item["vhdContainers"] + ? item["vhdContainers"] + : item["vhdContainers"].map((p: any) => { + return p; + }), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : virtualMachineScaleSetManagedDiskParametersSerializer(item["managedDisk"]), + deleteOption: item["deleteOption"], + }; +} + +/** Describes a virtual machine scale set network profile. */ +export interface VirtualMachineScaleSetUpdateNetworkProfile { + /** A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. */ + healthProbe?: ApiEntityReference; + /** The list of network configurations. */ + networkInterfaceConfigurations?: VirtualMachineScaleSetUpdateNetworkConfiguration[]; + /** specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible' */ + networkApiVersion?: NetworkApiVersion; +} + +export function virtualMachineScaleSetUpdateNetworkProfileSerializer( + item: VirtualMachineScaleSetUpdateNetworkProfile, +): any { + return { + healthProbe: !item["healthProbe"] + ? item["healthProbe"] + : apiEntityReferenceSerializer(item["healthProbe"]), + networkInterfaceConfigurations: !item["networkInterfaceConfigurations"] + ? item["networkInterfaceConfigurations"] + : virtualMachineScaleSetUpdateNetworkConfigurationArraySerializer( + item["networkInterfaceConfigurations"], + ), + networkApiVersion: item["networkApiVersion"], + }; +} + +export function virtualMachineScaleSetUpdateNetworkConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetUpdateNetworkConfigurationSerializer(item); + }); +} + +/** Describes a virtual machine scale set network profile's network configurations. */ +export interface VirtualMachineScaleSetUpdateNetworkConfiguration { + /** The network configuration name. */ + name?: string; + /** Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration */ + tags?: Record; + /** Whether this is a primary NIC on a virtual machine. */ + primary?: boolean; + /** 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; + /** The network security group. */ + networkSecurityGroup?: SubResource; + /** The dns settings to be applied on the network interfaces. */ + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + /** The virtual machine scale set IP Configuration. */ + ipConfigurations?: VirtualMachineScaleSetUpdateIPConfiguration[]; + /** Whether IP forwarding enabled on this NIC. */ + enableIPForwarding?: boolean; + /** Specify what happens to the network interface when the VM is deleted */ + deleteOption?: DeleteOptions; + /** 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 virtualMachineScaleSetUpdateNetworkConfigurationSerializer( + item: VirtualMachineScaleSetUpdateNetworkConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "primary", + "enableAcceleratedNetworking", + "disableTcpStateTracking", + "enableFpga", + "networkSecurityGroup", + "dnsSettings", + "ipConfigurations", + "enableIPForwarding", + "deleteOption", + "auxiliaryMode", + "auxiliarySku", + ]) + ? undefined + : _virtualMachineScaleSetUpdateNetworkConfigurationPropertiesSerializer(item), + tags: item["tags"], + }; +} + +/** Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network profile's IP Configuration. */ +export interface VirtualMachineScaleSetUpdateNetworkConfigurationProperties { + /** Whether this is a primary NIC on a virtual machine. */ + primary?: boolean; + /** 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; + /** The network security group. */ + networkSecurityGroup?: SubResource; + /** The dns settings to be applied on the network interfaces. */ + dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; + /** The virtual machine scale set IP Configuration. */ + ipConfigurations?: VirtualMachineScaleSetUpdateIPConfiguration[]; + /** Whether IP forwarding enabled on this NIC. */ + enableIPForwarding?: boolean; + /** Specify what happens to the network interface when the VM is deleted */ + deleteOption?: DeleteOptions; + /** 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 virtualMachineScaleSetUpdateNetworkConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetUpdateNetworkConfigurationProperties, +): any { + return { + primary: item["primary"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceSerializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetNetworkConfigurationDnsSettingsSerializer(item["dnsSettings"]), + ipConfigurations: !item["ipConfigurations"] + ? item["ipConfigurations"] + : virtualMachineScaleSetUpdateIPConfigurationArraySerializer(item["ipConfigurations"]), + enableIPForwarding: item["enableIPForwarding"], + deleteOption: item["deleteOption"], + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function virtualMachineScaleSetUpdateIPConfigurationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetUpdateIPConfigurationSerializer(item); + }); +} + +/** Describes a virtual machine scale set network profile's IP configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual network */ +export interface VirtualMachineScaleSetUpdateIPConfiguration { + /** The IP configuration name. */ + name?: string; + /** The subnet. */ + subnet?: ApiEntityReference; + /** Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. */ + primary?: boolean; + /** The publicIPAddressConfiguration. */ + publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; + /** 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?: IPVersion; + /** The application gateway backend address pools. */ + applicationGatewayBackendAddressPools?: SubResource[]; + /** Specifies an array of references to application security group. */ + applicationSecurityGroups?: SubResource[]; + /** The load balancer backend address pools. */ + loadBalancerBackendAddressPools?: SubResource[]; + /** The load balancer inbound nat pools. */ + loadBalancerInboundNatPools?: SubResource[]; +} + +export function virtualMachineScaleSetUpdateIPConfigurationSerializer( + item: VirtualMachineScaleSetUpdateIPConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "subnet", + "primary", + "publicIPAddressConfiguration", + "privateIPAddressVersion", + "applicationGatewayBackendAddressPools", + "applicationSecurityGroups", + "loadBalancerBackendAddressPools", + "loadBalancerInboundNatPools", + ]) + ? undefined + : _virtualMachineScaleSetUpdateIPConfigurationPropertiesSerializer(item), + }; +} + +/** Describes a virtual machine scale set network profile's IP configuration properties. */ +export interface VirtualMachineScaleSetUpdateIPConfigurationProperties { + /** The subnet. */ + subnet?: ApiEntityReference; + /** Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. */ + primary?: boolean; + /** The publicIPAddressConfiguration. */ + publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; + /** 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?: IPVersion; + /** The application gateway backend address pools. */ + applicationGatewayBackendAddressPools?: SubResource[]; + /** Specifies an array of references to application security group. */ + applicationSecurityGroups?: SubResource[]; + /** The load balancer backend address pools. */ + loadBalancerBackendAddressPools?: SubResource[]; + /** The load balancer inbound nat pools. */ + loadBalancerInboundNatPools?: SubResource[]; +} + +export function virtualMachineScaleSetUpdateIPConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetUpdateIPConfigurationProperties, +): any { + return { + subnet: !item["subnet"] ? item["subnet"] : apiEntityReferenceSerializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachineScaleSetUpdatePublicIPAddressConfigurationSerializer( + item["publicIPAddressConfiguration"], + ), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArraySerializer(item["applicationGatewayBackendAddressPools"]), + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArraySerializer(item["applicationSecurityGroups"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArraySerializer(item["loadBalancerBackendAddressPools"]), + loadBalancerInboundNatPools: !item["loadBalancerInboundNatPools"] + ? item["loadBalancerInboundNatPools"] + : subResourceArraySerializer(item["loadBalancerInboundNatPools"]), + }; +} + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ +export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { + /** The publicIP address configuration name. */ + name?: string; + /** Resource tags applied to the publicIP address created by this PublicIPAddressConfiguration */ + tags?: Record; + /** The idle timeout of the public IP address. */ + idleTimeoutInMinutes?: number; + /** The dns settings to be applied on the publicIP addresses . */ + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + /** The PublicIPPrefix from which to allocate publicIP addresses. */ + publicIPPrefix?: SubResource; + /** Specify what happens to the public IP when the VM is deleted */ + deleteOption?: DeleteOptions; +} + +export function virtualMachineScaleSetUpdatePublicIPAddressConfigurationSerializer( + item: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "idleTimeoutInMinutes", + "dnsSettings", + "publicIPPrefix", + "deleteOption", + ]) + ? undefined + : _virtualMachineScaleSetUpdatePublicIPAddressConfigurationPropertiesSerializer(item), + tags: item["tags"], + }; +} + +/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ +export interface VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties { + /** The idle timeout of the public IP address. */ + idleTimeoutInMinutes?: number; + /** The dns settings to be applied on the publicIP addresses . */ + dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; + /** The PublicIPPrefix from which to allocate publicIP addresses. */ + publicIPPrefix?: SubResource; + /** Specify what happens to the public IP when the VM is deleted */ + deleteOption?: DeleteOptions; +} + +export function virtualMachineScaleSetUpdatePublicIPAddressConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties, +): any { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsSerializer( + item["dnsSettings"], + ), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceSerializer(item["publicIPPrefix"]), + deleteOption: item["deleteOption"], + }; +} + +/** Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01 */ +export interface SecurityPostureReferenceUpdate { + /** The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest */ + id?: string; + /** The list of virtual machine extension names to exclude when applying the security posture. */ + excludeExtensions?: string[]; + /** Whether the security posture can be overridden by the user. */ + isOverridable?: boolean; +} + +export function securityPostureReferenceUpdateSerializer( + item: SecurityPostureReferenceUpdate, +): any { + return { + id: item["id"], + excludeExtensions: !item["excludeExtensions"] + ? item["excludeExtensions"] + : item["excludeExtensions"].map((p: any) => { + return p; + }), + isOverridable: item["isOverridable"], + }; +} + +/** The Update Resource model definition. */ +export interface UpdateResource { + /** Resource tags */ + tags?: Record; +} + +export function updateResourceSerializer(item: UpdateResource): any { + return { tags: item["tags"] }; +} + +/** The List Virtual Machine operation response. */ +export interface _VirtualMachineScaleSetListResult { + /** The list of virtual machine scale sets. */ + value: VirtualMachineScaleSet[]; + /** The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. */ + nextLink?: string; +} + +export function _virtualMachineScaleSetListResultDeserializer( + item: any, +): _VirtualMachineScaleSetListResult { + return { + value: virtualMachineScaleSetArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineScaleSetArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetSerializer(item); + }); +} + +export function virtualMachineScaleSetArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetDeserializer(item); + }); +} + +/** The List Virtual Machine operation response. */ +export interface _VirtualMachineScaleSetListWithLinkResult { + /** The list of virtual machine scale sets. */ + value: VirtualMachineScaleSet[]; + /** The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets. */ + nextLink?: string; +} + +export function _virtualMachineScaleSetListWithLinkResultDeserializer( + item: any, +): _VirtualMachineScaleSetListWithLinkResult { + return { + value: virtualMachineScaleSetArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** Specifies a list of virtual machine instance IDs from the VM scale set. */ +export interface VirtualMachineScaleSetVMInstanceIDs { + /** The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. */ + instanceIds?: string[]; +} + +export function virtualMachineScaleSetVMInstanceIDsSerializer( + item: VirtualMachineScaleSetVMInstanceIDs, +): any { + return { + instanceIds: !item["instanceIds"] + ? item["instanceIds"] + : item["instanceIds"].map((p: any) => { + return p; + }), + }; +} + +/** model interface VMScaleSetConvertToSinglePlacementGroupInput */ +export interface VMScaleSetConvertToSinglePlacementGroupInput { + /** Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. */ + activePlacementGroupId?: string; +} + +export function vmScaleSetConvertToSinglePlacementGroupInputSerializer( + item: VMScaleSetConvertToSinglePlacementGroupInput, +): any { + return { activePlacementGroupId: item["activePlacementGroupId"] }; +} + +/** Specifies a list of virtual machine instance IDs from the VM scale set. */ +export interface VirtualMachineScaleSetVMInstanceRequiredIDs { + /** The virtual machine scale set instance ids. */ + instanceIds: string[]; +} + +export function virtualMachineScaleSetVMInstanceRequiredIDsSerializer( + item: VirtualMachineScaleSetVMInstanceRequiredIDs, +): any { + return { + instanceIds: item["instanceIds"].map((p: any) => { + return p; + }), + }; +} + +/** Response after calling a manual recovery walk */ +export interface RecoveryWalkResponse { + /** Whether the recovery walk was performed */ + readonly walkPerformed?: boolean; + /** The next update domain that needs to be walked. Null means walk spanning all update domains has been completed */ + readonly nextPlatformUpdateDomain?: number; +} + +export function recoveryWalkResponseDeserializer(item: any): RecoveryWalkResponse { + return { + walkPerformed: item["walkPerformed"], + nextPlatformUpdateDomain: item["nextPlatformUpdateDomain"], + }; +} + +/** The instance view of a virtual machine scale set. */ +export interface VirtualMachineScaleSetInstanceView { + /** The instance view status summary for the virtual machine scale set. */ + readonly virtualMachine?: VirtualMachineScaleSetInstanceViewStatusesSummary; + /** The extensions information. */ + readonly extensions?: VirtualMachineScaleSetVMExtensionsSummary[]; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; + /** The orchestration services information. */ + readonly orchestrationServices?: OrchestrationServiceSummary[]; +} + +export function virtualMachineScaleSetInstanceViewDeserializer( + item: any, +): VirtualMachineScaleSetInstanceView { + return { + virtualMachine: !item["virtualMachine"] + ? item["virtualMachine"] + : virtualMachineScaleSetInstanceViewStatusesSummaryDeserializer(item["virtualMachine"]), + extensions: !item["extensions"] + ? item["extensions"] + : virtualMachineScaleSetVMExtensionsSummaryArrayDeserializer(item["extensions"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + orchestrationServices: !item["orchestrationServices"] + ? item["orchestrationServices"] + : orchestrationServiceSummaryArrayDeserializer(item["orchestrationServices"]), + }; +} + +/** Instance view statuses summary for virtual machines of a virtual machine scale set. */ +export interface VirtualMachineScaleSetInstanceViewStatusesSummary { + /** The extensions information. */ + readonly statusesSummary?: VirtualMachineStatusCodeCount[]; +} + +export function virtualMachineScaleSetInstanceViewStatusesSummaryDeserializer( + item: any, +): VirtualMachineScaleSetInstanceViewStatusesSummary { + return { + statusesSummary: !item["statusesSummary"] + ? item["statusesSummary"] + : virtualMachineStatusCodeCountArrayDeserializer(item["statusesSummary"]), + }; +} + +export function virtualMachineStatusCodeCountArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineStatusCodeCountDeserializer(item); + }); +} + +/** The status code and count of the virtual machine scale set instance view status summary. */ +export interface VirtualMachineStatusCodeCount { + /** The instance view status code. */ + readonly code?: string; + /** The number of instances having a particular status code. */ + readonly count?: number; +} + +export function virtualMachineStatusCodeCountDeserializer( + item: any, +): VirtualMachineStatusCodeCount { + return { + code: item["code"], + count: item["count"], + }; +} + +export function virtualMachineScaleSetVMExtensionsSummaryArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetVMExtensionsSummaryDeserializer(item); + }); +} + +/** Extensions summary for virtual machines of a virtual machine scale set. */ +export interface VirtualMachineScaleSetVMExtensionsSummary { + /** The extension name. */ + readonly name?: string; + /** The extensions information. */ + readonly statusesSummary?: VirtualMachineStatusCodeCount[]; +} + +export function virtualMachineScaleSetVMExtensionsSummaryDeserializer( + item: any, +): VirtualMachineScaleSetVMExtensionsSummary { + return { + name: item["name"], + statusesSummary: !item["statusesSummary"] + ? item["statusesSummary"] + : virtualMachineStatusCodeCountArrayDeserializer(item["statusesSummary"]), + }; +} + +export function instanceViewStatusArraySerializer(result: Array): any[] { + return result.map((item) => { + return instanceViewStatusSerializer(item); + }); +} + +export function instanceViewStatusArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return instanceViewStatusDeserializer(item); + }); +} + +/** Instance view status. */ +export interface InstanceViewStatus { + /** The status code. */ + code?: string; + /** The level code. */ + level?: StatusLevelTypes; + /** The short localizable label for the status. */ + displayStatus?: string; + /** The detailed status message, including for alerts and error messages. */ + message?: string; + /** The time of the status. */ + time?: Date; +} + +export function instanceViewStatusSerializer(item: InstanceViewStatus): any { + return { + code: item["code"], + level: item["level"], + displayStatus: item["displayStatus"], + message: item["message"], + time: !item["time"] ? item["time"] : item["time"].toISOString(), + }; +} + +export function instanceViewStatusDeserializer(item: any): InstanceViewStatus { + return { + code: item["code"], + level: item["level"], + displayStatus: item["displayStatus"], + message: item["message"], + time: !item["time"] ? item["time"] : new Date(item["time"]), + }; +} + +/** The level code. */ +export type StatusLevelTypes = "Info" | "Warning" | "Error"; + +export function orchestrationServiceSummaryArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return orchestrationServiceSummaryDeserializer(item); + }); +} + +/** Summary for an orchestration service of a virtual machine scale set. */ +export interface OrchestrationServiceSummary { + /** The name of the service. */ + readonly serviceName?: OrchestrationServiceNames; + /** The current state of the service. */ + readonly serviceState?: OrchestrationServiceState; + /** The latest operation status of the service. Minimum API version for this property is 2025-04-01. */ + readonly latestOperationStatus?: OrchestrationServiceOperationStatus; + /** The last UTC time when the operation status changed. Minimum API version for this property is 2025-04-01. */ + readonly lastStatusChangeTime?: Date; +} + +export function orchestrationServiceSummaryDeserializer(item: any): OrchestrationServiceSummary { + return { + serviceName: item["serviceName"], + serviceState: item["serviceState"], + latestOperationStatus: item["latestOperationStatus"], + lastStatusChangeTime: !item["lastStatusChangeTime"] + ? item["lastStatusChangeTime"] + : new Date(item["lastStatusChangeTime"]), + }; +} + +/** The name of the service. */ +export enum KnownOrchestrationServiceNames { + /** AutomaticRepairs */ + AutomaticRepairs = "AutomaticRepairs", + /** AutomaticZoneRebalancing orchestration service. */ + AutomaticZoneRebalancing = "AutomaticZoneRebalancing", +} + +/** + * The name of the service. \ + * {@link KnownOrchestrationServiceNames} can be used interchangeably with OrchestrationServiceNames, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AutomaticRepairs** \ + * **AutomaticZoneRebalancing**: AutomaticZoneRebalancing orchestration service. + */ +export type OrchestrationServiceNames = string; + +/** The current state of the service. */ +export enum KnownOrchestrationServiceState { + /** NotRunning */ + NotRunning = "NotRunning", + /** Running */ + Running = "Running", + /** Suspended */ + Suspended = "Suspended", +} + +/** + * The current state of the service. \ + * {@link KnownOrchestrationServiceState} can be used interchangeably with OrchestrationServiceState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotRunning** \ + * **Running** \ + * **Suspended** + */ +export type OrchestrationServiceState = string; + +/** The latest operation status of the service. */ +export enum KnownOrchestrationServiceOperationStatus { + /** InProgress orchestration service operation status. */ + InProgress = "InProgress", + /** Completed orchestration service operation status. */ + Completed = "Completed", +} + +/** + * The latest operation status of the service. \ + * {@link KnownOrchestrationServiceOperationStatus} can be used interchangeably with OrchestrationServiceOperationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InProgress**: InProgress orchestration service operation status. \ + * **Completed**: Completed orchestration service operation status. + */ +export type OrchestrationServiceOperationStatus = string; + +/** List of Virtual Machine Scale Set OS Upgrade History operation response. */ +export interface _VirtualMachineScaleSetListOSUpgradeHistory { + /** The list of OS upgrades performed on the virtual machine scale set. */ + value: UpgradeOperationHistoricalStatusInfo[]; + /** The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. */ + nextLink?: string; +} + +export function _virtualMachineScaleSetListOSUpgradeHistoryDeserializer( + item: any, +): _VirtualMachineScaleSetListOSUpgradeHistory { + return { + value: upgradeOperationHistoricalStatusInfoArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function upgradeOperationHistoricalStatusInfoArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return upgradeOperationHistoricalStatusInfoDeserializer(item); + }); +} + +/** Virtual Machine Scale Set OS Upgrade History operation response. */ +export interface UpgradeOperationHistoricalStatusInfo { + /** Information about the properties of the upgrade operation. */ + readonly properties?: UpgradeOperationHistoricalStatusInfoProperties; + /** Resource type */ + readonly type?: string; + /** Resource location */ + readonly location?: string; +} + +export function upgradeOperationHistoricalStatusInfoDeserializer( + item: any, +): UpgradeOperationHistoricalStatusInfo { + return { + properties: !item["properties"] + ? item["properties"] + : upgradeOperationHistoricalStatusInfoPropertiesDeserializer(item["properties"]), + type: item["type"], + location: item["location"], + }; +} + +/** Describes each OS upgrade on the Virtual Machine Scale Set. */ +export interface UpgradeOperationHistoricalStatusInfoProperties { + /** Information about the overall status of the upgrade operation. */ + readonly runningStatus?: UpgradeOperationHistoryStatus; + /** Counts of the VMs in each state. */ + readonly progress?: RollingUpgradeProgressInfo; + /** Error Details for this upgrade if there are any. */ + readonly error?: ApiError; + /** Invoker of the Upgrade Operation */ + readonly startedBy?: UpgradeOperationInvoker; + /** Image Reference details */ + readonly targetImageReference?: ImageReference; + /** Information about OS rollback if performed */ + readonly rollbackInfo?: RollbackStatusInfo; +} + +export function upgradeOperationHistoricalStatusInfoPropertiesDeserializer( + item: any, +): UpgradeOperationHistoricalStatusInfoProperties { + return { + runningStatus: !item["runningStatus"] + ? item["runningStatus"] + : upgradeOperationHistoryStatusDeserializer(item["runningStatus"]), + progress: !item["progress"] + ? item["progress"] + : rollingUpgradeProgressInfoDeserializer(item["progress"]), + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + startedBy: item["startedBy"], + targetImageReference: !item["targetImageReference"] + ? item["targetImageReference"] + : imageReferenceDeserializer(item["targetImageReference"]), + rollbackInfo: !item["rollbackInfo"] + ? item["rollbackInfo"] + : rollbackStatusInfoDeserializer(item["rollbackInfo"]), + }; +} + +/** Information about the current running state of the overall upgrade. */ +export interface UpgradeOperationHistoryStatus { + /** Code indicating the current status of the upgrade. */ + readonly code?: UpgradeState; + /** Start time of the upgrade. */ + readonly startTime?: Date; + /** End time of the upgrade. */ + readonly endTime?: Date; +} + +export function upgradeOperationHistoryStatusDeserializer( + item: any, +): UpgradeOperationHistoryStatus { + return { + code: item["code"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + }; +} + +/** Code indicating the current status of the upgrade. */ +export type UpgradeState = "RollingForward" | "Cancelled" | "Completed" | "Faulted"; + +/** Information about the number of virtual machine instances in each upgrade state. */ +export interface RollingUpgradeProgressInfo { + /** The number of instances that have been successfully upgraded. */ + readonly successfulInstanceCount?: number; + /** The number of instances that have failed to be upgraded successfully. */ + readonly failedInstanceCount?: number; + /** The number of instances that are currently being upgraded. */ + readonly inProgressInstanceCount?: number; + /** The number of instances that have not yet begun to be upgraded. */ + readonly pendingInstanceCount?: number; +} + +export function rollingUpgradeProgressInfoDeserializer(item: any): RollingUpgradeProgressInfo { + return { + successfulInstanceCount: item["successfulInstanceCount"], + failedInstanceCount: item["failedInstanceCount"], + inProgressInstanceCount: item["inProgressInstanceCount"], + pendingInstanceCount: item["pendingInstanceCount"], + }; +} + +/** Invoker of the Upgrade Operation */ +export type UpgradeOperationInvoker = "Unknown" | "User" | "Platform"; + +/** Information about rollback on failed VM instances after a OS Upgrade operation. */ +export interface RollbackStatusInfo { + /** The number of instances which have been successfully rolled back. */ + readonly successfullyRolledbackInstanceCount?: number; + /** The number of instances which failed to rollback. */ + readonly failedRolledbackInstanceCount?: number; + /** Error details if OS rollback failed. */ + readonly rollbackError?: ApiError; +} + +export function rollbackStatusInfoDeserializer(item: any): RollbackStatusInfo { + return { + successfullyRolledbackInstanceCount: item["successfullyRolledbackInstanceCount"], + failedRolledbackInstanceCount: item["failedRolledbackInstanceCount"], + rollbackError: !item["rollbackError"] + ? item["rollbackError"] + : apiErrorDeserializer(item["rollbackError"]), + }; +} + +/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ +export interface VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { + /** The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. */ + instanceIds?: string[]; +} + +export function virtualMachineScaleSetReimageParametersSerializer( + item: VirtualMachineScaleSetReimageParameters, +): any { + return { + forceUpdateOSDiskForEphemeral: item["forceUpdateOSDiskForEphemeral"], + tempDisk: item["tempDisk"], + exactVersion: item["exactVersion"], + osProfile: !item["osProfile"] + ? item["osProfile"] + : osProfileProvisioningDataSerializer(item["osProfile"]), + instanceIds: !item["instanceIds"] + ? item["instanceIds"] + : item["instanceIds"].map((p: any) => { + return p; + }), + }; +} + +/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ +export interface VirtualMachineScaleSetVMReimageParameters extends VirtualMachineReimageParameters { + /** Parameter to force update ephemeral OS disk for a virtual machine scale set VM */ + forceUpdateOSDiskForEphemeral?: boolean; +} + +export function virtualMachineScaleSetVMReimageParametersSerializer( + item: VirtualMachineScaleSetVMReimageParameters, +): any { + return { + tempDisk: item["tempDisk"], + exactVersion: item["exactVersion"], + osProfile: !item["osProfile"] + ? item["osProfile"] + : osProfileProvisioningDataSerializer(item["osProfile"]), + forceUpdateOSDiskForEphemeral: item["forceUpdateOSDiskForEphemeral"], + }; +} + +/** Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged */ +export interface VirtualMachineReimageParameters { + /** Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. */ + tempDisk?: boolean; + /** Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk is reimaged to the existing version of OS Disk. */ + exactVersion?: string; + /** Specifies information required for reimaging the non-ephemeral OS disk. */ + osProfile?: OSProfileProvisioningData; +} + +export function virtualMachineReimageParametersSerializer( + item: VirtualMachineReimageParameters, +): any { + return { + tempDisk: item["tempDisk"], + exactVersion: item["exactVersion"], + osProfile: !item["osProfile"] + ? item["osProfile"] + : osProfileProvisioningDataSerializer(item["osProfile"]), + }; +} + +/** Additional parameters for Reimaging Non-Ephemeral Virtual Machine. */ +export interface OSProfileProvisioningData { + /** 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/). If 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; +} + +export function osProfileProvisioningDataSerializer(item: OSProfileProvisioningData): any { + return { adminPassword: item["adminPassword"], customData: item["customData"] }; +} + +/** The input for OrchestrationServiceState */ +export interface OrchestrationServiceStateInput { + /** The name of the service. */ + serviceName: OrchestrationServiceNames; + /** The action to be performed. */ + action: OrchestrationServiceStateAction; +} + +export function orchestrationServiceStateInputSerializer( + item: OrchestrationServiceStateInput, +): any { + return { serviceName: item["serviceName"], action: item["action"] }; +} + +/** The action to be performed. */ +export enum KnownOrchestrationServiceStateAction { + /** Resume */ + Resume = "Resume", + /** Suspend */ + Suspend = "Suspend", +} + +/** + * The action to be performed. \ + * {@link KnownOrchestrationServiceStateAction} can be used interchangeably with OrchestrationServiceStateAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Resume** \ + * **Suspend** + */ +export type OrchestrationServiceStateAction = string; + +/** The Virtual Machine Scale Set List Skus operation response. */ +export interface _VirtualMachineScaleSetListSkusResult { + /** The list of skus available for the virtual machine scale set. */ + value: VirtualMachineScaleSetSku[]; + /** The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus. */ + nextLink?: string; +} + +export function _virtualMachineScaleSetListSkusResultDeserializer( + item: any, +): _VirtualMachineScaleSetListSkusResult { + return { + value: virtualMachineScaleSetSkuArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineScaleSetSkuArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetSkuDeserializer(item); + }); +} + +/** Describes an available virtual machine scale set sku. */ +export interface VirtualMachineScaleSetSku { + /** The type of resource the sku applies to. */ + readonly resourceType?: string; + /** The Sku. */ + readonly sku?: Sku; + /** Specifies the number of virtual machines in the scale set. */ + readonly capacity?: VirtualMachineScaleSetSkuCapacity; +} + +export function virtualMachineScaleSetSkuDeserializer(item: any): VirtualMachineScaleSetSku { + return { + resourceType: item["resourceType"], + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + capacity: !item["capacity"] + ? item["capacity"] + : virtualMachineScaleSetSkuCapacityDeserializer(item["capacity"]), + }; +} + +/** Describes scaling information of a sku. */ +export interface VirtualMachineScaleSetSkuCapacity { + /** The minimum capacity. */ + readonly minimum?: number; + /** The maximum capacity that can be set. */ + readonly maximum?: number; + /** The default capacity. */ + readonly defaultCapacity?: number; + /** The scale type applicable to the sku. */ + readonly scaleType?: VirtualMachineScaleSetSkuScaleType; +} + +export function virtualMachineScaleSetSkuCapacityDeserializer( + item: any, +): VirtualMachineScaleSetSkuCapacity { + return { + minimum: item["minimum"], + maximum: item["maximum"], + defaultCapacity: item["defaultCapacity"], + scaleType: item["scaleType"], + }; +} + +/** The scale type applicable to the sku. */ +export type VirtualMachineScaleSetSkuScaleType = "Automatic" | "None"; + +/** The input for ScaleOut */ +export interface VMScaleSetScaleOutInput { + /** Specifies the number of virtual machines in the scale set. */ + capacity: number; + /** The input properties for ScaleOut */ + properties?: VMScaleSetScaleOutInputProperties; +} + +export function vmScaleSetScaleOutInputSerializer(item: VMScaleSetScaleOutInput): any { + return { + capacity: item["capacity"], + properties: !item["properties"] + ? item["properties"] + : vmScaleSetScaleOutInputPropertiesSerializer(item["properties"]), + }; +} + +/** The input properties for ScaleOut */ +export interface VMScaleSetScaleOutInputProperties { + /** The zone in which the scale out is requested for the virtual machine scale set. */ + zone?: string; +} + +export function vmScaleSetScaleOutInputPropertiesSerializer( + item: VMScaleSetScaleOutInputProperties, +): any { + return { zone: item["zone"] }; +} + +/** Describes a Virtual Machine Scale Set Extension. */ +export interface VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { + /** The name of the extension. */ + readonly name?: string; + /** Resource type */ + readonly type?: string; + /** If a value is provided and is different from the previous value, the extension handler will 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". */ + typePropertiesType?: 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** Collection of extension names after which this extension needs to be provisioned. */ + provisionAfterExtensions?: string[]; + /** 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; +} + +export function virtualMachineScaleSetExtensionUpdateSerializer( + item: VirtualMachineScaleSetExtensionUpdate, +): any { + return { + properties: areAllPropsUndefined(item, [ + "forceUpdateTag", + "publisher", + "type", + "typeHandlerVersion", + "autoUpgradeMinorVersion", + "enableAutomaticUpgrade", + "settings", + "protectedSettings", + "provisionAfterExtensions", + "suppressFailures", + "protectedSettingsFromKeyVault", + ]) + ? undefined + : _virtualMachineScaleSetExtensionUpdatePropertiesSerializer(item), + }; +} + +/** The List VM scale set extension operation response. */ +export interface _VirtualMachineScaleSetExtensionListResult { + /** The list of VM scale set extensions. */ + value: VirtualMachineScaleSetExtension[]; + /** The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. */ + nextLink?: string; +} + +export function _virtualMachineScaleSetExtensionListResultDeserializer( + item: any, +): _VirtualMachineScaleSetExtensionListResult { + return { + value: virtualMachineScaleSetExtensionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** Defines a virtual machine scale set lifecycle hook event. */ +export interface VMScaleSetLifecycleHookEvent extends ProxyResource { + /** Defines the virtual machine scale set lifecycle hook event properties. */ + properties?: VMScaleSetLifecycleHookEventProperties; +} + +export function vmScaleSetLifecycleHookEventDeserializer(item: any): VMScaleSetLifecycleHookEvent { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : vmScaleSetLifecycleHookEventPropertiesDeserializer(item["properties"]), + }; +} + +/** Defines the virtual machine scale set lifecycle hook event properties. */ +export interface VMScaleSetLifecycleHookEventProperties { + /** Defines the type or scenario for sending a virtual machine scale set lifecycle hook event to the customer. */ + type?: VMScaleSetLifecycleHookEventType; + /** Specifies the exact UTC timestamp in ISO 8601 format till which the event would remain in the current lifecycle state waiting for an action from the customer. Beyond this timestamp, the platform will apply the defaultAction for the event. */ + waitUntil?: string; + /** Specifies the exact UTC timestamp in ISO 8601 format till when the customer can delay the lifecycle hook event. The customer will not be allowed to delay the event to a timestamp beyond this. */ + readonly maxWaitUntil?: string; + /** The UTC timestamp in ISO 8601 format at which the platform creates the virtual machine scale set lifecycle hook event entity. */ + readonly timeCreated?: string; + /** Specify the action that will be applied on the a target resource in the virtual machine scale set lifecycle hook event if the platform does not get a response from the customer for the target resource before waitUntil. */ + readonly defaultAction?: LifecycleHookAction; + /** List of target resources which are getting processed in the virtual machine scale set lifecycle hook event. */ + targetResources?: VMScaleSetLifecycleHookEventTargetResource[]; + /** + * Additional key-value pairs set on the lifecycle hook event that gives customer some useful context/data. + * The keys in this dictionary are specific to the lifecycle hook type. Different lifecycle hook events can have different sets of keys in the additional context depending on the lifecycle hook type. + * For example, for a lifecycle hook event with UpgradeAutoOSScheduling type, + * the additional context can contain the key "priority" that helps customer identify the priority of the Auto OS Upgrade operation triggered on the virtual machine scale set. + */ + additionalContext?: VMScaleSetLifecycleHookEventAdditionalContext; + /** Specifies the state of the virtual machine scale set lifecycle hook event. */ + readonly state?: VMScaleSetLifecycleHookEventState; +} + +export function vmScaleSetLifecycleHookEventPropertiesSerializer( + item: VMScaleSetLifecycleHookEventProperties, +): any { + return { + type: item["type"], + waitUntil: item["waitUntil"], + targetResources: !item["targetResources"] + ? item["targetResources"] + : vmScaleSetLifecycleHookEventTargetResourceArraySerializer(item["targetResources"]), + additionalContext: !item["additionalContext"] + ? item["additionalContext"] + : vmScaleSetLifecycleHookEventAdditionalContextSerializer(item["additionalContext"]), + }; +} + +export function vmScaleSetLifecycleHookEventPropertiesDeserializer( + item: any, +): VMScaleSetLifecycleHookEventProperties { + return { + type: item["type"], + waitUntil: item["waitUntil"], + maxWaitUntil: item["maxWaitUntil"], + timeCreated: item["timeCreated"], + defaultAction: item["defaultAction"], + targetResources: !item["targetResources"] + ? item["targetResources"] + : vmScaleSetLifecycleHookEventTargetResourceArrayDeserializer(item["targetResources"]), + additionalContext: !item["additionalContext"] + ? item["additionalContext"] + : vmScaleSetLifecycleHookEventAdditionalContextDeserializer(item["additionalContext"]), + state: item["state"], + }; +} + +export function vmScaleSetLifecycleHookEventTargetResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return vmScaleSetLifecycleHookEventTargetResourceSerializer(item); + }); +} + +export function vmScaleSetLifecycleHookEventTargetResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return vmScaleSetLifecycleHookEventTargetResourceDeserializer(item); + }); +} + +/** Define a single target ARM resource in a virtual machine scale set lifecycle hook event. Currently, this can be a virtual machine scale set resource or an individual virtual machine resource within a VMScaleSet. */ +export interface VMScaleSetLifecycleHookEventTargetResource { + /** Specifies the target ARM resource. Currently, this can be a virtual machine scale set resource or an individual virtual machine resource within a VMScaleSet. */ + resource?: ApiEntityReference; + /** State of the lifecycle hook for the target resource. The customer can patch this property to move the lifecycle hook to a terminal state. */ + actionState?: LifecycleHookActionState; +} + +export function vmScaleSetLifecycleHookEventTargetResourceSerializer( + item: VMScaleSetLifecycleHookEventTargetResource, +): any { + return { + resource: !item["resource"] ? item["resource"] : apiEntityReferenceSerializer(item["resource"]), + actionState: item["actionState"], + }; +} + +export function vmScaleSetLifecycleHookEventTargetResourceDeserializer( + item: any, +): VMScaleSetLifecycleHookEventTargetResource { + return { + resource: !item["resource"] + ? item["resource"] + : apiEntityReferenceDeserializer(item["resource"]), + actionState: item["actionState"], + }; +} + +/** Approval status of a target resource in a virtual machine scale set lifecycle hook event. */ +export enum KnownLifecycleHookActionState { + /** The lifecycle hook for the target resource is waiting for approval. */ + Waiting = "Waiting", + /** The lifecycle hook for the target resource is approved. */ + Approved = "Approved", + /** The lifecycle hook for the target resource is rejected. */ + Rejected = "Rejected", +} + +/** + * Approval status of a target resource in a virtual machine scale set lifecycle hook event. \ + * {@link KnownLifecycleHookActionState} can be used interchangeably with LifecycleHookActionState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Waiting**: The lifecycle hook for the target resource is waiting for approval. \ + * **Approved**: The lifecycle hook for the target resource is approved. \ + * **Rejected**: The lifecycle hook for the target resource is rejected. + */ +export type LifecycleHookActionState = string; + +/** + * Additional key-value pairs set on the lifecycle hook event that gives customer some useful context/data. + * The keys in this dictionary are specific to the lifecycle hook type. Different lifecycle hook events can have different sets of keys in the additional context depending on the lifecycle hook type. + * For example, for a lifecycle hook event with UpgradeAutoOSScheduling type, + * the additional context can contain the key "priority" that helps customer identify the priority of the Auto OS Upgrade operation triggered on the virtual machine scale set. + */ +export interface VMScaleSetLifecycleHookEventAdditionalContext { + /** + * Can only be present for a lifecycle hook event of type "UpgradeAutoOSScheduling". + * Denotes the priority of the virtual machine scale set lifecycle hook event for the Auto OS Upgrade scheduled on the virtual machine scale set. + */ + priority?: string; +} + +export function vmScaleSetLifecycleHookEventAdditionalContextSerializer( + item: VMScaleSetLifecycleHookEventAdditionalContext, +): any { + return { priority: item["priority"] }; +} + +export function vmScaleSetLifecycleHookEventAdditionalContextDeserializer( + item: any, +): VMScaleSetLifecycleHookEventAdditionalContext { + return { + priority: item["priority"], + }; +} + +/** The states that a virtual machine scale set lifecycle hook event can be in. This is not settable by the customer. It is set only by the platform. */ +export enum KnownVMScaleSetLifecycleHookEventState { + /** The lifecycle hook event is active. E.g., waiting on a response from the customer. */ + Active = "Active", + /** The lifecycle hook event is completed. i.e., all the target resources in the event have moved to a terminal state. */ + Completed = "Completed", +} + +/** + * The states that a virtual machine scale set lifecycle hook event can be in. This is not settable by the customer. It is set only by the platform. \ + * {@link KnownVMScaleSetLifecycleHookEventState} can be used interchangeably with VMScaleSetLifecycleHookEventState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active**: The lifecycle hook event is active. E.g., waiting on a response from the customer. \ + * **Completed**: The lifecycle hook event is completed. i.e., all the target resources in the event have moved to a terminal state. + */ +export type VMScaleSetLifecycleHookEventState = string; + +/** Specifies information about the virtual machine scale set lifecycle hook event. */ +export interface VMScaleSetLifecycleHookEventUpdate { + /** Defines the type or scenario for sending a virtual machine scale set lifecycle hook event to the customer. */ + type?: VMScaleSetLifecycleHookEventType; + /** Specifies the exact UTC timestamp in ISO 8601 format till which the event would remain in the current lifecycle state waiting for an action from the customer. Beyond this timestamp, the platform will apply the defaultAction for the event. */ + waitUntil?: string; + /** Specifies the exact UTC timestamp in ISO 8601 format till when the customer can delay the lifecycle hook event. The customer will not be allowed to delay the event to a timestamp beyond this. */ + readonly maxWaitUntil?: string; + /** The UTC timestamp in ISO 8601 format at which the platform creates the virtual machine scale set lifecycle hook event entity. */ + readonly timeCreated?: string; + /** Specify the action that will be applied on the a target resource in the virtual machine scale set lifecycle hook event if the platform does not get a response from the customer for the target resource before waitUntil. */ + readonly defaultAction?: LifecycleHookAction; + /** List of target resources which are getting processed in the virtual machine scale set lifecycle hook event. */ + targetResources?: VMScaleSetLifecycleHookEventTargetResource[]; + /** + * Additional key-value pairs set on the lifecycle hook event that gives customer some useful context/data. + * The keys in this dictionary are specific to the lifecycle hook type. Different lifecycle hook events can have different sets of keys in the additional context depending on the lifecycle hook type. + * For example, for a lifecycle hook event with UpgradeAutoOSScheduling type, + * the additional context can contain the key "priority" that helps customer identify the priority of the Auto OS Upgrade operation triggered on the virtual machine scale set. + */ + additionalContext?: VMScaleSetLifecycleHookEventAdditionalContext; + /** Specifies the state of the virtual machine scale set lifecycle hook event. */ + readonly state?: VMScaleSetLifecycleHookEventState; +} + +export function vmScaleSetLifecycleHookEventUpdateSerializer( + item: VMScaleSetLifecycleHookEventUpdate, +): any { + return { + properties: areAllPropsUndefined(item, [ + "type", + "waitUntil", + "targetResources", + "additionalContext", + ]) + ? undefined + : _vmScaleSetLifecycleHookEventUpdatePropertiesSerializer(item), + }; +} + +/** The List virtual machine scale set lifecycle hook events operation response. */ +export interface _VMScaleSetLifecycleHookEventListResult { + /** The list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource. */ + value: VMScaleSetLifecycleHookEvent[]; + /** The uri to fetch the next page of virtual machine scale set lifecycle hook events. Call ListNext() with this to fetch the next page of virtual machine scale set lifecycle hook events. */ + nextLink?: string; +} + +export function _vmScaleSetLifecycleHookEventListResultDeserializer( + item: any, +): _VMScaleSetLifecycleHookEventListResult { + return { + value: vmScaleSetLifecycleHookEventArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function vmScaleSetLifecycleHookEventArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return vmScaleSetLifecycleHookEventDeserializer(item); + }); +} + +/** Describes a VMSS VM Extension. */ +export interface VirtualMachineScaleSetVMExtension extends SubResourceReadOnly { + /** The location of the extension. */ + location?: string; + /** Resource type */ + readonly type?: string; + /** Resource name */ + readonly name?: string; + /** 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". */ + typePropertiesType?: 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The virtual machine extension instance view. */ + instanceView?: VirtualMachineExtensionInstanceView; + /** 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 virtualMachineScaleSetVMExtensionSerializer( + item: VirtualMachineScaleSetVMExtension, +): any { + return { + properties: areAllPropsUndefined(item, [ + "forceUpdateTag", + "publisher", + "type", + "typeHandlerVersion", + "autoUpgradeMinorVersion", + "enableAutomaticUpgrade", + "settings", + "protectedSettings", + "instanceView", + "suppressFailures", + "protectedSettingsFromKeyVault", + "provisionAfterExtensions", + ]) + ? undefined + : _virtualMachineScaleSetVMExtensionPropertiesSerializer(item), + location: item["location"], + }; +} + +export function virtualMachineScaleSetVMExtensionDeserializer( + item: any, +): VirtualMachineScaleSetVMExtension { + return { + id: item["id"], + ...(!item["properties"] + ? item["properties"] + : _virtualMachineScaleSetVMExtensionPropertiesDeserializer(item["properties"])), + location: item["location"], + type: item["type"], + name: item["name"], + }; +} + +/** 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The virtual machine extension instance view. */ + instanceView?: VirtualMachineExtensionInstanceView; + /** 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"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineExtensionInstanceViewSerializer(item["instanceView"]), + 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"], + protectedSettings: item["protectedSettings"], + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineExtensionInstanceViewDeserializer(item["instanceView"]), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceDeserializer(item["protectedSettingsFromKeyVault"]), + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + }; +} + +/** The instance view of a virtual machine extension. */ +export interface VirtualMachineExtensionInstanceView { + /** The virtual machine extension name. */ + name?: string; + /** Specifies the type of the extension; an example is "CustomScriptExtension". */ + type?: string; + /** Specifies the version of the script handler. */ + typeHandlerVersion?: string; + /** The resource status information. */ + substatuses?: InstanceViewStatus[]; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; +} + +export function virtualMachineExtensionInstanceViewSerializer( + item: VirtualMachineExtensionInstanceView, +): any { + return { + name: item["name"], + type: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + substatuses: !item["substatuses"] + ? item["substatuses"] + : instanceViewStatusArraySerializer(item["substatuses"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArraySerializer(item["statuses"]), + }; +} + +export function virtualMachineExtensionInstanceViewDeserializer( + item: any, +): VirtualMachineExtensionInstanceView { + return { + name: item["name"], + type: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + substatuses: !item["substatuses"] + ? item["substatuses"] + : instanceViewStatusArrayDeserializer(item["substatuses"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + }; +} + +/** Describes a VMSS VM Extension. */ +export interface VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { + /** The name of the extension. */ + readonly name?: string; + /** Resource type */ + readonly type?: string; + /** 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". */ + typePropertiesType?: 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** 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; +} + +export function virtualMachineScaleSetVMExtensionUpdateSerializer( + item: VirtualMachineScaleSetVMExtensionUpdate, +): any { + return { + properties: areAllPropsUndefined(item, [ + "forceUpdateTag", + "publisher", + "type", + "typeHandlerVersion", + "autoUpgradeMinorVersion", + "enableAutomaticUpgrade", + "settings", + "protectedSettings", + "suppressFailures", + "protectedSettingsFromKeyVault", + ]) + ? undefined + : _virtualMachineScaleSetVMExtensionUpdatePropertiesSerializer(item), + }; +} + +/** Describes the properties of a Virtual Machine Extension. */ +export interface VirtualMachineExtensionUpdateProperties { + /** 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** 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; +} + +export function virtualMachineExtensionUpdatePropertiesSerializer( + item: VirtualMachineExtensionUpdateProperties, +): 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"]), + }; +} + +/** The List VMSS VM Extension operation response */ +export interface VirtualMachineScaleSetVMExtensionsListResult { + /** The list of VMSS VM extensions */ + value?: VirtualMachineScaleSetVMExtension[]; +} + +export function virtualMachineScaleSetVMExtensionsListResultDeserializer( + item: any, +): VirtualMachineScaleSetVMExtensionsListResult { + return { + value: !item["value"] + ? item["value"] + : virtualMachineScaleSetVMExtensionArrayDeserializer(item["value"]), + }; +} + +export function virtualMachineScaleSetVMExtensionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetVMExtensionSerializer(item); + }); +} + +export function virtualMachineScaleSetVMExtensionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetVMExtensionDeserializer(item); + }); +} + +/** Describes a Virtual Machine. */ +export interface VirtualMachine extends TrackedResource { + /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ + plan?: Plan; + /** The virtual machine child extension resources. */ + readonly resources?: VirtualMachineExtension[]; + /** The identity of the virtual machine, if configured. */ + identity?: VirtualMachineIdentity; + /** The availability zones. */ + zones?: string[]; + /** The extended location of the Virtual Machine. */ + extendedLocation?: ExtendedLocation; + /** ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This property is used by platform for internal resource group delete optimization. */ + readonly managedBy?: string; + /** Etag is property returned in Create/Update/Get response of the VM, so that customer can supply it in the header to ensure optimistic updates. */ + readonly etag?: string; + /** Placement section specifies the user-defined constraints for virtual machine hardware placement. This property cannot be changed once VM is provisioned. Minimum api-version: 2024-11-01. */ + placement?: Placement; + /** Specifies the hardware settings for the virtual machine. */ + hardwareProfile?: HardwareProfile; + /** 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 api-version: 2015-06-15. */ + diagnosticsProfile?: DiagnosticsProfile; + /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. */ + availabilitySet?: SubResource; + /** Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. */ + virtualMachineScaleSet?: SubResource; + /** Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 */ + priority?: VirtualMachinePriorityTypes; + /** Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. */ + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + /** Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. */ + billingProfile?: BillingProfile; + /** Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. */ + host?: SubResource; + /** Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. */ + hostGroup?: SubResource; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The virtual machine instance view. */ + readonly instanceView?: VirtualMachineInstanceView; + /** 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 VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. */ + readonly vmId?: 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 api-version: 2020-06-01. */ + extensionsTimeBudget?: string; + /** Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. */ + platformFaultDomain?: number; + /** 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 api-version: 2021-03-01. */ + userData?: string; + /** Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. */ + capacityReservation?: CapacityReservationProfile; + /** Specifies the gallery applications that should be made available to the VM/VMSS. */ + applicationProfile?: ApplicationProfile; + /** Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Resiliency profile for the virtual machine. */ + resiliencyProfile?: ResiliencyProfile; +} + +export function virtualMachineSerializer(item: VirtualMachine): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "hardwareProfile", + "scheduledEventsPolicy", + "storageProfile", + "additionalCapabilities", + "osProfile", + "networkProfile", + "securityProfile", + "diagnosticsProfile", + "availabilitySet", + "virtualMachineScaleSet", + "proximityPlacementGroup", + "priority", + "evictionPolicy", + "billingProfile", + "host", + "hostGroup", + "licenseType", + "extensionsTimeBudget", + "platformFaultDomain", + "scheduledEventsProfile", + "userData", + "capacityReservation", + "applicationProfile", + "resiliencyProfile", + ]) + ? undefined + : _virtualMachinePropertiesSerializer(item), + plan: !item["plan"] ? item["plan"] : planSerializer(item["plan"]), + identity: !item["identity"] + ? item["identity"] + : virtualMachineIdentitySerializer(item["identity"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + placement: !item["placement"] ? item["placement"] : placementSerializer(item["placement"]), + }; +} + +export function virtualMachineDeserializer(item: any): VirtualMachine { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _virtualMachinePropertiesDeserializer(item["properties"])), + plan: !item["plan"] ? item["plan"] : planDeserializer(item["plan"]), + resources: !item["resources"] + ? item["resources"] + : virtualMachineExtensionArrayDeserializer(item["resources"]), + identity: !item["identity"] + ? item["identity"] + : virtualMachineIdentityDeserializer(item["identity"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + managedBy: item["managedBy"], + etag: item["etag"], + placement: !item["placement"] ? item["placement"] : placementDeserializer(item["placement"]), + }; +} + +/** Describes the properties of a Virtual Machine. */ +export interface VirtualMachineProperties { + /** Specifies the hardware settings for the virtual machine. */ + hardwareProfile?: HardwareProfile; + /** 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 api-version: 2015-06-15. */ + diagnosticsProfile?: DiagnosticsProfile; + /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. */ + availabilitySet?: SubResource; + /** Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. */ + virtualMachineScaleSet?: SubResource; + /** Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 */ + priority?: VirtualMachinePriorityTypes; + /** Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. */ + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + /** Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. */ + billingProfile?: BillingProfile; + /** Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. */ + host?: SubResource; + /** Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. */ + hostGroup?: SubResource; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The virtual machine instance view. */ + readonly instanceView?: VirtualMachineInstanceView; + /** 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 VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. */ + readonly vmId?: 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 api-version: 2020-06-01. */ + extensionsTimeBudget?: string; + /** Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. */ + platformFaultDomain?: number; + /** 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 api-version: 2021-03-01. */ + userData?: string; + /** Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. */ + capacityReservation?: CapacityReservationProfile; + /** Specifies the gallery applications that should be made available to the VM/VMSS. */ + applicationProfile?: ApplicationProfile; + /** Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Resiliency profile for the virtual machine. */ + resiliencyProfile?: ResiliencyProfile; +} + +export function virtualMachinePropertiesSerializer(item: VirtualMachineProperties): any { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileSerializer(item["hardwareProfile"]), + 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"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceSerializer(item["availabilitySet"]), + virtualMachineScaleSet: !item["virtualMachineScaleSet"] + ? item["virtualMachineScaleSet"] + : subResourceSerializer(item["virtualMachineScaleSet"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileSerializer(item["billingProfile"]), + host: !item["host"] ? item["host"] : subResourceSerializer(item["host"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceSerializer(item["hostGroup"]), + licenseType: item["licenseType"], + extensionsTimeBudget: item["extensionsTimeBudget"], + platformFaultDomain: item["platformFaultDomain"], + 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"]), + resiliencyProfile: !item["resiliencyProfile"] + ? item["resiliencyProfile"] + : resiliencyProfileSerializer(item["resiliencyProfile"]), + }; +} + +export function virtualMachinePropertiesDeserializer(item: any): VirtualMachineProperties { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileDeserializer(item["hardwareProfile"]), + 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"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceDeserializer(item["availabilitySet"]), + virtualMachineScaleSet: !item["virtualMachineScaleSet"] + ? item["virtualMachineScaleSet"] + : subResourceDeserializer(item["virtualMachineScaleSet"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileDeserializer(item["billingProfile"]), + host: !item["host"] ? item["host"] : subResourceDeserializer(item["host"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceDeserializer(item["hostGroup"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineInstanceViewDeserializer(item["instanceView"]), + licenseType: item["licenseType"], + vmId: item["vmId"], + extensionsTimeBudget: item["extensionsTimeBudget"], + platformFaultDomain: item["platformFaultDomain"], + 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"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + resiliencyProfile: !item["resiliencyProfile"] + ? item["resiliencyProfile"] + : resiliencyProfileDeserializer(item["resiliencyProfile"]), + }; +} + +/** Specifies the hardware settings for the virtual machine. */ +export interface HardwareProfile { + /** Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and availability set. */ + vmSize?: VirtualMachineSizeTypes; + /** Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature is still in preview mode and is not supported for VirtualMachineScaleSet. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. */ + vmSizeProperties?: VMSizeProperties; +} + +export function hardwareProfileSerializer(item: HardwareProfile): any { + return { + vmSize: item["vmSize"], + vmSizeProperties: !item["vmSizeProperties"] + ? item["vmSizeProperties"] + : vmSizePropertiesSerializer(item["vmSizeProperties"]), + }; +} + +export function hardwareProfileDeserializer(item: any): HardwareProfile { + return { + vmSize: item["vmSize"], + vmSizeProperties: !item["vmSizeProperties"] + ? item["vmSizeProperties"] + : vmSizePropertiesDeserializer(item["vmSizeProperties"]), + }; +} + +/** Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and availability set. */ +export enum KnownVirtualMachineSizeTypes { + /** Basic_A0 */ + BasicA0 = "Basic_A0", + /** Basic_A1 */ + BasicA1 = "Basic_A1", + /** Basic_A2 */ + BasicA2 = "Basic_A2", + /** Basic_A3 */ + BasicA3 = "Basic_A3", + /** Basic_A4 */ + BasicA4 = "Basic_A4", + /** Standard_A0 */ + StandardA0 = "Standard_A0", + /** Standard_A1 */ + StandardA1 = "Standard_A1", + /** Standard_A2 */ + StandardA2 = "Standard_A2", + /** Standard_A3 */ + StandardA3 = "Standard_A3", + /** Standard_A4 */ + StandardA4 = "Standard_A4", + /** Standard_A5 */ + StandardA5 = "Standard_A5", + /** Standard_A6 */ + StandardA6 = "Standard_A6", + /** Standard_A7 */ + StandardA7 = "Standard_A7", + /** Standard_A8 */ + StandardA8 = "Standard_A8", + /** Standard_A9 */ + StandardA9 = "Standard_A9", + /** Standard_A10 */ + StandardA10 = "Standard_A10", + /** Standard_A11 */ + StandardA11 = "Standard_A11", + /** Standard_A1_v2 */ + StandardA1V2 = "Standard_A1_v2", + /** Standard_A2_v2 */ + StandardA2V2 = "Standard_A2_v2", + /** Standard_A4_v2 */ + StandardA4V2 = "Standard_A4_v2", + /** Standard_A8_v2 */ + StandardA8V2 = "Standard_A8_v2", + /** Standard_A2m_v2 */ + StandardA2MV2 = "Standard_A2m_v2", + /** Standard_A4m_v2 */ + StandardA4MV2 = "Standard_A4m_v2", + /** Standard_A8m_v2 */ + StandardA8MV2 = "Standard_A8m_v2", + /** Standard_B1s */ + StandardB1S = "Standard_B1s", + /** Standard_B1ms */ + StandardB1Ms = "Standard_B1ms", + /** Standard_B2s */ + StandardB2S = "Standard_B2s", + /** Standard_B2ms */ + StandardB2Ms = "Standard_B2ms", + /** Standard_B4ms */ + StandardB4Ms = "Standard_B4ms", + /** Standard_B8ms */ + StandardB8Ms = "Standard_B8ms", + /** Standard_D1 */ + StandardD1 = "Standard_D1", + /** Standard_D2 */ + StandardD2 = "Standard_D2", + /** Standard_D3 */ + StandardD3 = "Standard_D3", + /** Standard_D4 */ + StandardD4 = "Standard_D4", + /** Standard_D11 */ + StandardD11 = "Standard_D11", + /** Standard_D12 */ + StandardD12 = "Standard_D12", + /** Standard_D13 */ + StandardD13 = "Standard_D13", + /** Standard_D14 */ + StandardD14 = "Standard_D14", + /** Standard_D1_v2 */ + StandardD1V2 = "Standard_D1_v2", + /** Standard_D2_v2 */ + StandardD2V2 = "Standard_D2_v2", + /** Standard_D3_v2 */ + StandardD3V2 = "Standard_D3_v2", + /** Standard_D4_v2 */ + StandardD4V2 = "Standard_D4_v2", + /** Standard_D5_v2 */ + StandardD5V2 = "Standard_D5_v2", + /** Standard_D2_v3 */ + StandardD2V3 = "Standard_D2_v3", + /** Standard_D4_v3 */ + StandardD4V3 = "Standard_D4_v3", + /** Standard_D8_v3 */ + StandardD8V3 = "Standard_D8_v3", + /** Standard_D16_v3 */ + StandardD16V3 = "Standard_D16_v3", + /** Standard_D32_v3 */ + StandardD32V3 = "Standard_D32_v3", + /** Standard_D64_v3 */ + StandardD64V3 = "Standard_D64_v3", + /** Standard_D2s_v3 */ + StandardD2SV3 = "Standard_D2s_v3", + /** Standard_D4s_v3 */ + StandardD4SV3 = "Standard_D4s_v3", + /** Standard_D8s_v3 */ + StandardD8SV3 = "Standard_D8s_v3", + /** Standard_D16s_v3 */ + StandardD16SV3 = "Standard_D16s_v3", + /** Standard_D32s_v3 */ + StandardD32SV3 = "Standard_D32s_v3", + /** Standard_D64s_v3 */ + StandardD64SV3 = "Standard_D64s_v3", + /** Standard_D11_v2 */ + StandardD11V2 = "Standard_D11_v2", + /** Standard_D12_v2 */ + StandardD12V2 = "Standard_D12_v2", + /** Standard_D13_v2 */ + StandardD13V2 = "Standard_D13_v2", + /** Standard_D14_v2 */ + StandardD14V2 = "Standard_D14_v2", + /** Standard_D15_v2 */ + StandardD15V2 = "Standard_D15_v2", + /** Standard_DS1 */ + StandardDS1 = "Standard_DS1", + /** Standard_DS2 */ + StandardDS2 = "Standard_DS2", + /** Standard_DS3 */ + StandardDS3 = "Standard_DS3", + /** Standard_DS4 */ + StandardDS4 = "Standard_DS4", + /** Standard_DS11 */ + StandardDS11 = "Standard_DS11", + /** Standard_DS12 */ + StandardDS12 = "Standard_DS12", + /** Standard_DS13 */ + StandardDS13 = "Standard_DS13", + /** Standard_DS14 */ + StandardDS14 = "Standard_DS14", + /** Standard_DS1_v2 */ + StandardDS1V2 = "Standard_DS1_v2", + /** Standard_DS2_v2 */ + StandardDS2V2 = "Standard_DS2_v2", + /** Standard_DS3_v2 */ + StandardDS3V2 = "Standard_DS3_v2", + /** Standard_DS4_v2 */ + StandardDS4V2 = "Standard_DS4_v2", + /** Standard_DS5_v2 */ + StandardDS5V2 = "Standard_DS5_v2", + /** Standard_DS11_v2 */ + StandardDS11V2 = "Standard_DS11_v2", + /** Standard_DS12_v2 */ + StandardDS12V2 = "Standard_DS12_v2", + /** Standard_DS13_v2 */ + StandardDS13V2 = "Standard_DS13_v2", + /** Standard_DS14_v2 */ + StandardDS14V2 = "Standard_DS14_v2", + /** Standard_DS15_v2 */ + StandardDS15V2 = "Standard_DS15_v2", + /** Standard_DS13-4_v2 */ + StandardDS134V2 = "Standard_DS13-4_v2", + /** Standard_DS13-2_v2 */ + StandardDS132V2 = "Standard_DS13-2_v2", + /** Standard_DS14-8_v2 */ + StandardDS148V2 = "Standard_DS14-8_v2", + /** Standard_DS14-4_v2 */ + StandardDS144V2 = "Standard_DS14-4_v2", + /** Standard_E2_v3 */ + StandardE2V3 = "Standard_E2_v3", + /** Standard_E4_v3 */ + StandardE4V3 = "Standard_E4_v3", + /** Standard_E8_v3 */ + StandardE8V3 = "Standard_E8_v3", + /** Standard_E16_v3 */ + StandardE16V3 = "Standard_E16_v3", + /** Standard_E32_v3 */ + StandardE32V3 = "Standard_E32_v3", + /** Standard_E64_v3 */ + StandardE64V3 = "Standard_E64_v3", + /** Standard_E2s_v3 */ + StandardE2SV3 = "Standard_E2s_v3", + /** Standard_E4s_v3 */ + StandardE4SV3 = "Standard_E4s_v3", + /** Standard_E8s_v3 */ + StandardE8SV3 = "Standard_E8s_v3", + /** Standard_E16s_v3 */ + StandardE16SV3 = "Standard_E16s_v3", + /** Standard_E32s_v3 */ + StandardE32SV3 = "Standard_E32s_v3", + /** Standard_E64s_v3 */ + StandardE64SV3 = "Standard_E64s_v3", + /** Standard_E32-16_v3 */ + StandardE3216V3 = "Standard_E32-16_v3", + /** Standard_E32-8s_v3 */ + StandardE328SV3 = "Standard_E32-8s_v3", + /** Standard_E64-32s_v3 */ + StandardE6432SV3 = "Standard_E64-32s_v3", + /** Standard_E64-16s_v3 */ + StandardE6416SV3 = "Standard_E64-16s_v3", + /** Standard_F1 */ + StandardF1 = "Standard_F1", + /** Standard_F2 */ + StandardF2 = "Standard_F2", + /** Standard_F4 */ + StandardF4 = "Standard_F4", + /** Standard_F8 */ + StandardF8 = "Standard_F8", + /** Standard_F16 */ + StandardF16 = "Standard_F16", + /** Standard_F1s */ + StandardF1S = "Standard_F1s", + /** Standard_F2s */ + StandardF2S = "Standard_F2s", + /** Standard_F4s */ + StandardF4S = "Standard_F4s", + /** Standard_F8s */ + StandardF8S = "Standard_F8s", + /** Standard_F16s */ + StandardF16S = "Standard_F16s", + /** Standard_F2s_v2 */ + StandardF2SV2 = "Standard_F2s_v2", + /** Standard_F4s_v2 */ + StandardF4SV2 = "Standard_F4s_v2", + /** Standard_F8s_v2 */ + StandardF8SV2 = "Standard_F8s_v2", + /** Standard_F16s_v2 */ + StandardF16SV2 = "Standard_F16s_v2", + /** Standard_F32s_v2 */ + StandardF32SV2 = "Standard_F32s_v2", + /** Standard_F64s_v2 */ + StandardF64SV2 = "Standard_F64s_v2", + /** Standard_F72s_v2 */ + StandardF72SV2 = "Standard_F72s_v2", + /** Standard_G1 */ + StandardG1 = "Standard_G1", + /** Standard_G2 */ + StandardG2 = "Standard_G2", + /** Standard_G3 */ + StandardG3 = "Standard_G3", + /** Standard_G4 */ + StandardG4 = "Standard_G4", + /** Standard_G5 */ + StandardG5 = "Standard_G5", + /** Standard_GS1 */ + StandardGS1 = "Standard_GS1", + /** Standard_GS2 */ + StandardGS2 = "Standard_GS2", + /** Standard_GS3 */ + StandardGS3 = "Standard_GS3", + /** Standard_GS4 */ + StandardGS4 = "Standard_GS4", + /** Standard_GS5 */ + StandardGS5 = "Standard_GS5", + /** Standard_GS4-8 */ + StandardGS48 = "Standard_GS4-8", + /** Standard_GS4-4 */ + StandardGS44 = "Standard_GS4-4", + /** Standard_GS5-16 */ + StandardGS516 = "Standard_GS5-16", + /** Standard_GS5-8 */ + StandardGS58 = "Standard_GS5-8", + /** Standard_H8 */ + StandardH8 = "Standard_H8", + /** Standard_H16 */ + StandardH16 = "Standard_H16", + /** Standard_H8m */ + StandardH8M = "Standard_H8m", + /** Standard_H16m */ + StandardH16M = "Standard_H16m", + /** Standard_H16r */ + StandardH16R = "Standard_H16r", + /** Standard_H16mr */ + StandardH16Mr = "Standard_H16mr", + /** Standard_L4s */ + StandardL4S = "Standard_L4s", + /** Standard_L8s */ + StandardL8S = "Standard_L8s", + /** Standard_L16s */ + StandardL16S = "Standard_L16s", + /** Standard_L32s */ + StandardL32S = "Standard_L32s", + /** Standard_M64s */ + StandardM64S = "Standard_M64s", + /** Standard_M64ms */ + StandardM64Ms = "Standard_M64ms", + /** Standard_M128s */ + StandardM128S = "Standard_M128s", + /** Standard_M128ms */ + StandardM128Ms = "Standard_M128ms", + /** Standard_M64-32ms */ + StandardM6432Ms = "Standard_M64-32ms", + /** Standard_M64-16ms */ + StandardM6416Ms = "Standard_M64-16ms", + /** Standard_M128-64ms */ + StandardM12864Ms = "Standard_M128-64ms", + /** Standard_M128-32ms */ + StandardM12832Ms = "Standard_M128-32ms", + /** Standard_NC6 */ + StandardNC6 = "Standard_NC6", + /** Standard_NC12 */ + StandardNC12 = "Standard_NC12", + /** Standard_NC24 */ + StandardNC24 = "Standard_NC24", + /** Standard_NC24r */ + StandardNC24R = "Standard_NC24r", + /** Standard_NC6s_v2 */ + StandardNC6SV2 = "Standard_NC6s_v2", + /** Standard_NC12s_v2 */ + StandardNC12SV2 = "Standard_NC12s_v2", + /** Standard_NC24s_v2 */ + StandardNC24SV2 = "Standard_NC24s_v2", + /** Standard_NC24rs_v2 */ + StandardNC24RsV2 = "Standard_NC24rs_v2", + /** Standard_NC6s_v3 */ + StandardNC6SV3 = "Standard_NC6s_v3", + /** Standard_NC12s_v3 */ + StandardNC12SV3 = "Standard_NC12s_v3", + /** Standard_NC24s_v3 */ + StandardNC24SV3 = "Standard_NC24s_v3", + /** Standard_NC24rs_v3 */ + StandardNC24RsV3 = "Standard_NC24rs_v3", + /** Standard_ND6s */ + StandardND6S = "Standard_ND6s", + /** Standard_ND12s */ + StandardND12S = "Standard_ND12s", + /** Standard_ND24s */ + StandardND24S = "Standard_ND24s", + /** Standard_ND24rs */ + StandardND24Rs = "Standard_ND24rs", + /** Standard_NV6 */ + StandardNV6 = "Standard_NV6", + /** Standard_NV12 */ + StandardNV12 = "Standard_NV12", + /** Standard_NV24 */ + StandardNV24 = "Standard_NV24", +} + +/** + * Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and availability set. \ + * {@link KnownVirtualMachineSizeTypes} can be used interchangeably with VirtualMachineSizeTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic_A0** \ + * **Basic_A1** \ + * **Basic_A2** \ + * **Basic_A3** \ + * **Basic_A4** \ + * **Standard_A0** \ + * **Standard_A1** \ + * **Standard_A2** \ + * **Standard_A3** \ + * **Standard_A4** \ + * **Standard_A5** \ + * **Standard_A6** \ + * **Standard_A7** \ + * **Standard_A8** \ + * **Standard_A9** \ + * **Standard_A10** \ + * **Standard_A11** \ + * **Standard_A1_v2** \ + * **Standard_A2_v2** \ + * **Standard_A4_v2** \ + * **Standard_A8_v2** \ + * **Standard_A2m_v2** \ + * **Standard_A4m_v2** \ + * **Standard_A8m_v2** \ + * **Standard_B1s** \ + * **Standard_B1ms** \ + * **Standard_B2s** \ + * **Standard_B2ms** \ + * **Standard_B4ms** \ + * **Standard_B8ms** \ + * **Standard_D1** \ + * **Standard_D2** \ + * **Standard_D3** \ + * **Standard_D4** \ + * **Standard_D11** \ + * **Standard_D12** \ + * **Standard_D13** \ + * **Standard_D14** \ + * **Standard_D1_v2** \ + * **Standard_D2_v2** \ + * **Standard_D3_v2** \ + * **Standard_D4_v2** \ + * **Standard_D5_v2** \ + * **Standard_D2_v3** \ + * **Standard_D4_v3** \ + * **Standard_D8_v3** \ + * **Standard_D16_v3** \ + * **Standard_D32_v3** \ + * **Standard_D64_v3** \ + * **Standard_D2s_v3** \ + * **Standard_D4s_v3** \ + * **Standard_D8s_v3** \ + * **Standard_D16s_v3** \ + * **Standard_D32s_v3** \ + * **Standard_D64s_v3** \ + * **Standard_D11_v2** \ + * **Standard_D12_v2** \ + * **Standard_D13_v2** \ + * **Standard_D14_v2** \ + * **Standard_D15_v2** \ + * **Standard_DS1** \ + * **Standard_DS2** \ + * **Standard_DS3** \ + * **Standard_DS4** \ + * **Standard_DS11** \ + * **Standard_DS12** \ + * **Standard_DS13** \ + * **Standard_DS14** \ + * **Standard_DS1_v2** \ + * **Standard_DS2_v2** \ + * **Standard_DS3_v2** \ + * **Standard_DS4_v2** \ + * **Standard_DS5_v2** \ + * **Standard_DS11_v2** \ + * **Standard_DS12_v2** \ + * **Standard_DS13_v2** \ + * **Standard_DS14_v2** \ + * **Standard_DS15_v2** \ + * **Standard_DS13-4_v2** \ + * **Standard_DS13-2_v2** \ + * **Standard_DS14-8_v2** \ + * **Standard_DS14-4_v2** \ + * **Standard_E2_v3** \ + * **Standard_E4_v3** \ + * **Standard_E8_v3** \ + * **Standard_E16_v3** \ + * **Standard_E32_v3** \ + * **Standard_E64_v3** \ + * **Standard_E2s_v3** \ + * **Standard_E4s_v3** \ + * **Standard_E8s_v3** \ + * **Standard_E16s_v3** \ + * **Standard_E32s_v3** \ + * **Standard_E64s_v3** \ + * **Standard_E32-16_v3** \ + * **Standard_E32-8s_v3** \ + * **Standard_E64-32s_v3** \ + * **Standard_E64-16s_v3** \ + * **Standard_F1** \ + * **Standard_F2** \ + * **Standard_F4** \ + * **Standard_F8** \ + * **Standard_F16** \ + * **Standard_F1s** \ + * **Standard_F2s** \ + * **Standard_F4s** \ + * **Standard_F8s** \ + * **Standard_F16s** \ + * **Standard_F2s_v2** \ + * **Standard_F4s_v2** \ + * **Standard_F8s_v2** \ + * **Standard_F16s_v2** \ + * **Standard_F32s_v2** \ + * **Standard_F64s_v2** \ + * **Standard_F72s_v2** \ + * **Standard_G1** \ + * **Standard_G2** \ + * **Standard_G3** \ + * **Standard_G4** \ + * **Standard_G5** \ + * **Standard_GS1** \ + * **Standard_GS2** \ + * **Standard_GS3** \ + * **Standard_GS4** \ + * **Standard_GS5** \ + * **Standard_GS4-8** \ + * **Standard_GS4-4** \ + * **Standard_GS5-16** \ + * **Standard_GS5-8** \ + * **Standard_H8** \ + * **Standard_H16** \ + * **Standard_H8m** \ + * **Standard_H16m** \ + * **Standard_H16r** \ + * **Standard_H16mr** \ + * **Standard_L4s** \ + * **Standard_L8s** \ + * **Standard_L16s** \ + * **Standard_L32s** \ + * **Standard_M64s** \ + * **Standard_M64ms** \ + * **Standard_M128s** \ + * **Standard_M128ms** \ + * **Standard_M64-32ms** \ + * **Standard_M64-16ms** \ + * **Standard_M128-64ms** \ + * **Standard_M128-32ms** \ + * **Standard_NC6** \ + * **Standard_NC12** \ + * **Standard_NC24** \ + * **Standard_NC24r** \ + * **Standard_NC6s_v2** \ + * **Standard_NC12s_v2** \ + * **Standard_NC24s_v2** \ + * **Standard_NC24rs_v2** \ + * **Standard_NC6s_v3** \ + * **Standard_NC12s_v3** \ + * **Standard_NC24s_v3** \ + * **Standard_NC24rs_v3** \ + * **Standard_ND6s** \ + * **Standard_ND12s** \ + * **Standard_ND24s** \ + * **Standard_ND24rs** \ + * **Standard_NV6** \ + * **Standard_NV12** \ + * **Standard_NV24** + */ +export type VirtualMachineSizeTypes = string; + +/** 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; + /** Specifies whether the regional disks should be aligned/moved to the VM zone. This is applicable only for VMs with placement property set. Please note that this change is irreversible. Minimum api-version: 2024-11-01. */ + alignRegionalDisksToVMZone?: boolean; +} + +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"], + alignRegionalDisksToVMZone: item["alignRegionalDisksToVMZone"], + }; +} + +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"], + alignRegionalDisksToVMZone: item["alignRegionalDisksToVMZone"], + }; +} + +/** 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 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:** 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. */ + 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; + /** Specifies the storage fault domain alignment type for the disk. */ + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + /** The managed disk parameters. */ + managedDisk?: ManagedDiskParameters; + /** Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. 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"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + 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"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersDeserializer(item["managedDisk"]), + deleteOption: item["deleteOption"], + }; +} + +/** 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 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"]), + }; +} + +/** 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"]), + }; +} + +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:** 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 data disk. 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. */ + 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; + /** Specifies the storage fault domain alignment type for the disk. */ + storageFaultDomainAlignment?: StorageFaultDomainAlignmentType; + /** 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 Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. */ + diskIopsReadWrite?: number; + /** Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. */ + diskMBpsReadWrite?: number; + /** 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.** 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'. */ + detachOption?: DiskDetachOptionTypes; + /** Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. 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"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersSerializer(item["managedDisk"]), + sourceResource: !item["sourceResource"] + ? item["sourceResource"] + : apiEntityReferenceSerializer(item["sourceResource"]), + toBeDetached: item["toBeDetached"], + diskIOPSReadWrite: item["diskIopsReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + 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"], + storageFaultDomainAlignment: item["storageFaultDomainAlignment"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersDeserializer(item["managedDisk"]), + sourceResource: !item["sourceResource"] + ? item["sourceResource"] + : apiEntityReferenceDeserializer(item["sourceResource"]), + toBeDetached: item["toBeDetached"], + diskIopsReadWrite: item["diskIOPSReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + detachOption: item["detachOption"], + deleteOption: item["deleteOption"], + }; +} + +/** 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 */ + 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** + */ +export type DiskDetachOptionTypes = string; + +/** 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 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 { + /** 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 networkInterfaceReferenceSerializer(item: NetworkInterfaceReference): any { + return { + id: item["id"], + properties: areAllPropsUndefined(item, ["primary", "deleteOption"]) + ? undefined + : _networkInterfaceReferencePropertiesSerializer(item), + }; +} + +export function networkInterfaceReferenceDeserializer(item: any): NetworkInterfaceReference { + return { + id: item["id"], + ...(!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"], + }; +} + +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; + /** Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration */ + tags?: Record; + /** 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[]; + 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 virtualMachineNetworkInterfaceConfigurationSerializer( + item: VirtualMachineNetworkInterfaceConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "primary", + "deleteOption", + "enableAcceleratedNetworking", + "disableTcpStateTracking", + "enableFpga", + "enableIPForwarding", + "networkSecurityGroup", + "dnsSettings", + "ipConfigurations", + "dscpConfiguration", + "auxiliaryMode", + "auxiliarySku", + ]) + ? undefined + : _virtualMachineNetworkInterfaceConfigurationPropertiesSerializer(item), + tags: item["tags"], + }; +} + +export function virtualMachineNetworkInterfaceConfigurationDeserializer( + item: any, +): VirtualMachineNetworkInterfaceConfiguration { + return { + name: item["name"], + ...(!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[]; + 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; + /** 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 virtualMachineNetworkInterfaceIPConfigurationSerializer( + item: VirtualMachineNetworkInterfaceIPConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "subnet", + "primary", + "publicIPAddressConfiguration", + "privateIPAddressVersion", + "applicationSecurityGroups", + "applicationGatewayBackendAddressPools", + "loadBalancerBackendAddressPools", + ]) + ? undefined + : _virtualMachineNetworkInterfaceIPConfigurationPropertiesSerializer(item), + }; +} + +export function virtualMachineNetworkInterfaceIPConfigurationDeserializer( + item: any, +): VirtualMachineNetworkInterfaceIPConfiguration { + return { + name: item["name"], + ...(!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 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; + /** 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 virtualMachinePublicIPAddressConfigurationSerializer( + item: VirtualMachinePublicIPAddressConfiguration, +): any { + return { + name: item["name"], + properties: areAllPropsUndefined(item, [ + "idleTimeoutInMinutes", + "deleteOption", + "dnsSettings", + "ipTags", + "publicIPPrefix", + "publicIPAddressVersion", + "publicIPAllocationMethod", + ]) + ? undefined + : _virtualMachinePublicIPAddressConfigurationPropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : publicIPAddressSkuSerializer(item["sku"]), + tags: item["tags"], + }; +} + +export function virtualMachinePublicIPAddressConfigurationDeserializer( + item: any, +): VirtualMachinePublicIPAddressConfiguration { + return { + name: item["name"], + ...(!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"], + }; +} + +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 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 */ + IPv4 = "IPv4", + /** IPv6 */ + IPv6 = "IPv6", +} + +/** + * 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'. \ + * {@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** \ + * **IPv6** + */ +export type IPVersions = string; + +/** Specify the public IP allocation type */ +export enum KnownPublicIPAllocationMethod { + /** Dynamic */ + Dynamic = "Dynamic", + /** Static */ + 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** \ + * **Static** + */ +export type PublicIPAllocationMethod = string; + +/** The instance view of a virtual machine. */ +export interface VirtualMachineInstanceView { + /** Specifies the update domain of the virtual machine. */ + platformUpdateDomain?: number; + /** Specifies the fault domain of the virtual machine. */ + platformFaultDomain?: number; + /** The computer name assigned to the virtual machine. */ + computerName?: string; + /** The Operating System running on the virtual machine. */ + osName?: string; + /** The version of Operating System running on the virtual machine. */ + osVersion?: string; + /** Specifies the HyperVGeneration Type associated with a resource */ + hyperVGeneration?: HyperVGenerationType; + /** The Remote desktop certificate thumbprint. */ + rdpThumbPrint?: string; + /** The VM Agent running on the virtual machine. */ + vmAgent?: VirtualMachineAgentInstanceView; + /** The Maintenance Operation status on the virtual machine. */ + maintenanceRedeployStatus?: MaintenanceRedeployStatus; + /** The virtual machine disk information. */ + disks?: DiskInstanceView[]; + /** The extensions information. */ + extensions?: VirtualMachineExtensionInstanceView[]; + /** The health status for the VM. */ + readonly vmHealth?: VirtualMachineHealthStatus; + /** 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. */ + bootDiagnostics?: BootDiagnosticsInstanceView; + /** Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. Minimum api-version: 2020-06-01. */ + readonly assignedHost?: string; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; + /** [Preview Feature] The status of virtual machine patch operations. */ + patchStatus?: VirtualMachinePatchStatus; + /** [Preview Feature] Specifies whether the VM is currently in or out of the Standby Pool. */ + readonly isVMInStandbyPool?: boolean; +} + +export function virtualMachineInstanceViewDeserializer(item: any): VirtualMachineInstanceView { + return { + platformUpdateDomain: item["platformUpdateDomain"], + platformFaultDomain: item["platformFaultDomain"], + computerName: item["computerName"], + osName: item["osName"], + osVersion: item["osVersion"], + hyperVGeneration: item["hyperVGeneration"], + rdpThumbPrint: item["rdpThumbPrint"], + vmAgent: !item["vmAgent"] + ? item["vmAgent"] + : virtualMachineAgentInstanceViewDeserializer(item["vmAgent"]), + maintenanceRedeployStatus: !item["maintenanceRedeployStatus"] + ? item["maintenanceRedeployStatus"] + : maintenanceRedeployStatusDeserializer(item["maintenanceRedeployStatus"]), + disks: !item["disks"] ? item["disks"] : diskInstanceViewArrayDeserializer(item["disks"]), + extensions: !item["extensions"] + ? item["extensions"] + : virtualMachineExtensionInstanceViewArrayDeserializer(item["extensions"]), + vmHealth: !item["vmHealth"] + ? item["vmHealth"] + : virtualMachineHealthStatusDeserializer(item["vmHealth"]), + bootDiagnostics: !item["bootDiagnostics"] + ? item["bootDiagnostics"] + : bootDiagnosticsInstanceViewDeserializer(item["bootDiagnostics"]), + assignedHost: item["assignedHost"], + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + patchStatus: !item["patchStatus"] + ? item["patchStatus"] + : virtualMachinePatchStatusDeserializer(item["patchStatus"]), + isVMInStandbyPool: item["isVMInStandbyPool"], + }; +} + +/** Specifies the HyperVGeneration Type associated with a resource */ +export enum KnownHyperVGenerationType { + /** V1 */ + V1 = "V1", + /** V2 */ + V2 = "V2", +} + +/** + * Specifies the HyperVGeneration Type associated with a resource \ + * {@link KnownHyperVGenerationType} can be used interchangeably with HyperVGenerationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **V1** \ + * **V2** + */ +export type HyperVGenerationType = string; + +/** The instance view of the VM Agent running on the virtual machine. */ +export interface VirtualMachineAgentInstanceView { + /** The VM Agent full version. */ + vmAgentVersion?: string; + /** The virtual machine extension handler instance view. */ + extensionHandlers?: VirtualMachineExtensionHandlerInstanceView[]; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; +} + +export function virtualMachineAgentInstanceViewDeserializer( + item: any, +): VirtualMachineAgentInstanceView { + return { + vmAgentVersion: item["vmAgentVersion"], + extensionHandlers: !item["extensionHandlers"] + ? item["extensionHandlers"] + : virtualMachineExtensionHandlerInstanceViewArrayDeserializer(item["extensionHandlers"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + }; +} + +export function virtualMachineExtensionHandlerInstanceViewArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineExtensionHandlerInstanceViewDeserializer(item); + }); +} + +/** The instance view of a virtual machine extension handler. */ +export interface VirtualMachineExtensionHandlerInstanceView { + /** Specifies the type of the extension; an example is "CustomScriptExtension". */ + type?: string; + /** Specifies the version of the script handler. */ + typeHandlerVersion?: string; + /** The extension handler status. */ + status?: InstanceViewStatus; +} + +export function virtualMachineExtensionHandlerInstanceViewDeserializer( + item: any, +): VirtualMachineExtensionHandlerInstanceView { + return { + type: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + status: !item["status"] ? item["status"] : instanceViewStatusDeserializer(item["status"]), + }; +} + +/** Maintenance Operation Status. */ +export interface MaintenanceRedeployStatus { + /** True, if customer is allowed to perform Maintenance. */ + isCustomerInitiatedMaintenanceAllowed?: boolean; + /** Start Time for the Pre Maintenance Window. */ + preMaintenanceWindowStartTime?: Date; + /** End Time for the Pre Maintenance Window. */ + preMaintenanceWindowEndTime?: Date; + /** Start Time for the Maintenance Window. */ + maintenanceWindowStartTime?: Date; + /** End Time for the Maintenance Window. */ + maintenanceWindowEndTime?: Date; + /** The Last Maintenance Operation Result Code. */ + lastOperationResultCode?: MaintenanceOperationResultCodeTypes; + /** Message returned for the last Maintenance Operation. */ + lastOperationMessage?: string; +} + +export function maintenanceRedeployStatusDeserializer(item: any): MaintenanceRedeployStatus { + return { + isCustomerInitiatedMaintenanceAllowed: item["isCustomerInitiatedMaintenanceAllowed"], + preMaintenanceWindowStartTime: !item["preMaintenanceWindowStartTime"] + ? item["preMaintenanceWindowStartTime"] + : new Date(item["preMaintenanceWindowStartTime"]), + preMaintenanceWindowEndTime: !item["preMaintenanceWindowEndTime"] + ? item["preMaintenanceWindowEndTime"] + : new Date(item["preMaintenanceWindowEndTime"]), + maintenanceWindowStartTime: !item["maintenanceWindowStartTime"] + ? item["maintenanceWindowStartTime"] + : new Date(item["maintenanceWindowStartTime"]), + maintenanceWindowEndTime: !item["maintenanceWindowEndTime"] + ? item["maintenanceWindowEndTime"] + : new Date(item["maintenanceWindowEndTime"]), + lastOperationResultCode: item["lastOperationResultCode"], + lastOperationMessage: item["lastOperationMessage"], + }; +} + +/** The Last Maintenance Operation Result Code. */ +export type MaintenanceOperationResultCodeTypes = + | "None" + | "RetryLater" + | "MaintenanceAborted" + | "MaintenanceCompleted"; + +export function diskInstanceViewArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return diskInstanceViewDeserializer(item); + }); +} + +/** The instance view of the disk. */ +export interface DiskInstanceView { + /** The disk name. */ + name?: string; + /** Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15 */ + encryptionSettings?: DiskEncryptionSettings[]; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; + /** Specifies the storage alignment status for the disk. */ + storageAlignmentStatus?: StorageAlignmentStatus; +} + +export function diskInstanceViewDeserializer(item: any): DiskInstanceView { + return { + name: item["name"], + encryptionSettings: !item["encryptionSettings"] + ? item["encryptionSettings"] + : diskEncryptionSettingsArrayDeserializer(item["encryptionSettings"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + storageAlignmentStatus: item["storageAlignmentStatus"], + }; +} + +export function diskEncryptionSettingsArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return diskEncryptionSettingsSerializer(item); + }); +} + +export function diskEncryptionSettingsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return diskEncryptionSettingsDeserializer(item); + }); +} + +/** Specifies the storage alignment status for the disk. */ +export enum KnownStorageAlignmentStatus { + /** Disk does not have Storage Fault Domain to Compute Fault Domain mapping. A single Storage Fault Domain failure may impact all VMs that reference this disk profile. */ + Unaligned = "Unaligned", + /** Disk has Storage Fault Domain to Compute Fault Domain mapping. Storage Fault Domain failure is contained to VMs in a single Compute Fault Domain. */ + Aligned = "Aligned", +} + +/** + * Specifies the storage alignment status for the disk. \ + * {@link KnownStorageAlignmentStatus} can be used interchangeably with StorageAlignmentStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unaligned**: Disk does not have Storage Fault Domain to Compute Fault Domain mapping. A single Storage Fault Domain failure may impact all VMs that reference this disk profile. \ + * **Aligned**: Disk has Storage Fault Domain to Compute Fault Domain mapping. Storage Fault Domain failure is contained to VMs in a single Compute Fault Domain. + */ +export type StorageAlignmentStatus = string; + +export function virtualMachineExtensionInstanceViewArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineExtensionInstanceViewSerializer(item); + }); +} + +export function virtualMachineExtensionInstanceViewArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineExtensionInstanceViewDeserializer(item); + }); +} + +/** The health status of the VM. */ +export interface VirtualMachineHealthStatus { + /** The health status information for the VM. */ + readonly status?: InstanceViewStatus; +} + +export function virtualMachineHealthStatusDeserializer(item: any): VirtualMachineHealthStatus { + return { + status: !item["status"] ? item["status"] : instanceViewStatusDeserializer(item["status"]), + }; +} + +/** The instance view of a virtual machine boot diagnostics. */ +export interface BootDiagnosticsInstanceView { + /** The console screenshot blob URI. **Note:** This will **not** be set if boot diagnostics is currently enabled with managed storage. */ + readonly consoleScreenshotBlobUri?: string; + /** The serial console log blob Uri. **Note:** This will **not** be set if boot diagnostics is currently enabled with managed storage. */ + readonly serialConsoleLogBlobUri?: string; + /** The boot diagnostics status information for the VM. **Note:** It will be set only if there are errors encountered in enabling boot diagnostics. */ + readonly status?: InstanceViewStatus; +} + +export function bootDiagnosticsInstanceViewDeserializer(item: any): BootDiagnosticsInstanceView { + return { + consoleScreenshotBlobUri: item["consoleScreenshotBlobUri"], + serialConsoleLogBlobUri: item["serialConsoleLogBlobUri"], + status: !item["status"] ? item["status"] : instanceViewStatusDeserializer(item["status"]), + }; +} + +/** The status of virtual machine patch operations. */ +export interface VirtualMachinePatchStatus { + /** The available patch summary of the latest assessment operation for the virtual machine. */ + availablePatchSummary?: AvailablePatchSummary; + /** The installation summary of the latest installation operation for the virtual machine. */ + lastPatchInstallationSummary?: LastPatchInstallationSummary; + /** The enablement status of the specified patchMode */ + readonly configurationStatuses?: InstanceViewStatus[]; +} + +export function virtualMachinePatchStatusDeserializer(item: any): VirtualMachinePatchStatus { + return { + availablePatchSummary: !item["availablePatchSummary"] + ? item["availablePatchSummary"] + : availablePatchSummaryDeserializer(item["availablePatchSummary"]), + lastPatchInstallationSummary: !item["lastPatchInstallationSummary"] + ? item["lastPatchInstallationSummary"] + : lastPatchInstallationSummaryDeserializer(item["lastPatchInstallationSummary"]), + configurationStatuses: !item["configurationStatuses"] + ? item["configurationStatuses"] + : instanceViewStatusArrayDeserializer(item["configurationStatuses"]), + }; +} + +/** Describes the properties of an virtual machine instance view for available patch summary. */ +export interface AvailablePatchSummary { + /** The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." */ + readonly status?: PatchOperationStatus; + /** The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. */ + readonly assessmentActivityId?: string; + /** The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. */ + readonly rebootPending?: boolean; + /** The number of critical or security patches that have been detected as available and not yet installed. */ + readonly criticalAndSecurityPatchCount?: number; + /** The number of all available patches excluding critical and security. */ + readonly otherPatchCount?: number; + /** The UTC timestamp when the operation began. */ + readonly startTime?: Date; + /** The UTC timestamp when the operation began. */ + readonly lastModifiedTime?: Date; + /** The errors that were encountered during execution of the operation. The details array contains the list of them. */ + readonly error?: ApiError; +} + +export function availablePatchSummaryDeserializer(item: any): AvailablePatchSummary { + return { + status: item["status"], + assessmentActivityId: item["assessmentActivityId"], + rebootPending: item["rebootPending"], + criticalAndSecurityPatchCount: item["criticalAndSecurityPatchCount"], + otherPatchCount: item["otherPatchCount"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + lastModifiedTime: !item["lastModifiedTime"] + ? item["lastModifiedTime"] + : new Date(item["lastModifiedTime"]), + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +/** The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." */ +export enum KnownPatchOperationStatus { + /** Unknown */ + Unknown = "Unknown", + /** InProgress */ + InProgress = "InProgress", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** CompletedWithWarnings */ + CompletedWithWarnings = "CompletedWithWarnings", +} + +/** + * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." \ + * {@link KnownPatchOperationStatus} can be used interchangeably with PatchOperationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **InProgress** \ + * **Failed** \ + * **Succeeded** \ + * **CompletedWithWarnings** + */ +export type PatchOperationStatus = string; + +/** Describes the properties of the last installed patch summary. */ +export interface LastPatchInstallationSummary { + /** The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." */ + readonly status?: PatchOperationStatus; + /** The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. */ + readonly installationActivityId?: string; + /** Describes whether the operation ran out of time before it completed all its intended actions */ + readonly maintenanceWindowExceeded?: boolean; + /** The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry. */ + readonly notSelectedPatchCount?: number; + /** The number of all available patches but excluded explicitly by a customer-specified exclusion list match. */ + readonly excludedPatchCount?: number; + /** The number of all available patches expected to be installed over the course of the patch installation operation. */ + readonly pendingPatchCount?: number; + /** The count of patches that successfully installed. */ + readonly installedPatchCount?: number; + /** The count of patches that failed installation. */ + readonly failedPatchCount?: number; + /** The UTC timestamp when the operation began. */ + readonly startTime?: Date; + /** The UTC timestamp when the operation began. */ + readonly lastModifiedTime?: Date; + /** The errors that were encountered during execution of the operation. The details array contains the list of them. */ + readonly error?: ApiError; +} + +export function lastPatchInstallationSummaryDeserializer(item: any): LastPatchInstallationSummary { + return { + status: item["status"], + installationActivityId: item["installationActivityId"], + maintenanceWindowExceeded: item["maintenanceWindowExceeded"], + notSelectedPatchCount: item["notSelectedPatchCount"], + excludedPatchCount: item["excludedPatchCount"], + pendingPatchCount: item["pendingPatchCount"], + installedPatchCount: item["installedPatchCount"], + failedPatchCount: item["failedPatchCount"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + lastModifiedTime: !item["lastModifiedTime"] + ? item["lastModifiedTime"] + : new Date(item["lastModifiedTime"]), + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +/** Gets resiliency solutions enabled on the VM. This includes backup or disaster recovery solutions. */ +export interface ResiliencyProfile { + /** Zone movement configuration. */ + zoneMovement?: ZoneMovement; +} + +export function resiliencyProfileSerializer(item: ResiliencyProfile): any { + return { + zoneMovement: !item["zoneMovement"] + ? item["zoneMovement"] + : zoneMovementSerializer(item["zoneMovement"]), + }; +} + +export function resiliencyProfileDeserializer(item: any): ResiliencyProfile { + return { + zoneMovement: !item["zoneMovement"] + ? item["zoneMovement"] + : zoneMovementDeserializer(item["zoneMovement"]), + }; +} + +/** Describes zone movement configuration. This allows VM to be moved across availability zones during an outage. */ +export interface ZoneMovement { + /** Indicates if zone movement is enabled. By default isEnabled is set to false i.e VM can't be moved from one zone to another. */ + isEnabled?: boolean; +} + +export function zoneMovementSerializer(item: ZoneMovement): any { + return { isEnabled: item["isEnabled"] }; +} + +export function zoneMovementDeserializer(item: any): ZoneMovement { + return { + isEnabled: item["isEnabled"], + }; +} + +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); + }); +} + +/** Describes a Virtual Machine Extension. */ +export interface VirtualMachineExtension extends TrackedResource { + /** 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". */ + typePropertiesType?: 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The virtual machine extension instance view. */ + instanceView?: VirtualMachineExtensionInstanceView; + /** 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 virtualMachineExtensionSerializer(item: VirtualMachineExtension): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "forceUpdateTag", + "publisher", + "type", + "typeHandlerVersion", + "autoUpgradeMinorVersion", + "enableAutomaticUpgrade", + "settings", + "protectedSettings", + "instanceView", + "suppressFailures", + "protectedSettingsFromKeyVault", + "provisionAfterExtensions", + ]) + ? undefined + : _virtualMachineExtensionPropertiesSerializer(item), + }; +} + +export function virtualMachineExtensionDeserializer(item: any): VirtualMachineExtension { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _virtualMachineExtensionPropertiesDeserializer(item["properties"])), + }; +} + +/** Identity for the virtual machine. */ +export interface VirtualMachineIdentity { + /** The principal id of virtual machine identity. This property will only be provided for a system assigned identity. */ + readonly principalId?: string; + /** The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. */ + type?: ResourceIdentityType; + /** The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: Record; +} + +export function virtualMachineIdentitySerializer(item: VirtualMachineIdentity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function virtualMachineIdentityDeserializer(item: any): VirtualMachineIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** Describes a Virtual Machine Update. */ +export interface VirtualMachineUpdate extends UpdateResource { + /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ + plan?: Plan; + /** The identity of the virtual machine, if configured. */ + identity?: VirtualMachineIdentity; + /** The virtual machine zones. */ + zones?: string[]; + /** Specifies the hardware settings for the virtual machine. */ + hardwareProfile?: HardwareProfile; + /** 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 api-version: 2015-06-15. */ + diagnosticsProfile?: DiagnosticsProfile; + /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. */ + availabilitySet?: SubResource; + /** Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. */ + virtualMachineScaleSet?: SubResource; + /** Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 */ + priority?: VirtualMachinePriorityTypes; + /** Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. */ + evictionPolicy?: VirtualMachineEvictionPolicyTypes; + /** Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. */ + billingProfile?: BillingProfile; + /** Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. */ + host?: SubResource; + /** Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. */ + hostGroup?: SubResource; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The virtual machine instance view. */ + readonly instanceView?: VirtualMachineInstanceView; + /** 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 VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. */ + readonly vmId?: 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 api-version: 2020-06-01. */ + extensionsTimeBudget?: string; + /** Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. */ + platformFaultDomain?: number; + /** 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 api-version: 2021-03-01. */ + userData?: string; + /** Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. */ + capacityReservation?: CapacityReservationProfile; + /** Specifies the gallery applications that should be made available to the VM/VMSS. */ + applicationProfile?: ApplicationProfile; + /** Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Resiliency profile for the virtual machine. */ + resiliencyProfile?: ResiliencyProfile; +} + +export function virtualMachineUpdateSerializer(item: VirtualMachineUpdate): any { + return { + tags: item["tags"], + plan: !item["plan"] ? item["plan"] : planSerializer(item["plan"]), + properties: areAllPropsUndefined(item, [ + "hardwareProfile", + "scheduledEventsPolicy", + "storageProfile", + "additionalCapabilities", + "osProfile", + "networkProfile", + "securityProfile", + "diagnosticsProfile", + "availabilitySet", + "virtualMachineScaleSet", + "proximityPlacementGroup", + "priority", + "evictionPolicy", + "billingProfile", + "host", + "hostGroup", + "licenseType", + "extensionsTimeBudget", + "platformFaultDomain", + "scheduledEventsProfile", + "userData", + "capacityReservation", + "applicationProfile", + "resiliencyProfile", + ]) + ? undefined + : _virtualMachineUpdatePropertiesSerializer(item), + identity: !item["identity"] + ? item["identity"] + : virtualMachineIdentitySerializer(item["identity"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** The List Virtual Machine operation response. */ +export interface _VirtualMachineListResult { + /** The list of virtual machines. */ + value: VirtualMachine[]; + /** The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. */ + nextLink?: string; +} + +export function _virtualMachineListResultDeserializer(item: any): _VirtualMachineListResult { + return { + value: virtualMachineArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineArraySerializer(result: Array): any[] { + return result.map((item) => { + return virtualMachineSerializer(item); + }); +} + +export function virtualMachineArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualMachineDeserializer(item); + }); +} + +/** Describes the properties of an AssessPatches result. */ +export interface VirtualMachineAssessPatchesResult { + /** The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." */ + readonly status?: PatchOperationStatus; + /** The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. */ + readonly assessmentActivityId?: string; + /** The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. */ + readonly rebootPending?: boolean; + /** The number of critical or security patches that have been detected as available and not yet installed. */ + readonly criticalAndSecurityPatchCount?: number; + /** The number of all available patches excluding critical and security. */ + readonly otherPatchCount?: number; + /** The UTC timestamp when the operation began. */ + readonly startDateTime?: Date; + /** The list of patches that have been detected as available for installation. */ + readonly availablePatches?: VirtualMachineSoftwarePatchProperties[]; + /** The errors that were encountered during execution of the operation. The details array contains the list of them. */ + readonly error?: ApiError; +} + +export function virtualMachineAssessPatchesResultDeserializer( + item: any, +): VirtualMachineAssessPatchesResult { + return { + status: item["status"], + assessmentActivityId: item["assessmentActivityId"], + rebootPending: item["rebootPending"], + criticalAndSecurityPatchCount: item["criticalAndSecurityPatchCount"], + otherPatchCount: item["otherPatchCount"], + startDateTime: !item["startDateTime"] ? item["startDateTime"] : new Date(item["startDateTime"]), + availablePatches: !item["availablePatches"] + ? item["availablePatches"] + : virtualMachineSoftwarePatchPropertiesArrayDeserializer(item["availablePatches"]), + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +export function virtualMachineSoftwarePatchPropertiesArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineSoftwarePatchPropertiesDeserializer(item); + }); +} + +/** Describes the properties of a Virtual Machine software patch. */ +export interface VirtualMachineSoftwarePatchProperties { + /** A unique identifier for the patch. */ + readonly patchId?: string; + /** The friendly name of the patch. */ + readonly name?: string; + /** The version number of the patch. This property applies only to Linux patches. */ + readonly version?: string; + /** The KBID of the patch. Only applies to Windows patches. */ + readonly kbId?: string; + /** The classification(s) of the patch as provided by the patch publisher. */ + readonly classifications?: string[]; + /** Describes the reboot requirements of the patch. */ + readonly rebootBehavior?: VMGuestPatchRebootBehavior; + /** The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. */ + readonly activityId?: string; + /** The UTC timestamp when the repository published this patch. */ + readonly publishedDate?: Date; + /** The UTC timestamp of the last update to this patch record. */ + readonly lastModifiedDateTime?: Date; + /** Describes the availability of a given patch. */ + readonly assessmentState?: PatchAssessmentState; +} + +export function virtualMachineSoftwarePatchPropertiesDeserializer( + item: any, +): VirtualMachineSoftwarePatchProperties { + return { + patchId: item["patchId"], + name: item["name"], + version: item["version"], + kbId: item["kbId"], + classifications: !item["classifications"] + ? item["classifications"] + : item["classifications"].map((p: any) => { + return p; + }), + rebootBehavior: item["rebootBehavior"], + activityId: item["activityId"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + lastModifiedDateTime: !item["lastModifiedDateTime"] + ? item["lastModifiedDateTime"] + : new Date(item["lastModifiedDateTime"]), + assessmentState: item["assessmentState"], + }; +} + +/** Describes the reboot requirements of the patch. */ +export enum KnownVMGuestPatchRebootBehavior { + /** Unknown */ + Unknown = "Unknown", + /** NeverReboots */ + NeverReboots = "NeverReboots", + /** AlwaysRequiresReboot */ + AlwaysRequiresReboot = "AlwaysRequiresReboot", + /** CanRequestReboot */ + CanRequestReboot = "CanRequestReboot", +} + +/** + * Describes the reboot requirements of the patch. \ + * {@link KnownVMGuestPatchRebootBehavior} can be used interchangeably with VMGuestPatchRebootBehavior, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **NeverReboots** \ + * **AlwaysRequiresReboot** \ + * **CanRequestReboot** + */ +export type VMGuestPatchRebootBehavior = string; + +/** Describes the availability of a given patch. */ +export enum KnownPatchAssessmentState { + /** Unknown */ + Unknown = "Unknown", + /** Available */ + Available = "Available", +} + +/** + * Describes the availability of a given patch. \ + * {@link KnownPatchAssessmentState} can be used interchangeably with PatchAssessmentState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Available** + */ +export type PatchAssessmentState = string; + +/** Specifies the input for attaching and detaching a list of managed data disks. */ +export interface AttachDetachDataDisksRequest { + /** The list of managed data disks to be attached. */ + dataDisksToAttach?: DataDisksToAttach[]; + /** The list of managed data disks to be detached. */ + dataDisksToDetach?: DataDisksToDetach[]; +} + +export function attachDetachDataDisksRequestSerializer(item: AttachDetachDataDisksRequest): any { + return { + dataDisksToAttach: !item["dataDisksToAttach"] + ? item["dataDisksToAttach"] + : dataDisksToAttachArraySerializer(item["dataDisksToAttach"]), + dataDisksToDetach: !item["dataDisksToDetach"] + ? item["dataDisksToDetach"] + : dataDisksToDetachArraySerializer(item["dataDisksToDetach"]), + }; +} + +export function dataDisksToAttachArraySerializer(result: Array): any[] { + return result.map((item) => { + return dataDisksToAttachSerializer(item); + }); +} + +/** Describes the data disk to be attached. */ +export interface DataDisksToAttach { + /** ID of the managed data disk. */ + diskId: string; + /** 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. If not specified, lun would be auto assigned. */ + lun?: number; + /** 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 data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**. */ + deleteOption?: DiskDeleteOptionTypes; + /** Specifies the customer managed disk encryption set resource id for the managed disk. */ + diskEncryptionSet?: DiskEncryptionSetParameters; + /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ + writeAcceleratorEnabled?: boolean; +} + +export function dataDisksToAttachSerializer(item: DataDisksToAttach): any { + return { + diskId: item["diskId"], + lun: item["lun"], + caching: item["caching"], + deleteOption: item["deleteOption"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + }; +} + +export function dataDisksToDetachArraySerializer(result: Array): any[] { + return result.map((item) => { + return dataDisksToDetachSerializer(item); + }); +} + +/** Describes the data disk to be detached. */ +export interface DataDisksToDetach { + /** ID of the managed data disk. */ + diskId: string; + /** Supported options available for Detach of a disk from a VM. Refer to DetachOption object reference for more details. */ + detachOption?: DiskDetachOptionTypes; +} + +export function dataDisksToDetachSerializer(item: DataDisksToDetach): any { + return { diskId: item["diskId"], detachOption: item["detachOption"] }; +} + +/** Capture Virtual Machine parameters. */ +export interface VirtualMachineCaptureParameters { + /** The captured virtual hard disk's name prefix. */ + vhdPrefix: string; + /** The destination container name. */ + destinationContainerName: string; + /** Specifies whether to overwrite the destination virtual hard disk, in case of conflict. */ + overwriteVhds: boolean; +} + +export function virtualMachineCaptureParametersSerializer( + item: VirtualMachineCaptureParameters, +): any { + return { + vhdPrefix: item["vhdPrefix"], + destinationContainerName: item["destinationContainerName"], + overwriteVhds: item["overwriteVhds"], + }; +} + +/** Output of virtual machine capture operation. */ +export interface VirtualMachineCaptureResult extends SubResource { + /** the schema of the captured virtual machine */ + readonly schema?: string; + /** the version of the content */ + readonly contentVersion?: string; + /** parameters of the captured virtual machine */ + readonly parameters?: any; + /** a list of resource items of the captured virtual machine */ + readonly resources?: any[]; +} + +export function virtualMachineCaptureResultDeserializer(item: any): VirtualMachineCaptureResult { + return { + id: item["id"], + schema: item["$schema"], + contentVersion: item["contentVersion"], + parameters: item["parameters"], + resources: !item["resources"] + ? item["resources"] + : item["resources"].map((p: any) => { + return p; + }), + }; +} + +/** Input for InstallPatches as directly received by the API */ +export interface VirtualMachineInstallPatchesParameters { + /** Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours) */ + maximumDuration?: string; + /** Defines when it is acceptable to reboot a VM during a software update operation. */ + rebootSetting: VMGuestPatchRebootSetting; + /** Input for InstallPatches on a Windows VM, as directly received by the API */ + windowsParameters?: WindowsParameters; + /** Input for InstallPatches on a Linux VM, as directly received by the API */ + linuxParameters?: LinuxParameters; +} + +export function virtualMachineInstallPatchesParametersSerializer( + item: VirtualMachineInstallPatchesParameters, +): any { + return { + maximumDuration: item["maximumDuration"], + rebootSetting: item["rebootSetting"], + windowsParameters: !item["windowsParameters"] + ? item["windowsParameters"] + : windowsParametersSerializer(item["windowsParameters"]), + linuxParameters: !item["linuxParameters"] + ? item["linuxParameters"] + : linuxParametersSerializer(item["linuxParameters"]), + }; +} + +/** Defines when it is acceptable to reboot a VM during a software update operation. */ +export enum KnownVMGuestPatchRebootSetting { + /** IfRequired */ + IfRequired = "IfRequired", + /** Never */ + Never = "Never", + /** Always */ + Always = "Always", +} + +/** + * Defines when it is acceptable to reboot a VM during a software update operation. \ + * {@link KnownVMGuestPatchRebootSetting} can be used interchangeably with VMGuestPatchRebootSetting, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IfRequired** \ + * **Never** \ + * **Always** + */ +export type VMGuestPatchRebootSetting = string; + +/** Input for InstallPatches on a Windows VM, as directly received by the API */ +export interface WindowsParameters { + /** The update classifications to select when installing patches for Windows. */ + classificationsToInclude?: VMGuestPatchClassificationWindows[]; + /** Kbs to include in the patch operation */ + kbNumbersToInclude?: string[]; + /** Kbs to exclude in the patch operation */ + kbNumbersToExclude?: string[]; + /** Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. */ + excludeKbsRequiringReboot?: boolean; + /** This is used to install patches that were published on or before this given max published date. */ + maxPatchPublishDate?: Date; + /** This is used to include patches that match the given patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only supported as input values in the list. Null, empty and only whitespaces strings as inputs values are not supported. */ + patchNameMasksToInclude?: string[]; + /** This is used to exclude patches that match the given patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only supported as input values in the list. Null, empty and only whitespaces strings as inputs values are not supported. */ + patchNameMasksToExclude?: string[]; +} + +export function windowsParametersSerializer(item: WindowsParameters): any { + return { + classificationsToInclude: !item["classificationsToInclude"] + ? item["classificationsToInclude"] + : item["classificationsToInclude"].map((p: any) => { + return p; + }), + kbNumbersToInclude: !item["kbNumbersToInclude"] + ? item["kbNumbersToInclude"] + : item["kbNumbersToInclude"].map((p: any) => { + return p; + }), + kbNumbersToExclude: !item["kbNumbersToExclude"] + ? item["kbNumbersToExclude"] + : item["kbNumbersToExclude"].map((p: any) => { + return p; + }), + excludeKbsRequiringReboot: item["excludeKbsRequiringReboot"], + maxPatchPublishDate: !item["maxPatchPublishDate"] + ? item["maxPatchPublishDate"] + : item["maxPatchPublishDate"].toISOString(), + patchNameMasksToInclude: !item["patchNameMasksToInclude"] + ? item["patchNameMasksToInclude"] + : item["patchNameMasksToInclude"].map((p: any) => { + return p; + }), + patchNameMasksToExclude: !item["patchNameMasksToExclude"] + ? item["patchNameMasksToExclude"] + : item["patchNameMasksToExclude"].map((p: any) => { + return p; + }), + }; +} + +/** Known values of {@link VMGuestPatchClassificationWindows} that the service accepts. */ +export enum KnownVMGuestPatchClassificationWindows { + /** Critical */ + Critical = "Critical", + /** Security */ + Security = "Security", + /** UpdateRollUp */ + UpdateRollUp = "UpdateRollUp", + /** FeaturePack */ + FeaturePack = "FeaturePack", + /** ServicePack */ + ServicePack = "ServicePack", + /** Definition */ + Definition = "Definition", + /** Tools */ + Tools = "Tools", + /** Updates */ + Updates = "Updates", +} + +/** Type of VMGuestPatchClassificationWindows */ +export type VMGuestPatchClassificationWindows = string; + +/** Input for InstallPatches on a Linux VM, as directly received by the API */ +export interface LinuxParameters { + /** The update classifications to select when installing patches for Linux. */ + classificationsToInclude?: VMGuestPatchClassificationLinux[]; + /** packages to include in the patch operation. Format: packageName_packageVersion */ + packageNameMasksToInclude?: string[]; + /** packages to exclude in the patch operation. Format: packageName_packageVersion */ + packageNameMasksToExclude?: string[]; + /** This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. */ + maintenanceRunId?: string; +} + +export function linuxParametersSerializer(item: LinuxParameters): any { + return { + classificationsToInclude: !item["classificationsToInclude"] + ? item["classificationsToInclude"] + : item["classificationsToInclude"].map((p: any) => { + return p; + }), + packageNameMasksToInclude: !item["packageNameMasksToInclude"] + ? item["packageNameMasksToInclude"] + : item["packageNameMasksToInclude"].map((p: any) => { + return p; + }), + packageNameMasksToExclude: !item["packageNameMasksToExclude"] + ? item["packageNameMasksToExclude"] + : item["packageNameMasksToExclude"].map((p: any) => { + return p; + }), + maintenanceRunId: item["maintenanceRunId"], + }; +} + +/** Known values of {@link VMGuestPatchClassificationLinux} that the service accepts. */ +export enum KnownVMGuestPatchClassificationLinux { + /** Critical */ + Critical = "Critical", + /** Security */ + Security = "Security", + /** Other */ + Other = "Other", +} + +/** Type of VMGuestPatchClassificationLinux */ +export type VMGuestPatchClassificationLinux = string; + +/** The result summary of an installation operation. */ +export interface VirtualMachineInstallPatchesResult { + /** The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." */ + readonly status?: PatchOperationStatus; + /** The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. */ + readonly installationActivityId?: string; + /** The reboot state of the VM following completion of the operation. */ + readonly rebootStatus?: VMGuestPatchRebootStatus; + /** Whether the operation ran out of time before it completed all its intended actions. */ + readonly maintenanceWindowExceeded?: boolean; + /** The number of patches that were not installed due to the user blocking their installation. */ + readonly excludedPatchCount?: number; + /** The number of patches that were detected as available for install, but did not meet the operation's criteria. */ + readonly notSelectedPatchCount?: number; + /** The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. */ + readonly pendingPatchCount?: number; + /** The number of patches successfully installed. */ + readonly installedPatchCount?: number; + /** The number of patches that could not be installed due to some issue. See errors for details. */ + readonly failedPatchCount?: number; + /** The patches that were installed during the operation. */ + readonly patches?: PatchInstallationDetail[]; + /** The UTC timestamp when the operation began. */ + readonly startDateTime?: Date; + /** The errors that were encountered during execution of the operation. The details array contains the list of them. */ + readonly error?: ApiError; +} + +export function virtualMachineInstallPatchesResultDeserializer( + item: any, +): VirtualMachineInstallPatchesResult { + return { + status: item["status"], + installationActivityId: item["installationActivityId"], + rebootStatus: item["rebootStatus"], + maintenanceWindowExceeded: item["maintenanceWindowExceeded"], + excludedPatchCount: item["excludedPatchCount"], + notSelectedPatchCount: item["notSelectedPatchCount"], + pendingPatchCount: item["pendingPatchCount"], + installedPatchCount: item["installedPatchCount"], + failedPatchCount: item["failedPatchCount"], + patches: !item["patches"] + ? item["patches"] + : patchInstallationDetailArrayDeserializer(item["patches"]), + startDateTime: !item["startDateTime"] ? item["startDateTime"] : new Date(item["startDateTime"]), + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +/** The reboot state of the VM following completion of the operation. */ +export enum KnownVMGuestPatchRebootStatus { + /** Unknown */ + Unknown = "Unknown", + /** NotNeeded */ + NotNeeded = "NotNeeded", + /** Required */ + Required = "Required", + /** Started */ + Started = "Started", + /** Failed */ + Failed = "Failed", + /** Completed */ + Completed = "Completed", +} + +/** + * The reboot state of the VM following completion of the operation. \ + * {@link KnownVMGuestPatchRebootStatus} can be used interchangeably with VMGuestPatchRebootStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **NotNeeded** \ + * **Required** \ + * **Started** \ + * **Failed** \ + * **Completed** + */ +export type VMGuestPatchRebootStatus = string; + +export function patchInstallationDetailArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return patchInstallationDetailDeserializer(item); + }); +} + +/** Information about a specific patch that was encountered during an installation action. */ +export interface PatchInstallationDetail { + /** A unique identifier for the patch. */ + readonly patchId?: string; + /** The friendly name of the patch. */ + readonly name?: string; + /** The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. */ + readonly version?: string; + /** The KBID of the patch. Only applies to Windows patches. */ + readonly kbId?: string; + /** The classification(s) of the patch as provided by the patch publisher. */ + readonly classifications?: string[]; + /** The state of the patch after the installation operation completed. */ + readonly installationState?: PatchInstallationState; +} + +export function patchInstallationDetailDeserializer(item: any): PatchInstallationDetail { + return { + patchId: item["patchId"], + name: item["name"], + version: item["version"], + kbId: item["kbId"], + classifications: !item["classifications"] + ? item["classifications"] + : item["classifications"].map((p: any) => { + return p; + }), + installationState: item["installationState"], + }; +} + +/** The state of the patch after the installation operation completed. */ +export enum KnownPatchInstallationState { + /** Unknown */ + Unknown = "Unknown", + /** Installed */ + Installed = "Installed", + /** Failed */ + Failed = "Failed", + /** Excluded */ + Excluded = "Excluded", + /** NotSelected */ + NotSelected = "NotSelected", + /** Pending */ + Pending = "Pending", +} + +/** + * The state of the patch after the installation operation completed. \ + * {@link KnownPatchInstallationState} can be used interchangeably with PatchInstallationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Installed** \ + * **Failed** \ + * **Excluded** \ + * **NotSelected** \ + * **Pending** + */ +export type PatchInstallationState = string; + +/** The SAS URIs of the console screenshot and serial log blobs. */ +export interface RetrieveBootDiagnosticsDataResult { + /** The console screenshot blob URI */ + readonly consoleScreenshotBlobUri?: string; + /** The serial console log blob URI. */ + readonly serialConsoleLogBlobUri?: string; +} + +export function retrieveBootDiagnosticsDataResultDeserializer( + item: any, +): RetrieveBootDiagnosticsDataResult { + return { + consoleScreenshotBlobUri: item["consoleScreenshotBlobUri"], + serialConsoleLogBlobUri: item["serialConsoleLogBlobUri"], + }; +} + +/** The List Virtual Machine operation response. */ +export interface _VirtualMachineSizeListResult { + /** The list of virtual machine sizes. */ + value?: VirtualMachineSize[]; + /** The link to the next page of items. */ + nextLink?: string; +} + +export function _virtualMachineSizeListResultDeserializer( + item: any, +): _VirtualMachineSizeListResult { + return { + value: !item["value"] ? item["value"] : virtualMachineSizeArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineSizeArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualMachineSizeDeserializer(item); + }); +} + +/** Describes the properties of a VM size. */ +export interface VirtualMachineSize { + /** The name of the virtual machine size. */ + name?: string; + /** The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list */ + numberOfCores?: number; + /** The OS disk size, in MB, allowed by the virtual machine size. */ + osDiskSizeInMB?: number; + /** The resource disk size, in MB, allowed by the virtual machine size. */ + resourceDiskSizeInMB?: number; + /** The amount of memory, in MB, supported by the virtual machine size. */ + memoryInMB?: number; + /** The maximum number of data disks that can be attached to the virtual machine size. */ + maxDataDiskCount?: number; +} + +export function virtualMachineSizeDeserializer(item: any): VirtualMachineSize { + return { + name: item["name"], + numberOfCores: item["numberOfCores"], + osDiskSizeInMB: item["osDiskSizeInMB"], + resourceDiskSizeInMB: item["resourceDiskSizeInMB"], + memoryInMB: item["memoryInMB"], + maxDataDiskCount: item["maxDataDiskCount"], + }; +} + +/** Capture Virtual Machine parameters. */ +export interface RunCommandInput { + /** Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands. */ + commandId: string; + /** Optional. The script to be executed. When this value is given, the given script will override the default script of the command. */ + script?: string[]; + /** The run command parameters. */ + parameters?: RunCommandInputParameter[]; +} + +export function runCommandInputSerializer(item: RunCommandInput): any { + return { + commandId: item["commandId"], + script: !item["script"] + ? item["script"] + : item["script"].map((p: any) => { + return p; + }), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandInputParameterArraySerializer(item["parameters"]), + }; +} + +export function runCommandInputParameterArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return runCommandInputParameterSerializer(item); + }); +} + +export function runCommandInputParameterArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return runCommandInputParameterDeserializer(item); + }); +} + +/** Describes the properties of a run command parameter. */ +export interface RunCommandInputParameter { + /** The run command parameter name. */ + name: string; + /** The run command parameter value. */ + value: string; +} + +export function runCommandInputParameterSerializer(item: RunCommandInputParameter): any { + return { name: item["name"], value: item["value"] }; +} + +export function runCommandInputParameterDeserializer(item: any): RunCommandInputParameter { + return { + name: item["name"], + value: item["value"], + }; +} + +/** model interface RunCommandResult */ +export interface RunCommandResult { + /** Run command operation response. */ + value?: InstanceViewStatus[]; +} + +export function runCommandResultDeserializer(item: any): RunCommandResult { + return { + value: !item["value"] ? item["value"] : instanceViewStatusArrayDeserializer(item["value"]), + }; +} + +/** The input of virtual machine migration from Availability Set to Flexible Virtual Machine Scale Set. */ +export interface MigrateVMToVirtualMachineScaleSetInput { + /** The target zone of VM migration to Flexible Virtual Machine Scale Set. */ + targetZone?: string; + /** The target compute fault domain of VM migration to Flexible Virtual Machine Scale Set. */ + targetFaultDomain?: number; + /** The target Virtual Machine size of VM migration to Flexible Virtual Machine Scale Set. */ + targetVMSize?: string; +} + +export function migrateVMToVirtualMachineScaleSetInputSerializer( + item: MigrateVMToVirtualMachineScaleSetInput, +): any { + return { + targetZone: item["targetZone"], + targetFaultDomain: item["targetFaultDomain"], + targetVMSize: item["targetVMSize"], + }; +} + +/** Describes a Virtual Machine Extension. */ +export interface VirtualMachineExtensionUpdate extends UpdateResource { + /** 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** 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; +} + +export function virtualMachineExtensionUpdateSerializer(item: VirtualMachineExtensionUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "forceUpdateTag", + "publisher", + "type", + "typeHandlerVersion", + "autoUpgradeMinorVersion", + "enableAutomaticUpgrade", + "settings", + "protectedSettings", + "suppressFailures", + "protectedSettingsFromKeyVault", + ]) + ? undefined + : _virtualMachineExtensionUpdatePropertiesSerializer(item), + }; +} + +/** The List Extension operation response */ +export interface VirtualMachineExtensionsListResult { + /** The list of extensions */ + value?: VirtualMachineExtension[]; +} + +export function virtualMachineExtensionsListResultDeserializer( + item: any, +): VirtualMachineExtensionsListResult { + return { + value: !item["value"] ? item["value"] : virtualMachineExtensionArrayDeserializer(item["value"]), + }; +} + +/** Describes a Virtual Machine Extension Image. */ +export interface VirtualMachineExtensionImage extends TrackedResource { + /** The operating system this extension supports. */ + operatingSystem?: string; + /** The type of role (IaaS or PaaS) this extension supports. */ + computeRole?: string; + /** The schema defined by publisher, where extension consumers should provide settings in a matching schema. */ + handlerSchema?: string; + /** Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. */ + vmScaleSetEnabled?: boolean; + /** Whether the handler can support multiple extensions. */ + supportsMultipleExtensions?: boolean; +} + +export function virtualMachineExtensionImageDeserializer(item: any): VirtualMachineExtensionImage { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _virtualMachineExtensionImagePropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a Virtual Machine Extension Image. */ +export interface VirtualMachineExtensionImageProperties { + /** The operating system this extension supports. */ + operatingSystem: string; + /** The type of role (IaaS or PaaS) this extension supports. */ + computeRole: string; + /** The schema defined by publisher, where extension consumers should provide settings in a matching schema. */ + handlerSchema: string; + /** Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. */ + vmScaleSetEnabled?: boolean; + /** Whether the handler can support multiple extensions. */ + supportsMultipleExtensions?: boolean; +} + +export function virtualMachineExtensionImagePropertiesDeserializer( + item: any, +): VirtualMachineExtensionImageProperties { + return { + operatingSystem: item["operatingSystem"], + computeRole: item["computeRole"], + handlerSchema: item["handlerSchema"], + vmScaleSetEnabled: item["vmScaleSetEnabled"], + supportsMultipleExtensions: item["supportsMultipleExtensions"], + }; +} + +/** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability set. */ +export interface AvailabilitySet extends TrackedResource { + /** Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. */ + sku?: Sku; + /** Update Domain count. */ + platformUpdateDomainCount?: number; + /** Fault Domain count. */ + platformFaultDomainCount?: number; + /** A list of references to all virtual machines in the availability set. */ + virtualMachines?: SubResource[]; + /** Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** The resource status information. */ + readonly statuses?: InstanceViewStatus[]; + /** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. */ + scheduledEventsPolicy?: ScheduledEventsPolicy; + /** Describes the migration properties on the Availability Set. */ + readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; +} + +export function availabilitySetSerializer(item: AvailabilitySet): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "platformUpdateDomainCount", + "platformFaultDomainCount", + "virtualMachines", + "proximityPlacementGroup", + "scheduledEventsPolicy", + ]) + ? undefined + : _availabilitySetPropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + }; +} + +export function availabilitySetDeserializer(item: any): AvailabilitySet { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _availabilitySetPropertiesDeserializer(item["properties"])), + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + }; +} + +/** The instance view of a resource. */ +export interface AvailabilitySetProperties { + /** Update Domain count. */ + platformUpdateDomainCount?: number; + /** Fault Domain count. */ + platformFaultDomainCount?: number; + /** A list of references to all virtual machines in the availability set. */ + virtualMachines?: SubResource[]; + /** Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** The resource status information. */ + readonly statuses?: InstanceViewStatus[]; + /** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. */ + scheduledEventsPolicy?: ScheduledEventsPolicy; + /** Describes the migration properties on the Availability Set. */ + readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; +} + +export function availabilitySetPropertiesSerializer(item: AvailabilitySetProperties): any { + return { + platformUpdateDomainCount: item["platformUpdateDomainCount"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceArraySerializer(item["virtualMachines"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicySerializer(item["scheduledEventsPolicy"]), + }; +} + +export function availabilitySetPropertiesDeserializer(item: any): AvailabilitySetProperties { + return { + platformUpdateDomainCount: item["platformUpdateDomainCount"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceArrayDeserializer(item["virtualMachines"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicyDeserializer(item["scheduledEventsPolicy"]), + virtualMachineScaleSetMigrationInfo: !item["virtualMachineScaleSetMigrationInfo"] + ? item["virtualMachineScaleSetMigrationInfo"] + : virtualMachineScaleSetMigrationInfoDeserializer( + item["virtualMachineScaleSetMigrationInfo"], + ), + }; +} + +/** Describes the Availability Set properties related to migration to Flexible Virtual Machine Scale Set. */ +export interface VirtualMachineScaleSetMigrationInfo { + /** Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API. */ + readonly defaultVirtualMachineScaleSetInfo?: DefaultVirtualMachineScaleSetInfo; + /** Specifies the Virtual Machine Scale Set that the Availability Set is migrated to. */ + readonly migrateToVirtualMachineScaleSet?: SubResource; +} + +export function virtualMachineScaleSetMigrationInfoDeserializer( + item: any, +): VirtualMachineScaleSetMigrationInfo { + return { + defaultVirtualMachineScaleSetInfo: !item["defaultVirtualMachineScaleSetInfo"] + ? item["defaultVirtualMachineScaleSetInfo"] + : defaultVirtualMachineScaleSetInfoDeserializer(item["defaultVirtualMachineScaleSetInfo"]), + migrateToVirtualMachineScaleSet: !item["migrateToVirtualMachineScaleSet"] + ? item["migrateToVirtualMachineScaleSet"] + : subResourceDeserializer(item["migrateToVirtualMachineScaleSet"]), + }; +} + +/** Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API. */ +export interface DefaultVirtualMachineScaleSetInfo { + /** Indicates if the the maximum capacity of the default migrated Virtual Machine Scale Set after its migration will be constrained to a limited number of VMs. */ + readonly constrainedMaximumCapacity?: boolean; + /** The default Virtual Machine ScaleSet Uri that the Availability Set will be moved to upon triggering a seamless migration via the ConvertToVirtualMachineScaleSet API. */ + readonly defaultVirtualMachineScaleSet?: SubResource; +} + +export function defaultVirtualMachineScaleSetInfoDeserializer( + item: any, +): DefaultVirtualMachineScaleSetInfo { + return { + constrainedMaximumCapacity: item["constrainedMaximumCapacity"], + defaultVirtualMachineScaleSet: !item["defaultVirtualMachineScaleSet"] + ? item["defaultVirtualMachineScaleSet"] + : subResourceDeserializer(item["defaultVirtualMachineScaleSet"]), + }; +} + +/** Specifies information about the availability set that the virtual machine should be assigned to. Only tags may be updated. */ +export interface AvailabilitySetUpdate extends UpdateResource { + /** Sku of the availability set */ + sku?: Sku; + /** Update Domain count. */ + platformUpdateDomainCount?: number; + /** Fault Domain count. */ + platformFaultDomainCount?: number; + /** A list of references to all virtual machines in the availability set. */ + virtualMachines?: SubResource[]; + /** Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. */ + proximityPlacementGroup?: SubResource; + /** The resource status information. */ + readonly statuses?: InstanceViewStatus[]; + /** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. */ + scheduledEventsPolicy?: ScheduledEventsPolicy; + /** Describes the migration properties on the Availability Set. */ + readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; +} + +export function availabilitySetUpdateSerializer(item: AvailabilitySetUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "platformUpdateDomainCount", + "platformFaultDomainCount", + "virtualMachines", + "proximityPlacementGroup", + "scheduledEventsPolicy", + ]) + ? undefined + : _availabilitySetUpdatePropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + }; +} + +/** The List Availability Set operation response. */ +export interface _AvailabilitySetListResult { + /** The list of availability sets. */ + value: AvailabilitySet[]; + /** The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. */ + nextLink?: string; +} + +export function _availabilitySetListResultDeserializer(item: any): _AvailabilitySetListResult { + return { + value: availabilitySetArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function availabilitySetArraySerializer(result: Array): any[] { + return result.map((item) => { + return availabilitySetSerializer(item); + }); +} + +export function availabilitySetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return availabilitySetDeserializer(item); + }); +} + +/** Describes the Virtual Machine Scale Set to migrate from Availability Set. */ +export interface MigrateToVirtualMachineScaleSetInput { + /** Specifies information about the Virtual Machine Scale Set that the Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. */ + virtualMachineScaleSetFlexible: SubResource; +} + +export function migrateToVirtualMachineScaleSetInputSerializer( + item: MigrateToVirtualMachineScaleSetInput, +): any { + return { + virtualMachineScaleSetFlexible: subResourceSerializer(item["virtualMachineScaleSetFlexible"]), + }; +} + +/** Describes the Virtual Machine Scale Set to convert from Availability Set. */ +export interface ConvertToVirtualMachineScaleSetInput { + /** Specifies information about the Virtual Machine Scale Set that the Availability Set should be converted to. */ + virtualMachineScaleSetName?: string; +} + +export function convertToVirtualMachineScaleSetInputSerializer( + item: ConvertToVirtualMachineScaleSetInput, +): any { + return { virtualMachineScaleSetName: item["virtualMachineScaleSetName"] }; +} + +/** Specifies information about the proximity placement group. */ +export interface ProximityPlacementGroup extends TrackedResource { + /** The availability zones. */ + zones?: string[]; + /** Specifies the type of the proximity placement group. Possible values are: **Standard** : Co-locate resources within an Azure region or Availability Zone. **Ultra** : For future use. */ + proximityPlacementGroupType?: ProximityPlacementGroupType; + /** A list of references to all virtual machines in the proximity placement group. */ + readonly virtualMachines?: SubResourceWithColocationStatus[]; + /** A list of references to all virtual machine scale sets in the proximity placement group. */ + readonly virtualMachineScaleSets?: SubResourceWithColocationStatus[]; + /** A list of references to all availability sets in the proximity placement group. */ + readonly availabilitySets?: SubResourceWithColocationStatus[]; + /** Describes colocation status of the Proximity Placement Group. */ + colocationStatus?: InstanceViewStatus; + /** Specifies the user intent of the proximity placement group. */ + intent?: ProximityPlacementGroupPropertiesIntent; +} + +export function proximityPlacementGroupSerializer(item: ProximityPlacementGroup): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "proximityPlacementGroupType", + "colocationStatus", + "intent", + ]) + ? undefined + : _proximityPlacementGroupPropertiesSerializer(item), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +export function proximityPlacementGroupDeserializer(item: any): ProximityPlacementGroup { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _proximityPlacementGroupPropertiesDeserializer(item["properties"])), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** Describes the properties of a Proximity Placement Group. */ +export interface ProximityPlacementGroupProperties { + /** Specifies the type of the proximity placement group. Possible values are: **Standard** : Co-locate resources within an Azure region or Availability Zone. **Ultra** : For future use. */ + proximityPlacementGroupType?: ProximityPlacementGroupType; + /** A list of references to all virtual machines in the proximity placement group. */ + readonly virtualMachines?: SubResourceWithColocationStatus[]; + /** A list of references to all virtual machine scale sets in the proximity placement group. */ + readonly virtualMachineScaleSets?: SubResourceWithColocationStatus[]; + /** A list of references to all availability sets in the proximity placement group. */ + readonly availabilitySets?: SubResourceWithColocationStatus[]; + /** Describes colocation status of the Proximity Placement Group. */ + colocationStatus?: InstanceViewStatus; + /** Specifies the user intent of the proximity placement group. */ + intent?: ProximityPlacementGroupPropertiesIntent; +} + +export function proximityPlacementGroupPropertiesSerializer( + item: ProximityPlacementGroupProperties, +): any { + return { + proximityPlacementGroupType: item["proximityPlacementGroupType"], + colocationStatus: !item["colocationStatus"] + ? item["colocationStatus"] + : instanceViewStatusSerializer(item["colocationStatus"]), + intent: !item["intent"] + ? item["intent"] + : proximityPlacementGroupPropertiesIntentSerializer(item["intent"]), + }; +} + +export function proximityPlacementGroupPropertiesDeserializer( + item: any, +): ProximityPlacementGroupProperties { + return { + proximityPlacementGroupType: item["proximityPlacementGroupType"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceWithColocationStatusArrayDeserializer(item["virtualMachines"]), + virtualMachineScaleSets: !item["virtualMachineScaleSets"] + ? item["virtualMachineScaleSets"] + : subResourceWithColocationStatusArrayDeserializer(item["virtualMachineScaleSets"]), + availabilitySets: !item["availabilitySets"] + ? item["availabilitySets"] + : subResourceWithColocationStatusArrayDeserializer(item["availabilitySets"]), + colocationStatus: !item["colocationStatus"] + ? item["colocationStatus"] + : instanceViewStatusDeserializer(item["colocationStatus"]), + intent: !item["intent"] + ? item["intent"] + : proximityPlacementGroupPropertiesIntentDeserializer(item["intent"]), + }; +} + +/** Specifies the type of the proximity placement group. Possible values are: **Standard** : Co-locate resources within an Azure region or Availability Zone. **Ultra** : For future use. */ +export enum KnownProximityPlacementGroupType { + /** Standard */ + Standard = "Standard", + /** Ultra */ + Ultra = "Ultra", +} + +/** + * Specifies the type of the proximity placement group. Possible values are: **Standard** : Co-locate resources within an Azure region or Availability Zone. **Ultra** : For future use. \ + * {@link KnownProximityPlacementGroupType} can be used interchangeably with ProximityPlacementGroupType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard** \ + * **Ultra** + */ +export type ProximityPlacementGroupType = string; + +export function subResourceWithColocationStatusArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return subResourceWithColocationStatusDeserializer(item); + }); +} + +/** model interface SubResourceWithColocationStatus */ +export interface SubResourceWithColocationStatus extends SubResource { + /** Describes colocation status of a resource in the Proximity Placement Group. */ + colocationStatus?: InstanceViewStatus; +} + +export function subResourceWithColocationStatusDeserializer( + item: any, +): SubResourceWithColocationStatus { + return { + id: item["id"], + colocationStatus: !item["colocationStatus"] + ? item["colocationStatus"] + : instanceViewStatusDeserializer(item["colocationStatus"]), + }; +} + +/** Specifies the user intent of the proximity placement group. */ +export interface ProximityPlacementGroupPropertiesIntent { + /** Specifies possible sizes of virtual machines that can be created in the proximity placement group. */ + vmSizes?: string[]; +} + +export function proximityPlacementGroupPropertiesIntentSerializer( + item: ProximityPlacementGroupPropertiesIntent, +): any { + return { + vmSizes: !item["vmSizes"] + ? item["vmSizes"] + : item["vmSizes"].map((p: any) => { + return p; + }), + }; +} + +export function proximityPlacementGroupPropertiesIntentDeserializer( + item: any, +): ProximityPlacementGroupPropertiesIntent { + return { + vmSizes: !item["vmSizes"] + ? item["vmSizes"] + : item["vmSizes"].map((p: any) => { + return p; + }), + }; +} + +/** Specifies information about the proximity placement group. */ +export interface ProximityPlacementGroupUpdate extends UpdateResource {} + +export function proximityPlacementGroupUpdateSerializer(item: ProximityPlacementGroupUpdate): any { + return { tags: item["tags"] }; +} + +/** The List Proximity Placement Group operation response. */ +export interface _ProximityPlacementGroupListResult { + /** The list of proximity placement groups. */ + value: ProximityPlacementGroup[]; + /** The URI to fetch the next page of proximity placement groups. */ + nextLink?: string; +} + +export function _proximityPlacementGroupListResultDeserializer( + item: any, +): _ProximityPlacementGroupListResult { + return { + value: proximityPlacementGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function proximityPlacementGroupArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return proximityPlacementGroupSerializer(item); + }); +} + +export function proximityPlacementGroupArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return proximityPlacementGroupDeserializer(item); + }); +} + +/** Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another dedicated host group. */ +export interface DedicatedHostGroup extends TrackedResource { + /** The availability zones. */ + zones?: string[]; + /** Number of fault domains that the host group can span. */ + platformFaultDomainCount?: number; + /** A list of references to all dedicated hosts in the dedicated host group. */ + readonly hosts?: SubResourceReadOnly[]; + /** The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. */ + readonly instanceView?: DedicatedHostGroupInstanceView; + /** Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: 2020-06-01. */ + supportAutomaticPlacement?: boolean; + /** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ + additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; +} + +export function dedicatedHostGroupSerializer(item: DedicatedHostGroup): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "platformFaultDomainCount", + "supportAutomaticPlacement", + "additionalCapabilities", + ]) + ? undefined + : _dedicatedHostGroupPropertiesSerializer(item), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +export function dedicatedHostGroupDeserializer(item: any): DedicatedHostGroup { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _dedicatedHostGroupPropertiesDeserializer(item["properties"])), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** Dedicated Host Group Properties. */ +export interface DedicatedHostGroupProperties { + /** Number of fault domains that the host group can span. */ + platformFaultDomainCount: number; + /** A list of references to all dedicated hosts in the dedicated host group. */ + readonly hosts?: SubResourceReadOnly[]; + /** The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. */ + readonly instanceView?: DedicatedHostGroupInstanceView; + /** Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: 2020-06-01. */ + supportAutomaticPlacement?: boolean; + /** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ + additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; +} + +export function dedicatedHostGroupPropertiesSerializer(item: DedicatedHostGroupProperties): any { + return { + platformFaultDomainCount: item["platformFaultDomainCount"], + supportAutomaticPlacement: item["supportAutomaticPlacement"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : dedicatedHostGroupPropertiesAdditionalCapabilitiesSerializer( + item["additionalCapabilities"], + ), + }; +} + +export function dedicatedHostGroupPropertiesDeserializer(item: any): DedicatedHostGroupProperties { + return { + platformFaultDomainCount: item["platformFaultDomainCount"], + hosts: !item["hosts"] ? item["hosts"] : subResourceReadOnlyArrayDeserializer(item["hosts"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : dedicatedHostGroupInstanceViewDeserializer(item["instanceView"]), + supportAutomaticPlacement: item["supportAutomaticPlacement"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : dedicatedHostGroupPropertiesAdditionalCapabilitiesDeserializer( + item["additionalCapabilities"], + ), + }; +} + +/** model interface DedicatedHostGroupInstanceView */ +export interface DedicatedHostGroupInstanceView { + /** List of instance view of the dedicated hosts under the dedicated host group. */ + hosts?: DedicatedHostInstanceViewWithName[]; +} + +export function dedicatedHostGroupInstanceViewDeserializer( + item: any, +): DedicatedHostGroupInstanceView { + return { + hosts: !item["hosts"] + ? item["hosts"] + : dedicatedHostInstanceViewWithNameArrayDeserializer(item["hosts"]), + }; +} + +export function dedicatedHostInstanceViewWithNameArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return dedicatedHostInstanceViewWithNameDeserializer(item); + }); +} + +/** The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to the instance view of a dedicated host group. */ +export interface DedicatedHostInstanceViewWithName extends DedicatedHostInstanceView { + /** The name of the dedicated host. */ + readonly name?: string; +} + +export function dedicatedHostInstanceViewWithNameDeserializer( + item: any, +): DedicatedHostInstanceViewWithName { + return { + assetId: item["assetId"], + availableCapacity: !item["availableCapacity"] + ? item["availableCapacity"] + : dedicatedHostAvailableCapacityDeserializer(item["availableCapacity"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + name: item["name"], + }; +} + +/** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ +export interface DedicatedHostGroupPropertiesAdditionalCapabilities { + /** The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated Host Group. For the Virtual Machines to be UltraSSD Enabled, UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided. Please refer to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature. **Note:** The ultraSSDEnabled setting can only be enabled for Host Groups that are created as zonal. Minimum api-version: 2022-03-01. */ + ultraSSDEnabled?: boolean; +} + +export function dedicatedHostGroupPropertiesAdditionalCapabilitiesSerializer( + item: DedicatedHostGroupPropertiesAdditionalCapabilities, +): any { + return { ultraSSDEnabled: item["ultraSSDEnabled"] }; +} + +export function dedicatedHostGroupPropertiesAdditionalCapabilitiesDeserializer( + item: any, +): DedicatedHostGroupPropertiesAdditionalCapabilities { + return { + ultraSSDEnabled: item["ultraSSDEnabled"], + }; +} + +/** The instance view of a dedicated host. */ +export interface DedicatedHostInstanceView { + /** Specifies the unique id of the dedicated physical machine on which the dedicated host resides. */ + readonly assetId?: string; + /** Unutilized capacity of the dedicated host. */ + availableCapacity?: DedicatedHostAvailableCapacity; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; +} + +export function dedicatedHostInstanceViewDeserializer(item: any): DedicatedHostInstanceView { + return { + assetId: item["assetId"], + availableCapacity: !item["availableCapacity"] + ? item["availableCapacity"] + : dedicatedHostAvailableCapacityDeserializer(item["availableCapacity"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + }; +} + +/** Dedicated host unutilized capacity. */ +export interface DedicatedHostAvailableCapacity { + /** The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. */ + allocatableVMs?: DedicatedHostAllocatableVM[]; +} + +export function dedicatedHostAvailableCapacityDeserializer( + item: any, +): DedicatedHostAvailableCapacity { + return { + allocatableVMs: !item["allocatableVMs"] + ? item["allocatableVMs"] + : dedicatedHostAllocatableVMArrayDeserializer(item["allocatableVMs"]), + }; +} + +export function dedicatedHostAllocatableVMArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return dedicatedHostAllocatableVMDeserializer(item); + }); +} + +/** Represents the dedicated host unutilized capacity in terms of a specific VM size. */ +export interface DedicatedHostAllocatableVM { + /** VM size in terms of which the unutilized capacity is represented. */ + vmSize?: string; + /** Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. */ + count?: number; +} + +export function dedicatedHostAllocatableVMDeserializer(item: any): DedicatedHostAllocatableVM { + return { + vmSize: item["vmSize"], + count: item["count"], + }; +} + +/** Specifies information about the dedicated host group that the dedicated host should be assigned to. Only tags may be updated. */ +export interface DedicatedHostGroupUpdate extends UpdateResource { + /** Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. */ + zones?: string[]; + /** Number of fault domains that the host group can span. */ + platformFaultDomainCount?: number; + /** A list of references to all dedicated hosts in the dedicated host group. */ + readonly hosts?: SubResourceReadOnly[]; + /** The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. */ + readonly instanceView?: DedicatedHostGroupInstanceView; + /** Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: 2020-06-01. */ + supportAutomaticPlacement?: boolean; + /** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ + additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; +} + +export function dedicatedHostGroupUpdateSerializer(item: DedicatedHostGroupUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "platformFaultDomainCount", + "supportAutomaticPlacement", + "additionalCapabilities", + ]) + ? undefined + : _dedicatedHostGroupUpdatePropertiesSerializer(item), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** The List Dedicated Host Group with resource group response. */ +export interface _DedicatedHostGroupListResult { + /** The list of dedicated host groups. */ + value: DedicatedHostGroup[]; + /** The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. */ + nextLink?: string; +} + +export function _dedicatedHostGroupListResultDeserializer( + item: any, +): _DedicatedHostGroupListResult { + return { + value: dedicatedHostGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function dedicatedHostGroupArraySerializer(result: Array): any[] { + return result.map((item) => { + return dedicatedHostGroupSerializer(item); + }); +} + +export function dedicatedHostGroupArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return dedicatedHostGroupDeserializer(item); + }); +} + +/** Specifies information about the Dedicated host. */ +export interface DedicatedHost extends TrackedResource { + /** SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. */ + sku: Sku; + /** Fault domain of the dedicated host within a dedicated host group. */ + platformFaultDomain?: number; + /** Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. */ + autoReplaceOnFailure?: boolean; + /** A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime of the host. */ + readonly hostId?: string; + /** A list of references to all virtual machines in the Dedicated Host. */ + readonly virtualMachines?: SubResourceReadOnly[]; + /** Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value is: **None.** */ + licenseType?: DedicatedHostLicenseTypes; + /** The date when the host was first provisioned. */ + readonly provisioningTime?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The dedicated host instance view. */ + readonly instanceView?: DedicatedHostInstanceView; + /** Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; +} + +export function dedicatedHostSerializer(item: DedicatedHost): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "platformFaultDomain", + "autoReplaceOnFailure", + "licenseType", + ]) + ? undefined + : _dedicatedHostPropertiesSerializer(item), + sku: skuSerializer(item["sku"]), + }; +} + +export function dedicatedHostDeserializer(item: any): DedicatedHost { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _dedicatedHostPropertiesDeserializer(item["properties"])), + sku: skuDeserializer(item["sku"]), + }; +} + +/** Properties of the dedicated host. */ +export interface DedicatedHostProperties { + /** Fault domain of the dedicated host within a dedicated host group. */ + platformFaultDomain?: number; + /** Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. */ + autoReplaceOnFailure?: boolean; + /** A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime of the host. */ + readonly hostId?: string; + /** A list of references to all virtual machines in the Dedicated Host. */ + readonly virtualMachines?: SubResourceReadOnly[]; + /** Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value is: **None.** */ + licenseType?: DedicatedHostLicenseTypes; + /** The date when the host was first provisioned. */ + readonly provisioningTime?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The dedicated host instance view. */ + readonly instanceView?: DedicatedHostInstanceView; + /** Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; +} + +export function dedicatedHostPropertiesSerializer(item: DedicatedHostProperties): any { + return { + platformFaultDomain: item["platformFaultDomain"], + autoReplaceOnFailure: item["autoReplaceOnFailure"], + licenseType: item["licenseType"], + }; +} + +export function dedicatedHostPropertiesDeserializer(item: any): DedicatedHostProperties { + return { + platformFaultDomain: item["platformFaultDomain"], + autoReplaceOnFailure: item["autoReplaceOnFailure"], + hostId: item["hostId"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachines"]), + licenseType: item["licenseType"], + provisioningTime: !item["provisioningTime"] + ? item["provisioningTime"] + : new Date(item["provisioningTime"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : dedicatedHostInstanceViewDeserializer(item["instanceView"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + }; +} + +/** Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value is: **None.** */ +export type DedicatedHostLicenseTypes = + | "None" + | "Windows_Server_Hybrid" + | "Windows_Server_Perpetual"; + +/** Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may be updated. */ +export interface DedicatedHostUpdate extends UpdateResource { + /** [List all available dedicated host sizes for resizing] (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). Resizing can be only used to scale up DedicatedHost. Only name is required to be set. */ + sku?: Sku; + /** Fault domain of the dedicated host within a dedicated host group. */ + platformFaultDomain?: number; + /** Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. */ + autoReplaceOnFailure?: boolean; + /** A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime of the host. */ + readonly hostId?: string; + /** A list of references to all virtual machines in the Dedicated Host. */ + readonly virtualMachines?: SubResourceReadOnly[]; + /** Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value is: **None.** */ + licenseType?: DedicatedHostLicenseTypes; + /** The date when the host was first provisioned. */ + readonly provisioningTime?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The dedicated host instance view. */ + readonly instanceView?: DedicatedHostInstanceView; + /** Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; +} + +export function dedicatedHostUpdateSerializer(item: DedicatedHostUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "platformFaultDomain", + "autoReplaceOnFailure", + "licenseType", + ]) + ? undefined + : _dedicatedHostUpdatePropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + }; +} + +/** The list dedicated host operation response. */ +export interface _DedicatedHostListResult { + /** The list of dedicated hosts. */ + value: DedicatedHost[]; + /** The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. */ + nextLink?: string; +} + +export function _dedicatedHostListResultDeserializer(item: any): _DedicatedHostListResult { + return { + value: dedicatedHostArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function dedicatedHostArraySerializer(result: Array): any[] { + return result.map((item) => { + return dedicatedHostSerializer(item); + }); +} + +export function dedicatedHostArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return dedicatedHostDeserializer(item); + }); +} + +/** The List Dedicated Host sizes operation response. */ +export interface _DedicatedHostSizeListResult { + /** The list of dedicated host sizes. */ + value?: string[]; + /** The link to the next page of items. */ + nextLink?: string; +} + +export function _dedicatedHostSizeListResultDeserializer(item: any): _DedicatedHostSizeListResult { + return { + value: !item["value"] + ? item["value"] + : item["value"].map((p: any) => { + return p; + }), + nextLink: item["nextLink"], + }; +} + +/** 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. */ +export interface Image extends TrackedResource { + /** The extended location of the Image. */ + extendedLocation?: ExtendedLocation; + /** The source virtual machine from which Image is created. */ + sourceVirtualMachine?: SubResource; + /** Specifies the storage settings for the virtual machine disks. */ + storageProfile?: ImageStorageProfile; + /** The provisioning state. */ + readonly provisioningState?: string; + /** Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. */ + hyperVGeneration?: HyperVGenerationTypes; +} + +export function imageSerializer(item: Image): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "sourceVirtualMachine", + "storageProfile", + "hyperVGeneration", + ]) + ? undefined + : _imagePropertiesSerializer(item), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function imageDeserializer(item: any): Image { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _imagePropertiesDeserializer(item["properties"])), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Describes the properties of an Image. */ +export interface ImageProperties { + /** The source virtual machine from which Image is created. */ + sourceVirtualMachine?: SubResource; + /** Specifies the storage settings for the virtual machine disks. */ + storageProfile?: ImageStorageProfile; + /** The provisioning state. */ + readonly provisioningState?: string; + /** Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. */ + hyperVGeneration?: HyperVGenerationTypes; +} + +export function imagePropertiesSerializer(item: ImageProperties): any { + return { + sourceVirtualMachine: !item["sourceVirtualMachine"] + ? item["sourceVirtualMachine"] + : subResourceSerializer(item["sourceVirtualMachine"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : imageStorageProfileSerializer(item["storageProfile"]), + hyperVGeneration: item["hyperVGeneration"], + }; +} + +export function imagePropertiesDeserializer(item: any): ImageProperties { + return { + sourceVirtualMachine: !item["sourceVirtualMachine"] + ? item["sourceVirtualMachine"] + : subResourceDeserializer(item["sourceVirtualMachine"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : imageStorageProfileDeserializer(item["storageProfile"]), + provisioningState: item["provisioningState"], + hyperVGeneration: item["hyperVGeneration"], + }; +} + +/** Describes a storage profile. */ +export interface ImageStorageProfile { + /** 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?: ImageOSDisk; + /** 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?: ImageDataDisk[]; + /** Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). */ + zoneResilient?: boolean; +} + +export function imageStorageProfileSerializer(item: ImageStorageProfile): any { + return { + osDisk: !item["osDisk"] ? item["osDisk"] : imageOSDiskSerializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : imageDataDiskArraySerializer(item["dataDisks"]), + zoneResilient: item["zoneResilient"], + }; +} + +export function imageStorageProfileDeserializer(item: any): ImageStorageProfile { + return { + osDisk: !item["osDisk"] ? item["osDisk"] : imageOSDiskDeserializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : imageDataDiskArrayDeserializer(item["dataDisks"]), + zoneResilient: item["zoneResilient"], + }; +} + +/** Describes an Operating System disk. */ +export interface ImageOSDisk extends ImageDisk { + /** This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. Possible values are: **Windows,** **Linux.** */ + osType: OperatingSystemTypes; + /** The OS State. For managed images, use Generalized. */ + osState: OperatingSystemStateTypes; +} + +export function imageOSDiskSerializer(item: ImageOSDisk): any { + return { + snapshot: !item["snapshot"] ? item["snapshot"] : subResourceSerializer(item["snapshot"]), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : subResourceSerializer(item["managedDisk"]), + blobUri: item["blobUri"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + osType: item["osType"], + osState: item["osState"], + }; +} + +export function imageOSDiskDeserializer(item: any): ImageOSDisk { + return { + snapshot: !item["snapshot"] ? item["snapshot"] : subResourceDeserializer(item["snapshot"]), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : subResourceDeserializer(item["managedDisk"]), + blobUri: item["blobUri"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + osType: item["osType"], + osState: item["osState"], + }; +} + +export function imageDataDiskArraySerializer(result: Array): any[] { + return result.map((item) => { + return imageDataDiskSerializer(item); + }); +} + +export function imageDataDiskArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return imageDataDiskDeserializer(item); + }); +} + +/** Describes a data disk. */ +export interface ImageDataDisk extends ImageDisk { + /** 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; +} + +export function imageDataDiskSerializer(item: ImageDataDisk): any { + return { + snapshot: !item["snapshot"] ? item["snapshot"] : subResourceSerializer(item["snapshot"]), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : subResourceSerializer(item["managedDisk"]), + blobUri: item["blobUri"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + lun: item["lun"], + }; +} + +export function imageDataDiskDeserializer(item: any): ImageDataDisk { + return { + snapshot: !item["snapshot"] ? item["snapshot"] : subResourceDeserializer(item["snapshot"]), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : subResourceDeserializer(item["managedDisk"]), + blobUri: item["blobUri"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + lun: item["lun"], + }; +} + +/** Specifies the HyperVGeneration Type */ +export enum KnownHyperVGenerationTypes { + /** V1 */ + V1 = "V1", + /** V2 */ + V2 = "V2", +} + +/** + * Specifies the HyperVGeneration Type \ + * {@link KnownHyperVGenerationTypes} can be used interchangeably with HyperVGenerationTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **V1** \ + * **V2** + */ +export type HyperVGenerationTypes = string; + +/** Describes a image disk. */ +export interface ImageDisk { + /** The snapshot. */ + snapshot?: SubResource; + /** The managedDisk. */ + managedDisk?: SubResource; + /** The Virtual Hard Disk. */ + blobUri?: string; + /** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.** */ + caching?: CachingTypes; + /** Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. This value cannot be larger than 1023 GB. */ + diskSizeGB?: number; + /** 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 image disk. */ + diskEncryptionSet?: DiskEncryptionSetParameters; +} + +export function imageDiskSerializer(item: ImageDisk): any { + return { + snapshot: !item["snapshot"] ? item["snapshot"] : subResourceSerializer(item["snapshot"]), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : subResourceSerializer(item["managedDisk"]), + blobUri: item["blobUri"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + }; +} + +export function imageDiskDeserializer(item: any): ImageDisk { + return { + snapshot: !item["snapshot"] ? item["snapshot"] : subResourceDeserializer(item["snapshot"]), + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : subResourceDeserializer(item["managedDisk"]), + blobUri: item["blobUri"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + storageAccountType: item["storageAccountType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + }; +} + +/** The source user image virtual hard disk. Only tags may be updated. */ +export interface ImageUpdate extends UpdateResource { + /** The source virtual machine from which Image is created. */ + sourceVirtualMachine?: SubResource; + /** Specifies the storage settings for the virtual machine disks. */ + storageProfile?: ImageStorageProfile; + /** The provisioning state. */ + readonly provisioningState?: string; + /** Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. */ + hyperVGeneration?: HyperVGenerationTypes; +} + +export function imageUpdateSerializer(item: ImageUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "sourceVirtualMachine", + "storageProfile", + "hyperVGeneration", + ]) + ? undefined + : _imageUpdatePropertiesSerializer(item), + }; +} + +/** The List Image operation response. */ +export interface _ImageListResult { + /** The list of Images */ + value: Image[]; + /** The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. */ + nextLink?: string; +} + +export function _imageListResultDeserializer(item: any): _ImageListResult { + return { + value: imageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function imageArraySerializer(result: Array): any[] { + return result.map((item) => { + return imageSerializer(item); + }); +} + +export function imageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return imageDeserializer(item); + }); +} + +/** Create or update Restore Point collection parameters. */ +export interface RestorePointCollection extends TrackedResource { + /** The properties of the source resource that this restore point collection is created from. */ + source?: RestorePointCollectionSourceProperties; + /** The provisioning state of the restore point collection. */ + readonly provisioningState?: string; + /** The unique id of the restore point collection. */ + readonly restorePointCollectionId?: string; + /** A list containing all restore points created under this restore point collection. */ + readonly restorePoints?: RestorePoint[]; + /** This property determines whether instant access snapshot is enabled for restore points created under this restore point collection for Premium SSD v2 or Ultra disk. Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for restoring disk with fast restore performance. */ + instantAccess?: boolean; +} + +export function restorePointCollectionSerializer(item: RestorePointCollection): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, ["source", "instantAccess"]) + ? undefined + : _restorePointCollectionPropertiesSerializer(item), + }; +} + +export function restorePointCollectionDeserializer(item: any): RestorePointCollection { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _restorePointCollectionPropertiesDeserializer(item["properties"])), + }; +} + +/** The restore point collection properties. */ +export interface RestorePointCollectionProperties { + /** The properties of the source resource that this restore point collection is created from. */ + source?: RestorePointCollectionSourceProperties; + /** The provisioning state of the restore point collection. */ + readonly provisioningState?: string; + /** The unique id of the restore point collection. */ + readonly restorePointCollectionId?: string; + /** A list containing all restore points created under this restore point collection. */ + readonly restorePoints?: RestorePoint[]; + /** This property determines whether instant access snapshot is enabled for restore points created under this restore point collection for Premium SSD v2 or Ultra disk. Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for restoring disk with fast restore performance. */ + instantAccess?: boolean; +} + +export function restorePointCollectionPropertiesSerializer( + item: RestorePointCollectionProperties, +): any { + return { + source: !item["source"] + ? item["source"] + : restorePointCollectionSourcePropertiesSerializer(item["source"]), + instantAccess: item["instantAccess"], + }; +} + +export function restorePointCollectionPropertiesDeserializer( + item: any, +): RestorePointCollectionProperties { + return { + source: !item["source"] + ? item["source"] + : restorePointCollectionSourcePropertiesDeserializer(item["source"]), + provisioningState: item["provisioningState"], + restorePointCollectionId: item["restorePointCollectionId"], + restorePoints: !item["restorePoints"] + ? item["restorePoints"] + : restorePointArrayDeserializer(item["restorePoints"]), + instantAccess: item["instantAccess"], + }; +} + +/** The properties of the source resource that this restore point collection is created from. */ +export interface RestorePointCollectionSourceProperties { + /** Location of the source resource used to create this restore point collection. */ + readonly location?: string; + /** Resource Id of the source resource used to create this restore point collection */ + id?: string; +} + +export function restorePointCollectionSourcePropertiesSerializer( + item: RestorePointCollectionSourceProperties, +): any { + return { id: item["id"] }; +} + +export function restorePointCollectionSourcePropertiesDeserializer( + item: any, +): RestorePointCollectionSourceProperties { + return { + location: item["location"], + id: item["id"], + }; +} + +export function restorePointArraySerializer(result: Array): any[] { + return result.map((item) => { + return restorePointSerializer(item); + }); +} + +export function restorePointArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return restorePointDeserializer(item); + }); +} + +/** Restore Point details. */ +export interface RestorePoint extends ProxyResource { + /** List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks will be included. */ + excludeDisks?: ApiEntityReference[]; + /** Gets the details of the VM captured at the time of the restore point creation. */ + sourceMetadata?: RestorePointSourceMetadata; + /** Gets the provisioning state of the restore point. */ + readonly provisioningState?: string; + /** ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. */ + consistencyMode?: ConsistencyModeTypes; + /** Gets the creation time of the restore point. */ + timeCreated?: Date; + /** Resource Id of the source restore point from which a copy needs to be created. */ + sourceRestorePoint?: ApiEntityReference; + /** The restore point instance view. */ + readonly instanceView?: RestorePointInstanceView; + /** This property determines the time in minutes the snapshot is retained as instant access for restoring Premium SSD v2 or Ultra disk with fast restore performance in this restore point. */ + instantAccessDurationMinutes?: number; +} + +export function restorePointSerializer(item: RestorePoint): any { + return { + properties: areAllPropsUndefined(item, [ + "excludeDisks", + "sourceMetadata", + "consistencyMode", + "timeCreated", + "sourceRestorePoint", + "instantAccessDurationMinutes", + ]) + ? undefined + : _restorePointPropertiesSerializer(item), + }; +} + +export function restorePointDeserializer(item: any): RestorePoint { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _restorePointPropertiesDeserializer(item["properties"])), + }; +} + +/** The restore point properties. */ +export interface RestorePointProperties { + /** List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks will be included. */ + excludeDisks?: ApiEntityReference[]; + /** Gets the details of the VM captured at the time of the restore point creation. */ + sourceMetadata?: RestorePointSourceMetadata; + /** Gets the provisioning state of the restore point. */ + readonly provisioningState?: string; + /** ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. */ + consistencyMode?: ConsistencyModeTypes; + /** Gets the creation time of the restore point. */ + timeCreated?: Date; + /** Resource Id of the source restore point from which a copy needs to be created. */ + sourceRestorePoint?: ApiEntityReference; + /** The restore point instance view. */ + readonly instanceView?: RestorePointInstanceView; + /** This property determines the time in minutes the snapshot is retained as instant access for restoring Premium SSD v2 or Ultra disk with fast restore performance in this restore point. */ + instantAccessDurationMinutes?: number; +} + +export function restorePointPropertiesSerializer(item: RestorePointProperties): any { + return { + excludeDisks: !item["excludeDisks"] + ? item["excludeDisks"] + : apiEntityReferenceArraySerializer(item["excludeDisks"]), + sourceMetadata: !item["sourceMetadata"] + ? item["sourceMetadata"] + : restorePointSourceMetadataSerializer(item["sourceMetadata"]), + consistencyMode: item["consistencyMode"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : item["timeCreated"].toISOString(), + sourceRestorePoint: !item["sourceRestorePoint"] + ? item["sourceRestorePoint"] + : apiEntityReferenceSerializer(item["sourceRestorePoint"]), + instantAccessDurationMinutes: item["instantAccessDurationMinutes"], + }; +} + +export function restorePointPropertiesDeserializer(item: any): RestorePointProperties { + return { + excludeDisks: !item["excludeDisks"] + ? item["excludeDisks"] + : apiEntityReferenceArrayDeserializer(item["excludeDisks"]), + sourceMetadata: !item["sourceMetadata"] + ? item["sourceMetadata"] + : restorePointSourceMetadataDeserializer(item["sourceMetadata"]), + provisioningState: item["provisioningState"], + consistencyMode: item["consistencyMode"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + sourceRestorePoint: !item["sourceRestorePoint"] + ? item["sourceRestorePoint"] + : apiEntityReferenceDeserializer(item["sourceRestorePoint"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : restorePointInstanceViewDeserializer(item["instanceView"]), + instantAccessDurationMinutes: item["instantAccessDurationMinutes"], + }; +} + +export function apiEntityReferenceArraySerializer(result: Array): any[] { + return result.map((item) => { + return apiEntityReferenceSerializer(item); + }); +} + +export function apiEntityReferenceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return apiEntityReferenceDeserializer(item); + }); +} + +/** Describes the properties of the Virtual Machine for which the restore point was created. The properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the time of the restore point creation. */ +export interface RestorePointSourceMetadata { + /** Gets the hardware profile. */ + readonly hardwareProfile?: HardwareProfile; + /** Gets the storage profile. */ + storageProfile?: RestorePointSourceVMStorageProfile; + /** Gets the OS profile. */ + readonly osProfile?: OSProfile; + /** Gets the diagnostics profile. */ + readonly diagnosticsProfile?: DiagnosticsProfile; + /** Gets the license type, which is for bring your own license scenario. */ + readonly licenseType?: string; + /** Gets the virtual machine unique id. */ + readonly vmId?: string; + /** Gets the security profile. */ + readonly securityProfile?: SecurityProfile; + /** Location of the VM from which the restore point was created. */ + readonly location?: string; + /** UserData associated with the source VM for which restore point is captured, which is a base-64 encoded value. */ + readonly userData?: string; + /** HyperVGeneration of the source VM for which restore point is captured. */ + readonly hyperVGeneration?: HyperVGenerationTypes; +} + +export function restorePointSourceMetadataSerializer(item: RestorePointSourceMetadata): any { + return { + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : restorePointSourceVMStorageProfileSerializer(item["storageProfile"]), + }; +} + +export function restorePointSourceMetadataDeserializer(item: any): RestorePointSourceMetadata { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileDeserializer(item["hardwareProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : restorePointSourceVMStorageProfileDeserializer(item["storageProfile"]), + osProfile: !item["osProfile"] ? item["osProfile"] : osProfileDeserializer(item["osProfile"]), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileDeserializer(item["diagnosticsProfile"]), + licenseType: item["licenseType"], + vmId: item["vmId"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileDeserializer(item["securityProfile"]), + location: item["location"], + userData: item["userData"], + hyperVGeneration: item["hyperVGeneration"], + }; +} + +/** Describes the storage profile. */ +export interface RestorePointSourceVMStorageProfile { + /** Gets the OS disk of the VM captured at the time of the restore point creation. */ + osDisk?: RestorePointSourceVmosDisk; + /** Gets the data disks of the VM captured at the time of the restore point creation. */ + dataDisks?: RestorePointSourceVMDataDisk[]; + /** Gets the disk controller type of the VM captured at the time of the restore point creation. */ + readonly diskControllerType?: DiskControllerTypes; +} + +export function restorePointSourceVMStorageProfileSerializer( + item: RestorePointSourceVMStorageProfile, +): any { + return { + osDisk: !item["osDisk"] ? item["osDisk"] : restorePointSourceVmosDiskSerializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : restorePointSourceVMDataDiskArraySerializer(item["dataDisks"]), + }; +} + +export function restorePointSourceVMStorageProfileDeserializer( + item: any, +): RestorePointSourceVMStorageProfile { + return { + osDisk: !item["osDisk"] + ? item["osDisk"] + : restorePointSourceVmosDiskDeserializer(item["osDisk"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : restorePointSourceVMDataDiskArrayDeserializer(item["dataDisks"]), + diskControllerType: item["diskControllerType"], + }; +} + +/** Describes an Operating System disk. */ +export interface RestorePointSourceVmosDisk { + /** Gets the Operating System type. */ + readonly osType?: OperatingSystemType; + /** Gets the disk encryption settings. */ + readonly encryptionSettings?: DiskEncryptionSettings; + /** Gets the disk name. */ + readonly name?: string; + /** Gets the caching type. */ + readonly caching?: CachingTypes; + /** Gets the disk size in GB. */ + readonly diskSizeGB?: number; + /** Gets the managed disk details */ + managedDisk?: ManagedDiskParameters; + /** Contains Disk Restore Point properties. */ + diskRestorePoint?: DiskRestorePointAttributes; + /** Shows true if the disk is write-accelerator enabled. */ + readonly writeAcceleratorEnabled?: boolean; +} + +export function restorePointSourceVmosDiskSerializer(item: RestorePointSourceVmosDisk): any { + return { + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersSerializer(item["managedDisk"]), + diskRestorePoint: !item["diskRestorePoint"] + ? item["diskRestorePoint"] + : diskRestorePointAttributesSerializer(item["diskRestorePoint"]), + }; +} + +export function restorePointSourceVmosDiskDeserializer(item: any): RestorePointSourceVmosDisk { + return { + osType: item["osType"], + encryptionSettings: !item["encryptionSettings"] + ? item["encryptionSettings"] + : diskEncryptionSettingsDeserializer(item["encryptionSettings"]), + name: item["name"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersDeserializer(item["managedDisk"]), + diskRestorePoint: !item["diskRestorePoint"] + ? item["diskRestorePoint"] + : diskRestorePointAttributesDeserializer(item["diskRestorePoint"]), + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + }; +} + +/** Gets the Operating System type. */ +export enum KnownOperatingSystemType { + /** Windows */ + Windows = "Windows", + /** Linux */ + Linux = "Linux", +} + +/** + * Gets the Operating System type. \ + * {@link KnownOperatingSystemType} can be used interchangeably with OperatingSystemType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows** \ + * **Linux** + */ +export type OperatingSystemType = string; + +/** Disk Restore Point details. */ +export interface DiskRestorePointAttributes extends SubResourceReadOnly { + /** Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while creating a restore point. */ + encryption?: RestorePointEncryption; + /** Resource Id of the source disk restore point. */ + sourceDiskRestorePoint?: ApiEntityReference; +} + +export function diskRestorePointAttributesSerializer(item: DiskRestorePointAttributes): any { + return { + encryption: !item["encryption"] + ? item["encryption"] + : restorePointEncryptionSerializer(item["encryption"]), + sourceDiskRestorePoint: !item["sourceDiskRestorePoint"] + ? item["sourceDiskRestorePoint"] + : apiEntityReferenceSerializer(item["sourceDiskRestorePoint"]), + }; +} + +export function diskRestorePointAttributesDeserializer(item: any): DiskRestorePointAttributes { + return { + id: item["id"], + encryption: !item["encryption"] + ? item["encryption"] + : restorePointEncryptionDeserializer(item["encryption"]), + sourceDiskRestorePoint: !item["sourceDiskRestorePoint"] + ? item["sourceDiskRestorePoint"] + : apiEntityReferenceDeserializer(item["sourceDiskRestorePoint"]), + }; +} + +/** Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while creating a restore point. */ +export interface RestorePointEncryption { + /** 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. */ + diskEncryptionSet?: DiskEncryptionSetParameters; + /** The type of key used to encrypt the data of the disk restore point. */ + type?: RestorePointEncryptionType; +} + +export function restorePointEncryptionSerializer(item: RestorePointEncryption): any { + return { + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + type: item["type"], + }; +} + +export function restorePointEncryptionDeserializer(item: any): RestorePointEncryption { + return { + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + type: item["type"], + }; +} + +/** The type of key used to encrypt the data of the disk restore point. */ +export enum KnownRestorePointEncryptionType { + /** Disk Restore Point is encrypted at rest with Platform managed key. */ + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", + /** Disk Restore Point is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + /** Disk Restore Point is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", +} + +/** + * The type of key used to encrypt the data of the disk restore point. \ + * {@link KnownRestorePointEncryptionType} can be used interchangeably with RestorePointEncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithPlatformKey**: Disk Restore Point is encrypted at rest with Platform managed key. \ + * **EncryptionAtRestWithCustomerKey**: Disk Restore Point is encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ + * **EncryptionAtRestWithPlatformAndCustomerKeys**: Disk Restore Point is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. + */ +export type RestorePointEncryptionType = string; + +export function restorePointSourceVMDataDiskArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return restorePointSourceVMDataDiskSerializer(item); + }); +} + +export function restorePointSourceVMDataDiskArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return restorePointSourceVMDataDiskDeserializer(item); + }); +} + +/** Describes a data disk. */ +export interface RestorePointSourceVMDataDisk { + /** Gets the logical unit number. */ + readonly lun?: number; + /** Gets the disk name. */ + readonly name?: string; + /** Gets the caching type. */ + readonly caching?: CachingTypes; + /** Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. */ + readonly diskSizeGB?: number; + /** Contains the managed disk details. */ + managedDisk?: ManagedDiskParameters; + /** Contains Disk Restore Point properties. */ + diskRestorePoint?: DiskRestorePointAttributes; + /** Shows true if the disk is write-accelerator enabled. */ + readonly writeAcceleratorEnabled?: boolean; +} + +export function restorePointSourceVMDataDiskSerializer(item: RestorePointSourceVMDataDisk): any { + return { + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersSerializer(item["managedDisk"]), + diskRestorePoint: !item["diskRestorePoint"] + ? item["diskRestorePoint"] + : diskRestorePointAttributesSerializer(item["diskRestorePoint"]), + }; +} + +export function restorePointSourceVMDataDiskDeserializer(item: any): RestorePointSourceVMDataDisk { + return { + lun: item["lun"], + name: item["name"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskParametersDeserializer(item["managedDisk"]), + diskRestorePoint: !item["diskRestorePoint"] + ? item["diskRestorePoint"] + : diskRestorePointAttributesDeserializer(item["diskRestorePoint"]), + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + }; +} + +/** ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. */ +export enum KnownConsistencyModeTypes { + /** CrashConsistent */ + CrashConsistent = "CrashConsistent", + /** FileSystemConsistent */ + FileSystemConsistent = "FileSystemConsistent", + /** ApplicationConsistent */ + ApplicationConsistent = "ApplicationConsistent", +} + +/** + * ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. \ + * {@link KnownConsistencyModeTypes} can be used interchangeably with ConsistencyModeTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CrashConsistent** \ + * **FileSystemConsistent** \ + * **ApplicationConsistent** + */ +export type ConsistencyModeTypes = string; + +/** The instance view of a restore point. */ +export interface RestorePointInstanceView { + /** The disk restore points information. */ + diskRestorePoints?: DiskRestorePointInstanceView[]; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; +} + +export function restorePointInstanceViewDeserializer(item: any): RestorePointInstanceView { + return { + diskRestorePoints: !item["diskRestorePoints"] + ? item["diskRestorePoints"] + : diskRestorePointInstanceViewArrayDeserializer(item["diskRestorePoints"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + }; +} + +export function diskRestorePointInstanceViewArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return diskRestorePointInstanceViewDeserializer(item); + }); +} + +/** The instance view of a disk restore point. */ +export interface DiskRestorePointInstanceView { + /** Disk restore point Id. */ + id?: string; + /** The state of snapshot which determines the access availability of the snapshot. */ + snapshotAccessState?: SnapshotAccessState; + /** The disk restore point replication status information. */ + replicationStatus?: DiskRestorePointReplicationStatus; +} + +export function diskRestorePointInstanceViewDeserializer(item: any): DiskRestorePointInstanceView { + return { + id: item["id"], + snapshotAccessState: item["snapshotAccessState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : diskRestorePointReplicationStatusDeserializer(item["replicationStatus"]), + }; +} + +/** The instance view of a disk restore point. */ +export interface DiskRestorePointReplicationStatus { + /** The resource status information. */ + status?: InstanceViewStatus; + /** Replication completion percentage. */ + completionPercent?: number; +} + +export function diskRestorePointReplicationStatusDeserializer( + item: any, +): DiskRestorePointReplicationStatus { + return { + status: !item["status"] ? item["status"] : instanceViewStatusDeserializer(item["status"]), + completionPercent: item["completionPercent"], + }; +} + +/** Update Restore Point collection parameters. */ +export interface RestorePointCollectionUpdate extends UpdateResource { + /** The properties of the source resource that this restore point collection is created from. */ + source?: RestorePointCollectionSourceProperties; + /** The provisioning state of the restore point collection. */ + readonly provisioningState?: string; + /** The unique id of the restore point collection. */ + readonly restorePointCollectionId?: string; + /** A list containing all restore points created under this restore point collection. */ + readonly restorePoints?: RestorePoint[]; + /** This property determines whether instant access snapshot is enabled for restore points created under this restore point collection for Premium SSD v2 or Ultra disk. Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for restoring disk with fast restore performance. */ + instantAccess?: boolean; +} + +export function restorePointCollectionUpdateSerializer(item: RestorePointCollectionUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, ["source", "instantAccess"]) + ? undefined + : _restorePointCollectionUpdatePropertiesSerializer(item), + }; +} + +/** The List restore point collection operation response. */ +export interface _RestorePointCollectionListResult { + /** Gets the list of restore point collections. */ + value: RestorePointCollection[]; + /** The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections. */ + nextLink?: string; +} + +export function _restorePointCollectionListResultDeserializer( + item: any, +): _RestorePointCollectionListResult { + return { + value: restorePointCollectionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function restorePointCollectionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return restorePointCollectionSerializer(item); + }); +} + +export function restorePointCollectionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return restorePointCollectionDeserializer(item); + }); +} + +/** Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group. */ +export interface CapacityReservationGroup extends TrackedResource { + /** The availability zones. */ + zones?: string[]; + /** A list of all capacity reservation resource ids that belong to capacity reservation group. */ + readonly capacityReservations?: SubResourceReadOnly[]; + /** A list of references to all virtual machines associated to the capacity reservation group. */ + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + /** The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. */ + readonly instanceView?: CapacityReservationGroupInstanceView; + /** Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ + sharingProfile?: ResourceSharingProfile; + /** Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. */ + reservationType?: ReservationType; +} + +export function capacityReservationGroupSerializer(item: CapacityReservationGroup): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, ["sharingProfile", "reservationType"]) + ? undefined + : _capacityReservationGroupPropertiesSerializer(item), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +export function capacityReservationGroupDeserializer(item: any): CapacityReservationGroup { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _capacityReservationGroupPropertiesDeserializer(item["properties"])), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** capacity reservation group Properties. */ +export interface CapacityReservationGroupProperties { + /** A list of all capacity reservation resource ids that belong to capacity reservation group. */ + readonly capacityReservations?: SubResourceReadOnly[]; + /** A list of references to all virtual machines associated to the capacity reservation group. */ + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + /** The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. */ + readonly instanceView?: CapacityReservationGroupInstanceView; + /** Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ + sharingProfile?: ResourceSharingProfile; + /** Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. */ + reservationType?: ReservationType; +} + +export function capacityReservationGroupPropertiesSerializer( + item: CapacityReservationGroupProperties, +): any { + return { + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : resourceSharingProfileSerializer(item["sharingProfile"]), + reservationType: item["reservationType"], + }; +} + +export function capacityReservationGroupPropertiesDeserializer( + item: any, +): CapacityReservationGroupProperties { + return { + capacityReservations: !item["capacityReservations"] + ? item["capacityReservations"] + : subResourceReadOnlyArrayDeserializer(item["capacityReservations"]), + virtualMachinesAssociated: !item["virtualMachinesAssociated"] + ? item["virtualMachinesAssociated"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachinesAssociated"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : capacityReservationGroupInstanceViewDeserializer(item["instanceView"]), + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : resourceSharingProfileDeserializer(item["sharingProfile"]), + reservationType: item["reservationType"], + }; +} + +/** model interface CapacityReservationGroupInstanceView */ +export interface CapacityReservationGroupInstanceView { + /** List of instance view of the capacity reservations under the capacity reservation group. */ + readonly capacityReservations?: CapacityReservationInstanceViewWithName[]; + /** List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ + readonly sharedSubscriptionIds?: SubResourceReadOnly[]; +} + +export function capacityReservationGroupInstanceViewDeserializer( + item: any, +): CapacityReservationGroupInstanceView { + return { + capacityReservations: !item["capacityReservations"] + ? item["capacityReservations"] + : capacityReservationInstanceViewWithNameArrayDeserializer(item["capacityReservations"]), + sharedSubscriptionIds: !item["sharedSubscriptionIds"] + ? item["sharedSubscriptionIds"] + : subResourceReadOnlyArrayDeserializer(item["sharedSubscriptionIds"]), + }; +} + +export function capacityReservationInstanceViewWithNameArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return capacityReservationInstanceViewWithNameDeserializer(item); + }); +} + +/** The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the response to the instance view of a capacity reservation group. */ +export interface CapacityReservationInstanceViewWithName extends CapacityReservationInstanceView { + /** The name of the capacity reservation. */ + readonly name?: string; +} + +export function capacityReservationInstanceViewWithNameDeserializer( + item: any, +): CapacityReservationInstanceViewWithName { + return { + utilizationInfo: !item["utilizationInfo"] + ? item["utilizationInfo"] + : capacityReservationUtilizationDeserializer(item["utilizationInfo"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + name: item["name"], + }; +} + +/** model interface ResourceSharingProfile */ +export interface ResourceSharingProfile { + /** Specifies an array of subscription resource IDs that capacity reservation group is shared with. Block Capacity Reservations does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ + subscriptionIds?: SubResource[]; +} + +export function resourceSharingProfileSerializer(item: ResourceSharingProfile): any { + return { + subscriptionIds: !item["subscriptionIds"] + ? item["subscriptionIds"] + : subResourceArraySerializer(item["subscriptionIds"]), + }; +} + +export function resourceSharingProfileDeserializer(item: any): ResourceSharingProfile { + return { + subscriptionIds: !item["subscriptionIds"] + ? item["subscriptionIds"] + : subResourceArrayDeserializer(item["subscriptionIds"]), + }; +} + +/** Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. */ +export enum KnownReservationType { + /** To consume on demand allocated capacity reservation when a capacity reservation group is provided. */ + Targeted = "Targeted", + /** To consume scheduled allocated block capacity reservation when a capacity reservation group is provided. */ + Block = "Block", +} + +/** + * Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. \ + * {@link KnownReservationType} can be used interchangeably with ReservationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Targeted**: To consume on demand allocated capacity reservation when a capacity reservation group is provided. \ + * **Block**: To consume scheduled allocated block capacity reservation when a capacity reservation group is provided. + */ +export type ReservationType = string; + +/** The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. */ +export interface CapacityReservationInstanceView { + /** Unutilized capacity of the capacity reservation. */ + utilizationInfo?: CapacityReservationUtilization; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; +} + +export function capacityReservationInstanceViewDeserializer( + item: any, +): CapacityReservationInstanceView { + return { + utilizationInfo: !item["utilizationInfo"] + ? item["utilizationInfo"] + : capacityReservationUtilizationDeserializer(item["utilizationInfo"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + }; +} + +/** Represents the capacity reservation utilization in terms of resources allocated. */ +export interface CapacityReservationUtilization { + /** The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01. */ + readonly currentCapacity?: number; + /** A list of all virtual machines resource ids allocated against the capacity reservation. */ + readonly virtualMachinesAllocated?: SubResourceReadOnly[]; +} + +export function capacityReservationUtilizationDeserializer( + item: any, +): CapacityReservationUtilization { + return { + currentCapacity: item["currentCapacity"], + virtualMachinesAllocated: !item["virtualMachinesAllocated"] + ? item["virtualMachinesAllocated"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachinesAllocated"]), + }; +} + +/** Specifies information about the capacity reservation group. Only tags can be updated. */ +export interface CapacityReservationGroupUpdate extends UpdateResource { + /** A list of all capacity reservation resource ids that belong to capacity reservation group. */ + readonly capacityReservations?: SubResourceReadOnly[]; + /** A list of references to all virtual machines associated to the capacity reservation group. */ + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + /** The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. */ + readonly instanceView?: CapacityReservationGroupInstanceView; + /** Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ + sharingProfile?: ResourceSharingProfile; + /** Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. */ + reservationType?: ReservationType; +} + +export function capacityReservationGroupUpdateSerializer( + item: CapacityReservationGroupUpdate, +): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, ["sharingProfile", "reservationType"]) + ? undefined + : _capacityReservationGroupUpdatePropertiesSerializer(item), + }; +} + +/** The List capacity reservation group with resource group response. */ +export interface _CapacityReservationGroupListResult { + /** The list of capacity reservation groups. */ + value: CapacityReservationGroup[]; + /** The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of capacity reservation groups. */ + nextLink?: string; +} + +export function _capacityReservationGroupListResultDeserializer( + item: any, +): _CapacityReservationGroupListResult { + return { + value: capacityReservationGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function capacityReservationGroupArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return capacityReservationGroupSerializer(item); + }); +} + +export function capacityReservationGroupArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return capacityReservationGroupDeserializer(item); + }); +} + +/** Specifies information about the capacity reservation. */ +export interface CapacityReservation extends TrackedResource { + /** SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. */ + sku: Sku; + /** The availability zones. */ + zones?: string[]; + /** A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. */ + readonly reservationId?: string; + /** Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. */ + readonly platformFaultDomainCount?: number; + /** A list of all virtual machine resource ids that are associated with the capacity reservation. */ + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + /** The date time when the capacity reservation was last updated. */ + readonly provisioningTime?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The Capacity reservation instance view. */ + readonly instanceView?: CapacityReservationInstanceView; + /** Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. */ + scheduleProfile?: ScheduleProfile; +} + +export function capacityReservationSerializer(item: CapacityReservation): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, ["scheduleProfile"]) + ? undefined + : _capacityReservationPropertiesSerializer(item), + sku: skuSerializer(item["sku"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +export function capacityReservationDeserializer(item: any): CapacityReservation { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _capacityReservationPropertiesDeserializer(item["properties"])), + sku: skuDeserializer(item["sku"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** Properties of the Capacity reservation. */ +export interface CapacityReservationProperties { + /** A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. */ + readonly reservationId?: string; + /** Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. */ + readonly platformFaultDomainCount?: number; + /** A list of all virtual machine resource ids that are associated with the capacity reservation. */ + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + /** The date time when the capacity reservation was last updated. */ + readonly provisioningTime?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The Capacity reservation instance view. */ + readonly instanceView?: CapacityReservationInstanceView; + /** Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. */ + scheduleProfile?: ScheduleProfile; +} + +export function capacityReservationPropertiesSerializer(item: CapacityReservationProperties): any { + return { + scheduleProfile: !item["scheduleProfile"] + ? item["scheduleProfile"] + : scheduleProfileSerializer(item["scheduleProfile"]), + }; +} + +export function capacityReservationPropertiesDeserializer( + item: any, +): CapacityReservationProperties { + return { + reservationId: item["reservationId"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachinesAssociated: !item["virtualMachinesAssociated"] + ? item["virtualMachinesAssociated"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachinesAssociated"]), + provisioningTime: !item["provisioningTime"] + ? item["provisioningTime"] + : new Date(item["provisioningTime"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : capacityReservationInstanceViewDeserializer(item["instanceView"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + scheduleProfile: !item["scheduleProfile"] + ? item["scheduleProfile"] + : scheduleProfileDeserializer(item["scheduleProfile"]), + }; +} + +/** Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. */ +export interface ScheduleProfile { + /** The required start date for block capacity reservations. Must be today or within 56 days in the future. For same-day scheduling, requests must be submitted before 11:30 AM UTC. Example: 2025-06-27. */ + start?: string; + /** The required end date for block capacity reservations. Must be after the start date, with a duration of either 1–14 whole days or 3–26 whole weeks. Example: 2025-06-28. */ + end?: string; +} + +export function scheduleProfileSerializer(item: ScheduleProfile): any { + return { start: item["start"], end: item["end"] }; +} + +export function scheduleProfileDeserializer(item: any): ScheduleProfile { + return { + start: item["start"], + end: item["end"], + }; +} + +/** Specifies information about the capacity reservation. sku.capacity cannot be updated for Block Capacity Reservation. Tags can be update for all Capacity Reservation Types. */ +export interface CapacityReservationUpdate extends UpdateResource { + /** SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. **Note:** The SKU name and capacity cannot be updated for Block capacity reservations. */ + sku?: Sku; + /** A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. */ + readonly reservationId?: string; + /** Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. */ + readonly platformFaultDomainCount?: number; + /** A list of all virtual machine resource ids that are associated with the capacity reservation. */ + readonly virtualMachinesAssociated?: SubResourceReadOnly[]; + /** The date time when the capacity reservation was last updated. */ + readonly provisioningTime?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** The Capacity reservation instance view. */ + readonly instanceView?: CapacityReservationInstanceView; + /** Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. */ + scheduleProfile?: ScheduleProfile; +} + +export function capacityReservationUpdateSerializer(item: CapacityReservationUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, ["scheduleProfile"]) + ? undefined + : _capacityReservationUpdatePropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + }; +} + +/** The list capacity reservation operation response. */ +export interface _CapacityReservationListResult { + /** The list of capacity reservations. */ + value: CapacityReservation[]; + /** The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity reservations. */ + nextLink?: string; +} + +export function _capacityReservationListResultDeserializer( + item: any, +): _CapacityReservationListResult { + return { + value: capacityReservationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function capacityReservationArraySerializer(result: Array): any[] { + return result.map((item) => { + return capacityReservationSerializer(item); + }); +} + +export function capacityReservationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return capacityReservationDeserializer(item); + }); +} + +/** Describes a Virtual Machine run command. */ +export interface VirtualMachineRunCommand extends TrackedResource { + /** The source of the run command script. */ + source?: VirtualMachineRunCommandScriptSource; + /** The parameters used by the script. */ + parameters?: RunCommandInputParameter[]; + /** The parameters used by the script. */ + protectedParameters?: RunCommandInputParameter[]; + /** Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. */ + asyncExecution?: boolean; + /** Specifies the user account on the VM when executing the run command. */ + runAsUser?: string; + /** Specifies the user account password on the VM when executing the run command. */ + runAsPassword?: string; + /** The timeout in seconds to execute the run command. */ + timeoutInSeconds?: number; + /** Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. */ + outputBlobUri?: string; + /** Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. */ + errorBlobUri?: string; + /** User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ + outputBlobManagedIdentity?: RunCommandManagedIdentity; + /** User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ + errorBlobManagedIdentity?: RunCommandManagedIdentity; + /** The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ + readonly provisioningState?: string; + /** The virtual machine run command instance view. */ + readonly instanceView?: VirtualMachineRunCommandInstanceView; + /** Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ + treatFailureAsDeploymentFailure?: boolean; +} + +export function virtualMachineRunCommandSerializer(item: VirtualMachineRunCommand): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "source", + "parameters", + "protectedParameters", + "asyncExecution", + "runAsUser", + "runAsPassword", + "timeoutInSeconds", + "outputBlobUri", + "errorBlobUri", + "outputBlobManagedIdentity", + "errorBlobManagedIdentity", + "treatFailureAsDeploymentFailure", + ]) + ? undefined + : _virtualMachineRunCommandPropertiesSerializer(item), + }; +} + +export function virtualMachineRunCommandDeserializer(item: any): VirtualMachineRunCommand { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _virtualMachineRunCommandPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a Virtual Machine run command. */ +export interface VirtualMachineRunCommandProperties { + /** The source of the run command script. */ + source?: VirtualMachineRunCommandScriptSource; + /** The parameters used by the script. */ + parameters?: RunCommandInputParameter[]; + /** The parameters used by the script. */ + protectedParameters?: RunCommandInputParameter[]; + /** Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. */ + asyncExecution?: boolean; + /** Specifies the user account on the VM when executing the run command. */ + runAsUser?: string; + /** Specifies the user account password on the VM when executing the run command. */ + runAsPassword?: string; + /** The timeout in seconds to execute the run command. */ + timeoutInSeconds?: number; + /** Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. */ + outputBlobUri?: string; + /** Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. */ + errorBlobUri?: string; + /** User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ + outputBlobManagedIdentity?: RunCommandManagedIdentity; + /** User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ + errorBlobManagedIdentity?: RunCommandManagedIdentity; + /** The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ + readonly provisioningState?: string; + /** The virtual machine run command instance view. */ + readonly instanceView?: VirtualMachineRunCommandInstanceView; + /** Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ + treatFailureAsDeploymentFailure?: boolean; +} + +export function virtualMachineRunCommandPropertiesSerializer( + item: VirtualMachineRunCommandProperties, +): any { + return { + source: !item["source"] + ? item["source"] + : virtualMachineRunCommandScriptSourceSerializer(item["source"]), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandInputParameterArraySerializer(item["parameters"]), + protectedParameters: !item["protectedParameters"] + ? item["protectedParameters"] + : runCommandInputParameterArraySerializer(item["protectedParameters"]), + asyncExecution: item["asyncExecution"], + runAsUser: item["runAsUser"], + runAsPassword: item["runAsPassword"], + timeoutInSeconds: item["timeoutInSeconds"], + outputBlobUri: item["outputBlobUri"], + errorBlobUri: item["errorBlobUri"], + outputBlobManagedIdentity: !item["outputBlobManagedIdentity"] + ? item["outputBlobManagedIdentity"] + : runCommandManagedIdentitySerializer(item["outputBlobManagedIdentity"]), + errorBlobManagedIdentity: !item["errorBlobManagedIdentity"] + ? item["errorBlobManagedIdentity"] + : runCommandManagedIdentitySerializer(item["errorBlobManagedIdentity"]), + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + }; +} + +export function virtualMachineRunCommandPropertiesDeserializer( + item: any, +): VirtualMachineRunCommandProperties { + return { + source: !item["source"] + ? item["source"] + : virtualMachineRunCommandScriptSourceDeserializer(item["source"]), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandInputParameterArrayDeserializer(item["parameters"]), + protectedParameters: !item["protectedParameters"] + ? item["protectedParameters"] + : runCommandInputParameterArrayDeserializer(item["protectedParameters"]), + asyncExecution: item["asyncExecution"], + runAsUser: item["runAsUser"], + runAsPassword: item["runAsPassword"], + timeoutInSeconds: item["timeoutInSeconds"], + outputBlobUri: item["outputBlobUri"], + errorBlobUri: item["errorBlobUri"], + outputBlobManagedIdentity: !item["outputBlobManagedIdentity"] + ? item["outputBlobManagedIdentity"] + : runCommandManagedIdentityDeserializer(item["outputBlobManagedIdentity"]), + errorBlobManagedIdentity: !item["errorBlobManagedIdentity"] + ? item["errorBlobManagedIdentity"] + : runCommandManagedIdentityDeserializer(item["errorBlobManagedIdentity"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineRunCommandInstanceViewDeserializer(item["instanceView"]), + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + }; +} + +/** Describes the script sources for run command. Use only one of these script sources: script, scriptUri, commandId, galleryScriptReferenceId. */ +export interface VirtualMachineRunCommandScriptSource { + /** Specifies the script content to be executed on the VM. */ + script?: string; + /** Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. */ + scriptUri?: string; + /** Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands. */ + commandId?: string; + /** User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. */ + scriptUriManagedIdentity?: RunCommandManagedIdentity; + /** Optional. Specify which shell to use for running the script. These values must match those expected by the extension. Currently supported only for Windows VMs, script uses Powershell 7 when specified. Powershell 7 must be already installed on the machine to use Powershell7 parameter value. */ + scriptShell?: ScriptShellTypes; + /** The resource ID of a Gallery Script version that needs to be executed. Example ID looks like /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}. */ + galleryScriptReferenceId?: string; +} + +export function virtualMachineRunCommandScriptSourceSerializer( + item: VirtualMachineRunCommandScriptSource, +): any { + return { + script: item["script"], + scriptUri: item["scriptUri"], + commandId: item["commandId"], + scriptUriManagedIdentity: !item["scriptUriManagedIdentity"] + ? item["scriptUriManagedIdentity"] + : runCommandManagedIdentitySerializer(item["scriptUriManagedIdentity"]), + scriptShell: item["scriptShell"], + galleryScriptReferenceId: item["galleryScriptReferenceId"], + }; +} + +export function virtualMachineRunCommandScriptSourceDeserializer( + item: any, +): VirtualMachineRunCommandScriptSource { + return { + script: item["script"], + scriptUri: item["scriptUri"], + commandId: item["commandId"], + scriptUriManagedIdentity: !item["scriptUriManagedIdentity"] + ? item["scriptUriManagedIdentity"] + : runCommandManagedIdentityDeserializer(item["scriptUriManagedIdentity"]), + scriptShell: item["scriptShell"], + galleryScriptReferenceId: item["galleryScriptReferenceId"], + }; +} + +/** Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. */ +export interface RunCommandManagedIdentity { + /** Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. */ + clientId?: string; + /** Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. */ + objectId?: string; +} + +export function runCommandManagedIdentitySerializer(item: RunCommandManagedIdentity): any { + return { clientId: item["clientId"], objectId: item["objectId"] }; +} + +export function runCommandManagedIdentityDeserializer(item: any): RunCommandManagedIdentity { + return { + clientId: item["clientId"], + objectId: item["objectId"], + }; +} + +/** Script shell types. */ +export enum KnownScriptShellTypes { + /** Default script shell type. */ + Default = "Default", + /** Powershell7 script shell type. */ + Powershell7 = "Powershell7", +} + +/** + * Script shell types. \ + * {@link KnownScriptShellTypes} can be used interchangeably with ScriptShellTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default**: Default script shell type. \ + * **Powershell7**: Powershell7 script shell type. + */ +export type ScriptShellTypes = string; + +/** The instance view of a virtual machine run command. */ +export interface VirtualMachineRunCommandInstanceView { + /** Script execution status. */ + executionState?: ExecutionState; + /** Communicate script configuration errors or execution messages. */ + executionMessage?: string; + /** Exit code returned from script execution. */ + exitCode?: number; + /** Script output stream. */ + output?: string; + /** Script error stream. */ + error?: string; + /** Script start time. */ + startTime?: Date; + /** Script end time. */ + endTime?: Date; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; +} + +export function virtualMachineRunCommandInstanceViewDeserializer( + item: any, +): VirtualMachineRunCommandInstanceView { + return { + executionState: item["executionState"], + executionMessage: item["executionMessage"], + exitCode: item["exitCode"], + output: item["output"], + error: item["error"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + }; +} + +/** Script execution status. */ +export enum KnownExecutionState { + /** Unknown */ + Unknown = "Unknown", + /** Pending */ + Pending = "Pending", + /** Running */ + Running = "Running", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** TimedOut */ + TimedOut = "TimedOut", + /** Canceled */ + Canceled = "Canceled", +} + +/** + * Script execution status. \ + * {@link KnownExecutionState} can be used interchangeably with ExecutionState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Pending** \ + * **Running** \ + * **Failed** \ + * **Succeeded** \ + * **TimedOut** \ + * **Canceled** + */ +export type ExecutionState = string; + +/** Describes a Virtual Machine run command. */ +export interface VirtualMachineRunCommandUpdate extends UpdateResource { + /** The source of the run command script. */ + source?: VirtualMachineRunCommandScriptSource; + /** The parameters used by the script. */ + parameters?: RunCommandInputParameter[]; + /** The parameters used by the script. */ + protectedParameters?: RunCommandInputParameter[]; + /** Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. */ + asyncExecution?: boolean; + /** Specifies the user account on the VM when executing the run command. */ + runAsUser?: string; + /** Specifies the user account password on the VM when executing the run command. */ + runAsPassword?: string; + /** The timeout in seconds to execute the run command. */ + timeoutInSeconds?: number; + /** Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. */ + outputBlobUri?: string; + /** Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. */ + errorBlobUri?: string; + /** User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ + outputBlobManagedIdentity?: RunCommandManagedIdentity; + /** User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ + errorBlobManagedIdentity?: RunCommandManagedIdentity; + /** The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ + readonly provisioningState?: string; + /** The virtual machine run command instance view. */ + readonly instanceView?: VirtualMachineRunCommandInstanceView; + /** Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ + treatFailureAsDeploymentFailure?: boolean; +} + +export function virtualMachineRunCommandUpdateSerializer( + item: VirtualMachineRunCommandUpdate, +): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "source", + "parameters", + "protectedParameters", + "asyncExecution", + "runAsUser", + "runAsPassword", + "timeoutInSeconds", + "outputBlobUri", + "errorBlobUri", + "outputBlobManagedIdentity", + "errorBlobManagedIdentity", + "treatFailureAsDeploymentFailure", + ]) + ? undefined + : _virtualMachineRunCommandUpdatePropertiesSerializer(item), + }; +} + +/** The List run command operation response */ +export interface _VirtualMachineRunCommandsListResult { + /** The list of run commands. */ + value: VirtualMachineRunCommand[]; + /** The uri to fetch the next page of run commands. */ + nextLink?: string; +} + +export function _virtualMachineRunCommandsListResultDeserializer( + item: any, +): _VirtualMachineRunCommandsListResult { + return { + value: virtualMachineRunCommandArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineRunCommandArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineRunCommandSerializer(item); + }); +} + +export function virtualMachineRunCommandArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineRunCommandDeserializer(item); + }); +} + +/** The List Virtual Machine operation response. */ +export interface _RunCommandListResult { + /** The list of virtual machine run commands. */ + value: RunCommandDocumentBase[]; + /** The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. */ + nextLink?: string; +} + +export function _runCommandListResultDeserializer(item: any): _RunCommandListResult { + return { + value: runCommandDocumentBaseArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function runCommandDocumentBaseArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return runCommandDocumentBaseDeserializer(item); + }); +} + +/** Describes the properties of a Run Command metadata. */ +export interface RunCommandDocumentBase { + /** The VM run command schema. */ + schema: string; + /** The VM run command id. */ + id: string; + /** The Operating System type. */ + osType: OperatingSystemTypes; + /** The VM run command label. */ + label: string; + /** The VM run command description. */ + description: string; +} + +export function runCommandDocumentBaseDeserializer(item: any): RunCommandDocumentBase { + return { + schema: item["$schema"], + id: item["id"], + osType: item["osType"], + label: item["label"], + description: item["description"], + }; +} + +/** Describes the properties of a Run Command. */ +export interface RunCommandDocument extends RunCommandDocumentBase { + /** The script to be executed. */ + script: string[]; + /** The parameters used by the script. */ + parameters?: RunCommandParameterDefinition[]; +} + +export function runCommandDocumentDeserializer(item: any): RunCommandDocument { + return { + schema: item["$schema"], + id: item["id"], + osType: item["osType"], + label: item["label"], + description: item["description"], + script: item["script"].map((p: any) => { + return p; + }), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandParameterDefinitionArrayDeserializer(item["parameters"]), + }; +} + +export function runCommandParameterDefinitionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return runCommandParameterDefinitionDeserializer(item); + }); +} + +/** Describes the properties of a run command parameter. */ +export interface RunCommandParameterDefinition { + /** The run command parameter name. */ + name: string; + /** The run command parameter type. */ + type: string; + /** The run command parameter default value. */ + defaultValue?: string; + /** The run command parameter required. */ + required?: boolean; +} + +export function runCommandParameterDefinitionDeserializer( + item: any, +): RunCommandParameterDefinition { + return { + name: item["name"], + type: item["type"], + defaultValue: item["defaultValue"], + required: item["required"], + }; +} + +/** The status of the latest virtual machine scale set rolling upgrade. */ +export interface RollingUpgradeStatusInfo extends TrackedResource { + /** The rolling upgrade policies applied for this upgrade. */ + readonly policy?: RollingUpgradePolicy; + /** Information about the current running state of the overall upgrade. */ + readonly runningStatus?: RollingUpgradeRunningStatus; + /** Information about the number of virtual machine instances in each upgrade state. */ + readonly progress?: RollingUpgradeProgressInfo; + /** Error details for this upgrade, if there are any. */ + readonly error?: ApiError; +} + +export function rollingUpgradeStatusInfoDeserializer(item: any): RollingUpgradeStatusInfo { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _rollingUpgradeStatusInfoPropertiesDeserializer(item["properties"])), + }; +} + +/** The status of the latest virtual machine scale set rolling upgrade. */ +export interface RollingUpgradeStatusInfoProperties { + /** The rolling upgrade policies applied for this upgrade. */ + readonly policy?: RollingUpgradePolicy; + /** Information about the current running state of the overall upgrade. */ + readonly runningStatus?: RollingUpgradeRunningStatus; + /** Information about the number of virtual machine instances in each upgrade state. */ + readonly progress?: RollingUpgradeProgressInfo; + /** Error details for this upgrade, if there are any. */ + readonly error?: ApiError; +} + +export function rollingUpgradeStatusInfoPropertiesDeserializer( + item: any, +): RollingUpgradeStatusInfoProperties { + return { + policy: !item["policy"] ? item["policy"] : rollingUpgradePolicyDeserializer(item["policy"]), + runningStatus: !item["runningStatus"] + ? item["runningStatus"] + : rollingUpgradeRunningStatusDeserializer(item["runningStatus"]), + progress: !item["progress"] + ? item["progress"] + : rollingUpgradeProgressInfoDeserializer(item["progress"]), + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +/** Information about the current running state of the overall upgrade. */ +export interface RollingUpgradeRunningStatus { + /** Code indicating the current status of the upgrade. */ + readonly code?: RollingUpgradeStatusCode; + /** Start time of the upgrade. */ + readonly startTime?: Date; + /** The last action performed on the rolling upgrade. */ + readonly lastAction?: RollingUpgradeActionType; + /** Last action time of the upgrade. */ + readonly lastActionTime?: Date; +} + +export function rollingUpgradeRunningStatusDeserializer(item: any): RollingUpgradeRunningStatus { + return { + code: item["code"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + lastAction: item["lastAction"], + lastActionTime: !item["lastActionTime"] + ? item["lastActionTime"] + : new Date(item["lastActionTime"]), + }; +} + +/** Code indicating the current status of the upgrade. */ +export type RollingUpgradeStatusCode = "RollingForward" | "Cancelled" | "Completed" | "Faulted"; +/** The last action performed on the rolling upgrade. */ +export type RollingUpgradeActionType = "Start" | "Cancel"; + +/** Describes a virtual machine scale set virtual machine. */ +export interface VirtualMachineScaleSetVM extends TrackedResource { + /** The virtual machine instance ID. */ + readonly instanceId?: string; + /** The virtual machine SKU. */ + readonly sku?: Sku; + /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ + plan?: Plan; + /** The virtual machine child extension resources. */ + readonly resources?: VirtualMachineExtension[]; + /** The virtual machine zones. */ + readonly zones?: string[]; + /** The identity of the virtual machine, if configured. */ + identity?: VirtualMachineIdentity; + /** Etag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header to ensure optimistic updates. */ + readonly etag?: string; + /** Specifies whether the latest model has been applied to the virtual machine. */ + readonly latestModelApplied?: boolean; + /** Azure VM unique ID. */ + readonly vmId?: string; + /** The virtual machine instance view. */ + readonly instanceView?: VirtualMachineScaleSetVMInstanceView; + /** Specifies the hardware settings for the virtual machine. */ + hardwareProfile?: HardwareProfile; + /** Specifies the resilient VM deletion status for the virtual machine. */ + resilientVMDeletionStatus?: ResilientVMDeletionStatus; + /** Specifies the storage settings for the virtual machine disks. */ + storageProfile?: StorageProfile; + /** Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ + additionalCapabilities?: AdditionalCapabilities; + /** Specifies the operating system settings for the virtual machine. */ + osProfile?: OSProfile; + /** Specifies the Security related profile settings for the virtual machine. */ + securityProfile?: SecurityProfile; + /** Specifies the network interfaces of the virtual machine. */ + networkProfile?: NetworkProfile; + /** Specifies the network profile configuration of the virtual machine. */ + networkProfileConfiguration?: VirtualMachineScaleSetVMNetworkProfileConfiguration; + /** Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. */ + diagnosticsProfile?: DiagnosticsProfile; + /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. */ + availabilitySet?: SubResource; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** 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 whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. */ + readonly modelDefinitionApplied?: string; + /** Specifies the protection policy of the virtual machine. */ + protectionPolicy?: VirtualMachineScaleSetVMProtectionPolicy; + /** UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01 */ + userData?: string; + /** Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Specifies the ARM resource ID of the standalone virtual machine associated with this VMSS VM. This property is only applicable to Virtual Machine Scale Sets with Flexible orchestration mode. Minimum api-version: 2025-11-01. */ + readonly virtualMachineResourceId?: string; +} + +export function virtualMachineScaleSetVMSerializer(item: VirtualMachineScaleSetVM): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "hardwareProfile", + "resilientVMDeletionStatus", + "storageProfile", + "additionalCapabilities", + "osProfile", + "securityProfile", + "networkProfile", + "networkProfileConfiguration", + "diagnosticsProfile", + "availabilitySet", + "licenseType", + "protectionPolicy", + "userData", + ]) + ? undefined + : _virtualMachineScaleSetVMPropertiesSerializer(item), + plan: !item["plan"] ? item["plan"] : planSerializer(item["plan"]), + identity: !item["identity"] + ? item["identity"] + : virtualMachineIdentitySerializer(item["identity"]), + }; +} + +export function virtualMachineScaleSetVMDeserializer(item: any): VirtualMachineScaleSetVM { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _virtualMachineScaleSetVMPropertiesDeserializer(item["properties"])), + instanceId: item["instanceId"], + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + plan: !item["plan"] ? item["plan"] : planDeserializer(item["plan"]), + resources: !item["resources"] + ? item["resources"] + : virtualMachineExtensionArrayDeserializer(item["resources"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + identity: !item["identity"] + ? item["identity"] + : virtualMachineIdentityDeserializer(item["identity"]), + etag: item["etag"], + }; +} + +/** Describes the properties of a virtual machine scale set virtual machine. */ +export interface VirtualMachineScaleSetVMProperties { + /** Specifies whether the latest model has been applied to the virtual machine. */ + readonly latestModelApplied?: boolean; + /** Azure VM unique ID. */ + readonly vmId?: string; + /** The virtual machine instance view. */ + readonly instanceView?: VirtualMachineScaleSetVMInstanceView; + /** Specifies the hardware settings for the virtual machine. */ + hardwareProfile?: HardwareProfile; + /** Specifies the resilient VM deletion status for the virtual machine. */ + resilientVMDeletionStatus?: ResilientVMDeletionStatus; + /** Specifies the storage settings for the virtual machine disks. */ + storageProfile?: StorageProfile; + /** Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ + additionalCapabilities?: AdditionalCapabilities; + /** Specifies the operating system settings for the virtual machine. */ + osProfile?: OSProfile; + /** Specifies the Security related profile settings for the virtual machine. */ + securityProfile?: SecurityProfile; + /** Specifies the network interfaces of the virtual machine. */ + networkProfile?: NetworkProfile; + /** Specifies the network profile configuration of the virtual machine. */ + networkProfileConfiguration?: VirtualMachineScaleSetVMNetworkProfileConfiguration; + /** Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. */ + diagnosticsProfile?: DiagnosticsProfile; + /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. */ + availabilitySet?: SubResource; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: string; + /** 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 whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. */ + readonly modelDefinitionApplied?: string; + /** Specifies the protection policy of the virtual machine. */ + protectionPolicy?: VirtualMachineScaleSetVMProtectionPolicy; + /** UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01 */ + userData?: string; + /** Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. */ + readonly timeCreated?: Date; + /** Specifies the ARM resource ID of the standalone virtual machine associated with this VMSS VM. This property is only applicable to Virtual Machine Scale Sets with Flexible orchestration mode. Minimum api-version: 2025-11-01. */ + readonly virtualMachineResourceId?: string; +} + +export function virtualMachineScaleSetVMPropertiesSerializer( + item: VirtualMachineScaleSetVMProperties, +): any { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileSerializer(item["hardwareProfile"]), + resilientVMDeletionStatus: item["resilientVMDeletionStatus"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileSerializer(item["storageProfile"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesSerializer(item["additionalCapabilities"]), + osProfile: !item["osProfile"] ? item["osProfile"] : osProfileSerializer(item["osProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileSerializer(item["securityProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + networkProfileConfiguration: !item["networkProfileConfiguration"] + ? item["networkProfileConfiguration"] + : virtualMachineScaleSetVMNetworkProfileConfigurationSerializer( + item["networkProfileConfiguration"], + ), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileSerializer(item["diagnosticsProfile"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceSerializer(item["availabilitySet"]), + licenseType: item["licenseType"], + protectionPolicy: !item["protectionPolicy"] + ? item["protectionPolicy"] + : virtualMachineScaleSetVMProtectionPolicySerializer(item["protectionPolicy"]), + userData: item["userData"], + }; +} + +export function virtualMachineScaleSetVMPropertiesDeserializer( + item: any, +): VirtualMachineScaleSetVMProperties { + return { + latestModelApplied: item["latestModelApplied"], + vmId: item["vmId"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineScaleSetVMInstanceViewDeserializer(item["instanceView"]), + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileDeserializer(item["hardwareProfile"]), + resilientVMDeletionStatus: item["resilientVMDeletionStatus"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileDeserializer(item["storageProfile"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesDeserializer(item["additionalCapabilities"]), + osProfile: !item["osProfile"] ? item["osProfile"] : osProfileDeserializer(item["osProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileDeserializer(item["securityProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileDeserializer(item["networkProfile"]), + networkProfileConfiguration: !item["networkProfileConfiguration"] + ? item["networkProfileConfiguration"] + : virtualMachineScaleSetVMNetworkProfileConfigurationDeserializer( + item["networkProfileConfiguration"], + ), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileDeserializer(item["diagnosticsProfile"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceDeserializer(item["availabilitySet"]), + provisioningState: item["provisioningState"], + licenseType: item["licenseType"], + modelDefinitionApplied: item["modelDefinitionApplied"], + protectionPolicy: !item["protectionPolicy"] + ? item["protectionPolicy"] + : virtualMachineScaleSetVMProtectionPolicyDeserializer(item["protectionPolicy"]), + userData: item["userData"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + virtualMachineResourceId: item["virtualMachineResourceId"], + }; +} + +/** The instance view of a virtual machine scale set VM. */ +export interface VirtualMachineScaleSetVMInstanceView { + /** The Update Domain count. */ + platformUpdateDomain?: number; + /** The Fault Domain count. */ + platformFaultDomain?: number; + /** The Remote desktop certificate thumbprint. */ + rdpThumbPrint?: string; + /** The VM Agent running on the virtual machine. */ + vmAgent?: VirtualMachineAgentInstanceView; + /** The Maintenance Operation status on the virtual machine. */ + maintenanceRedeployStatus?: MaintenanceRedeployStatus; + /** The disks information. */ + disks?: DiskInstanceView[]; + /** The extensions information. */ + extensions?: VirtualMachineExtensionInstanceView[]; + /** The health status for the VM. */ + readonly vmHealth?: VirtualMachineHealthStatus; + /** 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. */ + bootDiagnostics?: BootDiagnosticsInstanceView; + /** The resource status information. */ + statuses?: InstanceViewStatus[]; + /** Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. Minimum api-version: 2020-06-01. */ + readonly assignedHost?: string; + /** The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. */ + placementGroupId?: string; + /** 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://learn.microsoft.com/previous-versions/azure/virtual-machines/linux/infrastructure-example?toc=%2Fazure%2Fvirtual-machines%2Flinux%2Ftoc.json#1-naming-conventions). */ + computerName?: string; + /** The Operating System running on the hybrid machine. */ + osName?: string; + /** The version of Operating System running on the hybrid machine. */ + osVersion?: string; + /** The hypervisor generation of the Virtual Machine [V1, V2] */ + hyperVGeneration?: HyperVGeneration; +} + +export function virtualMachineScaleSetVMInstanceViewDeserializer( + item: any, +): VirtualMachineScaleSetVMInstanceView { + return { + platformUpdateDomain: item["platformUpdateDomain"], + platformFaultDomain: item["platformFaultDomain"], + rdpThumbPrint: item["rdpThumbPrint"], + vmAgent: !item["vmAgent"] + ? item["vmAgent"] + : virtualMachineAgentInstanceViewDeserializer(item["vmAgent"]), + maintenanceRedeployStatus: !item["maintenanceRedeployStatus"] + ? item["maintenanceRedeployStatus"] + : maintenanceRedeployStatusDeserializer(item["maintenanceRedeployStatus"]), + disks: !item["disks"] ? item["disks"] : diskInstanceViewArrayDeserializer(item["disks"]), + extensions: !item["extensions"] + ? item["extensions"] + : virtualMachineExtensionInstanceViewArrayDeserializer(item["extensions"]), + vmHealth: !item["vmHealth"] + ? item["vmHealth"] + : virtualMachineHealthStatusDeserializer(item["vmHealth"]), + bootDiagnostics: !item["bootDiagnostics"] + ? item["bootDiagnostics"] + : bootDiagnosticsInstanceViewDeserializer(item["bootDiagnostics"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + assignedHost: item["assignedHost"], + placementGroupId: item["placementGroupId"], + computerName: item["computerName"], + osName: item["osName"], + osVersion: item["osVersion"], + hyperVGeneration: item["hyperVGeneration"], + }; +} + +/** Specifies the resilient VM deletion status for the virtual machine. */ +export enum KnownResilientVMDeletionStatus { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", + /** InProgress */ + InProgress = "InProgress", + /** Failed */ + Failed = "Failed", +} + +/** + * Specifies the resilient VM deletion status for the virtual machine. \ + * {@link KnownResilientVMDeletionStatus} can be used interchangeably with ResilientVMDeletionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** \ + * **InProgress** \ + * **Failed** + */ +export type ResilientVMDeletionStatus = string; + +/** Describes a virtual machine scale set VM network profile. */ +export interface VirtualMachineScaleSetVMNetworkProfileConfiguration { + /** The list of network configurations. */ + networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; +} + +export function virtualMachineScaleSetVMNetworkProfileConfigurationSerializer( + item: VirtualMachineScaleSetVMNetworkProfileConfiguration, +): any { + return { + networkInterfaceConfigurations: !item["networkInterfaceConfigurations"] + ? item["networkInterfaceConfigurations"] + : virtualMachineScaleSetNetworkConfigurationArraySerializer( + item["networkInterfaceConfigurations"], + ), + }; +} + +export function virtualMachineScaleSetVMNetworkProfileConfigurationDeserializer( + item: any, +): VirtualMachineScaleSetVMNetworkProfileConfiguration { + return { + networkInterfaceConfigurations: !item["networkInterfaceConfigurations"] + ? item["networkInterfaceConfigurations"] + : virtualMachineScaleSetNetworkConfigurationArrayDeserializer( + item["networkInterfaceConfigurations"], + ), + }; +} + +/** The protection policy of a virtual machine scale set VM. */ +export interface VirtualMachineScaleSetVMProtectionPolicy { + /** Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. */ + protectFromScaleIn?: boolean; + /** Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. */ + protectFromScaleSetActions?: boolean; +} + +export function virtualMachineScaleSetVMProtectionPolicySerializer( + item: VirtualMachineScaleSetVMProtectionPolicy, +): any { + return { + protectFromScaleIn: item["protectFromScaleIn"], + protectFromScaleSetActions: item["protectFromScaleSetActions"], + }; +} + +export function virtualMachineScaleSetVMProtectionPolicyDeserializer( + item: any, +): VirtualMachineScaleSetVMProtectionPolicy { + return { + protectFromScaleIn: item["protectFromScaleIn"], + protectFromScaleSetActions: item["protectFromScaleSetActions"], + }; +} + +/** The List Virtual Machine Scale Set VMs operation response. */ +export interface _VirtualMachineScaleSetVMListResult { + /** The list of virtual machine scale sets VMs. */ + value: VirtualMachineScaleSetVM[]; + /** The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs. */ + nextLink?: string; +} + +export function _virtualMachineScaleSetVMListResultDeserializer( + item: any, +): _VirtualMachineScaleSetVMListResult { + return { + value: virtualMachineScaleSetVMArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineScaleSetVMArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetVMSerializer(item); + }); +} + +export function virtualMachineScaleSetVMArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineScaleSetVMDeserializer(item); + }); +} + +/** Specifies information about the SSH public key. */ +export interface SshPublicKeyResource extends TrackedResource { + /** SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. */ + publicKey?: string; +} + +export function sshPublicKeyResourceSerializer(item: SshPublicKeyResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, ["publicKey"]) + ? undefined + : _sshPublicKeyResourcePropertiesSerializer(item), + }; +} + +export function sshPublicKeyResourceDeserializer(item: any): SshPublicKeyResource { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _sshPublicKeyResourcePropertiesDeserializer(item["properties"])), + }; +} + +/** Properties of the SSH public key. */ +export interface SshPublicKeyResourceProperties { + /** SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. */ + publicKey?: string; +} + +export function sshPublicKeyResourcePropertiesSerializer( + item: SshPublicKeyResourceProperties, +): any { + return { publicKey: item["publicKey"] }; +} + +export function sshPublicKeyResourcePropertiesDeserializer( + item: any, +): SshPublicKeyResourceProperties { + return { + publicKey: item["publicKey"], + }; +} + +/** Specifies information about the SSH public key. */ +export interface SshPublicKeyUpdateResource extends UpdateResource { + /** SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. */ + publicKey?: string; +} + +export function sshPublicKeyUpdateResourceSerializer(item: SshPublicKeyUpdateResource): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, ["publicKey"]) + ? undefined + : _sshPublicKeyUpdateResourcePropertiesSerializer(item), + }; +} + +/** The list SSH public keys operation response. */ +export interface _SshPublicKeysGroupListResult { + /** The list of SSH public keys. */ + value: SshPublicKeyResource[]; + /** The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. */ + nextLink?: string; +} + +export function _sshPublicKeysGroupListResultDeserializer( + item: any, +): _SshPublicKeysGroupListResult { + return { + value: sshPublicKeyResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function sshPublicKeyResourceArraySerializer(result: Array): any[] { + return result.map((item) => { + return sshPublicKeyResourceSerializer(item); + }); +} + +export function sshPublicKeyResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return sshPublicKeyResourceDeserializer(item); + }); +} + +/** Parameters for GenerateSshKeyPair. */ +export interface SshGenerateKeyPairInputParameters { + /** The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA */ + encryptionType?: SshEncryptionTypes; +} + +export function sshGenerateKeyPairInputParametersSerializer( + item: SshGenerateKeyPairInputParameters, +): any { + return { encryptionType: item["encryptionType"] }; +} + +/** The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA */ +export enum KnownSshEncryptionTypes { + /** RSA */ + RSA = "RSA", + /** Ed25519 */ + Ed25519 = "Ed25519", +} + +/** + * The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA \ + * {@link KnownSshEncryptionTypes} can be used interchangeably with SshEncryptionTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **RSA** \ + * **Ed25519** + */ +export type SshEncryptionTypes = string; + +/** Response from generation of an SSH key pair. */ +export interface SshPublicKeyGenerateKeyPairResult { + /** Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. */ + privateKey: string; + /** Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. */ + publicKey: string; + /** The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} */ + id: string; +} + +export function sshPublicKeyGenerateKeyPairResultDeserializer( + item: any, +): SshPublicKeyGenerateKeyPairResult { + return { + privateKey: item["privateKey"], + publicKey: item["publicKey"], + id: item["id"], + }; +} + +/** The List Usages operation response. */ +export interface _ListUsagesResult { + /** The list of compute resource usages. */ + value: Usage[]; + /** The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information. */ + nextLink?: string; +} + +export function _listUsagesResultDeserializer(item: any): _ListUsagesResult { + return { + value: usageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function usageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return usageDeserializer(item); + }); +} + +/** Describes Compute Resource Usage. */ +export interface Usage { + /** An enum describing the unit of usage measurement. */ + unit: "Count"; + /** The current usage of the resource. */ + currentValue: number; + /** The maximum permitted usage of the resource. */ + limit: number; + /** The name of the type of usage. */ + name: UsageName; +} + +export function usageDeserializer(item: any): Usage { + return { + unit: item["unit"], + currentValue: item["currentValue"], + limit: item["limit"], + name: usageNameDeserializer(item["name"]), + }; +} + +/** The Usage Names. */ +export interface UsageName { + /** The name of the resource. */ + value?: string; + /** The localized name of the resource. */ + localizedValue?: string; +} + +export function usageNameDeserializer(item: any): UsageName { + return { + value: item["value"], + localizedValue: item["localizedValue"], + }; +} + +/** Virtual machine image resource information. */ +export interface VirtualMachineImageResource extends SubResource { + /** The name of the resource. */ + name: string; + /** The supported Azure location of the resource. */ + location: string; + /** Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). */ + tags?: Record; + /** The extended location of the Virtual Machine. */ + extendedLocation?: ExtendedLocation; +} + +export function virtualMachineImageResourceDeserializer(item: any): VirtualMachineImageResource { + return { + id: item["id"], + name: item["name"], + location: item["location"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Describes a Virtual Machine Image. */ +export interface VirtualMachineImage extends VirtualMachineImageResource { + /** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ + plan?: PurchasePlan; + /** Contains the os disk image information. */ + osDiskImage?: OSDiskImage; + /** The list of data disk images information. */ + dataDiskImages?: DataDiskImage[]; + /** Describes automatic OS upgrade properties on the image. */ + automaticOSUpgradeProperties?: AutomaticOSUpgradeProperties; + /** Specifies the HyperVGeneration Type */ + hyperVGeneration?: HyperVGenerationTypes; + /** Specifies disallowed configuration for the VirtualMachine created from the image */ + disallowed?: DisallowedConfiguration; + features?: VirtualMachineImageFeature[]; + /** Specifies the Architecture Type */ + architecture?: ArchitectureTypes; + /** Describes image deprecation status properties on the image. */ + imageDeprecationStatus?: ImageDeprecationStatus; +} + +export function virtualMachineImageDeserializer(item: any): VirtualMachineImage { + return { + name: item["name"], + location: item["location"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + id: item["id"], + ...(!item["properties"] + ? item["properties"] + : _virtualMachineImagePropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a Virtual Machine Image. */ +export interface VirtualMachineImageProperties { + /** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ + plan?: PurchasePlan; + /** Contains the os disk image information. */ + osDiskImage?: OSDiskImage; + /** The list of data disk images information. */ + dataDiskImages?: DataDiskImage[]; + /** Describes automatic OS upgrade properties on the image. */ + automaticOSUpgradeProperties?: AutomaticOSUpgradeProperties; + /** Specifies the HyperVGeneration Type */ + hyperVGeneration?: HyperVGenerationTypes; + /** Specifies disallowed configuration for the VirtualMachine created from the image */ + disallowed?: DisallowedConfiguration; + features?: VirtualMachineImageFeature[]; + /** Specifies the Architecture Type */ + architecture?: ArchitectureTypes; + /** Describes image deprecation status properties on the image. */ + imageDeprecationStatus?: ImageDeprecationStatus; +} + +export function virtualMachineImagePropertiesDeserializer( + item: any, +): VirtualMachineImageProperties { + return { + plan: !item["plan"] ? item["plan"] : purchasePlanDeserializer(item["plan"]), + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : osDiskImageDeserializer(item["osDiskImage"]), + dataDiskImages: !item["dataDiskImages"] + ? item["dataDiskImages"] + : dataDiskImageArrayDeserializer(item["dataDiskImages"]), + automaticOSUpgradeProperties: !item["automaticOSUpgradeProperties"] + ? item["automaticOSUpgradeProperties"] + : automaticOSUpgradePropertiesDeserializer(item["automaticOSUpgradeProperties"]), + hyperVGeneration: item["hyperVGeneration"], + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedConfigurationDeserializer(item["disallowed"]), + features: !item["features"] + ? item["features"] + : virtualMachineImageFeatureArrayDeserializer(item["features"]), + architecture: item["architecture"], + imageDeprecationStatus: !item["imageDeprecationStatus"] + ? item["imageDeprecationStatus"] + : imageDeprecationStatusDeserializer(item["imageDeprecationStatus"]), + }; +} + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +export interface PurchasePlan { + /** The publisher ID. */ + publisher: string; + /** The plan ID. */ + name: string; + /** Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. */ + product: string; +} + +export function purchasePlanDeserializer(item: any): PurchasePlan { + return { + publisher: item["publisher"], + name: item["name"], + product: item["product"], + }; +} + +/** Contains the os disk image information. */ +export interface OSDiskImage { + /** The operating system of the osDiskImage. */ + operatingSystem: OperatingSystemTypes; +} + +export function osDiskImageDeserializer(item: any): OSDiskImage { + return { + operatingSystem: item["operatingSystem"], + }; +} + +export function dataDiskImageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return dataDiskImageDeserializer(item); + }); +} + +/** Contains the data disk images information. */ +export interface DataDiskImage { + /** 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. */ + readonly lun?: number; +} + +export function dataDiskImageDeserializer(item: any): DataDiskImage { + return { + lun: item["lun"], + }; +} + +/** Describes automatic OS upgrade properties on the image. */ +export interface AutomaticOSUpgradeProperties { + /** Specifies whether automatic OS upgrade is supported on the image. */ + automaticOSUpgradeSupported: boolean; +} + +export function automaticOSUpgradePropertiesDeserializer(item: any): AutomaticOSUpgradeProperties { + return { + automaticOSUpgradeSupported: item["automaticOSUpgradeSupported"], + }; +} + +/** Specifies the disallowed configuration for a virtual machine image. */ +export interface DisallowedConfiguration { + /** VM disk types which are disallowed. */ + vmDiskType?: VmDiskTypes; +} + +export function disallowedConfigurationDeserializer(item: any): DisallowedConfiguration { + return { + vmDiskType: item["vmDiskType"], + }; +} + +/** VM disk types which are disallowed. */ +export enum KnownVmDiskTypes { + /** None */ + None = "None", + /** Unmanaged */ + Unmanaged = "Unmanaged", +} + +/** + * VM disk types which are disallowed. \ + * {@link KnownVmDiskTypes} can be used interchangeably with VmDiskTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Unmanaged** + */ +export type VmDiskTypes = string; + +export function virtualMachineImageFeatureArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineImageFeatureDeserializer(item); + }); +} + +/** Specifies additional capabilities supported by the image */ +export interface VirtualMachineImageFeature { + /** The name of the feature. */ + name?: string; + /** The corresponding value for the feature. */ + value?: string; +} + +export function virtualMachineImageFeatureDeserializer(item: any): VirtualMachineImageFeature { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Specifies the Architecture Type */ +export enum KnownArchitectureTypes { + /** x64 */ + X64 = "x64", + /** Arm64 */ + Arm64 = "Arm64", +} + +/** + * Specifies the Architecture Type \ + * {@link KnownArchitectureTypes} can be used interchangeably with ArchitectureTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **x64** \ + * **Arm64** + */ +export type ArchitectureTypes = string; + +/** Describes image deprecation status properties on the image. */ +export interface ImageDeprecationStatus { + /** Describes the state of the image. */ + imageState?: ImageState; + /** The time, in future, at which this image will be marked as deprecated. This scheduled time is chosen by the Publisher. */ + scheduledDeprecationTime?: Date; + /** Describes the alternative option specified by the Publisher for this image when this image is deprecated. */ + alternativeOption?: AlternativeOption; +} + +export function imageDeprecationStatusDeserializer(item: any): ImageDeprecationStatus { + return { + imageState: item["imageState"], + scheduledDeprecationTime: !item["scheduledDeprecationTime"] + ? item["scheduledDeprecationTime"] + : new Date(item["scheduledDeprecationTime"]), + alternativeOption: !item["alternativeOption"] + ? item["alternativeOption"] + : alternativeOptionDeserializer(item["alternativeOption"]), + }; +} + +/** Describes the state of the image. */ +export enum KnownImageState { + /** Active */ + Active = "Active", + /** ScheduledForDeprecation */ + ScheduledForDeprecation = "ScheduledForDeprecation", + /** Deprecated */ + Deprecated = "Deprecated", +} + +/** + * Describes the state of the image. \ + * {@link KnownImageState} can be used interchangeably with ImageState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **ScheduledForDeprecation** \ + * **Deprecated** + */ +export type ImageState = string; + +/** Describes the alternative option specified by the Publisher for this image when this image is deprecated. */ +export interface AlternativeOption { + /** Describes the type of the alternative option. */ + type?: AlternativeType; + /** Indicates the alternative option value specified by the Publisher. This is the Offer name when the type is Offer or the Plan name when the type is Plan. */ + value?: string; +} + +export function alternativeOptionDeserializer(item: any): AlternativeOption { + return { + type: item["type"], + value: item["value"], + }; +} + +/** Describes the type of the alternative option. */ +export enum KnownAlternativeType { + /** None */ + None = "None", + /** Offer */ + Offer = "Offer", + /** Plan */ + Plan = "Plan", +} + +/** + * Describes the type of the alternative option. \ + * {@link KnownAlternativeType} can be used interchangeably with AlternativeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Offer** \ + * **Plan** + */ +export type AlternativeType = string; + +/** The List VmImages in EdgeZone operation response. */ +export interface VmImagesInEdgeZoneListResult { + /** The list of VMImages in EdgeZone */ + value?: VirtualMachineImageResource[]; + /** The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of VmImages. */ + nextLink?: string; +} + +export function vmImagesInEdgeZoneListResultDeserializer(item: any): VmImagesInEdgeZoneListResult { + return { + value: !item["value"] + ? item["value"] + : virtualMachineImageResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function virtualMachineImageResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineImageResourceDeserializer(item); + }); +} + +/** Api request input for LogAnalytics getRequestRateByInterval Api. */ +export interface RequestRateByIntervalInput extends LogAnalyticsInputBase { + /** Interval value in minutes used to create LogAnalytics call rate logs. */ + intervalLength: IntervalInMins; +} + +export function requestRateByIntervalInputSerializer(item: RequestRateByIntervalInput): any { + return { + blobContainerSasUri: item["blobContainerSasUri"], + fromTime: item["fromTime"].toISOString(), + toTime: item["toTime"].toISOString(), + groupByThrottlePolicy: item["groupByThrottlePolicy"], + groupByOperationName: item["groupByOperationName"], + groupByResourceName: item["groupByResourceName"], + groupByClientApplicationId: item["groupByClientApplicationId"], + groupByUserAgent: item["groupByUserAgent"], + intervalLength: item["intervalLength"], + }; +} + +/** Interval value in minutes used to create LogAnalytics call rate logs. */ +export type IntervalInMins = "ThreeMins" | "FiveMins" | "ThirtyMins" | "SixtyMins"; + +/** Api input base class for LogAnalytics Api. */ +export interface LogAnalyticsInputBase { + /** SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. */ + blobContainerSasUri: string; + /** From time of the query */ + fromTime: Date; + /** To time of the query */ + toTime: Date; + /** Group query result by Throttle Policy applied. */ + groupByThrottlePolicy?: boolean; + /** Group query result by Operation Name. */ + groupByOperationName?: boolean; + /** Group query result by Resource Name. */ + groupByResourceName?: boolean; + /** Group query result by Client Application ID. */ + groupByClientApplicationId?: boolean; + /** Group query result by User Agent. */ + groupByUserAgent?: boolean; +} + +export function logAnalyticsInputBaseSerializer(item: LogAnalyticsInputBase): any { + return { + blobContainerSasUri: item["blobContainerSasUri"], + fromTime: item["fromTime"].toISOString(), + toTime: item["toTime"].toISOString(), + groupByThrottlePolicy: item["groupByThrottlePolicy"], + groupByOperationName: item["groupByOperationName"], + groupByResourceName: item["groupByResourceName"], + groupByClientApplicationId: item["groupByClientApplicationId"], + groupByUserAgent: item["groupByUserAgent"], + }; +} + +/** LogAnalytics operation status response */ +export interface LogAnalyticsOperationResult { + /** LogAnalyticsOutput */ + readonly properties?: LogAnalyticsOutput; +} + +export function logAnalyticsOperationResultDeserializer(item: any): LogAnalyticsOperationResult { + return { + properties: !item["properties"] + ? item["properties"] + : logAnalyticsOutputDeserializer(item["properties"]), + }; +} + +/** LogAnalytics output properties */ +export interface LogAnalyticsOutput { + /** Output file Uri path to blob container. */ + readonly output?: string; +} + +export function logAnalyticsOutputDeserializer(item: any): LogAnalyticsOutput { + return { + output: item["output"], + }; +} + +/** Api request input for LogAnalytics getThrottledRequests Api. */ +export interface ThrottledRequestsInput extends LogAnalyticsInputBase {} + +export function throttledRequestsInputSerializer(item: ThrottledRequestsInput): any { + return { + blobContainerSasUri: item["blobContainerSasUri"], + fromTime: item["fromTime"].toISOString(), + toTime: item["toTime"].toISOString(), + groupByThrottlePolicy: item["groupByThrottlePolicy"], + groupByOperationName: item["groupByOperationName"], + groupByResourceName: item["groupByResourceName"], + groupByClientApplicationId: item["groupByClientApplicationId"], + groupByUserAgent: item["groupByUserAgent"], + }; +} + +/** Known values of {@link ExpandTypesForGetVMScaleSets} that the service accepts. */ +export enum KnownExpandTypesForGetVMScaleSets { + /** userData */ + UserData = "userData", +} + +/** Type of ExpandTypesForGetVMScaleSets */ +export type ExpandTypesForGetVMScaleSets = string; +/** Type of InstanceViewTypes */ +export type InstanceViewTypes = "instanceView" | "userData" | "resiliencyView"; + +/** Known values of {@link ExpandTypeForListVMs} that the service accepts. */ +export enum KnownExpandTypeForListVMs { + /** instanceView */ + InstanceView = "instanceView", +} + +/** Type of ExpandTypeForListVMs */ +export type ExpandTypeForListVMs = string; + +/** Known values of {@link ExpandTypesForListVMs} that the service accepts. */ +export enum KnownExpandTypesForListVMs { + /** instanceView */ + InstanceView = "instanceView", +} + +/** Type of ExpandTypesForListVMs */ +export type ExpandTypesForListVMs = string; + +/** Known values of {@link RestorePointCollectionExpandOptions} that the service accepts. */ +export enum KnownRestorePointCollectionExpandOptions { + /** restorePoints */ + RestorePoints = "restorePoints", +} + +/** Type of RestorePointCollectionExpandOptions */ +export type RestorePointCollectionExpandOptions = string; + +/** Known values of {@link RestorePointExpandOptions} that the service accepts. */ +export enum KnownRestorePointExpandOptions { + /** instanceView */ + InstanceView = "instanceView", +} + +/** Type of RestorePointExpandOptions */ +export type RestorePointExpandOptions = string; + +/** Known values of {@link CapacityReservationGroupInstanceViewTypes} that the service accepts. */ +export enum KnownCapacityReservationGroupInstanceViewTypes { + /** instanceView */ + InstanceView = "instanceView", +} + +/** Type of CapacityReservationGroupInstanceViewTypes */ +export type CapacityReservationGroupInstanceViewTypes = string; + +/** Known values of {@link ExpandTypesForGetCapacityReservationGroups} that the service accepts. */ +export enum KnownExpandTypesForGetCapacityReservationGroups { + /** virtualMachineScaleSetVMs/$ref */ + VirtualMachineScaleSetVMsRef = "virtualMachineScaleSetVMs/$ref", + /** virtualMachines/$ref */ + VirtualMachinesRef = "virtualMachines/$ref", +} + +/** Type of ExpandTypesForGetCapacityReservationGroups */ +export type ExpandTypesForGetCapacityReservationGroups = string; + +/** Known values of {@link ResourceIdOptionsForGetCapacityReservationGroups} that the service accepts. */ +export enum KnownResourceIdOptionsForGetCapacityReservationGroups { + /** CreatedInSubscription */ + CreatedInSubscription = "CreatedInSubscription", + /** SharedWithSubscription */ + SharedWithSubscription = "SharedWithSubscription", + /** All */ + All = "All", +} + +/** Type of ResourceIdOptionsForGetCapacityReservationGroups */ +export type ResourceIdOptionsForGetCapacityReservationGroups = string; + +/** Known values of {@link CapacityReservationInstanceViewTypes} that the service accepts. */ +export enum KnownCapacityReservationInstanceViewTypes { + /** instanceView */ + InstanceView = "instanceView", +} + +/** Type of CapacityReservationInstanceViewTypes */ +export type CapacityReservationInstanceViewTypes = string; + +export function virtualMachineImageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualMachineImageDeserializer(item); + }); +} + +export function virtualMachineExtensionImageArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineExtensionImageDeserializer(item); + }); +} + +export function _virtualMachineScaleSetPublicIPAddressConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetPublicIPAddressConfiguration, +): any { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsSerializer( + item["dnsSettings"], + ), + ipTags: !item["ipTags"] + ? item["ipTags"] + : virtualMachineScaleSetIpTagArraySerializer(item["ipTags"]), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceSerializer(item["publicIPPrefix"]), + publicIPAddressVersion: item["publicIPAddressVersion"], + deleteOption: item["deleteOption"], + }; +} + +export function _virtualMachineScaleSetPublicIPAddressConfigurationPropertiesDeserializer( + item: any, +) { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsDeserializer( + item["dnsSettings"], + ), + ipTags: !item["ipTags"] + ? item["ipTags"] + : virtualMachineScaleSetIpTagArrayDeserializer(item["ipTags"]), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceDeserializer(item["publicIPPrefix"]), + publicIPAddressVersion: item["publicIPAddressVersion"], + deleteOption: item["deleteOption"], + }; +} + +export function _virtualMachineScaleSetIPConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetIPConfiguration, +): any { + return { + subnet: !item["subnet"] ? item["subnet"] : apiEntityReferenceSerializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachineScaleSetPublicIPAddressConfigurationSerializer( + item["publicIPAddressConfiguration"], + ), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArraySerializer(item["applicationGatewayBackendAddressPools"]), + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArraySerializer(item["applicationSecurityGroups"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArraySerializer(item["loadBalancerBackendAddressPools"]), + loadBalancerInboundNatPools: !item["loadBalancerInboundNatPools"] + ? item["loadBalancerInboundNatPools"] + : subResourceArraySerializer(item["loadBalancerInboundNatPools"]), + }; +} + +export function _virtualMachineScaleSetIPConfigurationPropertiesDeserializer(item: any) { + return { + subnet: !item["subnet"] ? item["subnet"] : apiEntityReferenceDeserializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachineScaleSetPublicIPAddressConfigurationDeserializer( + item["publicIPAddressConfiguration"], + ), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArrayDeserializer(item["applicationGatewayBackendAddressPools"]), + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArrayDeserializer(item["applicationSecurityGroups"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArrayDeserializer(item["loadBalancerBackendAddressPools"]), + loadBalancerInboundNatPools: !item["loadBalancerInboundNatPools"] + ? item["loadBalancerInboundNatPools"] + : subResourceArrayDeserializer(item["loadBalancerInboundNatPools"]), + }; +} + +export function _virtualMachineScaleSetNetworkConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetNetworkConfiguration, +): any { + return { + primary: item["primary"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceSerializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetNetworkConfigurationDnsSettingsSerializer(item["dnsSettings"]), + ipConfigurations: !item["ipConfigurations"] + ? item["ipConfigurations"] + : virtualMachineScaleSetIPConfigurationArraySerializer(item["ipConfigurations"]), + enableIPForwarding: item["enableIPForwarding"], + deleteOption: item["deleteOption"], + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function _virtualMachineScaleSetNetworkConfigurationPropertiesDeserializer(item: any) { + return { + primary: item["primary"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceDeserializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetNetworkConfigurationDnsSettingsDeserializer(item["dnsSettings"]), + ipConfigurations: !item["ipConfigurations"] + ? item["ipConfigurations"] + : virtualMachineScaleSetIPConfigurationArrayDeserializer(item["ipConfigurations"]), + enableIPForwarding: item["enableIPForwarding"], + deleteOption: item["deleteOption"], + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function _virtualMachineScaleSetExtensionPropertiesSerializer( + item: VirtualMachineScaleSetExtension, +): any { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + type: item["typePropertiesType"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceSerializer(item["protectedSettingsFromKeyVault"]), + }; +} + +export function _virtualMachineScaleSetExtensionPropertiesDeserializer(item: any) { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + typePropertiesType: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisioningState: item["provisioningState"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceDeserializer(item["protectedSettingsFromKeyVault"]), + }; +} + +export function _virtualMachineScaleSetPropertiesSerializer(item: VirtualMachineScaleSet): any { + return { + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicySerializer(item["upgradePolicy"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicySerializer(item["scheduledEventsPolicy"]), + automaticRepairsPolicy: !item["automaticRepairsPolicy"] + ? item["automaticRepairsPolicy"] + : automaticRepairsPolicySerializer(item["automaticRepairsPolicy"]), + virtualMachineProfile: !item["virtualMachineProfile"] + ? item["virtualMachineProfile"] + : virtualMachineScaleSetVMProfileSerializer(item["virtualMachineProfile"]), + overprovision: item["overprovision"], + doNotRunExtensionsOnOverprovisionedVMs: item["doNotRunExtensionsOnOverprovisionedVMs"], + singlePlacementGroup: item["singlePlacementGroup"], + zoneBalance: item["zoneBalance"], + platformFaultDomainCount: item["platformFaultDomainCount"], + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceSerializer(item["hostGroup"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesSerializer(item["additionalCapabilities"]), + scaleInPolicy: !item["scaleInPolicy"] + ? item["scaleInPolicy"] + : scaleInPolicySerializer(item["scaleInPolicy"]), + orchestrationMode: item["orchestrationMode"], + spotRestorePolicy: !item["spotRestorePolicy"] + ? item["spotRestorePolicy"] + : spotRestorePolicySerializer(item["spotRestorePolicy"]), + priorityMixPolicy: !item["priorityMixPolicy"] + ? item["priorityMixPolicy"] + : priorityMixPolicySerializer(item["priorityMixPolicy"]), + constrainedMaximumCapacity: item["constrainedMaximumCapacity"], + resiliencyPolicy: !item["resiliencyPolicy"] + ? item["resiliencyPolicy"] + : resiliencyPolicySerializer(item["resiliencyPolicy"]), + zonalPlatformFaultDomainAlignMode: item["zonalPlatformFaultDomainAlignMode"], + skuProfile: !item["skuProfile"] ? item["skuProfile"] : skuProfileSerializer(item["skuProfile"]), + highSpeedInterconnectPlacement: item["highSpeedInterconnectPlacement"], + lifecycleHooksProfile: !item["lifecycleHooksProfile"] + ? item["lifecycleHooksProfile"] + : lifecycleHooksProfileSerializer(item["lifecycleHooksProfile"]), + externalHealthPolicy: !item["externalHealthPolicy"] + ? item["externalHealthPolicy"] + : externalHealthPolicySerializer(item["externalHealthPolicy"]), + }; +} + +export function _virtualMachineScaleSetPropertiesDeserializer(item: any) { + return { + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicyDeserializer(item["upgradePolicy"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicyDeserializer(item["scheduledEventsPolicy"]), + automaticRepairsPolicy: !item["automaticRepairsPolicy"] + ? item["automaticRepairsPolicy"] + : automaticRepairsPolicyDeserializer(item["automaticRepairsPolicy"]), + virtualMachineProfile: !item["virtualMachineProfile"] + ? item["virtualMachineProfile"] + : virtualMachineScaleSetVMProfileDeserializer(item["virtualMachineProfile"]), + provisioningState: item["provisioningState"], + overprovision: item["overprovision"], + doNotRunExtensionsOnOverprovisionedVMs: item["doNotRunExtensionsOnOverprovisionedVMs"], + uniqueId: item["uniqueId"], + singlePlacementGroup: item["singlePlacementGroup"], + zoneBalance: item["zoneBalance"], + platformFaultDomainCount: item["platformFaultDomainCount"], + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceDeserializer(item["hostGroup"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesDeserializer(item["additionalCapabilities"]), + scaleInPolicy: !item["scaleInPolicy"] + ? item["scaleInPolicy"] + : scaleInPolicyDeserializer(item["scaleInPolicy"]), + orchestrationMode: item["orchestrationMode"], + spotRestorePolicy: !item["spotRestorePolicy"] + ? item["spotRestorePolicy"] + : spotRestorePolicyDeserializer(item["spotRestorePolicy"]), + priorityMixPolicy: !item["priorityMixPolicy"] + ? item["priorityMixPolicy"] + : priorityMixPolicyDeserializer(item["priorityMixPolicy"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + constrainedMaximumCapacity: item["constrainedMaximumCapacity"], + resiliencyPolicy: !item["resiliencyPolicy"] + ? item["resiliencyPolicy"] + : resiliencyPolicyDeserializer(item["resiliencyPolicy"]), + zonalPlatformFaultDomainAlignMode: item["zonalPlatformFaultDomainAlignMode"], + skuProfile: !item["skuProfile"] + ? item["skuProfile"] + : skuProfileDeserializer(item["skuProfile"]), + highSpeedInterconnectPlacement: item["highSpeedInterconnectPlacement"], + lifecycleHooksProfile: !item["lifecycleHooksProfile"] + ? item["lifecycleHooksProfile"] + : lifecycleHooksProfileDeserializer(item["lifecycleHooksProfile"]), + externalHealthPolicy: !item["externalHealthPolicy"] + ? item["externalHealthPolicy"] + : externalHealthPolicyDeserializer(item["externalHealthPolicy"]), + }; +} + +export function _virtualMachineScaleSetUpdatePublicIPAddressConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration, +): any { + return { + idleTimeoutInMinutes: item["idleTimeoutInMinutes"], + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsSerializer( + item["dnsSettings"], + ), + publicIPPrefix: !item["publicIPPrefix"] + ? item["publicIPPrefix"] + : subResourceSerializer(item["publicIPPrefix"]), + deleteOption: item["deleteOption"], + }; +} + +export function _virtualMachineScaleSetUpdateIPConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetUpdateIPConfiguration, +): any { + return { + subnet: !item["subnet"] ? item["subnet"] : apiEntityReferenceSerializer(item["subnet"]), + primary: item["primary"], + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : virtualMachineScaleSetUpdatePublicIPAddressConfigurationSerializer( + item["publicIPAddressConfiguration"], + ), + privateIPAddressVersion: item["privateIPAddressVersion"], + applicationGatewayBackendAddressPools: !item["applicationGatewayBackendAddressPools"] + ? item["applicationGatewayBackendAddressPools"] + : subResourceArraySerializer(item["applicationGatewayBackendAddressPools"]), + applicationSecurityGroups: !item["applicationSecurityGroups"] + ? item["applicationSecurityGroups"] + : subResourceArraySerializer(item["applicationSecurityGroups"]), + loadBalancerBackendAddressPools: !item["loadBalancerBackendAddressPools"] + ? item["loadBalancerBackendAddressPools"] + : subResourceArraySerializer(item["loadBalancerBackendAddressPools"]), + loadBalancerInboundNatPools: !item["loadBalancerInboundNatPools"] + ? item["loadBalancerInboundNatPools"] + : subResourceArraySerializer(item["loadBalancerInboundNatPools"]), + }; +} + +export function _virtualMachineScaleSetUpdateNetworkConfigurationPropertiesSerializer( + item: VirtualMachineScaleSetUpdateNetworkConfiguration, +): any { + return { + primary: item["primary"], + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + disableTcpStateTracking: item["disableTcpStateTracking"], + enableFpga: item["enableFpga"], + networkSecurityGroup: !item["networkSecurityGroup"] + ? item["networkSecurityGroup"] + : subResourceSerializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineScaleSetNetworkConfigurationDnsSettingsSerializer(item["dnsSettings"]), + ipConfigurations: !item["ipConfigurations"] + ? item["ipConfigurations"] + : virtualMachineScaleSetUpdateIPConfigurationArraySerializer(item["ipConfigurations"]), + enableIPForwarding: item["enableIPForwarding"], + deleteOption: item["deleteOption"], + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function _virtualMachineScaleSetUpdatePropertiesSerializer( + item: VirtualMachineScaleSetUpdate, +): any { + return { + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicySerializer(item["upgradePolicy"]), + automaticRepairsPolicy: !item["automaticRepairsPolicy"] + ? item["automaticRepairsPolicy"] + : automaticRepairsPolicySerializer(item["automaticRepairsPolicy"]), + virtualMachineProfile: !item["virtualMachineProfile"] + ? item["virtualMachineProfile"] + : virtualMachineScaleSetUpdateVMProfileSerializer(item["virtualMachineProfile"]), + overprovision: item["overprovision"], + doNotRunExtensionsOnOverprovisionedVMs: item["doNotRunExtensionsOnOverprovisionedVMs"], + singlePlacementGroup: item["singlePlacementGroup"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesSerializer(item["additionalCapabilities"]), + scaleInPolicy: !item["scaleInPolicy"] + ? item["scaleInPolicy"] + : scaleInPolicySerializer(item["scaleInPolicy"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + priorityMixPolicy: !item["priorityMixPolicy"] + ? item["priorityMixPolicy"] + : priorityMixPolicySerializer(item["priorityMixPolicy"]), + spotRestorePolicy: !item["spotRestorePolicy"] + ? item["spotRestorePolicy"] + : spotRestorePolicySerializer(item["spotRestorePolicy"]), + resiliencyPolicy: !item["resiliencyPolicy"] + ? item["resiliencyPolicy"] + : resiliencyPolicySerializer(item["resiliencyPolicy"]), + zonalPlatformFaultDomainAlignMode: item["zonalPlatformFaultDomainAlignMode"], + skuProfile: !item["skuProfile"] ? item["skuProfile"] : skuProfileSerializer(item["skuProfile"]), + lifecycleHooksProfile: !item["lifecycleHooksProfile"] + ? item["lifecycleHooksProfile"] + : lifecycleHooksProfileSerializer(item["lifecycleHooksProfile"]), + }; +} + +export function _virtualMachineScaleSetExtensionUpdatePropertiesSerializer( + item: VirtualMachineScaleSetExtensionUpdate, +): any { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + type: item["typePropertiesType"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceSerializer(item["protectedSettingsFromKeyVault"]), + }; +} + +export function _virtualMachineScaleSetExtensionUpdatePropertiesDeserializer(item: any) { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + typePropertiesType: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisioningState: item["provisioningState"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceDeserializer(item["protectedSettingsFromKeyVault"]), + }; +} + +export function _vmScaleSetLifecycleHookEventUpdatePropertiesSerializer( + item: VMScaleSetLifecycleHookEventUpdate, +): any { + return { + type: item["type"], + waitUntil: item["waitUntil"], + targetResources: !item["targetResources"] + ? item["targetResources"] + : vmScaleSetLifecycleHookEventTargetResourceArraySerializer(item["targetResources"]), + additionalContext: !item["additionalContext"] + ? item["additionalContext"] + : vmScaleSetLifecycleHookEventAdditionalContextSerializer(item["additionalContext"]), + }; +} + +export function _vmScaleSetLifecycleHookEventUpdatePropertiesDeserializer(item: any) { + return { + type: item["type"], + waitUntil: item["waitUntil"], + maxWaitUntil: item["maxWaitUntil"], + timeCreated: item["timeCreated"], + defaultAction: item["defaultAction"], + targetResources: !item["targetResources"] + ? item["targetResources"] + : vmScaleSetLifecycleHookEventTargetResourceArrayDeserializer(item["targetResources"]), + additionalContext: !item["additionalContext"] + ? item["additionalContext"] + : vmScaleSetLifecycleHookEventAdditionalContextDeserializer(item["additionalContext"]), + state: item["state"], + }; +} + +export function _virtualMachineScaleSetVMExtensionPropertiesSerializer( + item: VirtualMachineScaleSetVMExtension, +): any { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + type: item["typePropertiesType"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineExtensionInstanceViewSerializer(item["instanceView"]), + 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 _virtualMachineScaleSetVMExtensionPropertiesDeserializer(item: any) { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + typePropertiesType: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineExtensionInstanceViewDeserializer(item["instanceView"]), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceDeserializer(item["protectedSettingsFromKeyVault"]), + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + }; +} + +export function _virtualMachineScaleSetVMExtensionUpdatePropertiesSerializer( + item: VirtualMachineScaleSetVMExtensionUpdate, +): any { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + type: item["typePropertiesType"], + 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"]), + }; +} + +export function _networkInterfaceReferencePropertiesSerializer( + item: NetworkInterfaceReference, +): any { + return { primary: item["primary"], deleteOption: item["deleteOption"] }; +} + +export function _networkInterfaceReferencePropertiesDeserializer(item: any) { + return { + primary: item["primary"], + deleteOption: item["deleteOption"], + }; +} + +export function _virtualMachinePublicIPAddressConfigurationPropertiesSerializer( + item: VirtualMachinePublicIPAddressConfiguration, +): 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) { + 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"], + }; +} + +export function _virtualMachineNetworkInterfaceIPConfigurationPropertiesSerializer( + item: VirtualMachineNetworkInterfaceIPConfiguration, +): 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) { + 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"]), + }; +} + +export function _virtualMachineNetworkInterfaceConfigurationPropertiesSerializer( + item: VirtualMachineNetworkInterfaceConfiguration, +): 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: !item["ipConfigurations"] + ? item["ipConfigurations"] + : virtualMachineNetworkInterfaceIPConfigurationArraySerializer(item["ipConfigurations"]), + dscpConfiguration: !item["dscpConfiguration"] + ? item["dscpConfiguration"] + : subResourceSerializer(item["dscpConfiguration"]), + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function _virtualMachineNetworkInterfaceConfigurationPropertiesDeserializer(item: 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"] + : subResourceDeserializer(item["networkSecurityGroup"]), + dnsSettings: !item["dnsSettings"] + ? item["dnsSettings"] + : virtualMachineNetworkInterfaceDnsSettingsConfigurationDeserializer(item["dnsSettings"]), + ipConfigurations: !item["ipConfigurations"] + ? item["ipConfigurations"] + : virtualMachineNetworkInterfaceIPConfigurationArrayDeserializer(item["ipConfigurations"]), + dscpConfiguration: !item["dscpConfiguration"] + ? item["dscpConfiguration"] + : subResourceDeserializer(item["dscpConfiguration"]), + auxiliaryMode: item["auxiliaryMode"], + auxiliarySku: item["auxiliarySku"], + }; +} + +export function _virtualMachinePropertiesSerializer(item: VirtualMachine): any { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileSerializer(item["hardwareProfile"]), + 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"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceSerializer(item["availabilitySet"]), + virtualMachineScaleSet: !item["virtualMachineScaleSet"] + ? item["virtualMachineScaleSet"] + : subResourceSerializer(item["virtualMachineScaleSet"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileSerializer(item["billingProfile"]), + host: !item["host"] ? item["host"] : subResourceSerializer(item["host"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceSerializer(item["hostGroup"]), + licenseType: item["licenseType"], + extensionsTimeBudget: item["extensionsTimeBudget"], + platformFaultDomain: item["platformFaultDomain"], + 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"]), + resiliencyProfile: !item["resiliencyProfile"] + ? item["resiliencyProfile"] + : resiliencyProfileSerializer(item["resiliencyProfile"]), + }; +} + +export function _virtualMachinePropertiesDeserializer(item: any) { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileDeserializer(item["hardwareProfile"]), + 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"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceDeserializer(item["availabilitySet"]), + virtualMachineScaleSet: !item["virtualMachineScaleSet"] + ? item["virtualMachineScaleSet"] + : subResourceDeserializer(item["virtualMachineScaleSet"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileDeserializer(item["billingProfile"]), + host: !item["host"] ? item["host"] : subResourceDeserializer(item["host"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceDeserializer(item["hostGroup"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineInstanceViewDeserializer(item["instanceView"]), + licenseType: item["licenseType"], + vmId: item["vmId"], + extensionsTimeBudget: item["extensionsTimeBudget"], + platformFaultDomain: item["platformFaultDomain"], + 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"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + resiliencyProfile: !item["resiliencyProfile"] + ? item["resiliencyProfile"] + : resiliencyProfileDeserializer(item["resiliencyProfile"]), + }; +} + +export function _virtualMachineExtensionPropertiesSerializer(item: VirtualMachineExtension): any { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + type: item["typePropertiesType"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineExtensionInstanceViewSerializer(item["instanceView"]), + 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) { + return { + forceUpdateTag: item["forceUpdateTag"], + publisher: item["publisher"], + typePropertiesType: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineExtensionInstanceViewDeserializer(item["instanceView"]), + suppressFailures: item["suppressFailures"], + protectedSettingsFromKeyVault: !item["protectedSettingsFromKeyVault"] + ? item["protectedSettingsFromKeyVault"] + : keyVaultSecretReferenceDeserializer(item["protectedSettingsFromKeyVault"]), + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + }; +} + +export function _virtualMachineUpdatePropertiesSerializer(item: VirtualMachineUpdate): any { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileSerializer(item["hardwareProfile"]), + 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"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceSerializer(item["availabilitySet"]), + virtualMachineScaleSet: !item["virtualMachineScaleSet"] + ? item["virtualMachineScaleSet"] + : subResourceSerializer(item["virtualMachineScaleSet"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileSerializer(item["billingProfile"]), + host: !item["host"] ? item["host"] : subResourceSerializer(item["host"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceSerializer(item["hostGroup"]), + licenseType: item["licenseType"], + extensionsTimeBudget: item["extensionsTimeBudget"], + platformFaultDomain: item["platformFaultDomain"], + 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"]), + resiliencyProfile: !item["resiliencyProfile"] + ? item["resiliencyProfile"] + : resiliencyProfileSerializer(item["resiliencyProfile"]), + }; +} + +export function _virtualMachineUpdatePropertiesDeserializer(item: any) { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileDeserializer(item["hardwareProfile"]), + 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"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceDeserializer(item["availabilitySet"]), + virtualMachineScaleSet: !item["virtualMachineScaleSet"] + ? item["virtualMachineScaleSet"] + : subResourceDeserializer(item["virtualMachineScaleSet"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + priority: item["priority"], + evictionPolicy: item["evictionPolicy"], + billingProfile: !item["billingProfile"] + ? item["billingProfile"] + : billingProfileDeserializer(item["billingProfile"]), + host: !item["host"] ? item["host"] : subResourceDeserializer(item["host"]), + hostGroup: !item["hostGroup"] ? item["hostGroup"] : subResourceDeserializer(item["hostGroup"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineInstanceViewDeserializer(item["instanceView"]), + licenseType: item["licenseType"], + vmId: item["vmId"], + extensionsTimeBudget: item["extensionsTimeBudget"], + platformFaultDomain: item["platformFaultDomain"], + 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"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + resiliencyProfile: !item["resiliencyProfile"] + ? item["resiliencyProfile"] + : resiliencyProfileDeserializer(item["resiliencyProfile"]), + }; +} + +export function _virtualMachineExtensionUpdatePropertiesSerializer( + item: VirtualMachineExtensionUpdate, +): 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"]), + }; +} + +export function _virtualMachineExtensionImagePropertiesDeserializer(item: any) { + return { + operatingSystem: item["operatingSystem"], + computeRole: item["computeRole"], + handlerSchema: item["handlerSchema"], + vmScaleSetEnabled: item["vmScaleSetEnabled"], + supportsMultipleExtensions: item["supportsMultipleExtensions"], + }; +} + +export function _availabilitySetPropertiesSerializer(item: AvailabilitySet): any { + return { + platformUpdateDomainCount: item["platformUpdateDomainCount"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceArraySerializer(item["virtualMachines"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicySerializer(item["scheduledEventsPolicy"]), + }; +} + +export function _availabilitySetPropertiesDeserializer(item: any) { + return { + platformUpdateDomainCount: item["platformUpdateDomainCount"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceArrayDeserializer(item["virtualMachines"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicyDeserializer(item["scheduledEventsPolicy"]), + virtualMachineScaleSetMigrationInfo: !item["virtualMachineScaleSetMigrationInfo"] + ? item["virtualMachineScaleSetMigrationInfo"] + : virtualMachineScaleSetMigrationInfoDeserializer( + item["virtualMachineScaleSetMigrationInfo"], + ), + }; +} + +export function _availabilitySetUpdatePropertiesSerializer(item: AvailabilitySetUpdate): any { + return { + platformUpdateDomainCount: item["platformUpdateDomainCount"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceArraySerializer(item["virtualMachines"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceSerializer(item["proximityPlacementGroup"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicySerializer(item["scheduledEventsPolicy"]), + }; +} + +export function _availabilitySetUpdatePropertiesDeserializer(item: any) { + return { + platformUpdateDomainCount: item["platformUpdateDomainCount"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceArrayDeserializer(item["virtualMachines"]), + proximityPlacementGroup: !item["proximityPlacementGroup"] + ? item["proximityPlacementGroup"] + : subResourceDeserializer(item["proximityPlacementGroup"]), + statuses: !item["statuses"] + ? item["statuses"] + : instanceViewStatusArrayDeserializer(item["statuses"]), + scheduledEventsPolicy: !item["scheduledEventsPolicy"] + ? item["scheduledEventsPolicy"] + : scheduledEventsPolicyDeserializer(item["scheduledEventsPolicy"]), + virtualMachineScaleSetMigrationInfo: !item["virtualMachineScaleSetMigrationInfo"] + ? item["virtualMachineScaleSetMigrationInfo"] + : virtualMachineScaleSetMigrationInfoDeserializer( + item["virtualMachineScaleSetMigrationInfo"], + ), + }; +} + +export function _proximityPlacementGroupPropertiesSerializer(item: ProximityPlacementGroup): any { + return { + proximityPlacementGroupType: item["proximityPlacementGroupType"], + colocationStatus: !item["colocationStatus"] + ? item["colocationStatus"] + : instanceViewStatusSerializer(item["colocationStatus"]), + intent: !item["intent"] + ? item["intent"] + : proximityPlacementGroupPropertiesIntentSerializer(item["intent"]), + }; +} + +export function _proximityPlacementGroupPropertiesDeserializer(item: any) { + return { + proximityPlacementGroupType: item["proximityPlacementGroupType"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceWithColocationStatusArrayDeserializer(item["virtualMachines"]), + virtualMachineScaleSets: !item["virtualMachineScaleSets"] + ? item["virtualMachineScaleSets"] + : subResourceWithColocationStatusArrayDeserializer(item["virtualMachineScaleSets"]), + availabilitySets: !item["availabilitySets"] + ? item["availabilitySets"] + : subResourceWithColocationStatusArrayDeserializer(item["availabilitySets"]), + colocationStatus: !item["colocationStatus"] + ? item["colocationStatus"] + : instanceViewStatusDeserializer(item["colocationStatus"]), + intent: !item["intent"] + ? item["intent"] + : proximityPlacementGroupPropertiesIntentDeserializer(item["intent"]), + }; +} + +export function _dedicatedHostGroupPropertiesSerializer(item: DedicatedHostGroup): any { + return { + platformFaultDomainCount: item["platformFaultDomainCount"], + supportAutomaticPlacement: item["supportAutomaticPlacement"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : dedicatedHostGroupPropertiesAdditionalCapabilitiesSerializer( + item["additionalCapabilities"], + ), + }; +} + +export function _dedicatedHostGroupPropertiesDeserializer(item: any) { + return { + platformFaultDomainCount: item["platformFaultDomainCount"], + hosts: !item["hosts"] ? item["hosts"] : subResourceReadOnlyArrayDeserializer(item["hosts"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : dedicatedHostGroupInstanceViewDeserializer(item["instanceView"]), + supportAutomaticPlacement: item["supportAutomaticPlacement"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : dedicatedHostGroupPropertiesAdditionalCapabilitiesDeserializer( + item["additionalCapabilities"], + ), + }; +} + +export function _dedicatedHostGroupUpdatePropertiesSerializer(item: DedicatedHostGroupUpdate): any { + return { + platformFaultDomainCount: item["platformFaultDomainCount"], + supportAutomaticPlacement: item["supportAutomaticPlacement"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : dedicatedHostGroupPropertiesAdditionalCapabilitiesSerializer( + item["additionalCapabilities"], + ), + }; +} + +export function _dedicatedHostGroupUpdatePropertiesDeserializer(item: any) { + return { + platformFaultDomainCount: item["platformFaultDomainCount"], + hosts: !item["hosts"] ? item["hosts"] : subResourceReadOnlyArrayDeserializer(item["hosts"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : dedicatedHostGroupInstanceViewDeserializer(item["instanceView"]), + supportAutomaticPlacement: item["supportAutomaticPlacement"], + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : dedicatedHostGroupPropertiesAdditionalCapabilitiesDeserializer( + item["additionalCapabilities"], + ), + }; +} + +export function _dedicatedHostPropertiesSerializer(item: DedicatedHost): any { + return { + platformFaultDomain: item["platformFaultDomain"], + autoReplaceOnFailure: item["autoReplaceOnFailure"], + licenseType: item["licenseType"], + }; +} + +export function _dedicatedHostPropertiesDeserializer(item: any) { + return { + platformFaultDomain: item["platformFaultDomain"], + autoReplaceOnFailure: item["autoReplaceOnFailure"], + hostId: item["hostId"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachines"]), + licenseType: item["licenseType"], + provisioningTime: !item["provisioningTime"] + ? item["provisioningTime"] + : new Date(item["provisioningTime"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : dedicatedHostInstanceViewDeserializer(item["instanceView"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + }; +} + +export function _dedicatedHostUpdatePropertiesSerializer(item: DedicatedHostUpdate): any { + return { + platformFaultDomain: item["platformFaultDomain"], + autoReplaceOnFailure: item["autoReplaceOnFailure"], + licenseType: item["licenseType"], + }; +} + +export function _dedicatedHostUpdatePropertiesDeserializer(item: any) { + return { + platformFaultDomain: item["platformFaultDomain"], + autoReplaceOnFailure: item["autoReplaceOnFailure"], + hostId: item["hostId"], + virtualMachines: !item["virtualMachines"] + ? item["virtualMachines"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachines"]), + licenseType: item["licenseType"], + provisioningTime: !item["provisioningTime"] + ? item["provisioningTime"] + : new Date(item["provisioningTime"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : dedicatedHostInstanceViewDeserializer(item["instanceView"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + }; +} + +export function _imagePropertiesSerializer(item: Image): any { + return { + sourceVirtualMachine: !item["sourceVirtualMachine"] + ? item["sourceVirtualMachine"] + : subResourceSerializer(item["sourceVirtualMachine"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : imageStorageProfileSerializer(item["storageProfile"]), + hyperVGeneration: item["hyperVGeneration"], + }; +} + +export function _imagePropertiesDeserializer(item: any) { + return { + sourceVirtualMachine: !item["sourceVirtualMachine"] + ? item["sourceVirtualMachine"] + : subResourceDeserializer(item["sourceVirtualMachine"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : imageStorageProfileDeserializer(item["storageProfile"]), + provisioningState: item["provisioningState"], + hyperVGeneration: item["hyperVGeneration"], + }; +} + +export function _imageUpdatePropertiesSerializer(item: ImageUpdate): any { + return { + sourceVirtualMachine: !item["sourceVirtualMachine"] + ? item["sourceVirtualMachine"] + : subResourceSerializer(item["sourceVirtualMachine"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : imageStorageProfileSerializer(item["storageProfile"]), + hyperVGeneration: item["hyperVGeneration"], + }; +} + +export function _imageUpdatePropertiesDeserializer(item: any) { + return { + sourceVirtualMachine: !item["sourceVirtualMachine"] + ? item["sourceVirtualMachine"] + : subResourceDeserializer(item["sourceVirtualMachine"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : imageStorageProfileDeserializer(item["storageProfile"]), + provisioningState: item["provisioningState"], + hyperVGeneration: item["hyperVGeneration"], + }; +} + +export function _restorePointPropertiesSerializer(item: RestorePoint): any { + return { + excludeDisks: !item["excludeDisks"] + ? item["excludeDisks"] + : apiEntityReferenceArraySerializer(item["excludeDisks"]), + sourceMetadata: !item["sourceMetadata"] + ? item["sourceMetadata"] + : restorePointSourceMetadataSerializer(item["sourceMetadata"]), + consistencyMode: item["consistencyMode"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : item["timeCreated"].toISOString(), + sourceRestorePoint: !item["sourceRestorePoint"] + ? item["sourceRestorePoint"] + : apiEntityReferenceSerializer(item["sourceRestorePoint"]), + instantAccessDurationMinutes: item["instantAccessDurationMinutes"], + }; +} + +export function _restorePointPropertiesDeserializer(item: any) { + return { + excludeDisks: !item["excludeDisks"] + ? item["excludeDisks"] + : apiEntityReferenceArrayDeserializer(item["excludeDisks"]), + sourceMetadata: !item["sourceMetadata"] + ? item["sourceMetadata"] + : restorePointSourceMetadataDeserializer(item["sourceMetadata"]), + provisioningState: item["provisioningState"], + consistencyMode: item["consistencyMode"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + sourceRestorePoint: !item["sourceRestorePoint"] + ? item["sourceRestorePoint"] + : apiEntityReferenceDeserializer(item["sourceRestorePoint"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : restorePointInstanceViewDeserializer(item["instanceView"]), + instantAccessDurationMinutes: item["instantAccessDurationMinutes"], + }; +} + +export function _restorePointCollectionPropertiesSerializer(item: RestorePointCollection): any { + return { + source: !item["source"] + ? item["source"] + : restorePointCollectionSourcePropertiesSerializer(item["source"]), + instantAccess: item["instantAccess"], + }; +} + +export function _restorePointCollectionPropertiesDeserializer(item: any) { + return { + source: !item["source"] + ? item["source"] + : restorePointCollectionSourcePropertiesDeserializer(item["source"]), + provisioningState: item["provisioningState"], + restorePointCollectionId: item["restorePointCollectionId"], + restorePoints: !item["restorePoints"] + ? item["restorePoints"] + : restorePointArrayDeserializer(item["restorePoints"]), + instantAccess: item["instantAccess"], + }; +} + +export function _restorePointCollectionUpdatePropertiesSerializer( + item: RestorePointCollectionUpdate, +): any { + return { + source: !item["source"] + ? item["source"] + : restorePointCollectionSourcePropertiesSerializer(item["source"]), + instantAccess: item["instantAccess"], + }; +} + +export function _restorePointCollectionUpdatePropertiesDeserializer(item: any) { + return { + source: !item["source"] + ? item["source"] + : restorePointCollectionSourcePropertiesDeserializer(item["source"]), + provisioningState: item["provisioningState"], + restorePointCollectionId: item["restorePointCollectionId"], + restorePoints: !item["restorePoints"] + ? item["restorePoints"] + : restorePointArrayDeserializer(item["restorePoints"]), + instantAccess: item["instantAccess"], + }; +} + +export function _capacityReservationGroupPropertiesSerializer(item: CapacityReservationGroup): any { + return { + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : resourceSharingProfileSerializer(item["sharingProfile"]), + reservationType: item["reservationType"], + }; +} + +export function _capacityReservationGroupPropertiesDeserializer(item: any) { + return { + capacityReservations: !item["capacityReservations"] + ? item["capacityReservations"] + : subResourceReadOnlyArrayDeserializer(item["capacityReservations"]), + virtualMachinesAssociated: !item["virtualMachinesAssociated"] + ? item["virtualMachinesAssociated"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachinesAssociated"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : capacityReservationGroupInstanceViewDeserializer(item["instanceView"]), + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : resourceSharingProfileDeserializer(item["sharingProfile"]), + reservationType: item["reservationType"], + }; +} + +export function _capacityReservationGroupUpdatePropertiesSerializer( + item: CapacityReservationGroupUpdate, +): any { + return { + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : resourceSharingProfileSerializer(item["sharingProfile"]), + reservationType: item["reservationType"], + }; +} + +export function _capacityReservationGroupUpdatePropertiesDeserializer(item: any) { + return { + capacityReservations: !item["capacityReservations"] + ? item["capacityReservations"] + : subResourceReadOnlyArrayDeserializer(item["capacityReservations"]), + virtualMachinesAssociated: !item["virtualMachinesAssociated"] + ? item["virtualMachinesAssociated"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachinesAssociated"]), + instanceView: !item["instanceView"] + ? item["instanceView"] + : capacityReservationGroupInstanceViewDeserializer(item["instanceView"]), + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : resourceSharingProfileDeserializer(item["sharingProfile"]), + reservationType: item["reservationType"], + }; +} + +export function _capacityReservationPropertiesSerializer(item: CapacityReservation): any { + return { + scheduleProfile: !item["scheduleProfile"] + ? item["scheduleProfile"] + : scheduleProfileSerializer(item["scheduleProfile"]), + }; +} + +export function _capacityReservationPropertiesDeserializer(item: any) { + return { + reservationId: item["reservationId"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachinesAssociated: !item["virtualMachinesAssociated"] + ? item["virtualMachinesAssociated"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachinesAssociated"]), + provisioningTime: !item["provisioningTime"] + ? item["provisioningTime"] + : new Date(item["provisioningTime"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : capacityReservationInstanceViewDeserializer(item["instanceView"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + scheduleProfile: !item["scheduleProfile"] + ? item["scheduleProfile"] + : scheduleProfileDeserializer(item["scheduleProfile"]), + }; +} + +export function _capacityReservationUpdatePropertiesSerializer( + item: CapacityReservationUpdate, +): any { + return { + scheduleProfile: !item["scheduleProfile"] + ? item["scheduleProfile"] + : scheduleProfileSerializer(item["scheduleProfile"]), + }; +} + +export function _capacityReservationUpdatePropertiesDeserializer(item: any) { + return { + reservationId: item["reservationId"], + platformFaultDomainCount: item["platformFaultDomainCount"], + virtualMachinesAssociated: !item["virtualMachinesAssociated"] + ? item["virtualMachinesAssociated"] + : subResourceReadOnlyArrayDeserializer(item["virtualMachinesAssociated"]), + provisioningTime: !item["provisioningTime"] + ? item["provisioningTime"] + : new Date(item["provisioningTime"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : capacityReservationInstanceViewDeserializer(item["instanceView"]), + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + scheduleProfile: !item["scheduleProfile"] + ? item["scheduleProfile"] + : scheduleProfileDeserializer(item["scheduleProfile"]), + }; +} + +export function _virtualMachineRunCommandPropertiesSerializer(item: VirtualMachineRunCommand): any { + return { + source: !item["source"] + ? item["source"] + : virtualMachineRunCommandScriptSourceSerializer(item["source"]), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandInputParameterArraySerializer(item["parameters"]), + protectedParameters: !item["protectedParameters"] + ? item["protectedParameters"] + : runCommandInputParameterArraySerializer(item["protectedParameters"]), + asyncExecution: item["asyncExecution"], + runAsUser: item["runAsUser"], + runAsPassword: item["runAsPassword"], + timeoutInSeconds: item["timeoutInSeconds"], + outputBlobUri: item["outputBlobUri"], + errorBlobUri: item["errorBlobUri"], + outputBlobManagedIdentity: !item["outputBlobManagedIdentity"] + ? item["outputBlobManagedIdentity"] + : runCommandManagedIdentitySerializer(item["outputBlobManagedIdentity"]), + errorBlobManagedIdentity: !item["errorBlobManagedIdentity"] + ? item["errorBlobManagedIdentity"] + : runCommandManagedIdentitySerializer(item["errorBlobManagedIdentity"]), + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + }; +} + +export function _virtualMachineRunCommandPropertiesDeserializer(item: any) { + return { + source: !item["source"] + ? item["source"] + : virtualMachineRunCommandScriptSourceDeserializer(item["source"]), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandInputParameterArrayDeserializer(item["parameters"]), + protectedParameters: !item["protectedParameters"] + ? item["protectedParameters"] + : runCommandInputParameterArrayDeserializer(item["protectedParameters"]), + asyncExecution: item["asyncExecution"], + runAsUser: item["runAsUser"], + runAsPassword: item["runAsPassword"], + timeoutInSeconds: item["timeoutInSeconds"], + outputBlobUri: item["outputBlobUri"], + errorBlobUri: item["errorBlobUri"], + outputBlobManagedIdentity: !item["outputBlobManagedIdentity"] + ? item["outputBlobManagedIdentity"] + : runCommandManagedIdentityDeserializer(item["outputBlobManagedIdentity"]), + errorBlobManagedIdentity: !item["errorBlobManagedIdentity"] + ? item["errorBlobManagedIdentity"] + : runCommandManagedIdentityDeserializer(item["errorBlobManagedIdentity"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineRunCommandInstanceViewDeserializer(item["instanceView"]), + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + }; +} + +export function _virtualMachineRunCommandUpdatePropertiesSerializer( + item: VirtualMachineRunCommandUpdate, +): any { + return { + source: !item["source"] + ? item["source"] + : virtualMachineRunCommandScriptSourceSerializer(item["source"]), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandInputParameterArraySerializer(item["parameters"]), + protectedParameters: !item["protectedParameters"] + ? item["protectedParameters"] + : runCommandInputParameterArraySerializer(item["protectedParameters"]), + asyncExecution: item["asyncExecution"], + runAsUser: item["runAsUser"], + runAsPassword: item["runAsPassword"], + timeoutInSeconds: item["timeoutInSeconds"], + outputBlobUri: item["outputBlobUri"], + errorBlobUri: item["errorBlobUri"], + outputBlobManagedIdentity: !item["outputBlobManagedIdentity"] + ? item["outputBlobManagedIdentity"] + : runCommandManagedIdentitySerializer(item["outputBlobManagedIdentity"]), + errorBlobManagedIdentity: !item["errorBlobManagedIdentity"] + ? item["errorBlobManagedIdentity"] + : runCommandManagedIdentitySerializer(item["errorBlobManagedIdentity"]), + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + }; +} + +export function _virtualMachineRunCommandUpdatePropertiesDeserializer(item: any) { + return { + source: !item["source"] + ? item["source"] + : virtualMachineRunCommandScriptSourceDeserializer(item["source"]), + parameters: !item["parameters"] + ? item["parameters"] + : runCommandInputParameterArrayDeserializer(item["parameters"]), + protectedParameters: !item["protectedParameters"] + ? item["protectedParameters"] + : runCommandInputParameterArrayDeserializer(item["protectedParameters"]), + asyncExecution: item["asyncExecution"], + runAsUser: item["runAsUser"], + runAsPassword: item["runAsPassword"], + timeoutInSeconds: item["timeoutInSeconds"], + outputBlobUri: item["outputBlobUri"], + errorBlobUri: item["errorBlobUri"], + outputBlobManagedIdentity: !item["outputBlobManagedIdentity"] + ? item["outputBlobManagedIdentity"] + : runCommandManagedIdentityDeserializer(item["outputBlobManagedIdentity"]), + errorBlobManagedIdentity: !item["errorBlobManagedIdentity"] + ? item["errorBlobManagedIdentity"] + : runCommandManagedIdentityDeserializer(item["errorBlobManagedIdentity"]), + provisioningState: item["provisioningState"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineRunCommandInstanceViewDeserializer(item["instanceView"]), + treatFailureAsDeploymentFailure: item["treatFailureAsDeploymentFailure"], + }; +} + +export function _rollingUpgradeStatusInfoPropertiesDeserializer(item: any) { + return { + policy: !item["policy"] ? item["policy"] : rollingUpgradePolicyDeserializer(item["policy"]), + runningStatus: !item["runningStatus"] + ? item["runningStatus"] + : rollingUpgradeRunningStatusDeserializer(item["runningStatus"]), + progress: !item["progress"] + ? item["progress"] + : rollingUpgradeProgressInfoDeserializer(item["progress"]), + error: !item["error"] ? item["error"] : apiErrorDeserializer(item["error"]), + }; +} + +export function _virtualMachineScaleSetVMPropertiesSerializer(item: VirtualMachineScaleSetVM): any { + return { + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileSerializer(item["hardwareProfile"]), + resilientVMDeletionStatus: item["resilientVMDeletionStatus"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileSerializer(item["storageProfile"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesSerializer(item["additionalCapabilities"]), + osProfile: !item["osProfile"] ? item["osProfile"] : osProfileSerializer(item["osProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileSerializer(item["securityProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + networkProfileConfiguration: !item["networkProfileConfiguration"] + ? item["networkProfileConfiguration"] + : virtualMachineScaleSetVMNetworkProfileConfigurationSerializer( + item["networkProfileConfiguration"], + ), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileSerializer(item["diagnosticsProfile"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceSerializer(item["availabilitySet"]), + licenseType: item["licenseType"], + protectionPolicy: !item["protectionPolicy"] + ? item["protectionPolicy"] + : virtualMachineScaleSetVMProtectionPolicySerializer(item["protectionPolicy"]), + userData: item["userData"], + }; +} + +export function _virtualMachineScaleSetVMPropertiesDeserializer(item: any) { + return { + latestModelApplied: item["latestModelApplied"], + vmId: item["vmId"], + instanceView: !item["instanceView"] + ? item["instanceView"] + : virtualMachineScaleSetVMInstanceViewDeserializer(item["instanceView"]), + hardwareProfile: !item["hardwareProfile"] + ? item["hardwareProfile"] + : hardwareProfileDeserializer(item["hardwareProfile"]), + resilientVMDeletionStatus: item["resilientVMDeletionStatus"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : storageProfileDeserializer(item["storageProfile"]), + additionalCapabilities: !item["additionalCapabilities"] + ? item["additionalCapabilities"] + : additionalCapabilitiesDeserializer(item["additionalCapabilities"]), + osProfile: !item["osProfile"] ? item["osProfile"] : osProfileDeserializer(item["osProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileDeserializer(item["securityProfile"]), + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileDeserializer(item["networkProfile"]), + networkProfileConfiguration: !item["networkProfileConfiguration"] + ? item["networkProfileConfiguration"] + : virtualMachineScaleSetVMNetworkProfileConfigurationDeserializer( + item["networkProfileConfiguration"], + ), + diagnosticsProfile: !item["diagnosticsProfile"] + ? item["diagnosticsProfile"] + : diagnosticsProfileDeserializer(item["diagnosticsProfile"]), + availabilitySet: !item["availabilitySet"] + ? item["availabilitySet"] + : subResourceDeserializer(item["availabilitySet"]), + provisioningState: item["provisioningState"], + licenseType: item["licenseType"], + modelDefinitionApplied: item["modelDefinitionApplied"], + protectionPolicy: !item["protectionPolicy"] + ? item["protectionPolicy"] + : virtualMachineScaleSetVMProtectionPolicyDeserializer(item["protectionPolicy"]), + userData: item["userData"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + virtualMachineResourceId: item["virtualMachineResourceId"], + }; +} + +export function _sshPublicKeyResourcePropertiesSerializer(item: SshPublicKeyResource): any { + return { publicKey: item["publicKey"] }; +} + +export function _sshPublicKeyResourcePropertiesDeserializer(item: any) { + return { + publicKey: item["publicKey"], + }; +} + +export function _sshPublicKeyUpdateResourcePropertiesSerializer( + item: SshPublicKeyUpdateResource, +): any { + return { publicKey: item["publicKey"] }; +} + +export function _sshPublicKeyUpdateResourcePropertiesDeserializer(item: any) { + return { + publicKey: item["publicKey"], + }; +} + +export function _virtualMachineImagePropertiesDeserializer(item: any) { + return { + plan: !item["plan"] ? item["plan"] : purchasePlanDeserializer(item["plan"]), + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : osDiskImageDeserializer(item["osDiskImage"]), + dataDiskImages: !item["dataDiskImages"] + ? item["dataDiskImages"] + : dataDiskImageArrayDeserializer(item["dataDiskImages"]), + automaticOSUpgradeProperties: !item["automaticOSUpgradeProperties"] + ? item["automaticOSUpgradeProperties"] + : automaticOSUpgradePropertiesDeserializer(item["automaticOSUpgradeProperties"]), + hyperVGeneration: item["hyperVGeneration"], + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedConfigurationDeserializer(item["disallowed"]), + features: !item["features"] + ? item["features"] + : virtualMachineImageFeatureArrayDeserializer(item["features"]), + architecture: item["architecture"], + imageDeprecationStatus: !item["imageDeprecationStatus"] + ? item["imageDeprecationStatus"] + : imageDeprecationStatusDeserializer(item["imageDeprecationStatus"]), + }; +} diff --git a/sdk/compute/arm-compute/src/models/computeDisk/index.ts b/sdk/compute/arm-compute/src/models/computeDisk/index.ts new file mode 100644 index 000000000000..f7e1c639324c --- /dev/null +++ b/sdk/compute/arm-compute/src/models/computeDisk/index.ts @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + Disk, + DiskProperties, + DiskPurchasePlan, + SupportedCapabilities, + SupportedSecurityOption, + CreationData, + DiskCreateOption, + ImageDiskReference, + ProvisionedBandwidthCopyOption, + EncryptionSettingsCollection, + EncryptionSettingsElement, + KeyVaultAndSecretReference, + SourceVault, + KeyVaultAndKeyReference, + DiskState, + Encryption, + EncryptionType, + ShareInfoElement, + NetworkAccessPolicy, + PropertyUpdatesInProgress, + DiskSecurityProfile, + DiskSecurityTypes, + PublicNetworkAccess, + DataAccessAuthMode, + AvailabilityPolicy, + AvailabilityPolicyDiskDelay, + DiskSku, + DiskStorageAccountTypes, + DiskUpdate, + DiskUpdateProperties, + GrantAccessData, + AccessLevel, + FileFormat, + AccessUri, + DiskAccess, + DiskAccessProperties, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, + DiskAccessUpdate, + PrivateLinkResourceListResult, + PrivateLinkResource, + PrivateLinkResourceProperties, + DiskEncryptionSet, + EncryptionSetProperties, + DiskEncryptionSetType, + KeyForDiskEncryptionSet, + EncryptionSetIdentity, + DiskEncryptionSetIdentityType, + DiskEncryptionSetUpdate, + DiskEncryptionSetUpdateProperties, + Snapshot, + SnapshotProperties, + CopyCompletionError, + CopyCompletionErrorReason, + SnapshotSku, + SnapshotStorageAccountTypes, + SnapshotUpdate, + SnapshotUpdateProperties, + DiskRestorePoint, + DiskRestorePointProperties, +} from "./models.js"; +export { + KnownSupportedSecurityOption, + KnownDiskCreateOption, + KnownProvisionedBandwidthCopyOption, + KnownDiskState, + KnownEncryptionType, + KnownNetworkAccessPolicy, + KnownDiskSecurityTypes, + KnownPublicNetworkAccess, + KnownDataAccessAuthMode, + KnownAvailabilityPolicyDiskDelay, + KnownDiskStorageAccountTypes, + KnownAccessLevel, + KnownFileFormat, + KnownPrivateEndpointServiceConnectionStatus, + KnownPrivateEndpointConnectionProvisioningState, + KnownDiskEncryptionSetType, + KnownDiskEncryptionSetIdentityType, + KnownCopyCompletionErrorReason, + KnownSnapshotStorageAccountTypes, +} from "./models.js"; diff --git a/sdk/compute/arm-compute/src/models/computeDisk/models.ts b/sdk/compute/arm-compute/src/models/computeDisk/models.ts new file mode 100644 index 000000000000..ae4b2c8a1114 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/computeDisk/models.ts @@ -0,0 +1,2932 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { areAllPropsUndefined } from "../../static-helpers/serialization/check-prop-undefined.js"; +import type { + ApiError, + OperatingSystemTypes, + UserAssignedIdentitiesValue, + ExtendedLocation, + SnapshotAccessState, + HyperVGeneration, + Architecture, +} from "../common/models.js"; +import { + apiErrorDeserializer, + userAssignedIdentitiesValueRecordSerializer, + userAssignedIdentitiesValueRecordDeserializer, + extendedLocationSerializer, + extendedLocationDeserializer, +} from "../common/models.js"; +import type { TrackedResource, ProxyResource } from "../models.js"; +import { systemDataDeserializer } from "../models.js"; + +/** + * 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 */ +/** Disk resource. */ +export interface Disk extends TrackedResource { + /** A relative URI containing the ID of the VM that has the disk attached. */ + readonly managedBy?: string; + /** List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. */ + readonly managedByExtended?: string[]; + /** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ + sku?: DiskSku; + /** The Logical zone list for Disk. */ + zones?: string[]; + /** The extended location where the disk will be created. Extended location cannot be changed. */ + extendedLocation?: ExtendedLocation; + /** The time when the disk was created. */ + readonly timeCreated?: Date; + /** The Operating System type. */ + osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** Disk source information. CreationData information cannot be changed after the disk has been created. */ + creationData?: CreationData; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** The size of the disk in bytes. This field is read only. */ + readonly diskSizeBytes?: number; + /** Unique Guid identifying the resource. */ + readonly uniqueId?: string; + /** Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** The disk provisioning state. */ + readonly provisioningState?: string; + /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadWrite?: number; + /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadWrite?: number; + /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadOnly?: number; + /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadOnly?: number; + /** The state of the disk. */ + readonly diskState?: DiskState; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ + maxShares?: number; + /** Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. */ + readonly shareInfo?: ShareInfoElement[]; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Latest time when bursting was last enabled on a disk. */ + readonly burstingEnabledTime?: Date; + /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ + tier?: string; + /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ + burstingEnabled?: boolean; + /** Properties of the disk for which update is pending. */ + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ + completionPercent?: number; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ + optimizedForFrequentAttach?: boolean; + /** The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached or detached from a VM or the time when the VM to which the disk was attached was deallocated or started. */ + readonly lastOwnershipUpdateTime?: Date; + /** Determines how platform treats disk failures */ + availabilityPolicy?: AvailabilityPolicy; +} + +export function diskSerializer(item: Disk): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "osType", + "hyperVGeneration", + "purchasePlan", + "supportedCapabilities", + "creationData", + "diskSizeGB", + "encryptionSettingsCollection", + "diskIOPSReadWrite", + "diskMBpsReadWrite", + "diskIOPSReadOnly", + "diskMBpsReadOnly", + "encryption", + "maxShares", + "networkAccessPolicy", + "diskAccessId", + "tier", + "burstingEnabled", + "supportsHibernation", + "securityProfile", + "completionPercent", + "publicNetworkAccess", + "dataAccessAuthMode", + "optimizedForFrequentAttach", + "availabilityPolicy", + ]) + ? undefined + : _diskPropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : diskSkuSerializer(item["sku"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function diskDeserializer(item: any): Disk { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] ? item["properties"] : _diskPropertiesDeserializer(item["properties"])), + managedBy: item["managedBy"], + managedByExtended: !item["managedByExtended"] + ? item["managedByExtended"] + : item["managedByExtended"].map((p: any) => { + return p; + }), + sku: !item["sku"] ? item["sku"] : diskSkuDeserializer(item["sku"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Disk resource properties. */ +export interface DiskProperties { + /** The time when the disk was created. */ + readonly timeCreated?: Date; + /** The Operating System type. */ + osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** Disk source information. CreationData information cannot be changed after the disk has been created. */ + creationData: CreationData; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** The size of the disk in bytes. This field is read only. */ + readonly diskSizeBytes?: number; + /** Unique Guid identifying the resource. */ + readonly uniqueId?: string; + /** Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** The disk provisioning state. */ + readonly provisioningState?: string; + /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadWrite?: number; + /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadWrite?: number; + /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadOnly?: number; + /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadOnly?: number; + /** The state of the disk. */ + readonly diskState?: DiskState; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ + maxShares?: number; + /** Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. */ + readonly shareInfo?: ShareInfoElement[]; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Latest time when bursting was last enabled on a disk. */ + readonly burstingEnabledTime?: Date; + /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ + tier?: string; + /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ + burstingEnabled?: boolean; + /** Properties of the disk for which update is pending. */ + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ + completionPercent?: number; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ + optimizedForFrequentAttach?: boolean; + /** The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached or detached from a VM or the time when the VM to which the disk was attached was deallocated or started. */ + readonly lastOwnershipUpdateTime?: Date; + /** Determines how platform treats disk failures */ + availabilityPolicy?: AvailabilityPolicy; +} + +export function diskPropertiesSerializer(item: DiskProperties): any { + return { + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanSerializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + creationData: creationDataSerializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + diskIOPSReadWrite: item["diskIopsReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + diskIOPSReadOnly: item["diskIopsReadOnly"], + diskMBpsReadOnly: item["diskMBpsReadOnly"], + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + maxShares: item["maxShares"], + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + tier: item["tier"], + burstingEnabled: item["burstingEnabled"], + supportsHibernation: item["supportsHibernation"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileSerializer(item["securityProfile"]), + completionPercent: item["completionPercent"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + optimizedForFrequentAttach: item["optimizedForFrequentAttach"], + availabilityPolicy: !item["availabilityPolicy"] + ? item["availabilityPolicy"] + : availabilityPolicySerializer(item["availabilityPolicy"]), + }; +} + +export function diskPropertiesDeserializer(item: any): DiskProperties { + return { + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanDeserializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesDeserializer(item["supportedCapabilities"]), + creationData: creationDataDeserializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + diskSizeBytes: item["diskSizeBytes"], + uniqueId: item["uniqueId"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionDeserializer(item["encryptionSettingsCollection"]), + provisioningState: item["provisioningState"], + diskIopsReadWrite: item["diskIOPSReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + diskIopsReadOnly: item["diskIOPSReadOnly"], + diskMBpsReadOnly: item["diskMBpsReadOnly"], + diskState: item["diskState"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionDeserializer(item["encryption"]), + maxShares: item["maxShares"], + shareInfo: !item["shareInfo"] + ? item["shareInfo"] + : shareInfoElementArrayDeserializer(item["shareInfo"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + burstingEnabledTime: !item["burstingEnabledTime"] + ? item["burstingEnabledTime"] + : new Date(item["burstingEnabledTime"]), + tier: item["tier"], + burstingEnabled: item["burstingEnabled"], + propertyUpdatesInProgress: !item["propertyUpdatesInProgress"] + ? item["propertyUpdatesInProgress"] + : propertyUpdatesInProgressDeserializer(item["propertyUpdatesInProgress"]), + supportsHibernation: item["supportsHibernation"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileDeserializer(item["securityProfile"]), + completionPercent: item["completionPercent"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + optimizedForFrequentAttach: item["optimizedForFrequentAttach"], + lastOwnershipUpdateTime: !item["LastOwnershipUpdateTime"] + ? item["LastOwnershipUpdateTime"] + : new Date(item["LastOwnershipUpdateTime"]), + availabilityPolicy: !item["availabilityPolicy"] + ? item["availabilityPolicy"] + : availabilityPolicyDeserializer(item["availabilityPolicy"]), + }; +} + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +export interface DiskPurchasePlan { + /** The plan ID. */ + name: string; + /** The publisher ID. */ + publisher: string; + /** Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. */ + product: string; + /** The Offer Promotion Code. */ + promotionCode?: string; +} + +export function diskPurchasePlanSerializer(item: DiskPurchasePlan): any { + return { + name: item["name"], + publisher: item["publisher"], + product: item["product"], + promotionCode: item["promotionCode"], + }; +} + +export function diskPurchasePlanDeserializer(item: any): DiskPurchasePlan { + return { + name: item["name"], + publisher: item["publisher"], + product: item["product"], + promotionCode: item["promotionCode"], + }; +} + +/** List of supported capabilities persisted on the disk resource for VM use. */ +export interface SupportedCapabilities { + /** The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. */ + diskControllerTypes?: string; + /** True if the image from which the OS disk is created supports accelerated networking. */ + acceleratedNetwork?: boolean; + /** CPU architecture supported by an OS disk. */ + architecture?: Architecture; + /** Refers to the security capability of the disk supported to create a Trusted launch or Confidential VM */ + supportedSecurityOption?: SupportedSecurityOption; +} + +export function supportedCapabilitiesSerializer(item: SupportedCapabilities): any { + return { + diskControllerTypes: item["diskControllerTypes"], + acceleratedNetwork: item["acceleratedNetwork"], + architecture: item["architecture"], + supportedSecurityOption: item["supportedSecurityOption"], + }; +} + +export function supportedCapabilitiesDeserializer(item: any): SupportedCapabilities { + return { + diskControllerTypes: item["diskControllerTypes"], + acceleratedNetwork: item["acceleratedNetwork"], + architecture: item["architecture"], + supportedSecurityOption: item["supportedSecurityOption"], + }; +} + +/** Refers to the security capability of the disk supported to create a Trusted launch or Confidential VM */ +export enum KnownSupportedSecurityOption { + /** The disk supports creating Trusted Launch VMs. */ + TrustedLaunchSupported = "TrustedLaunchSupported", + /** The disk supports creating both Trusted Launch and Confidential VMs. */ + TrustedLaunchAndConfidentialVMSupported = "TrustedLaunchAndConfidentialVMSupported", +} + +/** + * Refers to the security capability of the disk supported to create a Trusted launch or Confidential VM \ + * {@link KnownSupportedSecurityOption} can be used interchangeably with SupportedSecurityOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TrustedLaunchSupported**: The disk supports creating Trusted Launch VMs. \ + * **TrustedLaunchAndConfidentialVMSupported**: The disk supports creating both Trusted Launch and Confidential VMs. + */ +export type SupportedSecurityOption = string; + +/** Data used when creating a disk. */ +export interface CreationData { + /** This enumerates the possible sources of a disk's creation. */ + createOption: DiskCreateOption; + /** Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. */ + storageAccountId?: string; + /** Disk source information for PIR or user images. */ + imageReference?: ImageDiskReference; + /** Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. */ + galleryImageReference?: ImageDiskReference; + /** If createOption is Import, this is the URI of a blob to be imported into a managed disk. */ + sourceUri?: string; + /** If createOption is Copy, this is the ARM id of the source snapshot or disk. */ + sourceResourceId?: string; + /** If this field is set, this is the unique id identifying the source of this resource. */ + readonly sourceUniqueId?: string; + /** If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). */ + uploadSizeBytes?: number; + /** Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. */ + logicalSectorSize?: number; + /** If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. */ + securityDataUri?: string; + /** If createOption is ImportSecure, this is the URI of a blob to be imported into VM metadata for Confidential VM. */ + securityMetadataUri?: string; + /** Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled. */ + performancePlus?: boolean; + /** Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san volume snapshot. */ + elasticSanResourceId?: string; + /** If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. */ + provisionedBandwidthCopySpeed?: ProvisionedBandwidthCopyOption; + /** For snapshots created from Premium SSD v2 or Ultra disk, this property determines the time in minutes the snapshot is retained for instant access to enable faster restore. */ + instantAccessDurationMinutes?: number; +} + +export function creationDataSerializer(item: CreationData): any { + return { + createOption: item["createOption"], + storageAccountId: item["storageAccountId"], + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageDiskReferenceSerializer(item["imageReference"]), + galleryImageReference: !item["galleryImageReference"] + ? item["galleryImageReference"] + : imageDiskReferenceSerializer(item["galleryImageReference"]), + sourceUri: item["sourceUri"], + sourceResourceId: item["sourceResourceId"], + uploadSizeBytes: item["uploadSizeBytes"], + logicalSectorSize: item["logicalSectorSize"], + securityDataUri: item["securityDataUri"], + securityMetadataUri: item["securityMetadataUri"], + performancePlus: item["performancePlus"], + elasticSanResourceId: item["elasticSanResourceId"], + provisionedBandwidthCopySpeed: item["provisionedBandwidthCopySpeed"], + instantAccessDurationMinutes: item["instantAccessDurationMinutes"], + }; +} + +export function creationDataDeserializer(item: any): CreationData { + return { + createOption: item["createOption"], + storageAccountId: item["storageAccountId"], + imageReference: !item["imageReference"] + ? item["imageReference"] + : imageDiskReferenceDeserializer(item["imageReference"]), + galleryImageReference: !item["galleryImageReference"] + ? item["galleryImageReference"] + : imageDiskReferenceDeserializer(item["galleryImageReference"]), + sourceUri: item["sourceUri"], + sourceResourceId: item["sourceResourceId"], + sourceUniqueId: item["sourceUniqueId"], + uploadSizeBytes: item["uploadSizeBytes"], + logicalSectorSize: item["logicalSectorSize"], + securityDataUri: item["securityDataUri"], + securityMetadataUri: item["securityMetadataUri"], + performancePlus: item["performancePlus"], + elasticSanResourceId: item["elasticSanResourceId"], + provisionedBandwidthCopySpeed: item["provisionedBandwidthCopySpeed"], + instantAccessDurationMinutes: item["instantAccessDurationMinutes"], + }; +} + +/** This enumerates the possible sources of a disk's creation. */ +export enum KnownDiskCreateOption { + /** Create an empty data disk of a size given by diskSizeGB. */ + Empty = "Empty", + /** Disk will be attached to a VM. */ + Attach = "Attach", + /** Create a new disk from a platform image specified by the given imageReference or galleryImageReference. */ + FromImage = "FromImage", + /** Create a disk by importing from a blob specified by a sourceUri in a storage account specified by storageAccountId. */ + Import = "Import", + /** Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. */ + Copy = "Copy", + /** Create a new disk by copying from a backup recovery point. */ + Restore = "Restore", + /** Create a new disk by obtaining a write token and using it to directly upload the contents of the disk. */ + Upload = "Upload", + /** Create a new disk by using a deep copy process, where the resource creation is considered complete only after all data has been copied from the source. */ + CopyStart = "CopyStart", + /** Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. */ + ImportSecure = "ImportSecure", + /** Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. */ + UploadPreparedSecure = "UploadPreparedSecure", + /** Create a new disk by exporting from elastic san volume snapshot */ + CopyFromSanSnapshot = "CopyFromSanSnapshot", +} + +/** + * This enumerates the possible sources of a disk's creation. \ + * {@link KnownDiskCreateOption} can be used interchangeably with DiskCreateOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Empty**: Create an empty data disk of a size given by diskSizeGB. \ + * **Attach**: Disk will be attached to a VM. \ + * **FromImage**: Create a new disk from a platform image specified by the given imageReference or galleryImageReference. \ + * **Import**: Create a disk by importing from a blob specified by a sourceUri in a storage account specified by storageAccountId. \ + * **Copy**: Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. \ + * **Restore**: Create a new disk by copying from a backup recovery point. \ + * **Upload**: Create a new disk by obtaining a write token and using it to directly upload the contents of the disk. \ + * **CopyStart**: Create a new disk by using a deep copy process, where the resource creation is considered complete only after all data has been copied from the source. \ + * **ImportSecure**: Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. \ + * **UploadPreparedSecure**: Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. \ + * **CopyFromSanSnapshot**: Create a new disk by exporting from elastic san volume snapshot + */ +export type DiskCreateOption = string; + +/** The source image used for creating the disk. */ +export interface ImageDiskReference { + /** A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. */ + id?: string; + /** A relative uri containing a direct shared Azure Compute Gallery image reference. */ + sharedGalleryImageId?: string; + /** A relative uri containing a community Azure Compute Gallery image reference. */ + communityGalleryImageId?: string; + /** If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. */ + lun?: number; +} + +export function imageDiskReferenceSerializer(item: ImageDiskReference): any { + return { + id: item["id"], + sharedGalleryImageId: item["sharedGalleryImageId"], + communityGalleryImageId: item["communityGalleryImageId"], + lun: item["lun"], + }; +} + +export function imageDiskReferenceDeserializer(item: any): ImageDiskReference { + return { + id: item["id"], + sharedGalleryImageId: item["sharedGalleryImageId"], + communityGalleryImageId: item["communityGalleryImageId"], + lun: item["lun"], + }; +} + +/** If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. */ +export enum KnownProvisionedBandwidthCopyOption { + /** None */ + None = "None", + /** Enhanced */ + Enhanced = "Enhanced", +} + +/** + * If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. \ + * {@link KnownProvisionedBandwidthCopyOption} can be used interchangeably with ProvisionedBandwidthCopyOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Enhanced** + */ +export type ProvisionedBandwidthCopyOption = string; + +/** Encryption settings for disk or snapshot */ +export interface EncryptionSettingsCollection { + /** Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. */ + enabled: boolean; + /** A collection of encryption settings, one for each disk volume. */ + encryptionSettings?: EncryptionSettingsElement[]; + /** Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. */ + encryptionSettingsVersion?: string; +} + +export function encryptionSettingsCollectionSerializer(item: EncryptionSettingsCollection): any { + return { + enabled: item["enabled"], + encryptionSettings: !item["encryptionSettings"] + ? item["encryptionSettings"] + : encryptionSettingsElementArraySerializer(item["encryptionSettings"]), + encryptionSettingsVersion: item["encryptionSettingsVersion"], + }; +} + +export function encryptionSettingsCollectionDeserializer(item: any): EncryptionSettingsCollection { + return { + enabled: item["enabled"], + encryptionSettings: !item["encryptionSettings"] + ? item["encryptionSettings"] + : encryptionSettingsElementArrayDeserializer(item["encryptionSettings"]), + encryptionSettingsVersion: item["encryptionSettingsVersion"], + }; +} + +export function encryptionSettingsElementArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return encryptionSettingsElementSerializer(item); + }); +} + +export function encryptionSettingsElementArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return encryptionSettingsElementDeserializer(item); + }); +} + +/** Encryption settings for one disk volume. */ +export interface EncryptionSettingsElement { + /** Key Vault Secret Url and vault id of the disk encryption key */ + diskEncryptionKey?: KeyVaultAndSecretReference; + /** Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. */ + keyEncryptionKey?: KeyVaultAndKeyReference; +} + +export function encryptionSettingsElementSerializer(item: EncryptionSettingsElement): any { + return { + diskEncryptionKey: !item["diskEncryptionKey"] + ? item["diskEncryptionKey"] + : keyVaultAndSecretReferenceSerializer(item["diskEncryptionKey"]), + keyEncryptionKey: !item["keyEncryptionKey"] + ? item["keyEncryptionKey"] + : keyVaultAndKeyReferenceSerializer(item["keyEncryptionKey"]), + }; +} + +export function encryptionSettingsElementDeserializer(item: any): EncryptionSettingsElement { + return { + diskEncryptionKey: !item["diskEncryptionKey"] + ? item["diskEncryptionKey"] + : keyVaultAndSecretReferenceDeserializer(item["diskEncryptionKey"]), + keyEncryptionKey: !item["keyEncryptionKey"] + ? item["keyEncryptionKey"] + : keyVaultAndKeyReferenceDeserializer(item["keyEncryptionKey"]), + }; +} + +/** Key Vault Secret Url and vault id of the encryption key */ +export interface KeyVaultAndSecretReference { + /** Resource id of the KeyVault containing the key or secret */ + sourceVault: SourceVault; + /** Url pointing to a key or secret in KeyVault */ + secretUrl: string; +} + +export function keyVaultAndSecretReferenceSerializer(item: KeyVaultAndSecretReference): any { + return { sourceVault: sourceVaultSerializer(item["sourceVault"]), secretUrl: item["secretUrl"] }; +} + +export function keyVaultAndSecretReferenceDeserializer(item: any): KeyVaultAndSecretReference { + return { + sourceVault: sourceVaultDeserializer(item["sourceVault"]), + secretUrl: item["secretUrl"], + }; +} + +/** The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} */ +export interface SourceVault { + /** Resource Id */ + id?: string; +} + +export function sourceVaultSerializer(item: SourceVault): any { + return { id: item["id"] }; +} + +export function sourceVaultDeserializer(item: any): SourceVault { + return { + id: item["id"], + }; +} + +/** Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey */ +export interface KeyVaultAndKeyReference { + /** Resource id of the KeyVault containing the key or secret */ + sourceVault: SourceVault; + /** Url pointing to a key or secret in KeyVault */ + keyUrl: string; +} + +export function keyVaultAndKeyReferenceSerializer(item: KeyVaultAndKeyReference): any { + return { sourceVault: sourceVaultSerializer(item["sourceVault"]), keyUrl: item["keyUrl"] }; +} + +export function keyVaultAndKeyReferenceDeserializer(item: any): KeyVaultAndKeyReference { + return { + sourceVault: sourceVaultDeserializer(item["sourceVault"]), + keyUrl: item["keyUrl"], + }; +} + +/** This enumerates the possible state of the disk. */ +export enum KnownDiskState { + /** The disk is not being used and can be attached to a VM. */ + Unattached = "Unattached", + /** The disk is currently attached to a running VM. */ + Attached = "Attached", + /** The disk is attached to a stopped-deallocated VM. */ + Reserved = "Reserved", + /** The disk is attached to a VM which is in hibernated state. */ + Frozen = "Frozen", + /** The disk currently has an Active SAS Uri associated with it. */ + ActiveSAS = "ActiveSAS", + /** The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. */ + ActiveSASFrozen = "ActiveSASFrozen", + /** A disk is ready to be created by upload by requesting a write token. */ + ReadyToUpload = "ReadyToUpload", + /** A disk is created for upload and a write token has been issued for uploading to it. */ + ActiveUpload = "ActiveUpload", +} + +/** + * This enumerates the possible state of the disk. \ + * {@link KnownDiskState} can be used interchangeably with DiskState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unattached**: The disk is not being used and can be attached to a VM. \ + * **Attached**: The disk is currently attached to a running VM. \ + * **Reserved**: The disk is attached to a stopped-deallocated VM. \ + * **Frozen**: The disk is attached to a VM which is in hibernated state. \ + * **ActiveSAS**: The disk currently has an Active SAS Uri associated with it. \ + * **ActiveSASFrozen**: The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. \ + * **ReadyToUpload**: A disk is ready to be created by upload by requesting a write token. \ + * **ActiveUpload**: A disk is created for upload and a write token has been issued for uploading to it. + */ +export type DiskState = string; + +/** Encryption at rest settings for disk or snapshot */ +export interface Encryption { + /** ResourceId of the disk encryption set to use for enabling encryption at rest. */ + diskEncryptionSetId?: string; + /** The type of key used to encrypt the data of the disk. */ + type?: EncryptionType; +} + +export function encryptionSerializer(item: Encryption): any { + return { diskEncryptionSetId: item["diskEncryptionSetId"], type: item["type"] }; +} + +export function encryptionDeserializer(item: any): Encryption { + return { + diskEncryptionSetId: item["diskEncryptionSetId"], + type: item["type"], + }; +} + +/** The type of key used to encrypt the data of the disk. */ +export enum KnownEncryptionType { + /** Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is not a valid encryption type for disk encryption sets. */ + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", + /** Disk is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + /** Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", +} + +/** + * The type of key used to encrypt the data of the disk. \ + * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithPlatformKey**: Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is not a valid encryption type for disk encryption sets. \ + * **EncryptionAtRestWithCustomerKey**: Disk is encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ + * **EncryptionAtRestWithPlatformAndCustomerKeys**: Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. + */ +export type EncryptionType = string; + +export function shareInfoElementArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return shareInfoElementDeserializer(item); + }); +} + +/** model interface ShareInfoElement */ +export interface ShareInfoElement { + /** A relative URI containing the ID of the VM that has the disk attached. */ + readonly vmUri?: string; +} + +export function shareInfoElementDeserializer(item: any): ShareInfoElement { + return { + vmUri: item["vmUri"], + }; +} + +/** Policy for accessing the disk via network. */ +export enum KnownNetworkAccessPolicy { + /** The disk can be exported or uploaded to from any network. */ + AllowAll = "AllowAll", + /** The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. */ + AllowPrivate = "AllowPrivate", + /** The disk cannot be exported. */ + DenyAll = "DenyAll", +} + +/** + * Policy for accessing the disk via network. \ + * {@link KnownNetworkAccessPolicy} can be used interchangeably with NetworkAccessPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AllowAll**: The disk can be exported or uploaded to from any network. \ + * **AllowPrivate**: The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. \ + * **DenyAll**: The disk cannot be exported. + */ +export type NetworkAccessPolicy = string; + +/** Properties of the disk for which update is pending. */ +export interface PropertyUpdatesInProgress { + /** The target performance tier of the disk if a tier change operation is in progress. */ + targetTier?: string; +} + +export function propertyUpdatesInProgressDeserializer(item: any): PropertyUpdatesInProgress { + return { + targetTier: item["targetTier"], + }; +} + +/** Contains the security related information for the resource. */ +export interface DiskSecurityProfile { + /** Specifies the SecurityType of the VM. Applicable for OS disks only. */ + securityType?: DiskSecurityTypes; + /** ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key */ + secureVMDiskEncryptionSetId?: string; +} + +export function diskSecurityProfileSerializer(item: DiskSecurityProfile): any { + return { + securityType: item["securityType"], + secureVMDiskEncryptionSetId: item["secureVMDiskEncryptionSetId"], + }; +} + +export function diskSecurityProfileDeserializer(item: any): DiskSecurityProfile { + return { + securityType: item["securityType"], + secureVMDiskEncryptionSetId: item["secureVMDiskEncryptionSetId"], + }; +} + +/** Specifies the SecurityType of the VM. Applicable for OS disks only. */ +export enum KnownDiskSecurityTypes { + /** Trusted Launch provides security features such as secure boot and virtual Trusted Platform Module (vTPM) */ + TrustedLaunch = "TrustedLaunch", + /** Indicates Confidential VM disk with only VM guest state encrypted */ + ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform managed key */ + ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", + /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer managed key */ + ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", + /** Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not persisted across VM reboots. */ + ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", +} + +/** + * Specifies the SecurityType of the VM. Applicable for OS disks only. \ + * {@link KnownDiskSecurityTypes} can be used interchangeably with DiskSecurityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TrustedLaunch**: Trusted Launch provides security features such as secure boot and virtual Trusted Platform Module (vTPM) \ + * **ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey**: Indicates Confidential VM disk with only VM guest state encrypted \ + * **ConfidentialVM_DiskEncryptedWithPlatformKey**: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform managed key \ + * **ConfidentialVM_DiskEncryptedWithCustomerKey**: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer managed key \ + * **ConfidentialVM_NonPersistedTPM**: Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not persisted across VM reboots. + */ +export type DiskSecurityTypes = string; + +/** Policy for controlling export on the disk. */ +export enum KnownPublicNetworkAccess { + /** You can generate a SAS URI to access the underlying data of the disk publicly on the internet when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. */ + Enabled = "Enabled", + /** You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. */ + Disabled = "Disabled", +} + +/** + * Policy for controlling export on the disk. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled**: You can generate a SAS URI to access the underlying data of the disk publicly on the internet when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. \ + * **Disabled**: You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. + */ +export type PublicNetworkAccess = string; + +/** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ +export enum KnownDataAccessAuthMode { + /** When export/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export/upload the data. Please refer to aka.ms/DisksAzureADAuth. */ + AzureActiveDirectory = "AzureActiveDirectory", + /** No additional authentication would be performed when accessing export/upload URL. */ + None = "None", +} + +/** + * Additional authentication requirements when exporting or uploading to a disk or snapshot. \ + * {@link KnownDataAccessAuthMode} can be used interchangeably with DataAccessAuthMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AzureActiveDirectory**: When export\/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export\/upload the data. Please refer to aka.ms\/DisksAzureADAuth. \ + * **None**: No additional authentication would be performed when accessing export\/upload URL. + */ +export type DataAccessAuthMode = string; + +/** In the case of an availability or connectivity issue with the data disk, specify the behavior of your VM */ +export interface AvailabilityPolicy { + /** Determines on how to handle disks with slow I/O. */ + actionOnDiskDelay?: AvailabilityPolicyDiskDelay; +} + +export function availabilityPolicySerializer(item: AvailabilityPolicy): any { + return { actionOnDiskDelay: item["actionOnDiskDelay"] }; +} + +export function availabilityPolicyDeserializer(item: any): AvailabilityPolicy { + return { + actionOnDiskDelay: item["actionOnDiskDelay"], + }; +} + +/** Determines on how to handle disks with slow I/O. */ +export enum KnownAvailabilityPolicyDiskDelay { + /** Defaults to behavior without av policy specified, which is VM restart upon slow disk io. */ + None = "None", + /** Upon a disk io failure or slow response, try detaching then reattaching the disk. */ + AutomaticReattach = "AutomaticReattach", +} + +/** + * Determines on how to handle disks with slow I/O. \ + * {@link KnownAvailabilityPolicyDiskDelay} can be used interchangeably with AvailabilityPolicyDiskDelay, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Defaults to behavior without av policy specified, which is VM restart upon slow disk io. \ + * **AutomaticReattach**: Upon a disk io failure or slow response, try detaching then reattaching the disk. + */ +export type AvailabilityPolicyDiskDelay = string; + +/** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ +export interface DiskSku { + /** The sku name. */ + name?: DiskStorageAccountTypes; + /** The sku tier. */ + readonly tier?: string; +} + +export function diskSkuSerializer(item: DiskSku): any { + return { name: item["name"] }; +} + +export function diskSkuDeserializer(item: any): DiskSku { + return { + name: item["name"], + tier: item["tier"], + }; +} + +/** The sku name. */ +export enum KnownDiskStorageAccountTypes { + /** Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. */ + StandardLRS = "Standard_LRS", + /** Premium SSD locally redundant storage. Best for production and performance sensitive workloads. */ + PremiumLRS = "Premium_LRS", + /** Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev/test. */ + StandardSSDLRS = "StandardSSD_LRS", + /** Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. */ + UltraSSDLRS = "UltraSSD_LRS", + /** Premium SSD zone redundant storage. Best for the production workloads that need storage resiliency against zone failures. */ + PremiumZRS = "Premium_ZRS", + /** Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications and dev/test that need storage resiliency against zone failures. */ + StandardSSDZRS = "StandardSSD_ZRS", + /** Premium SSD v2 locally redundant storage. Best for production and performance-sensitive workloads that consistently require low latency and high IOPS and throughput. */ + PremiumV2LRS = "PremiumV2_LRS", +} + +/** + * The sku name. \ + * {@link KnownDiskStorageAccountTypes} can be used interchangeably with DiskStorageAccountTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS**: Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. \ + * **Premium_LRS**: Premium SSD locally redundant storage. Best for production and performance sensitive workloads. \ + * **StandardSSD_LRS**: Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev\/test. \ + * **UltraSSD_LRS**: Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. \ + * **Premium_ZRS**: Premium SSD zone redundant storage. Best for the production workloads that need storage resiliency against zone failures. \ + * **StandardSSD_ZRS**: Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications and dev\/test that need storage resiliency against zone failures. \ + * **PremiumV2_LRS**: Premium SSD v2 locally redundant storage. Best for production and performance-sensitive workloads that consistently require low latency and high IOPS and throughput. + */ +export type DiskStorageAccountTypes = string; + +/** Disk update resource. */ +export interface DiskUpdate { + /** Resource tags */ + tags?: Record; + /** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ + sku?: DiskSku; + /** the Operating System type. */ + osType?: OperatingSystemTypes; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadWrite?: number; + /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadWrite?: number; + /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadOnly?: number; + /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadOnly?: number; + /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ + maxShares?: number; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ + tier?: string; + /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ + burstingEnabled?: boolean; + /** Purchase plan information to be added on the OS disk */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities to be added on the OS disk. */ + supportedCapabilities?: SupportedCapabilities; + /** Properties of the disk for which update is pending. */ + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ + optimizedForFrequentAttach?: boolean; + /** Determines how platform treats disk failures */ + availabilityPolicy?: AvailabilityPolicy; +} + +export function diskUpdateSerializer(item: DiskUpdate): any { + return { + properties: areAllPropsUndefined(item, [ + "osType", + "diskSizeGB", + "encryptionSettingsCollection", + "diskIOPSReadWrite", + "diskMBpsReadWrite", + "diskIOPSReadOnly", + "diskMBpsReadOnly", + "maxShares", + "encryption", + "networkAccessPolicy", + "diskAccessId", + "tier", + "burstingEnabled", + "purchasePlan", + "supportedCapabilities", + "supportsHibernation", + "publicNetworkAccess", + "dataAccessAuthMode", + "optimizedForFrequentAttach", + "availabilityPolicy", + ]) + ? undefined + : _diskUpdatePropertiesSerializer(item), + tags: item["tags"], + sku: !item["sku"] ? item["sku"] : diskSkuSerializer(item["sku"]), + }; +} + +/** Disk resource update properties. */ +export interface DiskUpdateProperties { + /** the Operating System type. */ + osType?: OperatingSystemTypes; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadWrite?: number; + /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadWrite?: number; + /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadOnly?: number; + /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadOnly?: number; + /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ + maxShares?: number; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ + tier?: string; + /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ + burstingEnabled?: boolean; + /** Purchase plan information to be added on the OS disk */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities to be added on the OS disk. */ + supportedCapabilities?: SupportedCapabilities; + /** Properties of the disk for which update is pending. */ + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ + optimizedForFrequentAttach?: boolean; + /** Determines how platform treats disk failures */ + availabilityPolicy?: AvailabilityPolicy; +} + +export function diskUpdatePropertiesSerializer(item: DiskUpdateProperties): any { + return { + osType: item["osType"], + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + diskIOPSReadWrite: item["diskIopsReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + diskIOPSReadOnly: item["diskIopsReadOnly"], + diskMBpsReadOnly: item["diskMBpsReadOnly"], + maxShares: item["maxShares"], + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + tier: item["tier"], + burstingEnabled: item["burstingEnabled"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanSerializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + optimizedForFrequentAttach: item["optimizedForFrequentAttach"], + availabilityPolicy: !item["availabilityPolicy"] + ? item["availabilityPolicy"] + : availabilityPolicySerializer(item["availabilityPolicy"]), + }; +} + +/** The List Disks operation response. */ +export interface _DiskList { + /** The Disk items on this page */ + value: Disk[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _diskListDeserializer(item: any): _DiskList { + return { + value: diskArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function diskArraySerializer(result: Array): any[] { + return result.map((item) => { + return diskSerializer(item); + }); +} + +export function diskArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return diskDeserializer(item); + }); +} + +/** Data used for requesting a SAS. */ +export interface GrantAccessData { + /** The Access Level, accepted values include None, Read, Write. */ + access: AccessLevel; + /** Time duration in seconds until the SAS access expires. */ + durationInSeconds: number; + /** Set this flag to true to get additional SAS for VM guest state */ + getSecureVMGuestStateSAS?: boolean; + /** Used to specify the file format when making request for SAS on a VHDX file format snapshot */ + fileFormat?: FileFormat; +} + +export function grantAccessDataSerializer(item: GrantAccessData): any { + return { + access: item["access"], + durationInSeconds: item["durationInSeconds"], + getSecureVMGuestStateSAS: item["getSecureVMGuestStateSAS"], + fileFormat: item["fileFormat"], + }; +} + +/** The Access Level, accepted values include None, Read, Write. */ +export enum KnownAccessLevel { + /** None */ + None = "None", + /** Read */ + Read = "Read", + /** Write */ + Write = "Write", +} + +/** + * The Access Level, accepted values include None, Read, Write. \ + * {@link KnownAccessLevel} can be used interchangeably with AccessLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Read** \ + * **Write** + */ +export type AccessLevel = string; + +/** Used to specify the file format when making request for SAS on a VHDX file format snapshot */ +export enum KnownFileFormat { + /** A VHD file is a disk image file in the Virtual Hard Disk file format. */ + VHD = "VHD", + /** A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. */ + Vhdx = "VHDX", +} + +/** + * Used to specify the file format when making request for SAS on a VHDX file format snapshot \ + * {@link KnownFileFormat} can be used interchangeably with FileFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **VHD**: A VHD file is a disk image file in the Virtual Hard Disk file format. \ + * **VHDX**: A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. + */ +export type FileFormat = string; + +/** A disk access SAS uri. */ +export interface AccessUri { + /** A SAS uri for accessing a disk. */ + readonly accessSAS?: string; + /** A SAS uri for accessing a VM guest state. */ + readonly securityDataAccessSAS?: string; + /** A SAS uri for accessing a VM metadata. */ + readonly securityMetadataAccessSAS?: string; +} + +export function accessUriDeserializer(item: any): AccessUri { + return { + accessSAS: item["accessSAS"], + securityDataAccessSAS: item["securityDataAccessSAS"], + securityMetadataAccessSAS: item["securityMetadataAccessSAS"], + }; +} + +/** disk access resource. */ +export interface DiskAccess extends TrackedResource { + /** The extended location where the disk access will be created. Extended location cannot be changed. */ + extendedLocation?: ExtendedLocation; + /** A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** The disk access resource provisioning state. */ + readonly provisioningState?: string; + /** The time when the disk access was created. */ + readonly timeCreated?: Date; +} + +export function diskAccessSerializer(item: DiskAccess): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, []) ? undefined : _diskAccessPropertiesSerializer(item), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function diskAccessDeserializer(item: any): DiskAccess { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _diskAccessPropertiesDeserializer(item["properties"])), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** model interface DiskAccessProperties */ +export interface DiskAccessProperties { + /** A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** The disk access resource provisioning state. */ + readonly provisioningState?: string; + /** The time when the disk access was created. */ + readonly timeCreated?: Date; +} + +export function diskAccessPropertiesSerializer(_item: DiskAccessProperties): any { + return {}; +} + +export function diskAccessPropertiesDeserializer(item: any): DiskAccessProperties { + return { + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + provisioningState: item["provisioningState"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + }; +} + +export function privateEndpointConnectionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionSerializer(item); + }); +} + +export function privateEndpointConnectionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionDeserializer(item); + }); +} + +/** The Private Endpoint Connection resource. */ +export interface PrivateEndpointConnection extends ProxyResource { + /** The resource of private end point. */ + readonly privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between DiskAccess and Virtual Network. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** The provisioning state of the private endpoint connection resource. */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { + return { + properties: areAllPropsUndefined(item, ["privateLinkServiceConnectionState"]) + ? undefined + : _privateEndpointConnectionPropertiesSerializer(item), + }; +} + +export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _privateEndpointConnectionPropertiesDeserializer(item["properties"])), + }; +} + +/** Properties of the PrivateEndpointConnectProperties. */ +export interface PrivateEndpointConnectionProperties { + /** The resource of private end point. */ + readonly privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between DiskAccess and Virtual Network. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** The provisioning state of the private endpoint connection resource. */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +export function privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnectionProperties, +): any { + return { + privateLinkServiceConnectionState: privateLinkServiceConnectionStateSerializer( + item["privateLinkServiceConnectionState"], + ), + }; +} + +export function privateEndpointConnectionPropertiesDeserializer( + item: any, +): PrivateEndpointConnectionProperties { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( + item["privateLinkServiceConnectionState"], + ), + provisioningState: item["provisioningState"], + }; +} + +/** The Private Endpoint resource. */ +export interface PrivateEndpoint { + /** The ARM identifier for Private Endpoint */ + readonly id?: string; +} + +export function privateEndpointDeserializer(item: any): PrivateEndpoint { + return { + id: item["id"], + }; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +export function privateLinkServiceConnectionStateSerializer( + item: PrivateLinkServiceConnectionState, +): any { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +export function privateLinkServiceConnectionStateDeserializer( + item: any, +): PrivateLinkServiceConnectionState { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +/** The private endpoint connection status. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * The private endpoint connection status. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** The current provisioning state. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed", +} + +/** + * The current provisioning state. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = string; + +/** Used for updating a disk access resource. */ +export interface DiskAccessUpdate { + /** Resource tags */ + tags?: Record; +} + +export function diskAccessUpdateSerializer(item: DiskAccessUpdate): any { + return { tags: item["tags"] }; +} + +/** The List disk access operation response. */ +export interface _DiskAccessList { + /** The DiskAccess items on this page */ + value: DiskAccess[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _diskAccessListDeserializer(item: any): _DiskAccessList { + return { + value: diskAccessArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function diskAccessArraySerializer(result: Array): any[] { + return result.map((item) => { + return diskAccessSerializer(item); + }); +} + +export function diskAccessArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return diskAccessDeserializer(item); + }); +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; +} + +export function privateLinkResourceListResultDeserializer( + item: any, +): PrivateLinkResourceListResult { + return { + value: !item["value"] ? item["value"] : privateLinkResourceArrayDeserializer(item["value"]), + }; +} + +export function privateLinkResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return privateLinkResourceDeserializer(item); + }); +} + +/** A private link resource */ +export interface PrivateLinkResource { + /** private link resource Id */ + readonly id?: string; + /** private link resource name */ + readonly name?: string; + /** private link resource type */ + readonly type?: string; + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource DNS zone name. */ + requiredZoneNames?: string[]; +} + +export function privateLinkResourceDeserializer(item: any): PrivateLinkResource { + return { + ...(!item["properties"] + ? item["properties"] + : _privateLinkResourcePropertiesDeserializer(item["properties"])), + id: item["id"], + name: item["name"], + type: item["type"], + }; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource DNS zone name. */ + requiredZoneNames?: string[]; +} + +export function privateLinkResourcePropertiesDeserializer( + item: any, +): PrivateLinkResourceProperties { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +/** A list of private link resources */ +export interface _PrivateEndpointConnectionListResult { + /** The PrivateEndpointConnection items on this page */ + value: PrivateEndpointConnection[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _privateEndpointConnectionListResultDeserializer( + item: any, +): _PrivateEndpointConnectionListResult { + return { + value: privateEndpointConnectionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** disk encryption set resource. */ +export interface DiskEncryptionSet extends TrackedResource { + /** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ + identity?: EncryptionSetIdentity; + /** The type of key used to encrypt the data of the disk. */ + encryptionType?: DiskEncryptionSetType; + /** The key vault key which is currently used by this disk encryption set. */ + activeKey?: KeyForDiskEncryptionSet; + /** A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. */ + readonly previousKeys?: KeyForDiskEncryptionSet[]; + /** The disk encryption set provisioning state. */ + readonly provisioningState?: string; + /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ + rotationToLatestKeyVersionEnabled?: boolean; + /** The time when the active key of this disk encryption set was updated. */ + readonly lastKeyRotationTimestamp?: Date; + /** The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. */ + readonly autoKeyRotationError?: ApiError; + /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ + federatedClientId?: string; +} + +export function diskEncryptionSetSerializer(item: DiskEncryptionSet): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "encryptionType", + "activeKey", + "rotationToLatestKeyVersionEnabled", + "federatedClientId", + ]) + ? undefined + : _diskEncryptionSetPropertiesSerializer(item), + identity: !item["identity"] + ? item["identity"] + : encryptionSetIdentitySerializer(item["identity"]), + }; +} + +export function diskEncryptionSetDeserializer(item: any): DiskEncryptionSet { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _diskEncryptionSetPropertiesDeserializer(item["properties"])), + identity: !item["identity"] + ? item["identity"] + : encryptionSetIdentityDeserializer(item["identity"]), + }; +} + +/** model interface EncryptionSetProperties */ +export interface EncryptionSetProperties { + /** The type of key used to encrypt the data of the disk. */ + encryptionType?: DiskEncryptionSetType; + /** The key vault key which is currently used by this disk encryption set. */ + activeKey?: KeyForDiskEncryptionSet; + /** A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. */ + readonly previousKeys?: KeyForDiskEncryptionSet[]; + /** The disk encryption set provisioning state. */ + readonly provisioningState?: string; + /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ + rotationToLatestKeyVersionEnabled?: boolean; + /** The time when the active key of this disk encryption set was updated. */ + readonly lastKeyRotationTimestamp?: Date; + /** The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. */ + readonly autoKeyRotationError?: ApiError; + /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ + federatedClientId?: string; +} + +export function encryptionSetPropertiesSerializer(item: EncryptionSetProperties): any { + return { + encryptionType: item["encryptionType"], + activeKey: !item["activeKey"] + ? item["activeKey"] + : keyForDiskEncryptionSetSerializer(item["activeKey"]), + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + federatedClientId: item["federatedClientId"], + }; +} + +export function encryptionSetPropertiesDeserializer(item: any): EncryptionSetProperties { + return { + encryptionType: item["encryptionType"], + activeKey: !item["activeKey"] + ? item["activeKey"] + : keyForDiskEncryptionSetDeserializer(item["activeKey"]), + previousKeys: !item["previousKeys"] + ? item["previousKeys"] + : keyForDiskEncryptionSetArrayDeserializer(item["previousKeys"]), + provisioningState: item["provisioningState"], + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + lastKeyRotationTimestamp: !item["lastKeyRotationTimestamp"] + ? item["lastKeyRotationTimestamp"] + : new Date(item["lastKeyRotationTimestamp"]), + autoKeyRotationError: !item["autoKeyRotationError"] + ? item["autoKeyRotationError"] + : apiErrorDeserializer(item["autoKeyRotationError"]), + federatedClientId: item["federatedClientId"], + }; +} + +/** The type of key used to encrypt the data of the disk. */ +export enum KnownDiskEncryptionSetType { + /** Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + /** Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", + /** Confidential VM supported disk and VM guest state would be encrypted with customer managed key. */ + ConfidentialVmEncryptedWithCustomerKey = "ConfidentialVmEncryptedWithCustomerKey", +} + +/** + * The type of key used to encrypt the data of the disk. \ + * {@link KnownDiskEncryptionSetType} can be used interchangeably with DiskEncryptionSetType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithCustomerKey**: Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ + * **EncryptionAtRestWithPlatformAndCustomerKeys**: Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. \ + * **ConfidentialVmEncryptedWithCustomerKey**: Confidential VM supported disk and VM guest state would be encrypted with customer managed key. + */ +export type DiskEncryptionSetType = string; + +/** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots */ +export interface KeyForDiskEncryptionSet { + /** Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. */ + sourceVault?: SourceVault; + /** Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. */ + keyUrl: string; +} + +export function keyForDiskEncryptionSetSerializer(item: KeyForDiskEncryptionSet): any { + return { + sourceVault: !item["sourceVault"] + ? item["sourceVault"] + : sourceVaultSerializer(item["sourceVault"]), + keyUrl: item["keyUrl"], + }; +} + +export function keyForDiskEncryptionSetDeserializer(item: any): KeyForDiskEncryptionSet { + return { + sourceVault: !item["sourceVault"] + ? item["sourceVault"] + : sourceVaultDeserializer(item["sourceVault"]), + keyUrl: item["keyUrl"], + }; +} + +export function keyForDiskEncryptionSetArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return keyForDiskEncryptionSetSerializer(item); + }); +} + +export function keyForDiskEncryptionSetArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return keyForDiskEncryptionSetDeserializer(item); + }); +} + +/** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ +export interface EncryptionSetIdentity { + /** The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. */ + type?: DiskEncryptionSetIdentityType; + /** The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity */ + readonly principalId?: string; + /** The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity */ + readonly tenantId?: string; + /** The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: Record; +} + +export function encryptionSetIdentitySerializer(item: EncryptionSetIdentity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function encryptionSetIdentityDeserializer(item: any): EncryptionSetIdentity { + return { + type: item["type"], + principalId: item["principalId"], + tenantId: item["tenantId"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. */ +export enum KnownDiskEncryptionSetIdentityType { + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssigned, UserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + /** None */ + None = "None", +} + +/** + * The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. \ + * {@link KnownDiskEncryptionSetIdentityType} can be used interchangeably with DiskEncryptionSetIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** \ + * **None** + */ +export type DiskEncryptionSetIdentityType = string; + +/** disk encryption set update resource. */ +export interface DiskEncryptionSetUpdate { + /** Resource tags */ + tags?: Record; + /** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ + identity?: EncryptionSetIdentity; + /** The type of key used to encrypt the data of the disk. */ + encryptionType?: DiskEncryptionSetType; + /** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots */ + activeKey?: KeyForDiskEncryptionSet; + /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ + rotationToLatestKeyVersionEnabled?: boolean; + /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ + federatedClientId?: string; +} + +export function diskEncryptionSetUpdateSerializer(item: DiskEncryptionSetUpdate): any { + return { + properties: areAllPropsUndefined(item, [ + "encryptionType", + "activeKey", + "rotationToLatestKeyVersionEnabled", + "federatedClientId", + ]) + ? undefined + : _diskEncryptionSetUpdatePropertiesSerializer(item), + tags: item["tags"], + identity: !item["identity"] + ? item["identity"] + : encryptionSetIdentitySerializer(item["identity"]), + }; +} + +/** disk encryption set resource update properties. */ +export interface DiskEncryptionSetUpdateProperties { + /** The type of key used to encrypt the data of the disk. */ + encryptionType?: DiskEncryptionSetType; + /** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots */ + activeKey?: KeyForDiskEncryptionSet; + /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ + rotationToLatestKeyVersionEnabled?: boolean; + /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ + federatedClientId?: string; +} + +export function diskEncryptionSetUpdatePropertiesSerializer( + item: DiskEncryptionSetUpdateProperties, +): any { + return { + encryptionType: item["encryptionType"], + activeKey: !item["activeKey"] + ? item["activeKey"] + : keyForDiskEncryptionSetSerializer(item["activeKey"]), + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + federatedClientId: item["federatedClientId"], + }; +} + +/** The List disk encryption set operation response. */ +export interface _DiskEncryptionSetList { + /** The DiskEncryptionSet items on this page */ + value: DiskEncryptionSet[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _diskEncryptionSetListDeserializer(item: any): _DiskEncryptionSetList { + return { + value: diskEncryptionSetArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function diskEncryptionSetArraySerializer(result: Array): any[] { + return result.map((item) => { + return diskEncryptionSetSerializer(item); + }); +} + +export function diskEncryptionSetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return diskEncryptionSetDeserializer(item); + }); +} + +/** The List resources which are encrypted with the disk encryption set. */ +export interface _ResourceUriList { + /** A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. */ + value: string[]; + /** The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. */ + nextLink?: string; +} + +export function _resourceUriListDeserializer(item: any): _ResourceUriList { + return { + value: item["value"].map((p: any) => { + return p; + }), + nextLink: item["nextLink"], + }; +} + +/** Snapshot resource. */ +export interface Snapshot extends TrackedResource { + /** Unused. Always Null. */ + readonly managedBy?: string; + /** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ + sku?: SnapshotSku; + /** The extended location where the snapshot will be created. Extended location cannot be changed. */ + extendedLocation?: ExtendedLocation; + /** The time when the snapshot was created. */ + readonly timeCreated?: Date; + /** The Operating System type. */ + osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the image from which the source disk for the snapshot was originally created. */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the source disk from the snapshot was originally created. */ + supportedCapabilities?: SupportedCapabilities; + /** Disk source information. CreationData information cannot be changed after the disk has been created. */ + creationData?: CreationData; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** The size of the disk in bytes. This field is read only. */ + readonly diskSizeBytes?: number; + /** The state of the snapshot. */ + readonly diskState?: DiskState; + /** Unique Guid identifying the resource. */ + readonly uniqueId?: string; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** The disk provisioning state. */ + readonly provisioningState?: string; + /** Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. */ + incremental?: boolean; + /** Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. */ + readonly incrementalSnapshotFamilyId?: string; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Indicates the OS on a snapshot supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ + completionPercent?: number; + /** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ + copyCompletionError?: CopyCompletionError; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** The state of snapshot which determines the access availability of the snapshot. */ + readonly snapshotAccessState?: SnapshotAccessState; +} + +export function snapshotSerializer(item: Snapshot): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "osType", + "hyperVGeneration", + "purchasePlan", + "supportedCapabilities", + "creationData", + "diskSizeGB", + "encryptionSettingsCollection", + "incremental", + "encryption", + "networkAccessPolicy", + "diskAccessId", + "securityProfile", + "supportsHibernation", + "publicNetworkAccess", + "completionPercent", + "copyCompletionError", + "dataAccessAuthMode", + ]) + ? undefined + : _snapshotPropertiesSerializer(item), + sku: !item["sku"] ? item["sku"] : snapshotSkuSerializer(item["sku"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationSerializer(item["extendedLocation"]), + }; +} + +export function snapshotDeserializer(item: any): Snapshot { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _snapshotPropertiesDeserializer(item["properties"])), + managedBy: item["managedBy"], + sku: !item["sku"] ? item["sku"] : snapshotSkuDeserializer(item["sku"]), + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : extendedLocationDeserializer(item["extendedLocation"]), + }; +} + +/** Snapshot resource properties. */ +export interface SnapshotProperties { + /** The time when the snapshot was created. */ + readonly timeCreated?: Date; + /** The Operating System type. */ + osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the image from which the source disk for the snapshot was originally created. */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the source disk from the snapshot was originally created. */ + supportedCapabilities?: SupportedCapabilities; + /** Disk source information. CreationData information cannot be changed after the disk has been created. */ + creationData: CreationData; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** The size of the disk in bytes. This field is read only. */ + readonly diskSizeBytes?: number; + /** The state of the snapshot. */ + readonly diskState?: DiskState; + /** Unique Guid identifying the resource. */ + readonly uniqueId?: string; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** The disk provisioning state. */ + readonly provisioningState?: string; + /** Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. */ + incremental?: boolean; + /** Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. */ + readonly incrementalSnapshotFamilyId?: string; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Indicates the OS on a snapshot supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ + completionPercent?: number; + /** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ + copyCompletionError?: CopyCompletionError; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** The state of snapshot which determines the access availability of the snapshot. */ + readonly snapshotAccessState?: SnapshotAccessState; +} + +export function snapshotPropertiesSerializer(item: SnapshotProperties): any { + return { + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanSerializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + creationData: creationDataSerializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + incremental: item["incremental"], + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileSerializer(item["securityProfile"]), + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + completionPercent: item["completionPercent"], + copyCompletionError: !item["copyCompletionError"] + ? item["copyCompletionError"] + : copyCompletionErrorSerializer(item["copyCompletionError"]), + dataAccessAuthMode: item["dataAccessAuthMode"], + }; +} + +export function snapshotPropertiesDeserializer(item: any): SnapshotProperties { + return { + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanDeserializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesDeserializer(item["supportedCapabilities"]), + creationData: creationDataDeserializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + diskSizeBytes: item["diskSizeBytes"], + diskState: item["diskState"], + uniqueId: item["uniqueId"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionDeserializer(item["encryptionSettingsCollection"]), + provisioningState: item["provisioningState"], + incremental: item["incremental"], + incrementalSnapshotFamilyId: item["incrementalSnapshotFamilyId"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionDeserializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileDeserializer(item["securityProfile"]), + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + completionPercent: item["completionPercent"], + copyCompletionError: !item["copyCompletionError"] + ? item["copyCompletionError"] + : copyCompletionErrorDeserializer(item["copyCompletionError"]), + dataAccessAuthMode: item["dataAccessAuthMode"], + snapshotAccessState: item["snapshotAccessState"], + }; +} + +/** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ +export interface CopyCompletionError { + /** Indicates the error code if the background copy of a resource created via the CopyStart operation fails. */ + errorCode: CopyCompletionErrorReason; + /** Indicates the error message if the background copy of a resource created via the CopyStart operation fails. */ + errorMessage: string; +} + +export function copyCompletionErrorSerializer(item: CopyCompletionError): any { + return { errorCode: item["errorCode"], errorMessage: item["errorMessage"] }; +} + +export function copyCompletionErrorDeserializer(item: any): CopyCompletionError { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + }; +} + +/** Indicates the error code if the background copy of a resource created via the CopyStart operation fails. */ +export enum KnownCopyCompletionErrorReason { + /** Indicates that the source snapshot was deleted while the background copy of the resource created via CopyStart operation was in progress. */ + CopySourceNotFound = "CopySourceNotFound", +} + +/** + * Indicates the error code if the background copy of a resource created via the CopyStart operation fails. \ + * {@link KnownCopyCompletionErrorReason} can be used interchangeably with CopyCompletionErrorReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CopySourceNotFound**: Indicates that the source snapshot was deleted while the background copy of the resource created via CopyStart operation was in progress. + */ +export type CopyCompletionErrorReason = string; + +/** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ +export interface SnapshotSku { + /** The sku name. */ + name?: SnapshotStorageAccountTypes; + /** The sku tier. */ + readonly tier?: string; +} + +export function snapshotSkuSerializer(item: SnapshotSku): any { + return { name: item["name"] }; +} + +export function snapshotSkuDeserializer(item: any): SnapshotSku { + return { + name: item["name"], + tier: item["tier"], + }; +} + +/** The sku name. */ +export enum KnownSnapshotStorageAccountTypes { + /** Standard HDD locally redundant storage */ + StandardLRS = "Standard_LRS", + /** Premium SSD locally redundant storage */ + PremiumLRS = "Premium_LRS", + /** Standard zone redundant storage */ + StandardZRS = "Standard_ZRS", +} + +/** + * The sku name. \ + * {@link KnownSnapshotStorageAccountTypes} can be used interchangeably with SnapshotStorageAccountTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS**: Standard HDD locally redundant storage \ + * **Premium_LRS**: Premium SSD locally redundant storage \ + * **Standard_ZRS**: Standard zone redundant storage + */ +export type SnapshotStorageAccountTypes = string; + +/** Snapshot update resource. */ +export interface SnapshotUpdate { + /** Resource tags */ + tags?: Record; + /** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ + sku?: SnapshotSku; + /** the Operating System type. */ + osType?: OperatingSystemTypes; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Indicates the OS on a snapshot supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** The state of snapshot which determines the access availability of the snapshot. */ + readonly snapshotAccessState?: SnapshotAccessState; +} + +export function snapshotUpdateSerializer(item: SnapshotUpdate): any { + return { + properties: areAllPropsUndefined(item, [ + "osType", + "diskSizeGB", + "encryptionSettingsCollection", + "encryption", + "networkAccessPolicy", + "diskAccessId", + "supportsHibernation", + "publicNetworkAccess", + "dataAccessAuthMode", + "supportedCapabilities", + ]) + ? undefined + : _snapshotUpdatePropertiesSerializer(item), + tags: item["tags"], + sku: !item["sku"] ? item["sku"] : snapshotSkuSerializer(item["sku"]), + }; +} + +/** Snapshot resource update properties. */ +export interface SnapshotUpdateProperties { + /** the Operating System type. */ + osType?: OperatingSystemTypes; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Indicates the OS on a snapshot supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** The state of snapshot which determines the access availability of the snapshot. */ + readonly snapshotAccessState?: SnapshotAccessState; +} + +export function snapshotUpdatePropertiesSerializer(item: SnapshotUpdateProperties): any { + return { + osType: item["osType"], + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + }; +} + +/** The List Snapshots operation response. */ +export interface _SnapshotList { + /** A list of snapshots. */ + value: Snapshot[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _snapshotListDeserializer(item: any): _SnapshotList { + return { + value: snapshotArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function snapshotArraySerializer(result: Array): any[] { + return result.map((item) => { + return snapshotSerializer(item); + }); +} + +export function snapshotArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return snapshotDeserializer(item); + }); +} + +/** Properties of disk restore point */ +export interface DiskRestorePoint extends ProxyResource { + /** The timestamp of restorePoint creation */ + readonly timeCreated?: Date; + /** arm id of source disk or source disk restore point. */ + readonly sourceResourceId?: string; + /** The Operating System type. */ + readonly osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the the image from which the OS disk was created. */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** id of the backing snapshot's MIS family */ + readonly familyId?: string; + /** unique incarnation id of the source disk */ + readonly sourceUniqueId?: string; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + readonly encryption?: Encryption; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Percentage complete for the background copy of disk restore point when source resource is from a different region. */ + completionPercent?: number; + /** Replication state of disk restore point when source resource is from a different region. */ + readonly replicationState?: string; + /** Location of source disk or source disk restore point when source resource is from a different region. */ + readonly sourceResourceLocation?: string; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. */ + readonly logicalSectorSize?: number; +} + +export function diskRestorePointDeserializer(item: any): DiskRestorePoint { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _diskRestorePointPropertiesDeserializer(item["properties"])), + }; +} + +/** Properties of an incremental disk restore point */ +export interface DiskRestorePointProperties { + /** The timestamp of restorePoint creation */ + readonly timeCreated?: Date; + /** arm id of source disk or source disk restore point. */ + readonly sourceResourceId?: string; + /** The Operating System type. */ + readonly osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the the image from which the OS disk was created. */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** id of the backing snapshot's MIS family */ + readonly familyId?: string; + /** unique incarnation id of the source disk */ + readonly sourceUniqueId?: string; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + readonly encryption?: Encryption; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Percentage complete for the background copy of disk restore point when source resource is from a different region. */ + completionPercent?: number; + /** Replication state of disk restore point when source resource is from a different region. */ + readonly replicationState?: string; + /** Location of source disk or source disk restore point when source resource is from a different region. */ + readonly sourceResourceLocation?: string; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. */ + readonly logicalSectorSize?: number; +} + +export function diskRestorePointPropertiesDeserializer(item: any): DiskRestorePointProperties { + return { + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + sourceResourceId: item["sourceResourceId"], + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanDeserializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesDeserializer(item["supportedCapabilities"]), + familyId: item["familyId"], + sourceUniqueId: item["sourceUniqueId"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionDeserializer(item["encryption"]), + supportsHibernation: item["supportsHibernation"], + networkAccessPolicy: item["networkAccessPolicy"], + publicNetworkAccess: item["publicNetworkAccess"], + diskAccessId: item["diskAccessId"], + completionPercent: item["completionPercent"], + replicationState: item["replicationState"], + sourceResourceLocation: item["sourceResourceLocation"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileDeserializer(item["securityProfile"]), + logicalSectorSize: item["logicalSectorSize"], + }; +} + +/** The List Disk Restore Points operation response. */ +export interface _DiskRestorePointList { + /** The DiskRestorePoint items on this page */ + value: DiskRestorePoint[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _diskRestorePointListDeserializer(item: any): _DiskRestorePointList { + return { + value: diskRestorePointArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function diskRestorePointArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return diskRestorePointDeserializer(item); + }); +} + +export function _diskPropertiesSerializer(item: Disk): any { + return { + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanSerializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + creationData: !item["creationData"] + ? item["creationData"] + : creationDataSerializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + diskIOPSReadWrite: item["diskIopsReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + diskIOPSReadOnly: item["diskIopsReadOnly"], + diskMBpsReadOnly: item["diskMBpsReadOnly"], + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + maxShares: item["maxShares"], + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + tier: item["tier"], + burstingEnabled: item["burstingEnabled"], + supportsHibernation: item["supportsHibernation"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileSerializer(item["securityProfile"]), + completionPercent: item["completionPercent"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + optimizedForFrequentAttach: item["optimizedForFrequentAttach"], + availabilityPolicy: !item["availabilityPolicy"] + ? item["availabilityPolicy"] + : availabilityPolicySerializer(item["availabilityPolicy"]), + }; +} + +export function _diskPropertiesDeserializer(item: any) { + return { + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanDeserializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesDeserializer(item["supportedCapabilities"]), + creationData: !item["creationData"] + ? item["creationData"] + : creationDataDeserializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + diskSizeBytes: item["diskSizeBytes"], + uniqueId: item["uniqueId"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionDeserializer(item["encryptionSettingsCollection"]), + provisioningState: item["provisioningState"], + diskIopsReadWrite: item["diskIOPSReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + diskIopsReadOnly: item["diskIOPSReadOnly"], + diskMBpsReadOnly: item["diskMBpsReadOnly"], + diskState: item["diskState"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionDeserializer(item["encryption"]), + maxShares: item["maxShares"], + shareInfo: !item["shareInfo"] + ? item["shareInfo"] + : shareInfoElementArrayDeserializer(item["shareInfo"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + burstingEnabledTime: !item["burstingEnabledTime"] + ? item["burstingEnabledTime"] + : new Date(item["burstingEnabledTime"]), + tier: item["tier"], + burstingEnabled: item["burstingEnabled"], + propertyUpdatesInProgress: !item["propertyUpdatesInProgress"] + ? item["propertyUpdatesInProgress"] + : propertyUpdatesInProgressDeserializer(item["propertyUpdatesInProgress"]), + supportsHibernation: item["supportsHibernation"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileDeserializer(item["securityProfile"]), + completionPercent: item["completionPercent"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + optimizedForFrequentAttach: item["optimizedForFrequentAttach"], + lastOwnershipUpdateTime: !item["LastOwnershipUpdateTime"] + ? item["LastOwnershipUpdateTime"] + : new Date(item["LastOwnershipUpdateTime"]), + availabilityPolicy: !item["availabilityPolicy"] + ? item["availabilityPolicy"] + : availabilityPolicyDeserializer(item["availabilityPolicy"]), + }; +} + +export function _diskUpdatePropertiesSerializer(item: DiskUpdate): any { + return { + osType: item["osType"], + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + diskIOPSReadWrite: item["diskIopsReadWrite"], + diskMBpsReadWrite: item["diskMBpsReadWrite"], + diskIOPSReadOnly: item["diskIopsReadOnly"], + diskMBpsReadOnly: item["diskMBpsReadOnly"], + maxShares: item["maxShares"], + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + tier: item["tier"], + burstingEnabled: item["burstingEnabled"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanSerializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + optimizedForFrequentAttach: item["optimizedForFrequentAttach"], + availabilityPolicy: !item["availabilityPolicy"] + ? item["availabilityPolicy"] + : availabilityPolicySerializer(item["availabilityPolicy"]), + }; +} + +export function _privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnection, +): any { + return { + privateLinkServiceConnectionState: !item["privateLinkServiceConnectionState"] + ? item["privateLinkServiceConnectionState"] + : privateLinkServiceConnectionStateSerializer(item["privateLinkServiceConnectionState"]), + }; +} + +export function _privateEndpointConnectionPropertiesDeserializer(item: any) { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: !item["privateLinkServiceConnectionState"] + ? item["privateLinkServiceConnectionState"] + : privateLinkServiceConnectionStateDeserializer(item["privateLinkServiceConnectionState"]), + provisioningState: item["provisioningState"], + }; +} + +export function _diskAccessPropertiesSerializer(_item: DiskAccess): any { + return {}; +} + +export function _diskAccessPropertiesDeserializer(item: any) { + return { + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + provisioningState: item["provisioningState"], + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + }; +} + +export function _privateLinkResourcePropertiesDeserializer(item: any) { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +export function _diskEncryptionSetPropertiesSerializer(item: DiskEncryptionSet): any { + return { + encryptionType: item["encryptionType"], + activeKey: !item["activeKey"] + ? item["activeKey"] + : keyForDiskEncryptionSetSerializer(item["activeKey"]), + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + federatedClientId: item["federatedClientId"], + }; +} + +export function _diskEncryptionSetPropertiesDeserializer(item: any) { + return { + encryptionType: item["encryptionType"], + activeKey: !item["activeKey"] + ? item["activeKey"] + : keyForDiskEncryptionSetDeserializer(item["activeKey"]), + previousKeys: !item["previousKeys"] + ? item["previousKeys"] + : keyForDiskEncryptionSetArrayDeserializer(item["previousKeys"]), + provisioningState: item["provisioningState"], + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + lastKeyRotationTimestamp: !item["lastKeyRotationTimestamp"] + ? item["lastKeyRotationTimestamp"] + : new Date(item["lastKeyRotationTimestamp"]), + autoKeyRotationError: !item["autoKeyRotationError"] + ? item["autoKeyRotationError"] + : apiErrorDeserializer(item["autoKeyRotationError"]), + federatedClientId: item["federatedClientId"], + }; +} + +export function _diskEncryptionSetUpdatePropertiesSerializer(item: DiskEncryptionSetUpdate): any { + return { + encryptionType: item["encryptionType"], + activeKey: !item["activeKey"] + ? item["activeKey"] + : keyForDiskEncryptionSetSerializer(item["activeKey"]), + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + federatedClientId: item["federatedClientId"], + }; +} + +export function _snapshotPropertiesSerializer(item: Snapshot): any { + return { + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanSerializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + creationData: !item["creationData"] + ? item["creationData"] + : creationDataSerializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + incremental: item["incremental"], + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileSerializer(item["securityProfile"]), + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + completionPercent: item["completionPercent"], + copyCompletionError: !item["copyCompletionError"] + ? item["copyCompletionError"] + : copyCompletionErrorSerializer(item["copyCompletionError"]), + dataAccessAuthMode: item["dataAccessAuthMode"], + }; +} + +export function _snapshotPropertiesDeserializer(item: any) { + return { + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanDeserializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesDeserializer(item["supportedCapabilities"]), + creationData: !item["creationData"] + ? item["creationData"] + : creationDataDeserializer(item["creationData"]), + diskSizeGB: item["diskSizeGB"], + diskSizeBytes: item["diskSizeBytes"], + diskState: item["diskState"], + uniqueId: item["uniqueId"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionDeserializer(item["encryptionSettingsCollection"]), + provisioningState: item["provisioningState"], + incremental: item["incremental"], + incrementalSnapshotFamilyId: item["incrementalSnapshotFamilyId"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionDeserializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileDeserializer(item["securityProfile"]), + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + completionPercent: item["completionPercent"], + copyCompletionError: !item["copyCompletionError"] + ? item["copyCompletionError"] + : copyCompletionErrorDeserializer(item["copyCompletionError"]), + dataAccessAuthMode: item["dataAccessAuthMode"], + snapshotAccessState: item["snapshotAccessState"], + }; +} + +export function _snapshotUpdatePropertiesSerializer(item: SnapshotUpdate): any { + return { + osType: item["osType"], + diskSizeGB: item["diskSizeGB"], + encryptionSettingsCollection: !item["encryptionSettingsCollection"] + ? item["encryptionSettingsCollection"] + : encryptionSettingsCollectionSerializer(item["encryptionSettingsCollection"]), + encryption: !item["encryption"] ? item["encryption"] : encryptionSerializer(item["encryption"]), + networkAccessPolicy: item["networkAccessPolicy"], + diskAccessId: item["diskAccessId"], + supportsHibernation: item["supportsHibernation"], + publicNetworkAccess: item["publicNetworkAccess"], + dataAccessAuthMode: item["dataAccessAuthMode"], + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesSerializer(item["supportedCapabilities"]), + }; +} + +export function _diskRestorePointPropertiesDeserializer(item: any) { + return { + timeCreated: !item["timeCreated"] ? item["timeCreated"] : new Date(item["timeCreated"]), + sourceResourceId: item["sourceResourceId"], + osType: item["osType"], + hyperVGeneration: item["hyperVGeneration"], + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : diskPurchasePlanDeserializer(item["purchasePlan"]), + supportedCapabilities: !item["supportedCapabilities"] + ? item["supportedCapabilities"] + : supportedCapabilitiesDeserializer(item["supportedCapabilities"]), + familyId: item["familyId"], + sourceUniqueId: item["sourceUniqueId"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionDeserializer(item["encryption"]), + supportsHibernation: item["supportsHibernation"], + networkAccessPolicy: item["networkAccessPolicy"], + publicNetworkAccess: item["publicNetworkAccess"], + diskAccessId: item["diskAccessId"], + completionPercent: item["completionPercent"], + replicationState: item["replicationState"], + sourceResourceLocation: item["sourceResourceLocation"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : diskSecurityProfileDeserializer(item["securityProfile"]), + logicalSectorSize: item["logicalSectorSize"], + }; +} diff --git a/sdk/compute/arm-compute/src/models/computeGallery/index.ts b/sdk/compute/arm-compute/src/models/computeGallery/index.ts new file mode 100644 index 000000000000..303d31bfcdd5 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/computeGallery/index.ts @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + Gallery, + GalleryProperties, + GalleryIdentifier, + GalleryProvisioningState, + SharingProfile, + GallerySharingPermissionTypes, + SharingProfileGroup, + SharingProfileGroupTypes, + CommunityGalleryInfo, + SoftDeletePolicy, + SharingStatus, + SharingState, + RegionalSharingStatus, + GalleryIdentity, + GalleryUpdate, + UpdateResourceDefinition, + ImageVersionSecurityProfile, + GalleryImageVersionUefiSettings, + UefiSignatureTemplateName, + UefiKeySignatures, + UefiKey, + UefiKeyType, + GalleryImage, + GalleryImageProperties, + GalleryImageIdentifier, + RecommendedMachineConfiguration, + ResourceRange, + Disallowed, + ImagePurchasePlan, + GalleryImageFeature, + GalleryImageUpdate, + GalleryImageVersion, + GalleryImageVersionProperties, + GalleryImageVersionPublishingProfile, + GalleryImageVersionStorageProfile, + GalleryArtifactVersionFullSource, + GalleryOSDiskImage, + GalleryDataDiskImage, + GalleryImageVersionSafetyProfile, + PolicyViolation, + PolicyViolationCategory, + ReplicationStatus, + AggregatedReplicationState, + RegionalReplicationStatus, + ReplicationState, + ValidationsProfile, + ExecutedValidation, + ValidationStatus, + PlatformAttribute, + GalleryArtifactPublishingProfileBase, + TargetRegion, + StorageAccountType, + EncryptionImages, + OSDiskImageEncryption, + OSDiskImageSecurityProfile, + ConfidentialVMEncryptionType, + DataDiskImageEncryption, + AdditionalReplicaSet, + ReplicationMode, + GalleryTargetExtendedLocation, + GalleryExtendedLocation, + GalleryExtendedLocationType, + EdgeZoneStorageAccountType, + StorageAccountStrategy, + DiskImageEncryption, + GalleryArtifactVersionSource, + GalleryDiskImage, + HostCaching, + GalleryDiskImageSource, + GalleryArtifactSafetyProfileBase, + GalleryImageVersionUpdate, + GalleryApplication, + GalleryApplicationProperties, + GalleryApplicationCustomAction, + GalleryApplicationCustomActionParameter, + GalleryApplicationCustomActionParameterType, + GalleryApplicationUpdate, + GalleryApplicationVersion, + GalleryApplicationVersionProperties, + GalleryApplicationVersionPublishingProfile, + UserArtifactSource, + UserArtifactManage, + UserArtifactSettings, + GalleryApplicationScriptRebootBehavior, + GalleryApplicationVersionSafetyProfile, + GalleryApplicationVersionUpdate, + GalleryScript, + GalleryScriptProperties, + GalleryScriptUpdate, + GalleryScriptVersion, + GalleryScriptVersionProperties, + GalleryScriptVersionPublishingProfile, + ScriptSource, + GalleryScriptParameter, + GalleryScriptParameterType, + GalleryScriptVersionSafetyProfile, + GenericGalleryParameter, + GalleryScriptVersionUpdate, + GalleryInVMAccessControlProfile, + GalleryInVMAccessControlProfileProperties, + EndpointTypes, + GalleryResourceProfilePropertiesBase, + GalleryInVMAccessControlProfileUpdate, + GalleryInVMAccessControlProfileVersion, + GalleryInVMAccessControlProfileVersionProperties, + AccessControlRulesMode, + EndpointAccess, + AccessControlRules, + AccessControlRulesPrivilege, + AccessControlRulesRole, + AccessControlRulesIdentity, + AccessControlRulesRoleAssignment, + GalleryResourceProfileVersionPropertiesBase, + GalleryInVMAccessControlProfileVersionUpdate, + SharedGallery, + SharedGalleryProperties, + PirSharedGalleryResource, + SharedGalleryIdentifier, + PirResource, + SharedGalleryImage, + SharedGalleryImageProperties, + SharedGalleryImageVersion, + SharedGalleryImageVersionProperties, + SharedGalleryImageVersionStorageProfile, + SharedGalleryOSDiskImage, + SharedGalleryDataDiskImage, + SharedGalleryDiskImage, + SharedGalleryHostCaching, + CommunityGallery, + CommunityGalleryProperties, + CommunityGalleryMetadata, + PirCommunityGalleryResource, + CommunityGalleryIdentifier, + CommunityGalleryImage, + CommunityGalleryImageProperties, + CommunityGalleryImageIdentifier, + CommunityGalleryImageVersion, + CommunityGalleryImageVersionProperties, + GallerySoftDeletedResource, + GallerySoftDeletedResourceProperties, + SoftDeletedArtifactTypes, + SharingUpdate, + SharingUpdateOperationTypes, + SelectPermissions, + GalleryExpandParams, + ReplicationStatusTypes, + SharedToValues, +} from "./models.js"; +export { + KnownGalleryProvisioningState, + KnownGallerySharingPermissionTypes, + KnownSharingProfileGroupTypes, + KnownSharingState, + KnownUefiSignatureTemplateName, + KnownUefiKeyType, + KnownPolicyViolationCategory, + KnownAggregatedReplicationState, + KnownReplicationState, + KnownValidationStatus, + KnownStorageAccountType, + KnownConfidentialVMEncryptionType, + KnownReplicationMode, + KnownGalleryExtendedLocationType, + KnownEdgeZoneStorageAccountType, + KnownStorageAccountStrategy, + KnownGalleryApplicationScriptRebootBehavior, + KnownGalleryScriptParameterType, + KnownAccessControlRulesMode, + KnownEndpointAccess, + KnownSharedGalleryHostCaching, + KnownSoftDeletedArtifactTypes, + KnownSharingUpdateOperationTypes, + KnownSelectPermissions, + KnownGalleryExpandParams, + KnownReplicationStatusTypes, + KnownSharedToValues, +} from "./models.js"; diff --git a/sdk/compute/arm-compute/src/models/computeGallery/models.ts b/sdk/compute/arm-compute/src/models/computeGallery/models.ts new file mode 100644 index 000000000000..c54ccf71447f --- /dev/null +++ b/sdk/compute/arm-compute/src/models/computeGallery/models.ts @@ -0,0 +1,5534 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { areAllPropsUndefined } from "../../static-helpers/serialization/check-prop-undefined.js"; +import type { + OperatingSystemTypes, + ResourceIdentityType, + UserAssignedIdentitiesValue, + OperatingSystemStateTypes, + HyperVGeneration, + Architecture, +} from "../common/models.js"; +import { + userAssignedIdentitiesValueRecordSerializer, + userAssignedIdentitiesValueRecordDeserializer, +} from "../common/models.js"; +import type { TrackedResource } from "../models.js"; +import { systemDataDeserializer } from "../models.js"; + +/** + * 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 */ +/** Specifies information about the Shared Image Gallery that you want to create or update. */ +export interface Gallery extends TrackedResource { + /** The identity of the gallery, if configured. */ + identity?: GalleryIdentity; + /** The description of this Shared Image Gallery resource. This property is updatable. */ + description?: string; + /** Describes the gallery unique name. */ + identifier?: GalleryIdentifier; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** Profile for gallery sharing to subscription or tenant */ + sharingProfile?: SharingProfile; + /** Contains information about the soft deletion policy of the gallery. */ + softDeletePolicy?: SoftDeletePolicy; + /** Sharing status of current gallery. */ + readonly sharingStatus?: SharingStatus; +} + +export function gallerySerializer(item: Gallery): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "description", + "identifier", + "sharingProfile", + "softDeletePolicy", + ]) + ? undefined + : _galleryPropertiesSerializer(item), + identity: !item["identity"] ? item["identity"] : galleryIdentitySerializer(item["identity"]), + }; +} + +export function galleryDeserializer(item: any): Gallery { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _galleryPropertiesDeserializer(item["properties"])), + identity: !item["identity"] ? item["identity"] : galleryIdentityDeserializer(item["identity"]), + }; +} + +/** Describes the properties of a Shared Image Gallery. */ +export interface GalleryProperties { + /** The description of this Shared Image Gallery resource. This property is updatable. */ + description?: string; + /** Describes the gallery unique name. */ + identifier?: GalleryIdentifier; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** Profile for gallery sharing to subscription or tenant */ + sharingProfile?: SharingProfile; + /** Contains information about the soft deletion policy of the gallery. */ + softDeletePolicy?: SoftDeletePolicy; + /** Sharing status of current gallery. */ + readonly sharingStatus?: SharingStatus; +} + +export function galleryPropertiesSerializer(item: GalleryProperties): any { + return { + description: item["description"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryIdentifierSerializer(item["identifier"]), + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : sharingProfileSerializer(item["sharingProfile"]), + softDeletePolicy: !item["softDeletePolicy"] + ? item["softDeletePolicy"] + : softDeletePolicySerializer(item["softDeletePolicy"]), + }; +} + +export function galleryPropertiesDeserializer(item: any): GalleryProperties { + return { + description: item["description"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryIdentifierDeserializer(item["identifier"]), + provisioningState: item["provisioningState"], + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : sharingProfileDeserializer(item["sharingProfile"]), + softDeletePolicy: !item["softDeletePolicy"] + ? item["softDeletePolicy"] + : softDeletePolicyDeserializer(item["softDeletePolicy"]), + sharingStatus: !item["sharingStatus"] + ? item["sharingStatus"] + : sharingStatusDeserializer(item["sharingStatus"]), + }; +} + +/** Describes the gallery unique name. */ +export interface GalleryIdentifier { + /** The unique name of the Shared Image Gallery. This name is generated automatically by Azure. */ + readonly uniqueName?: string; +} + +export function galleryIdentifierSerializer(_item: GalleryIdentifier): any { + return {}; +} + +export function galleryIdentifierDeserializer(item: any): GalleryIdentifier { + return { + uniqueName: item["uniqueName"], + }; +} + +/** The provisioning state, which only appears in the response. */ +export enum KnownGalleryProvisioningState { + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Migrating */ + Migrating = "Migrating", +} + +/** + * The provisioning state, which only appears in the response. \ + * {@link KnownGalleryProvisioningState} can be used interchangeably with GalleryProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating** \ + * **Updating** \ + * **Failed** \ + * **Succeeded** \ + * **Deleting** \ + * **Migrating** + */ +export type GalleryProvisioningState = string; + +/** Profile for gallery sharing to subscription or tenant */ +export interface SharingProfile { + /** This property allows you to specify the permission of sharing gallery. Possible values are: **Private,** **Groups,** **Community.** */ + permissions?: GallerySharingPermissionTypes; + /** A list of sharing profile groups. */ + readonly groups?: SharingProfileGroup[]; + /** Information of community gallery if current gallery is shared to community. */ + communityGalleryInfo?: CommunityGalleryInfo; +} + +export function sharingProfileSerializer(item: SharingProfile): any { + return { + permissions: item["permissions"], + communityGalleryInfo: !item["communityGalleryInfo"] + ? item["communityGalleryInfo"] + : communityGalleryInfoSerializer(item["communityGalleryInfo"]), + }; +} + +export function sharingProfileDeserializer(item: any): SharingProfile { + return { + permissions: item["permissions"], + groups: !item["groups"] ? item["groups"] : sharingProfileGroupArrayDeserializer(item["groups"]), + communityGalleryInfo: !item["communityGalleryInfo"] + ? item["communityGalleryInfo"] + : communityGalleryInfoDeserializer(item["communityGalleryInfo"]), + }; +} + +/** This property allows you to specify the permission of sharing gallery. Possible values are: **Private,** **Groups,** **Community.** */ +export enum KnownGallerySharingPermissionTypes { + /** Private */ + Private = "Private", + /** Groups */ + Groups = "Groups", + /** Community */ + Community = "Community", +} + +/** + * This property allows you to specify the permission of sharing gallery. Possible values are: **Private,** **Groups,** **Community.** \ + * {@link KnownGallerySharingPermissionTypes} can be used interchangeably with GallerySharingPermissionTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Private** \ + * **Groups** \ + * **Community** + */ +export type GallerySharingPermissionTypes = string; + +export function sharingProfileGroupArraySerializer(result: Array): any[] { + return result.map((item) => { + return sharingProfileGroupSerializer(item); + }); +} + +export function sharingProfileGroupArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return sharingProfileGroupDeserializer(item); + }); +} + +/** Group of the gallery sharing profile */ +export interface SharingProfileGroup { + /** This property allows you to specify the type of sharing group. Possible values are: **Subscriptions,** **AADTenants.** */ + type?: SharingProfileGroupTypes; + /** A list of subscription/tenant ids the gallery is aimed to be shared to. */ + ids?: string[]; +} + +export function sharingProfileGroupSerializer(item: SharingProfileGroup): any { + return { + type: item["type"], + ids: !item["ids"] + ? item["ids"] + : item["ids"].map((p: any) => { + return p; + }), + }; +} + +export function sharingProfileGroupDeserializer(item: any): SharingProfileGroup { + return { + type: item["type"], + ids: !item["ids"] + ? item["ids"] + : item["ids"].map((p: any) => { + return p; + }), + }; +} + +/** This property allows you to specify the type of sharing group. Possible values are: **Subscriptions,** **AADTenants.** */ +export enum KnownSharingProfileGroupTypes { + /** Subscriptions */ + Subscriptions = "Subscriptions", + /** AADTenants */ + AADTenants = "AADTenants", +} + +/** + * This property allows you to specify the type of sharing group. Possible values are: **Subscriptions,** **AADTenants.** \ + * {@link KnownSharingProfileGroupTypes} can be used interchangeably with SharingProfileGroupTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Subscriptions** \ + * **AADTenants** + */ +export type SharingProfileGroupTypes = string; + +/** Information of community gallery if current gallery is shared to community */ +export interface CommunityGalleryInfo { + /** The link to the publisher website. Visible to all users. */ + publisherUri?: string; + /** Community gallery publisher support email. The email address of the publisher. Visible to all users. */ + publisherContact?: string; + /** End-user license agreement for community gallery image. */ + eula?: string; + /** The prefix of the gallery name that will be displayed publicly. Visible to all users. */ + publicNamePrefix?: string; + /** Contains info about whether community gallery sharing is enabled. */ + readonly communityGalleryEnabled?: boolean; + /** Community gallery public name list. */ + readonly publicNames?: string[]; +} + +export function communityGalleryInfoSerializer(item: CommunityGalleryInfo): any { + return { + publisherUri: item["publisherUri"], + publisherContact: item["publisherContact"], + eula: item["eula"], + publicNamePrefix: item["publicNamePrefix"], + }; +} + +export function communityGalleryInfoDeserializer(item: any): CommunityGalleryInfo { + return { + publisherUri: item["publisherUri"], + publisherContact: item["publisherContact"], + eula: item["eula"], + publicNamePrefix: item["publicNamePrefix"], + communityGalleryEnabled: item["communityGalleryEnabled"], + publicNames: !item["publicNames"] + ? item["publicNames"] + : item["publicNames"].map((p: any) => { + return p; + }), + }; +} + +/** Contains information about the soft deletion policy of the gallery. */ +export interface SoftDeletePolicy { + /** Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. */ + isSoftDeleteEnabled?: boolean; +} + +export function softDeletePolicySerializer(item: SoftDeletePolicy): any { + return { isSoftDeleteEnabled: item["isSoftDeleteEnabled"] }; +} + +export function softDeletePolicyDeserializer(item: any): SoftDeletePolicy { + return { + isSoftDeleteEnabled: item["isSoftDeleteEnabled"], + }; +} + +/** Sharing status of current gallery. */ +export interface SharingStatus { + /** Aggregated sharing state of current gallery. */ + readonly aggregatedState?: SharingState; + /** Summary of all regional sharing status. */ + summary?: RegionalSharingStatus[]; +} + +export function sharingStatusDeserializer(item: any): SharingStatus { + return { + aggregatedState: item["aggregatedState"], + summary: !item["summary"] + ? item["summary"] + : regionalSharingStatusArrayDeserializer(item["summary"]), + }; +} + +/** The sharing state of the gallery, which only appears in the response. */ +export enum KnownSharingState { + /** Succeeded */ + Succeeded = "Succeeded", + /** InProgress */ + InProgress = "InProgress", + /** Failed */ + Failed = "Failed", + /** Unknown */ + Unknown = "Unknown", +} + +/** + * The sharing state of the gallery, which only appears in the response. \ + * {@link KnownSharingState} can be used interchangeably with SharingState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **InProgress** \ + * **Failed** \ + * **Unknown** + */ +export type SharingState = string; + +export function regionalSharingStatusArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return regionalSharingStatusDeserializer(item); + }); +} + +/** Gallery regional sharing status */ +export interface RegionalSharingStatus { + /** Region name */ + region?: string; + /** Gallery sharing state in current region */ + readonly state?: SharingState; + /** Details of gallery regional sharing failure. */ + details?: string; +} + +export function regionalSharingStatusDeserializer(item: any): RegionalSharingStatus { + return { + region: item["region"], + state: item["state"], + details: item["details"], + }; +} + +/** Identity for the virtual machine. */ +export interface GalleryIdentity { + /** The principal id of the gallery identity. This property will only be provided for a system assigned identity. */ + readonly principalId?: string; + /** The AAD tenant id of the gallery identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of identity used for the gallery. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove all identities from the gallery. */ + type?: ResourceIdentityType; + /** The list of user identities associated with the gallery. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: Record; +} + +export function galleryIdentitySerializer(item: GalleryIdentity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function galleryIdentityDeserializer(item: any): GalleryIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesValueRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** Specifies information about the Shared Image Gallery that you want to update. */ +export interface GalleryUpdate extends UpdateResourceDefinition { + /** The identity of the gallery, if configured. */ + identity?: GalleryIdentity; + /** The description of this Shared Image Gallery resource. This property is updatable. */ + description?: string; + /** Describes the gallery unique name. */ + identifier?: GalleryIdentifier; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** Profile for gallery sharing to subscription or tenant */ + sharingProfile?: SharingProfile; + /** Contains information about the soft deletion policy of the gallery. */ + softDeletePolicy?: SoftDeletePolicy; + /** Sharing status of current gallery. */ + readonly sharingStatus?: SharingStatus; +} + +export function galleryUpdateSerializer(item: GalleryUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "description", + "identifier", + "sharingProfile", + "softDeletePolicy", + ]) + ? undefined + : _galleryUpdatePropertiesSerializer(item), + identity: !item["identity"] ? item["identity"] : galleryIdentitySerializer(item["identity"]), + }; +} + +/** The Update Resource model definition. */ +export interface UpdateResourceDefinition { + /** Resource Id */ + readonly id?: string; + /** Resource name */ + readonly name?: string; + /** Resource type */ + readonly type?: string; + /** Resource tags */ + tags?: Record; +} + +export function updateResourceDefinitionSerializer(item: UpdateResourceDefinition): any { + return { tags: item["tags"] }; +} + +/** The List Galleries operation response. */ +export interface _GalleryList { + /** A list of galleries. */ + value: Gallery[]; + /** The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. */ + nextLink?: string; + /** The security profile of a gallery image version */ + securityProfile?: ImageVersionSecurityProfile; +} + +export function _galleryListDeserializer(item: any): _GalleryList { + return { + value: galleryArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : imageVersionSecurityProfileDeserializer(item["securityProfile"]), + }; +} + +export function galleryArraySerializer(result: Array): any[] { + return result.map((item) => { + return gallerySerializer(item); + }); +} + +export function galleryArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryDeserializer(item); + }); +} + +/** The security profile of a gallery image version */ +export interface ImageVersionSecurityProfile { + /** Contains UEFI settings for the image version. */ + uefiSettings?: GalleryImageVersionUefiSettings; +} + +export function imageVersionSecurityProfileSerializer(item: ImageVersionSecurityProfile): any { + return { + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : galleryImageVersionUefiSettingsSerializer(item["uefiSettings"]), + }; +} + +export function imageVersionSecurityProfileDeserializer(item: any): ImageVersionSecurityProfile { + return { + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : galleryImageVersionUefiSettingsDeserializer(item["uefiSettings"]), + }; +} + +/** Contains UEFI settings for the image version. */ +export interface GalleryImageVersionUefiSettings { + /** The name of the template(s) that contains default UEFI key signatures that will be added to the image. */ + signatureTemplateNames?: UefiSignatureTemplateName[]; + /** Additional UEFI key signatures that will be added to the image in addition to the signature templates */ + additionalSignatures?: UefiKeySignatures; +} + +export function galleryImageVersionUefiSettingsSerializer( + item: GalleryImageVersionUefiSettings, +): any { + return { + signatureTemplateNames: !item["signatureTemplateNames"] + ? item["signatureTemplateNames"] + : item["signatureTemplateNames"].map((p: any) => { + return p; + }), + additionalSignatures: !item["additionalSignatures"] + ? item["additionalSignatures"] + : uefiKeySignaturesSerializer(item["additionalSignatures"]), + }; +} + +export function galleryImageVersionUefiSettingsDeserializer( + item: any, +): GalleryImageVersionUefiSettings { + return { + signatureTemplateNames: !item["signatureTemplateNames"] + ? item["signatureTemplateNames"] + : item["signatureTemplateNames"].map((p: any) => { + return p; + }), + additionalSignatures: !item["additionalSignatures"] + ? item["additionalSignatures"] + : uefiKeySignaturesDeserializer(item["additionalSignatures"]), + }; +} + +/** The name of the signature template that contains default UEFI keys. */ +export enum KnownUefiSignatureTemplateName { + /** NoSignatureTemplate */ + NoSignatureTemplate = "NoSignatureTemplate", + /** MicrosoftUefiCertificateAuthorityTemplate */ + MicrosoftUefiCertificateAuthorityTemplate = "MicrosoftUefiCertificateAuthorityTemplate", + /** MicrosoftWindowsTemplate */ + MicrosoftWindowsTemplate = "MicrosoftWindowsTemplate", +} + +/** + * The name of the signature template that contains default UEFI keys. \ + * {@link KnownUefiSignatureTemplateName} can be used interchangeably with UefiSignatureTemplateName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NoSignatureTemplate** \ + * **MicrosoftUefiCertificateAuthorityTemplate** \ + * **MicrosoftWindowsTemplate** + */ +export type UefiSignatureTemplateName = string; + +/** Additional UEFI key signatures that will be added to the image in addition to the signature templates */ +export interface UefiKeySignatures { + /** The Platform Key of this image version. */ + pk?: UefiKey; + /** The Key Encryption Keys of this image version. */ + kek?: UefiKey[]; + /** The database of UEFI keys for this image version. */ + db?: UefiKey[]; + /** The database of revoked UEFI keys for this image version. */ + dbx?: UefiKey[]; +} + +export function uefiKeySignaturesSerializer(item: UefiKeySignatures): any { + return { + pk: !item["pk"] ? item["pk"] : uefiKeySerializer(item["pk"]), + kek: !item["kek"] ? item["kek"] : uefiKeyArraySerializer(item["kek"]), + db: !item["db"] ? item["db"] : uefiKeyArraySerializer(item["db"]), + dbx: !item["dbx"] ? item["dbx"] : uefiKeyArraySerializer(item["dbx"]), + }; +} + +export function uefiKeySignaturesDeserializer(item: any): UefiKeySignatures { + return { + pk: !item["pk"] ? item["pk"] : uefiKeyDeserializer(item["pk"]), + kek: !item["kek"] ? item["kek"] : uefiKeyArrayDeserializer(item["kek"]), + db: !item["db"] ? item["db"] : uefiKeyArrayDeserializer(item["db"]), + dbx: !item["dbx"] ? item["dbx"] : uefiKeyArrayDeserializer(item["dbx"]), + }; +} + +/** A UEFI key signature. */ +export interface UefiKey { + /** The type of key signature. */ + type?: UefiKeyType; + /** The value of the key signature. */ + value?: string[]; +} + +export function uefiKeySerializer(item: UefiKey): any { + return { + type: item["type"], + value: !item["value"] + ? item["value"] + : item["value"].map((p: any) => { + return p; + }), + }; +} + +export function uefiKeyDeserializer(item: any): UefiKey { + return { + type: item["type"], + value: !item["value"] + ? item["value"] + : item["value"].map((p: any) => { + return p; + }), + }; +} + +/** The type of key signature. */ +export enum KnownUefiKeyType { + /** sha256 */ + Sha256 = "sha256", + /** x509 */ + X509 = "x509", +} + +/** + * The type of key signature. \ + * {@link KnownUefiKeyType} can be used interchangeably with UefiKeyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **sha256** \ + * **x509** + */ +export type UefiKeyType = string; + +export function uefiKeyArraySerializer(result: Array): any[] { + return result.map((item) => { + return uefiKeySerializer(item); + }); +} + +export function uefiKeyArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return uefiKeyDeserializer(item); + }); +} + +/** Specifies information about the gallery image definition that you want to create or update. */ +export interface GalleryImage extends TrackedResource { + /** The description of this gallery image definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement for the gallery image definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ + osType?: OperatingSystemTypes; + /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ + osState?: OperatingSystemStateTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This is the gallery image definition identifier. */ + identifier?: GalleryImageIdentifier; + /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ + recommended?: RecommendedMachineConfiguration; + /** Describes the disallowed disk types. */ + disallowed?: Disallowed; + /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ + purchasePlan?: ImagePurchasePlan; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** A list of gallery image features. */ + features?: GalleryImageFeature[]; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; + /** Optional. Must be set to true if the gallery image features are being updated. */ + allowUpdateImage?: boolean; +} + +export function galleryImageSerializer(item: GalleryImage): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "description", + "eula", + "privacyStatementUri", + "releaseNoteUri", + "osType", + "osState", + "hyperVGeneration", + "endOfLifeDate", + "identifier", + "recommended", + "disallowed", + "purchasePlan", + "features", + "architecture", + "allowUpdateImage", + ]) + ? undefined + : _galleryImagePropertiesSerializer(item), + }; +} + +export function galleryImageDeserializer(item: any): GalleryImage { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _galleryImagePropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery image definition. */ +export interface GalleryImageProperties { + /** The description of this gallery image definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement for the gallery image definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ + osType: OperatingSystemTypes; + /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ + osState: OperatingSystemStateTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This is the gallery image definition identifier. */ + identifier: GalleryImageIdentifier; + /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ + recommended?: RecommendedMachineConfiguration; + /** Describes the disallowed disk types. */ + disallowed?: Disallowed; + /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ + purchasePlan?: ImagePurchasePlan; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** A list of gallery image features. */ + features?: GalleryImageFeature[]; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; + /** Optional. Must be set to true if the gallery image features are being updated. */ + allowUpdateImage?: boolean; +} + +export function galleryImagePropertiesSerializer(item: GalleryImageProperties): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + osType: item["osType"], + osState: item["osState"], + hyperVGeneration: item["hyperVGeneration"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + identifier: galleryImageIdentifierSerializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationSerializer(item["recommended"]), + disallowed: !item["disallowed"] ? item["disallowed"] : disallowedSerializer(item["disallowed"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanSerializer(item["purchasePlan"]), + features: !item["features"] + ? item["features"] + : galleryImageFeatureArraySerializer(item["features"]), + architecture: item["architecture"], + allowUpdateImage: item["allowUpdateImage"], + }; +} + +export function galleryImagePropertiesDeserializer(item: any): GalleryImageProperties { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + osType: item["osType"], + osState: item["osState"], + hyperVGeneration: item["hyperVGeneration"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + identifier: galleryImageIdentifierDeserializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationDeserializer(item["recommended"]), + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedDeserializer(item["disallowed"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanDeserializer(item["purchasePlan"]), + provisioningState: item["provisioningState"], + features: !item["features"] + ? item["features"] + : galleryImageFeatureArrayDeserializer(item["features"]), + architecture: item["architecture"], + allowUpdateImage: item["allowUpdateImage"], + }; +} + +/** This is the gallery image definition identifier. */ +export interface GalleryImageIdentifier { + /** The name of the gallery image definition publisher. */ + publisher: string; + /** The name of the gallery image definition offer. */ + offer: string; + /** The name of the gallery image definition SKU. */ + sku: string; +} + +export function galleryImageIdentifierSerializer(item: GalleryImageIdentifier): any { + return { publisher: item["publisher"], offer: item["offer"], sku: item["sku"] }; +} + +export function galleryImageIdentifierDeserializer(item: any): GalleryImageIdentifier { + return { + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + }; +} + +/** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ +export interface RecommendedMachineConfiguration { + /** Describes the resource range. */ + vCPUs?: ResourceRange; + /** Describes the resource range. */ + memory?: ResourceRange; +} + +export function recommendedMachineConfigurationSerializer( + item: RecommendedMachineConfiguration, +): any { + return { + vCPUs: !item["vCPUs"] ? item["vCPUs"] : resourceRangeSerializer(item["vCPUs"]), + memory: !item["memory"] ? item["memory"] : resourceRangeSerializer(item["memory"]), + }; +} + +export function recommendedMachineConfigurationDeserializer( + item: any, +): RecommendedMachineConfiguration { + return { + vCPUs: !item["vCPUs"] ? item["vCPUs"] : resourceRangeDeserializer(item["vCPUs"]), + memory: !item["memory"] ? item["memory"] : resourceRangeDeserializer(item["memory"]), + }; +} + +/** Describes the resource range. */ +export interface ResourceRange { + /** The minimum number of the resource. */ + min?: number; + /** The maximum number of the resource. */ + max?: number; +} + +export function resourceRangeSerializer(item: ResourceRange): any { + return { min: item["min"], max: item["max"] }; +} + +export function resourceRangeDeserializer(item: any): ResourceRange { + return { + min: item["min"], + max: item["max"], + }; +} + +/** Describes the disallowed disk types. */ +export interface Disallowed { + /** A list of disk types. */ + diskTypes?: string[]; +} + +export function disallowedSerializer(item: Disallowed): any { + return { + diskTypes: !item["diskTypes"] + ? item["diskTypes"] + : item["diskTypes"].map((p: any) => { + return p; + }), + }; +} + +export function disallowedDeserializer(item: any): Disallowed { + return { + diskTypes: !item["diskTypes"] + ? item["diskTypes"] + : item["diskTypes"].map((p: any) => { + return p; + }), + }; +} + +/** Describes the gallery image definition purchase plan. This is used by marketplace images. */ +export interface ImagePurchasePlan { + /** The plan ID. */ + name?: string; + /** The publisher ID. */ + publisher?: string; + /** The product ID. */ + product?: string; +} + +export function imagePurchasePlanSerializer(item: ImagePurchasePlan): any { + return { name: item["name"], publisher: item["publisher"], product: item["product"] }; +} + +export function imagePurchasePlanDeserializer(item: any): ImagePurchasePlan { + return { + name: item["name"], + publisher: item["publisher"], + product: item["product"], + }; +} + +export function galleryImageFeatureArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryImageFeatureSerializer(item); + }); +} + +export function galleryImageFeatureArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryImageFeatureDeserializer(item); + }); +} + +/** A feature for gallery image. */ +export interface GalleryImageFeature { + /** The name of the gallery image feature. */ + name?: string; + /** The value of the gallery image feature. */ + value?: string; + /** The minimum gallery image version which supports this feature. */ + startsAtVersion?: string; +} + +export function galleryImageFeatureSerializer(item: GalleryImageFeature): any { + return { name: item["name"], value: item["value"], startsAtVersion: item["startsAtVersion"] }; +} + +export function galleryImageFeatureDeserializer(item: any): GalleryImageFeature { + return { + name: item["name"], + value: item["value"], + startsAtVersion: item["startsAtVersion"], + }; +} + +/** Specifies information about the gallery image definition that you want to update. */ +export interface GalleryImageUpdate extends UpdateResourceDefinition { + /** The description of this gallery image definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement for the gallery image definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ + osType?: OperatingSystemTypes; + /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ + osState?: OperatingSystemStateTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This is the gallery image definition identifier. */ + identifier?: GalleryImageIdentifier; + /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ + recommended?: RecommendedMachineConfiguration; + /** Describes the disallowed disk types. */ + disallowed?: Disallowed; + /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ + purchasePlan?: ImagePurchasePlan; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** A list of gallery image features. */ + features?: GalleryImageFeature[]; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; + /** Optional. Must be set to true if the gallery image features are being updated. */ + allowUpdateImage?: boolean; +} + +export function galleryImageUpdateSerializer(item: GalleryImageUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "description", + "eula", + "privacyStatementUri", + "releaseNoteUri", + "osType", + "osState", + "hyperVGeneration", + "endOfLifeDate", + "identifier", + "recommended", + "disallowed", + "purchasePlan", + "features", + "architecture", + "allowUpdateImage", + ]) + ? undefined + : _galleryImageUpdatePropertiesSerializer(item), + }; +} + +/** The List Gallery Images operation response. */ +export interface _GalleryImageList { + /** A list of Shared Image Gallery images. */ + value: GalleryImage[]; + /** The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. */ + nextLink?: string; +} + +export function _galleryImageListDeserializer(item: any): _GalleryImageList { + return { + value: galleryImageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryImageArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryImageSerializer(item); + }); +} + +export function galleryImageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryImageDeserializer(item); + }); +} + +/** Specifies information about the gallery image version that you want to create or update. */ +export interface GalleryImageVersion extends TrackedResource { + /** The publishing profile of a gallery image Version. */ + publishingProfile?: GalleryImageVersionPublishingProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the storage profile of a Gallery Image Version. */ + storageProfile?: GalleryImageVersionStorageProfile; + /** This is the safety profile of the Gallery Image Version. */ + safetyProfile?: GalleryImageVersionSafetyProfile; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; + /** The security profile of a gallery image version */ + securityProfile?: ImageVersionSecurityProfile; + /** Indicates if this is a soft-delete resource restoration request. */ + restore?: boolean; + /** This is the validations profile of a Gallery Image Version. */ + readonly validationsProfile?: ValidationsProfile; +} + +export function galleryImageVersionSerializer(item: GalleryImageVersion): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "publishingProfile", + "storageProfile", + "safetyProfile", + "securityProfile", + "restore", + ]) + ? undefined + : _galleryImageVersionPropertiesSerializer(item), + }; +} + +export function galleryImageVersionDeserializer(item: any): GalleryImageVersion { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _galleryImageVersionPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery image version. */ +export interface GalleryImageVersionProperties { + /** The publishing profile of a gallery image Version. */ + publishingProfile?: GalleryImageVersionPublishingProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the storage profile of a Gallery Image Version. */ + storageProfile: GalleryImageVersionStorageProfile; + /** This is the safety profile of the Gallery Image Version. */ + safetyProfile?: GalleryImageVersionSafetyProfile; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; + /** The security profile of a gallery image version */ + securityProfile?: ImageVersionSecurityProfile; + /** Indicates if this is a soft-delete resource restoration request. */ + restore?: boolean; + /** This is the validations profile of a Gallery Image Version. */ + readonly validationsProfile?: ValidationsProfile; +} + +export function galleryImageVersionPropertiesSerializer(item: GalleryImageVersionProperties): any { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryImageVersionPublishingProfileSerializer(item["publishingProfile"]), + storageProfile: galleryImageVersionStorageProfileSerializer(item["storageProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryImageVersionSafetyProfileSerializer(item["safetyProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : imageVersionSecurityProfileSerializer(item["securityProfile"]), + restore: item["restore"], + }; +} + +export function galleryImageVersionPropertiesDeserializer( + item: any, +): GalleryImageVersionProperties { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryImageVersionPublishingProfileDeserializer(item["publishingProfile"]), + provisioningState: item["provisioningState"], + storageProfile: galleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryImageVersionSafetyProfileDeserializer(item["safetyProfile"]), + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : imageVersionSecurityProfileDeserializer(item["securityProfile"]), + restore: item["restore"], + validationsProfile: !item["validationsProfile"] + ? item["validationsProfile"] + : validationsProfileDeserializer(item["validationsProfile"]), + }; +} + +/** The publishing profile of a gallery image Version. */ +export interface GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase {} + +export function galleryImageVersionPublishingProfileSerializer( + item: GalleryImageVersionPublishingProfile, +): any { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArraySerializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArraySerializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + }; +} + +export function galleryImageVersionPublishingProfileDeserializer( + item: any, +): GalleryImageVersionPublishingProfile { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArrayDeserializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArrayDeserializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + }; +} + +/** This is the storage profile of a Gallery Image Version. */ +export interface GalleryImageVersionStorageProfile { + /** The source of the gallery artifact version. */ + source?: GalleryArtifactVersionFullSource; + /** This is the OS disk image. */ + osDiskImage?: GalleryOSDiskImage; + /** A list of data disk images. */ + dataDiskImages?: GalleryDataDiskImage[]; +} + +export function galleryImageVersionStorageProfileSerializer( + item: GalleryImageVersionStorageProfile, +): any { + return { + source: !item["source"] + ? item["source"] + : galleryArtifactVersionFullSourceSerializer(item["source"]), + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : galleryOSDiskImageSerializer(item["osDiskImage"]), + dataDiskImages: !item["dataDiskImages"] + ? item["dataDiskImages"] + : galleryDataDiskImageArraySerializer(item["dataDiskImages"]), + }; +} + +export function galleryImageVersionStorageProfileDeserializer( + item: any, +): GalleryImageVersionStorageProfile { + return { + source: !item["source"] + ? item["source"] + : galleryArtifactVersionFullSourceDeserializer(item["source"]), + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : galleryOSDiskImageDeserializer(item["osDiskImage"]), + dataDiskImages: !item["dataDiskImages"] + ? item["dataDiskImages"] + : galleryDataDiskImageArrayDeserializer(item["dataDiskImages"]), + }; +} + +/** The source of the gallery artifact version. */ +export interface GalleryArtifactVersionFullSource extends GalleryArtifactVersionSource { + /** The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a source. */ + communityGalleryImageId?: string; + /** The resource Id of the source virtual machine. Only required when capturing a virtual machine to source this Gallery Image Version. */ + virtualMachineId?: string; +} + +export function galleryArtifactVersionFullSourceSerializer( + item: GalleryArtifactVersionFullSource, +): any { + return { + id: item["id"], + communityGalleryImageId: item["communityGalleryImageId"], + virtualMachineId: item["virtualMachineId"], + }; +} + +export function galleryArtifactVersionFullSourceDeserializer( + item: any, +): GalleryArtifactVersionFullSource { + return { + id: item["id"], + communityGalleryImageId: item["communityGalleryImageId"], + virtualMachineId: item["virtualMachineId"], + }; +} + +/** This is the OS disk image. */ +export interface GalleryOSDiskImage extends GalleryDiskImage {} + +export function galleryOSDiskImageSerializer(item: GalleryOSDiskImage): any { + return { + hostCaching: item["hostCaching"], + source: !item["source"] ? item["source"] : galleryDiskImageSourceSerializer(item["source"]), + }; +} + +export function galleryOSDiskImageDeserializer(item: any): GalleryOSDiskImage { + return { + sizeInGB: item["sizeInGB"], + hostCaching: item["hostCaching"], + source: !item["source"] ? item["source"] : galleryDiskImageSourceDeserializer(item["source"]), + }; +} + +export function galleryDataDiskImageArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryDataDiskImageSerializer(item); + }); +} + +export function galleryDataDiskImageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryDataDiskImageDeserializer(item); + }); +} + +/** This is the data disk image. */ +export interface GalleryDataDiskImage extends GalleryDiskImage { + /** This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. */ + lun: number; +} + +export function galleryDataDiskImageSerializer(item: GalleryDataDiskImage): any { + return { + hostCaching: item["hostCaching"], + source: !item["source"] ? item["source"] : galleryDiskImageSourceSerializer(item["source"]), + lun: item["lun"], + }; +} + +export function galleryDataDiskImageDeserializer(item: any): GalleryDataDiskImage { + return { + sizeInGB: item["sizeInGB"], + hostCaching: item["hostCaching"], + source: !item["source"] ? item["source"] : galleryDiskImageSourceDeserializer(item["source"]), + lun: item["lun"], + }; +} + +/** This is the safety profile of the Gallery Image Version. */ +export interface GalleryImageVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { + /** Indicates whether this image has been reported as violating Microsoft's policies. */ + readonly reportedForPolicyViolation?: boolean; + /** A list of Policy Violations that have been reported for this Gallery Image Version. */ + readonly policyViolations?: PolicyViolation[]; + /** Indicates whether or not the deletion is blocked for this Gallery Image Version if its End Of Life has not expired. */ + blockDeletionBeforeEndOfLife?: boolean; +} + +export function galleryImageVersionSafetyProfileSerializer( + item: GalleryImageVersionSafetyProfile, +): any { + return { + allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"], + blockDeletionBeforeEndOfLife: item["blockDeletionBeforeEndOfLife"], + }; +} + +export function galleryImageVersionSafetyProfileDeserializer( + item: any, +): GalleryImageVersionSafetyProfile { + return { + allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"], + reportedForPolicyViolation: item["reportedForPolicyViolation"], + policyViolations: !item["policyViolations"] + ? item["policyViolations"] + : policyViolationArrayDeserializer(item["policyViolations"]), + blockDeletionBeforeEndOfLife: item["blockDeletionBeforeEndOfLife"], + }; +} + +export function policyViolationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return policyViolationDeserializer(item); + }); +} + +/** A policy violation reported against a gallery artifact. */ +export interface PolicyViolation { + /** Describes the nature of the policy violation. */ + category?: PolicyViolationCategory; + /** Describes specific details about why this policy violation was reported. */ + details?: string; +} + +export function policyViolationDeserializer(item: any): PolicyViolation { + return { + category: item["category"], + details: item["details"], + }; +} + +/** Describes the nature of the policy violation. */ +export enum KnownPolicyViolationCategory { + /** Other */ + Other = "Other", + /** ImageFlaggedUnsafe */ + ImageFlaggedUnsafe = "ImageFlaggedUnsafe", + /** CopyrightValidation */ + CopyrightValidation = "CopyrightValidation", + /** IpTheft */ + IpTheft = "IpTheft", +} + +/** + * Describes the nature of the policy violation. \ + * {@link KnownPolicyViolationCategory} can be used interchangeably with PolicyViolationCategory, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **ImageFlaggedUnsafe** \ + * **CopyrightValidation** \ + * **IpTheft** + */ +export type PolicyViolationCategory = string; + +/** This is the replication status of the gallery image version. */ +export interface ReplicationStatus { + /** This is the aggregated replication status based on all the regional replication status flags. */ + readonly aggregatedState?: AggregatedReplicationState; + /** This is a summary of replication status for each region. */ + readonly summary?: RegionalReplicationStatus[]; +} + +export function replicationStatusDeserializer(item: any): ReplicationStatus { + return { + aggregatedState: item["aggregatedState"], + summary: !item["summary"] + ? item["summary"] + : regionalReplicationStatusArrayDeserializer(item["summary"]), + }; +} + +/** This is the aggregated replication status based on all the regional replication status flags. */ +export enum KnownAggregatedReplicationState { + /** Unknown */ + Unknown = "Unknown", + /** InProgress */ + InProgress = "InProgress", + /** Completed */ + Completed = "Completed", + /** Failed */ + Failed = "Failed", +} + +/** + * This is the aggregated replication status based on all the regional replication status flags. \ + * {@link KnownAggregatedReplicationState} can be used interchangeably with AggregatedReplicationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **InProgress** \ + * **Completed** \ + * **Failed** + */ +export type AggregatedReplicationState = string; + +export function regionalReplicationStatusArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return regionalReplicationStatusDeserializer(item); + }); +} + +/** This is the regional replication status. */ +export interface RegionalReplicationStatus { + /** The region to which the gallery image version is being replicated to. */ + readonly region?: string; + /** This is the regional replication state. */ + readonly state?: ReplicationState; + /** The details of the replication status. */ + readonly details?: string; + /** It indicates progress of the replication job. */ + readonly progress?: number; +} + +export function regionalReplicationStatusDeserializer(item: any): RegionalReplicationStatus { + return { + region: item["region"], + state: item["state"], + details: item["details"], + progress: item["progress"], + }; +} + +/** This is the regional replication state. */ +export enum KnownReplicationState { + /** Unknown */ + Unknown = "Unknown", + /** Replicating */ + Replicating = "Replicating", + /** Completed */ + Completed = "Completed", + /** Failed */ + Failed = "Failed", +} + +/** + * This is the regional replication state. \ + * {@link KnownReplicationState} can be used interchangeably with ReplicationState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Replicating** \ + * **Completed** \ + * **Failed** + */ +export type ReplicationState = string; + +/** This is the validations profile of a Gallery Image Version. */ +export interface ValidationsProfile { + /** The published time of the image version */ + validationEtag?: string; + executedValidations?: ExecutedValidation[]; + /** This specifies the pub, offer, sku and version of the image version metadata */ + platformAttributes?: PlatformAttribute[]; +} + +export function validationsProfileDeserializer(item: any): ValidationsProfile { + return { + validationEtag: item["validationEtag"], + executedValidations: !item["executedValidations"] + ? item["executedValidations"] + : executedValidationArrayDeserializer(item["executedValidations"]), + platformAttributes: !item["platformAttributes"] + ? item["platformAttributes"] + : platformAttributeArrayDeserializer(item["platformAttributes"]), + }; +} + +export function executedValidationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return executedValidationDeserializer(item); + }); +} + +/** This is the executed Validation. */ +export interface ExecutedValidation { + /** This property specifies the type of image version validation. */ + type?: string; + /** This property specifies the status of the validationProfile of the image version. */ + status?: ValidationStatus; + /** This property specifies the valid version of the validation. */ + version?: string; + /** This property specifies the starting timestamp. */ + executionTime?: Date; +} + +export function executedValidationDeserializer(item: any): ExecutedValidation { + return { + type: item["type"], + status: item["status"], + version: item["version"], + executionTime: !item["executionTime"] ? item["executionTime"] : new Date(item["executionTime"]), + }; +} + +/** This property specifies the status of the validationProfile of the image version. */ +export enum KnownValidationStatus { + /** Unknown */ + Unknown = "Unknown", + /** Failed */ + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", +} + +/** + * This property specifies the status of the validationProfile of the image version. \ + * {@link KnownValidationStatus} can be used interchangeably with ValidationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Failed** \ + * **Succeeded** + */ +export type ValidationStatus = string; + +export function platformAttributeArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return platformAttributeDeserializer(item); + }); +} + +/** This is the platform attribute of the image version. */ +export interface PlatformAttribute { + /** This property specifies the name of the platformAttribute. It is read-only. */ + readonly name?: string; + /** This property specifies the value of the corresponding name property. It is read-only. */ + readonly value?: string; +} + +export function platformAttributeDeserializer(item: any): PlatformAttribute { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Describes the basic gallery artifact publishing profile. */ +export interface GalleryArtifactPublishingProfileBase { + /** The target regions where the Image Version is going to be replicated to. This property is updatable. */ + targetRegions?: TargetRegion[]; + /** The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. */ + replicaCount?: number; + /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ + excludeFromLatest?: boolean; + /** The timestamp for when the gallery image version is published. */ + readonly publishedDate?: Date; + /** The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** Specifies the storage account type to be used to store the image. Cannot be specified along with storageAccountStrategy. This property is not updatable. */ + storageAccountType?: StorageAccountType; + /** Optional parameter which specifies the mode to be used for replication. This property is not updatable. */ + replicationMode?: ReplicationMode; + /** The target extended locations where the Image Version is going to be replicated to. This property is updatable. */ + targetExtendedLocations?: GalleryTargetExtendedLocation[]; + /** Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property is not updatable. */ + storageAccountStrategy?: StorageAccountStrategy; +} + +export function galleryArtifactPublishingProfileBaseSerializer( + item: GalleryArtifactPublishingProfileBase, +): any { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArraySerializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArraySerializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + }; +} + +export function galleryArtifactPublishingProfileBaseDeserializer( + item: any, +): GalleryArtifactPublishingProfileBase { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArrayDeserializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArrayDeserializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + }; +} + +export function targetRegionArraySerializer(result: Array): any[] { + return result.map((item) => { + return targetRegionSerializer(item); + }); +} + +export function targetRegionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return targetRegionDeserializer(item); + }); +} + +/** Describes the target region information. */ +export interface TargetRegion { + /** The name of the region. */ + name: string; + /** The number of replicas of the Image Version to be created per region. This property is updatable. */ + regionalReplicaCount?: number; + /** Specifies the storage account type to be used to store the image. This property is not updatable. */ + storageAccountType?: StorageAccountType; + /** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ + encryption?: EncryptionImages; + /** Contains the flag setting to hide an image when users specify version='latest' */ + excludeFromLatest?: boolean; + /** List of storage sku with replica count to create direct drive replicas. */ + additionalReplicaSets?: AdditionalReplicaSet[]; +} + +export function targetRegionSerializer(item: TargetRegion): any { + return { + name: item["name"], + regionalReplicaCount: item["regionalReplicaCount"], + storageAccountType: item["storageAccountType"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionImagesSerializer(item["encryption"]), + excludeFromLatest: item["excludeFromLatest"], + additionalReplicaSets: !item["additionalReplicaSets"] + ? item["additionalReplicaSets"] + : additionalReplicaSetArraySerializer(item["additionalReplicaSets"]), + }; +} + +export function targetRegionDeserializer(item: any): TargetRegion { + return { + name: item["name"], + regionalReplicaCount: item["regionalReplicaCount"], + storageAccountType: item["storageAccountType"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionImagesDeserializer(item["encryption"]), + excludeFromLatest: item["excludeFromLatest"], + additionalReplicaSets: !item["additionalReplicaSets"] + ? item["additionalReplicaSets"] + : additionalReplicaSetArrayDeserializer(item["additionalReplicaSets"]), + }; +} + +/** Specifies the storage account type to be used to store the image. This property is not updatable. */ +export enum KnownStorageAccountType { + /** Standard_LRS */ + StandardLRS = "Standard_LRS", + /** Standard_ZRS */ + StandardZRS = "Standard_ZRS", + /** Premium_LRS */ + PremiumLRS = "Premium_LRS", + /** PremiumV2_LRS */ + PremiumV2LRS = "PremiumV2_LRS", +} + +/** + * Specifies the storage account type to be used to store the image. This property is not updatable. \ + * {@link KnownStorageAccountType} can be used interchangeably with StorageAccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS** \ + * **Standard_ZRS** \ + * **Premium_LRS** \ + * **PremiumV2_LRS** + */ +export type StorageAccountType = string; + +/** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ +export interface EncryptionImages { + /** Contains encryption settings for an OS disk image. */ + osDiskImage?: OSDiskImageEncryption; + /** A list of encryption specifications for data disk images. */ + dataDiskImages?: DataDiskImageEncryption[]; +} + +export function encryptionImagesSerializer(item: EncryptionImages): any { + return { + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : osDiskImageEncryptionSerializer(item["osDiskImage"]), + dataDiskImages: !item["dataDiskImages"] + ? item["dataDiskImages"] + : dataDiskImageEncryptionArraySerializer(item["dataDiskImages"]), + }; +} + +export function encryptionImagesDeserializer(item: any): EncryptionImages { + return { + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : osDiskImageEncryptionDeserializer(item["osDiskImage"]), + dataDiskImages: !item["dataDiskImages"] + ? item["dataDiskImages"] + : dataDiskImageEncryptionArrayDeserializer(item["dataDiskImages"]), + }; +} + +/** Contains encryption settings for an OS disk image. */ +export interface OSDiskImageEncryption extends DiskImageEncryption { + /** This property specifies the security profile of an OS disk image. */ + securityProfile?: OSDiskImageSecurityProfile; +} + +export function osDiskImageEncryptionSerializer(item: OSDiskImageEncryption): any { + return { + diskEncryptionSetId: item["diskEncryptionSetId"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : osDiskImageSecurityProfileSerializer(item["securityProfile"]), + }; +} + +export function osDiskImageEncryptionDeserializer(item: any): OSDiskImageEncryption { + return { + diskEncryptionSetId: item["diskEncryptionSetId"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : osDiskImageSecurityProfileDeserializer(item["securityProfile"]), + }; +} + +/** Contains security profile for an OS disk image. */ +export interface OSDiskImageSecurityProfile { + /** confidential VM encryption types */ + confidentialVMEncryptionType?: ConfidentialVMEncryptionType; + /** secure VM disk encryption set id */ + secureVMDiskEncryptionSetId?: string; +} + +export function osDiskImageSecurityProfileSerializer(item: OSDiskImageSecurityProfile): any { + return { + confidentialVMEncryptionType: item["confidentialVMEncryptionType"], + secureVMDiskEncryptionSetId: item["secureVMDiskEncryptionSetId"], + }; +} + +export function osDiskImageSecurityProfileDeserializer(item: any): OSDiskImageSecurityProfile { + return { + confidentialVMEncryptionType: item["confidentialVMEncryptionType"], + secureVMDiskEncryptionSetId: item["secureVMDiskEncryptionSetId"], + }; +} + +/** confidential VM encryption types */ +export enum KnownConfidentialVMEncryptionType { + /** EncryptedVMGuestStateOnlyWithPmk */ + EncryptedVMGuestStateOnlyWithPmk = "EncryptedVMGuestStateOnlyWithPmk", + /** EncryptedWithPmk */ + EncryptedWithPmk = "EncryptedWithPmk", + /** EncryptedWithCmk */ + EncryptedWithCmk = "EncryptedWithCmk", + /** NonPersistedTPM */ + NonPersistedTPM = "NonPersistedTPM", +} + +/** + * confidential VM encryption types \ + * {@link KnownConfidentialVMEncryptionType} can be used interchangeably with ConfidentialVMEncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptedVMGuestStateOnlyWithPmk** \ + * **EncryptedWithPmk** \ + * **EncryptedWithCmk** \ + * **NonPersistedTPM** + */ +export type ConfidentialVMEncryptionType = string; + +export function dataDiskImageEncryptionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return dataDiskImageEncryptionSerializer(item); + }); +} + +export function dataDiskImageEncryptionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return dataDiskImageEncryptionDeserializer(item); + }); +} + +/** Contains encryption settings for a data disk image. */ +export interface DataDiskImageEncryption extends DiskImageEncryption { + /** This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. */ + lun: number; +} + +export function dataDiskImageEncryptionSerializer(item: DataDiskImageEncryption): any { + return { diskEncryptionSetId: item["diskEncryptionSetId"], lun: item["lun"] }; +} + +export function dataDiskImageEncryptionDeserializer(item: any): DataDiskImageEncryption { + return { + diskEncryptionSetId: item["diskEncryptionSetId"], + lun: item["lun"], + }; +} + +export function additionalReplicaSetArraySerializer(result: Array): any[] { + return result.map((item) => { + return additionalReplicaSetSerializer(item); + }); +} + +export function additionalReplicaSetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return additionalReplicaSetDeserializer(item); + }); +} + +/** Describes the additional replica set information. */ +export interface AdditionalReplicaSet { + /** Specifies the storage account type to be used to create the direct drive replicas */ + storageAccountType?: StorageAccountType; + /** The number of direct drive replicas of the Image Version to be created.This Property is updatable */ + regionalReplicaCount?: number; +} + +export function additionalReplicaSetSerializer(item: AdditionalReplicaSet): any { + return { + storageAccountType: item["storageAccountType"], + regionalReplicaCount: item["regionalReplicaCount"], + }; +} + +export function additionalReplicaSetDeserializer(item: any): AdditionalReplicaSet { + return { + storageAccountType: item["storageAccountType"], + regionalReplicaCount: item["regionalReplicaCount"], + }; +} + +/** Optional parameter which specifies the mode to be used for replication. This property is not updatable. */ +export enum KnownReplicationMode { + /** Full */ + Full = "Full", + /** Shallow */ + Shallow = "Shallow", +} + +/** + * Optional parameter which specifies the mode to be used for replication. This property is not updatable. \ + * {@link KnownReplicationMode} can be used interchangeably with ReplicationMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Full** \ + * **Shallow** + */ +export type ReplicationMode = string; + +export function galleryTargetExtendedLocationArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryTargetExtendedLocationSerializer(item); + }); +} + +export function galleryTargetExtendedLocationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryTargetExtendedLocationDeserializer(item); + }); +} + +/** model interface GalleryTargetExtendedLocation */ +export interface GalleryTargetExtendedLocation { + /** The name of the region. */ + name?: string; + /** The name of the extended location. */ + extendedLocation?: GalleryExtendedLocation; + /** The number of replicas of the Image Version to be created per extended location. This property is updatable. */ + extendedLocationReplicaCount?: number; + /** Specifies the storage account type to be used to store the image. This property is not updatable. */ + storageAccountType?: EdgeZoneStorageAccountType; + /** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ + encryption?: EncryptionImages; +} + +export function galleryTargetExtendedLocationSerializer(item: GalleryTargetExtendedLocation): any { + return { + name: item["name"], + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : galleryExtendedLocationSerializer(item["extendedLocation"]), + extendedLocationReplicaCount: item["extendedLocationReplicaCount"], + storageAccountType: item["storageAccountType"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionImagesSerializer(item["encryption"]), + }; +} + +export function galleryTargetExtendedLocationDeserializer( + item: any, +): GalleryTargetExtendedLocation { + return { + name: item["name"], + extendedLocation: !item["extendedLocation"] + ? item["extendedLocation"] + : galleryExtendedLocationDeserializer(item["extendedLocation"]), + extendedLocationReplicaCount: item["extendedLocationReplicaCount"], + storageAccountType: item["storageAccountType"], + encryption: !item["encryption"] + ? item["encryption"] + : encryptionImagesDeserializer(item["encryption"]), + }; +} + +/** The name of the extended location. */ +export interface GalleryExtendedLocation { + name?: string; + /** It is type of the extended location. */ + type?: GalleryExtendedLocationType; +} + +export function galleryExtendedLocationSerializer(item: GalleryExtendedLocation): any { + return { name: item["name"], type: item["type"] }; +} + +export function galleryExtendedLocationDeserializer(item: any): GalleryExtendedLocation { + return { + name: item["name"], + type: item["type"], + }; +} + +/** It is type of the extended location. */ +export enum KnownGalleryExtendedLocationType { + /** EdgeZone */ + EdgeZone = "EdgeZone", + /** Unknown */ + Unknown = "Unknown", +} + +/** + * It is type of the extended location. \ + * {@link KnownGalleryExtendedLocationType} can be used interchangeably with GalleryExtendedLocationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EdgeZone** \ + * **Unknown** + */ +export type GalleryExtendedLocationType = string; + +/** Specifies the storage account type to be used to store the image. This property is not updatable. */ +export enum KnownEdgeZoneStorageAccountType { + /** Standard_LRS */ + StandardLRS = "Standard_LRS", + /** Standard_ZRS */ + StandardZRS = "Standard_ZRS", + /** StandardSSD_LRS */ + StandardSSDLRS = "StandardSSD_LRS", + /** Premium_LRS */ + PremiumLRS = "Premium_LRS", +} + +/** + * Specifies the storage account type to be used to store the image. This property is not updatable. \ + * {@link KnownEdgeZoneStorageAccountType} can be used interchangeably with EdgeZoneStorageAccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS** \ + * **Standard_ZRS** \ + * **StandardSSD_LRS** \ + * **Premium_LRS** + */ +export type EdgeZoneStorageAccountType = string; + +/** Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property is not updatable. */ +export enum KnownStorageAccountStrategy { + /** Choose Standard_ZRS storage if the region supports it, else choose Standard_LRS storage, unless overridden by specifying regional storageAccountType. If no storageAccountStrategy is specified, this is the default strategy (from API version 2025-03-03 onwards). */ + PreferStandardZRS = "PreferStandard_ZRS", + /** Choose Standard_LRS storage unless overridden by specifying regional storageAccountType. */ + DefaultStandardLRS = "DefaultStandard_LRS", +} + +/** + * Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property is not updatable. \ + * {@link KnownStorageAccountStrategy} can be used interchangeably with StorageAccountStrategy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PreferStandard_ZRS**: Choose Standard_ZRS storage if the region supports it, else choose Standard_LRS storage, unless overridden by specifying regional storageAccountType. If no storageAccountStrategy is specified, this is the default strategy (from API version 2025-03-03 onwards). \ + * **DefaultStandard_LRS**: Choose Standard_LRS storage unless overridden by specifying regional storageAccountType. + */ +export type StorageAccountStrategy = string; + +/** This is the disk image encryption base class. */ +export interface DiskImageEncryption { + /** A relative URI containing the resource ID of the disk encryption set. */ + diskEncryptionSetId?: string; +} + +export function diskImageEncryptionSerializer(item: DiskImageEncryption): any { + return { diskEncryptionSetId: item["diskEncryptionSetId"] }; +} + +export function diskImageEncryptionDeserializer(item: any): DiskImageEncryption { + return { + diskEncryptionSetId: item["diskEncryptionSetId"], + }; +} + +/** The gallery artifact version source. */ +export interface GalleryArtifactVersionSource { + /** The id of the gallery artifact version source. */ + id?: string; +} + +export function galleryArtifactVersionSourceSerializer(item: GalleryArtifactVersionSource): any { + return { id: item["id"] }; +} + +export function galleryArtifactVersionSourceDeserializer(item: any): GalleryArtifactVersionSource { + return { + id: item["id"], + }; +} + +/** This is the disk image base class. */ +export interface GalleryDiskImage { + /** This property indicates the size of the VHD to be created. */ + readonly sizeInGB?: number; + /** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ + hostCaching?: HostCaching; + /** The source for the disk image. */ + source?: GalleryDiskImageSource; +} + +export function galleryDiskImageSerializer(item: GalleryDiskImage): any { + return { + hostCaching: item["hostCaching"], + source: !item["source"] ? item["source"] : galleryDiskImageSourceSerializer(item["source"]), + }; +} + +export function galleryDiskImageDeserializer(item: any): GalleryDiskImage { + return { + sizeInGB: item["sizeInGB"], + hostCaching: item["hostCaching"], + source: !item["source"] ? item["source"] : galleryDiskImageSourceDeserializer(item["source"]), + }; +} + +/** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ +export type HostCaching = "None" | "ReadOnly" | "ReadWrite"; + +/** The source for the disk image. */ +export interface GalleryDiskImageSource extends GalleryArtifactVersionSource { + /** The uri of the gallery artifact version source. Currently used to specify vhd/blob source. */ + uri?: string; + /** The Storage Account Id that contains the vhd blob being used as a source for this artifact version. */ + storageAccountId?: string; +} + +export function galleryDiskImageSourceSerializer(item: GalleryDiskImageSource): any { + return { id: item["id"], uri: item["uri"], storageAccountId: item["storageAccountId"] }; +} + +export function galleryDiskImageSourceDeserializer(item: any): GalleryDiskImageSource { + return { + id: item["id"], + uri: item["uri"], + storageAccountId: item["storageAccountId"], + }; +} + +/** This is the safety profile of the Gallery Artifact Version. */ +export interface GalleryArtifactSafetyProfileBase { + /** Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. */ + allowDeletionOfReplicatedLocations?: boolean; +} + +export function galleryArtifactSafetyProfileBaseSerializer( + item: GalleryArtifactSafetyProfileBase, +): any { + return { allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"] }; +} + +export function galleryArtifactSafetyProfileBaseDeserializer( + item: any, +): GalleryArtifactSafetyProfileBase { + return { + allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"], + }; +} + +/** Specifies information about the gallery image version that you want to update. */ +export interface GalleryImageVersionUpdate extends UpdateResourceDefinition { + /** The publishing profile of a gallery image Version. */ + publishingProfile?: GalleryImageVersionPublishingProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the storage profile of a Gallery Image Version. */ + storageProfile?: GalleryImageVersionStorageProfile; + /** This is the safety profile of the Gallery Image Version. */ + safetyProfile?: GalleryImageVersionSafetyProfile; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; + /** The security profile of a gallery image version */ + securityProfile?: ImageVersionSecurityProfile; + /** Indicates if this is a soft-delete resource restoration request. */ + restore?: boolean; + /** This is the validations profile of a Gallery Image Version. */ + readonly validationsProfile?: ValidationsProfile; +} + +export function galleryImageVersionUpdateSerializer(item: GalleryImageVersionUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "publishingProfile", + "storageProfile", + "safetyProfile", + "securityProfile", + "restore", + ]) + ? undefined + : _galleryImageVersionUpdatePropertiesSerializer(item), + }; +} + +/** The List Gallery Image version operation response. */ +export interface _GalleryImageVersionList { + /** A list of gallery image versions. */ + value: GalleryImageVersion[]; + /** The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image versions. */ + nextLink?: string; +} + +export function _galleryImageVersionListDeserializer(item: any): _GalleryImageVersionList { + return { + value: galleryImageVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryImageVersionArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryImageVersionSerializer(item); + }); +} + +export function galleryImageVersionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryImageVersionDeserializer(item); + }); +} + +/** Specifies information about the gallery Application Definition that you want to create or update. */ +export interface GalleryApplication extends TrackedResource { + /** The description of this gallery Application Definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement for the gallery Application Definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ + supportedOSType?: OperatingSystemTypes; + /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ + customActions?: GalleryApplicationCustomAction[]; +} + +export function galleryApplicationSerializer(item: GalleryApplication): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "description", + "eula", + "privacyStatementUri", + "releaseNoteUri", + "endOfLifeDate", + "supportedOSType", + "customActions", + ]) + ? undefined + : _galleryApplicationPropertiesSerializer(item), + }; +} + +export function galleryApplicationDeserializer(item: any): GalleryApplication { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _galleryApplicationPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery Application Definition. */ +export interface GalleryApplicationProperties { + /** The description of this gallery Application Definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement for the gallery Application Definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ + supportedOSType: OperatingSystemTypes; + /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ + customActions?: GalleryApplicationCustomAction[]; +} + +export function galleryApplicationPropertiesSerializer(item: GalleryApplicationProperties): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + supportedOSType: item["supportedOSType"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArraySerializer(item["customActions"]), + }; +} + +export function galleryApplicationPropertiesDeserializer(item: any): GalleryApplicationProperties { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + supportedOSType: item["supportedOSType"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArrayDeserializer(item["customActions"]), + }; +} + +export function galleryApplicationCustomActionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryApplicationCustomActionSerializer(item); + }); +} + +export function galleryApplicationCustomActionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryApplicationCustomActionDeserializer(item); + }); +} + +/** A custom action that can be performed with a Gallery Application Version. */ +export interface GalleryApplicationCustomAction { + /** The name of the custom action. Must be unique within the Gallery Application Version. */ + name: string; + /** The script to run when executing this custom action. */ + script: string; + /** Description to help the users understand what this custom action does. */ + description?: string; + /** The parameters that this custom action uses */ + parameters?: GalleryApplicationCustomActionParameter[]; +} + +export function galleryApplicationCustomActionSerializer( + item: GalleryApplicationCustomAction, +): any { + return { + name: item["name"], + script: item["script"], + description: item["description"], + parameters: !item["parameters"] + ? item["parameters"] + : galleryApplicationCustomActionParameterArraySerializer(item["parameters"]), + }; +} + +export function galleryApplicationCustomActionDeserializer( + item: any, +): GalleryApplicationCustomAction { + return { + name: item["name"], + script: item["script"], + description: item["description"], + parameters: !item["parameters"] + ? item["parameters"] + : galleryApplicationCustomActionParameterArrayDeserializer(item["parameters"]), + }; +} + +export function galleryApplicationCustomActionParameterArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryApplicationCustomActionParameterSerializer(item); + }); +} + +export function galleryApplicationCustomActionParameterArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryApplicationCustomActionParameterDeserializer(item); + }); +} + +/** The definition of a parameter that can be passed to a custom action of a Gallery Application Version. */ +export interface GalleryApplicationCustomActionParameter { + /** The name of the custom action. Must be unique within the Gallery Application Version. */ + name: string; + /** Indicates whether this parameter must be passed when running the custom action. */ + required?: boolean; + /** Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob */ + type?: GalleryApplicationCustomActionParameterType; + /** The default value of the parameter. Only applies to string types */ + defaultValue?: string; + /** A description to help users understand what this parameter means */ + description?: string; +} + +export function galleryApplicationCustomActionParameterSerializer( + item: GalleryApplicationCustomActionParameter, +): any { + return { + name: item["name"], + required: item["required"], + type: item["type"], + defaultValue: item["defaultValue"], + description: item["description"], + }; +} + +export function galleryApplicationCustomActionParameterDeserializer( + item: any, +): GalleryApplicationCustomActionParameter { + return { + name: item["name"], + required: item["required"], + type: item["type"], + defaultValue: item["defaultValue"], + description: item["description"], + }; +} + +/** Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob */ +export type GalleryApplicationCustomActionParameterType = + | "String" + | "ConfigurationDataBlob" + | "LogOutputBlob"; + +/** Specifies information about the gallery Application Definition that you want to update. */ +export interface GalleryApplicationUpdate extends UpdateResourceDefinition { + /** The description of this gallery Application Definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement for the gallery Application Definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ + supportedOSType?: OperatingSystemTypes; + /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ + customActions?: GalleryApplicationCustomAction[]; +} + +export function galleryApplicationUpdateSerializer(item: GalleryApplicationUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "description", + "eula", + "privacyStatementUri", + "releaseNoteUri", + "endOfLifeDate", + "supportedOSType", + "customActions", + ]) + ? undefined + : _galleryApplicationUpdatePropertiesSerializer(item), + }; +} + +/** The List Gallery Applications operation response. */ +export interface _GalleryApplicationList { + /** The GalleryApplication items on this page */ + value: GalleryApplication[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _galleryApplicationListDeserializer(item: any): _GalleryApplicationList { + return { + value: galleryApplicationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryApplicationArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryApplicationSerializer(item); + }); +} + +export function galleryApplicationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryApplicationDeserializer(item); + }); +} + +/** Specifies information about the gallery Application Version that you want to create or update. */ +export interface GalleryApplicationVersion extends TrackedResource { + /** The publishing profile of a gallery image version. */ + publishingProfile?: GalleryApplicationVersionPublishingProfile; + /** The safety profile of the Gallery Application Version. */ + safetyProfile?: GalleryApplicationVersionSafetyProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; +} + +export function galleryApplicationVersionSerializer(item: GalleryApplicationVersion): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, ["publishingProfile", "safetyProfile"]) + ? undefined + : _galleryApplicationVersionPropertiesSerializer(item), + }; +} + +export function galleryApplicationVersionDeserializer(item: any): GalleryApplicationVersion { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _galleryApplicationVersionPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery image version. */ +export interface GalleryApplicationVersionProperties { + /** The publishing profile of a gallery image version. */ + publishingProfile: GalleryApplicationVersionPublishingProfile; + /** The safety profile of the Gallery Application Version. */ + safetyProfile?: GalleryApplicationVersionSafetyProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; +} + +export function galleryApplicationVersionPropertiesSerializer( + item: GalleryApplicationVersionProperties, +): any { + return { + publishingProfile: galleryApplicationVersionPublishingProfileSerializer( + item["publishingProfile"], + ), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryApplicationVersionSafetyProfileSerializer(item["safetyProfile"]), + }; +} + +export function galleryApplicationVersionPropertiesDeserializer( + item: any, +): GalleryApplicationVersionProperties { + return { + publishingProfile: galleryApplicationVersionPublishingProfileDeserializer( + item["publishingProfile"], + ), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryApplicationVersionSafetyProfileDeserializer(item["safetyProfile"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + }; +} + +/** The publishing profile of a gallery image version. */ +export interface GalleryApplicationVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + /** The source image from which the Image Version is going to be created. */ + source: UserArtifactSource; + manageActions?: UserArtifactManage; + /** Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set. */ + settings?: UserArtifactSettings; + /** Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. */ + advancedSettings?: Record; + /** Optional. Whether or not this application reports health. */ + enableHealthCheck?: boolean; + /** A list of custom actions that can be performed with this Gallery Application Version. */ + customActions?: GalleryApplicationCustomAction[]; +} + +export function galleryApplicationVersionPublishingProfileSerializer( + item: GalleryApplicationVersionPublishingProfile, +): any { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArraySerializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArraySerializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + source: userArtifactSourceSerializer(item["source"]), + manageActions: !item["manageActions"] + ? item["manageActions"] + : userArtifactManageSerializer(item["manageActions"]), + settings: !item["settings"] + ? item["settings"] + : userArtifactSettingsSerializer(item["settings"]), + advancedSettings: item["advancedSettings"], + enableHealthCheck: item["enableHealthCheck"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArraySerializer(item["customActions"]), + }; +} + +export function galleryApplicationVersionPublishingProfileDeserializer( + item: any, +): GalleryApplicationVersionPublishingProfile { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArrayDeserializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArrayDeserializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + source: userArtifactSourceDeserializer(item["source"]), + manageActions: !item["manageActions"] + ? item["manageActions"] + : userArtifactManageDeserializer(item["manageActions"]), + settings: !item["settings"] + ? item["settings"] + : userArtifactSettingsDeserializer(item["settings"]), + advancedSettings: !item["advancedSettings"] + ? item["advancedSettings"] + : Object.fromEntries( + Object.entries(item["advancedSettings"]).map(([k, p]: [string, any]) => [k, p]), + ), + enableHealthCheck: item["enableHealthCheck"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArrayDeserializer(item["customActions"]), + }; +} + +/** The source image from which the Image Version is going to be created. */ +export interface UserArtifactSource { + /** Required. The mediaLink of the artifact, must be a readable storage page blob. */ + mediaLink: string; + /** Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. */ + defaultConfigurationLink?: string; +} + +export function userArtifactSourceSerializer(item: UserArtifactSource): any { + return { + mediaLink: item["mediaLink"], + defaultConfigurationLink: item["defaultConfigurationLink"], + }; +} + +export function userArtifactSourceDeserializer(item: any): UserArtifactSource { + return { + mediaLink: item["mediaLink"], + defaultConfigurationLink: item["defaultConfigurationLink"], + }; +} + +/** model interface UserArtifactManage */ +export interface UserArtifactManage { + /** Required. The path and arguments to install the gallery application. This is limited to 4096 characters. */ + install: string; + /** Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. */ + remove: string; + /** Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. */ + update?: string; +} + +export function userArtifactManageSerializer(item: UserArtifactManage): any { + return { install: item["install"], remove: item["remove"], update: item["update"] }; +} + +export function userArtifactManageDeserializer(item: any): UserArtifactManage { + return { + install: item["install"], + remove: item["remove"], + update: item["update"], + }; +} + +/** Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set. */ +export interface UserArtifactSettings { + /** Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, the package file will be named the same as the Gallery Application name. */ + packageFileName?: string; + /** Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, the config file will be named the Gallery Application name appended with "_config". */ + configFileName?: string; + /** Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot. */ + scriptBehaviorAfterReboot?: GalleryApplicationScriptRebootBehavior; +} + +export function userArtifactSettingsSerializer(item: UserArtifactSettings): any { + return { + packageFileName: item["packageFileName"], + configFileName: item["configFileName"], + scriptBehaviorAfterReboot: item["scriptBehaviorAfterReboot"], + }; +} + +export function userArtifactSettingsDeserializer(item: any): UserArtifactSettings { + return { + packageFileName: item["packageFileName"], + configFileName: item["configFileName"], + scriptBehaviorAfterReboot: item["scriptBehaviorAfterReboot"], + }; +} + +/** Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot. */ +export enum KnownGalleryApplicationScriptRebootBehavior { + /** None */ + None = "None", + /** Rerun */ + Rerun = "Rerun", +} + +/** + * Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot. \ + * {@link KnownGalleryApplicationScriptRebootBehavior} can be used interchangeably with GalleryApplicationScriptRebootBehavior, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Rerun** + */ +export type GalleryApplicationScriptRebootBehavior = string; + +/** The safety profile of the Gallery Application Version. */ +export interface GalleryApplicationVersionSafetyProfile extends GalleryArtifactSafetyProfileBase {} + +export function galleryApplicationVersionSafetyProfileSerializer( + item: GalleryApplicationVersionSafetyProfile, +): any { + return { allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"] }; +} + +export function galleryApplicationVersionSafetyProfileDeserializer( + item: any, +): GalleryApplicationVersionSafetyProfile { + return { + allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"], + }; +} + +/** Specifies information about the gallery Application Version that you want to update. */ +export interface GalleryApplicationVersionUpdate extends UpdateResourceDefinition { + /** The publishing profile of a gallery image version. */ + publishingProfile?: GalleryApplicationVersionPublishingProfile; + /** The safety profile of the Gallery Application Version. */ + safetyProfile?: GalleryApplicationVersionSafetyProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; +} + +export function galleryApplicationVersionUpdateSerializer( + item: GalleryApplicationVersionUpdate, +): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, ["publishingProfile", "safetyProfile"]) + ? undefined + : _galleryApplicationVersionUpdatePropertiesSerializer(item), + }; +} + +/** The List Gallery Application version operation response. */ +export interface _GalleryApplicationVersionList { + /** A list of gallery Application Versions. */ + value: GalleryApplicationVersion[]; + /** The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. */ + nextLink?: string; +} + +export function _galleryApplicationVersionListDeserializer( + item: any, +): _GalleryApplicationVersionList { + return { + value: galleryApplicationVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryApplicationVersionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryApplicationVersionSerializer(item); + }); +} + +export function galleryApplicationVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryApplicationVersionDeserializer(item); + }); +} + +/** Specifies information about the gallery Script Definition that you want to create or update. */ +export interface GalleryScript extends TrackedResource { + /** Describes the properties of a gallery Script Definition. */ + properties?: GalleryScriptProperties; +} + +export function galleryScriptSerializer(item: GalleryScript): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : galleryScriptPropertiesSerializer(item["properties"]), + }; +} + +export function galleryScriptDeserializer(item: any): GalleryScript { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : galleryScriptPropertiesDeserializer(item["properties"]), + }; +} + +/** Describes the properties of a gallery script definition. */ +export interface GalleryScriptProperties { + /** The description of this gallery script definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement (End User License Agreement) for the gallery Script Definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** The end of life date of the gallery Script Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ + supportedOSType: OperatingSystemTypes; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; +} + +export function galleryScriptPropertiesSerializer(item: GalleryScriptProperties): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + supportedOSType: item["supportedOSType"], + }; +} + +export function galleryScriptPropertiesDeserializer(item: any): GalleryScriptProperties { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + supportedOSType: item["supportedOSType"], + provisioningState: item["provisioningState"], + }; +} + +/** Specifies information about the gallery Script Definition that you want to update. */ +export interface GalleryScriptUpdate extends UpdateResourceDefinition { + /** The description of this gallery script definition resource. This property is updatable. */ + description?: string; + /** The Eula agreement (End User License Agreement) for the gallery Script Definition. */ + eula?: string; + /** The privacy statement uri. */ + privacyStatementUri?: string; + /** The release note uri. */ + releaseNoteUri?: string; + /** The end of life date of the gallery Script Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ + supportedOSType?: OperatingSystemTypes; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; +} + +export function galleryScriptUpdateSerializer(item: GalleryScriptUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "description", + "eula", + "privacyStatementUri", + "releaseNoteUri", + "endOfLifeDate", + "supportedOSType", + ]) + ? undefined + : _galleryScriptUpdatePropertiesSerializer(item), + }; +} + +/** The List Gallery Script operation response. */ +export interface _GalleryScriptList { + /** The GalleryScript items on this page */ + value: GalleryScript[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _galleryScriptListDeserializer(item: any): _GalleryScriptList { + return { + value: galleryScriptArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryScriptArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryScriptSerializer(item); + }); +} + +export function galleryScriptArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryScriptDeserializer(item); + }); +} + +/** Concrete tracked resource types can be created by aliasing this type using a specific property type. */ +export interface GalleryScriptVersion extends TrackedResource { + /** Describes the properties of a gallery Script Version. */ + properties?: GalleryScriptVersionProperties; +} + +export function galleryScriptVersionSerializer(item: GalleryScriptVersion): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : galleryScriptVersionPropertiesSerializer(item["properties"]), + }; +} + +export function galleryScriptVersionDeserializer(item: any): GalleryScriptVersion { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : galleryScriptVersionPropertiesDeserializer(item["properties"]), + }; +} + +/** Describes the properties of a gallery script version. */ +export interface GalleryScriptVersionProperties { + /** The publishing profile of a gallery image version. */ + publishingProfile: GalleryScriptVersionPublishingProfile; + /** The safety profile of the Gallery Script Version. */ + safetyProfile?: GalleryScriptVersionSafetyProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; +} + +export function galleryScriptVersionPropertiesSerializer( + item: GalleryScriptVersionProperties, +): any { + return { + publishingProfile: galleryScriptVersionPublishingProfileSerializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryScriptVersionSafetyProfileSerializer(item["safetyProfile"]), + }; +} + +export function galleryScriptVersionPropertiesDeserializer( + item: any, +): GalleryScriptVersionProperties { + return { + publishingProfile: galleryScriptVersionPublishingProfileDeserializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryScriptVersionSafetyProfileDeserializer(item["safetyProfile"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + }; +} + +/** The publishing profile of a gallery image version. */ +export interface GalleryScriptVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + /** The source script from which the Script Version is going to be created. */ + source: ScriptSource; +} + +export function galleryScriptVersionPublishingProfileSerializer( + item: GalleryScriptVersionPublishingProfile, +): any { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArraySerializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArraySerializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + source: scriptSourceSerializer(item["source"]), + }; +} + +export function galleryScriptVersionPublishingProfileDeserializer( + item: any, +): GalleryScriptVersionPublishingProfile { + return { + targetRegions: !item["targetRegions"] + ? item["targetRegions"] + : targetRegionArrayDeserializer(item["targetRegions"]), + replicaCount: item["replicaCount"], + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + storageAccountType: item["storageAccountType"], + replicationMode: item["replicationMode"], + targetExtendedLocations: !item["targetExtendedLocations"] + ? item["targetExtendedLocations"] + : galleryTargetExtendedLocationArrayDeserializer(item["targetExtendedLocations"]), + storageAccountStrategy: item["storageAccountStrategy"], + source: scriptSourceDeserializer(item["source"]), + }; +} + +/** The source script from which the Script Version is going to be created. */ +export interface ScriptSource { + /** Required. The link of the source script, it must be a readable storage blob with SAS URI or publicly accessible URI or managed identity enabled. */ + scriptLink: string; + /** Optional. Any input parameters that needs to passed to the script and are accessed within the script for its execution. */ + parameters?: GalleryScriptParameter[]; +} + +export function scriptSourceSerializer(item: ScriptSource): any { + return { + scriptLink: item["scriptLink"], + parameters: !item["parameters"] + ? item["parameters"] + : galleryScriptParameterArraySerializer(item["parameters"]), + }; +} + +export function scriptSourceDeserializer(item: any): ScriptSource { + return { + scriptLink: item["scriptLink"], + parameters: !item["parameters"] + ? item["parameters"] + : galleryScriptParameterArrayDeserializer(item["parameters"]), + }; +} + +export function galleryScriptParameterArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryScriptParameterSerializer(item); + }); +} + +export function galleryScriptParameterArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryScriptParameterDeserializer(item); + }); +} + +/** The definition of a parameter that can be passed to a script of a Gallery Script Version. */ +export interface GalleryScriptParameter extends GenericGalleryParameter { + /** Specifies the type of the Gallery Script parameter. Possible values are: String, Int, Double, Boolean, Enum */ + type?: GalleryScriptParameterType; + /** The minimum value of parameter. */ + minValue?: string; + /** The minimum value of parameter. */ + maxValue?: string; + /** A list of permissible values. Only applicable values are from 'enum' values defined in 'GalleryScriptParameter'. */ + enumValues?: string[]; +} + +export function galleryScriptParameterSerializer(item: GalleryScriptParameter): any { + return { + name: item["name"], + required: item["required"], + defaultValue: item["defaultValue"], + description: item["description"], + type: item["type"], + minValue: item["minValue"], + maxValue: item["maxValue"], + enumValues: !item["enumValues"] + ? item["enumValues"] + : item["enumValues"].map((p: any) => { + return p; + }), + }; +} + +export function galleryScriptParameterDeserializer(item: any): GalleryScriptParameter { + return { + name: item["name"], + required: item["required"], + defaultValue: item["defaultValue"], + description: item["description"], + type: item["type"], + minValue: item["minValue"], + maxValue: item["maxValue"], + enumValues: !item["enumValues"] + ? item["enumValues"] + : item["enumValues"].map((p: any) => { + return p; + }), + }; +} + +/** Specifies the type of the Gallery Script parameter. Possible values are: String, Int, Double, Boolean, Enum */ +export enum KnownGalleryScriptParameterType { + /** String gallery script parameter type */ + String = "String", + /** Int gallery script parameter type */ + Int = "Int", + /** Double gallery script parameter type */ + Double = "Double", + /** Boolean gallery script parameter type */ + Boolean = "Boolean", + /** Enum gallery script parameter type */ + Enum = "Enum", +} + +/** + * Specifies the type of the Gallery Script parameter. Possible values are: String, Int, Double, Boolean, Enum \ + * {@link KnownGalleryScriptParameterType} can be used interchangeably with GalleryScriptParameterType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **String**: String gallery script parameter type \ + * **Int**: Int gallery script parameter type \ + * **Double**: Double gallery script parameter type \ + * **Boolean**: Boolean gallery script parameter type \ + * **Enum**: Enum gallery script parameter type + */ +export type GalleryScriptParameterType = string; + +/** The safety profile of the Gallery Script Version. */ +export interface GalleryScriptVersionSafetyProfile extends GalleryArtifactSafetyProfileBase {} + +export function galleryScriptVersionSafetyProfileSerializer( + item: GalleryScriptVersionSafetyProfile, +): any { + return { allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"] }; +} + +export function galleryScriptVersionSafetyProfileDeserializer( + item: any, +): GalleryScriptVersionSafetyProfile { + return { + allowDeletionOfReplicatedLocations: item["allowDeletionOfReplicatedLocations"], + }; +} + +/** The definition of a generic gallery parameter. */ +export interface GenericGalleryParameter { + /** The name of the parameter. */ + name: string; + /** Indicates whether this parameter must be passed. */ + required?: boolean; + /** The default value of the parameter, only applies to string types. */ + defaultValue?: string; + /** A description to help users understand what this parameter means */ + description?: string; +} + +export function genericGalleryParameterSerializer(item: GenericGalleryParameter): any { + return { + name: item["name"], + required: item["required"], + defaultValue: item["defaultValue"], + description: item["description"], + }; +} + +export function genericGalleryParameterDeserializer(item: any): GenericGalleryParameter { + return { + name: item["name"], + required: item["required"], + defaultValue: item["defaultValue"], + description: item["description"], + }; +} + +/** Specifies information about the gallery Script Version that you want to update. */ +export interface GalleryScriptVersionUpdate extends UpdateResourceDefinition { + /** The publishing profile of a gallery image version. */ + publishingProfile?: GalleryScriptVersionPublishingProfile; + /** The safety profile of the Gallery Script Version. */ + safetyProfile?: GalleryScriptVersionSafetyProfile; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; +} + +export function galleryScriptVersionUpdateSerializer(item: GalleryScriptVersionUpdate): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, ["publishingProfile", "safetyProfile"]) + ? undefined + : _galleryScriptVersionUpdatePropertiesSerializer(item), + }; +} + +/** Paged collection of GalleryScriptVersion items */ +export interface _GalleryScriptVersionList { + /** The GalleryScriptVersion items on this page */ + value: GalleryScriptVersion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _galleryScriptVersionListDeserializer(item: any): _GalleryScriptVersionList { + return { + value: galleryScriptVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryScriptVersionArraySerializer(result: Array): any[] { + return result.map((item) => { + return galleryScriptVersionSerializer(item); + }); +} + +export function galleryScriptVersionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return galleryScriptVersionDeserializer(item); + }); +} + +/** Specifies information about the gallery inVMAccessControlProfile that you want to create or update. */ +export interface GalleryInVMAccessControlProfile extends TrackedResource { + /** Describes the properties of a gallery inVMAccessControlProfile. */ + properties?: GalleryInVMAccessControlProfileProperties; +} + +export function galleryInVMAccessControlProfileSerializer( + item: GalleryInVMAccessControlProfile, +): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : galleryInVMAccessControlProfilePropertiesSerializer(item["properties"]), + }; +} + +export function galleryInVMAccessControlProfileDeserializer( + item: any, +): GalleryInVMAccessControlProfile { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : galleryInVMAccessControlProfilePropertiesDeserializer(item["properties"]), + }; +} + +/** Describes the properties of a gallery inVMAccessControlProfile. */ +export interface GalleryInVMAccessControlProfileProperties extends GalleryResourceProfilePropertiesBase { + /** The description of this gallery inVMAccessControlProfile resources. This property is updatable. */ + description?: string; + /** This property allows you to specify the OS type of the VMs/VMSS for which this profile can be used against. Possible values are: 'Windows' or 'Linux' */ + osType: OperatingSystemTypes; + /** This property allows you to specify the Endpoint type for which this profile is defining the access control for. Possible values are: 'WireServer' or 'IMDS' */ + applicableHostEndpoint: EndpointTypes; +} + +export function galleryInVMAccessControlProfilePropertiesSerializer( + item: GalleryInVMAccessControlProfileProperties, +): any { + return { + description: item["description"], + osType: item["osType"], + applicableHostEndpoint: item["applicableHostEndpoint"], + }; +} + +export function galleryInVMAccessControlProfilePropertiesDeserializer( + item: any, +): GalleryInVMAccessControlProfileProperties { + return { + provisioningState: item["provisioningState"], + description: item["description"], + osType: item["osType"], + applicableHostEndpoint: item["applicableHostEndpoint"], + }; +} + +/** This property allows you to specify the Endpoint type for which this profile is defining the access control for. Possible values are: 'WireServer' or 'IMDS' */ +export type EndpointTypes = "WireServer" | "IMDS"; + +/** The properties of a gallery ResourceProfile. */ +export interface GalleryResourceProfilePropertiesBase { + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; +} + +export function galleryResourceProfilePropertiesBaseSerializer( + _item: GalleryResourceProfilePropertiesBase, +): any { + return {}; +} + +export function galleryResourceProfilePropertiesBaseDeserializer( + item: any, +): GalleryResourceProfilePropertiesBase { + return { + provisioningState: item["provisioningState"], + }; +} + +/** Specifies information about the gallery inVMAccessControlProfile that you want to update. */ +export interface GalleryInVMAccessControlProfileUpdate extends UpdateResourceDefinition { + /** Describes the properties of a gallery inVMAccessControlProfile. */ + properties?: GalleryInVMAccessControlProfileProperties; +} + +export function galleryInVMAccessControlProfileUpdateSerializer( + item: GalleryInVMAccessControlProfileUpdate, +): any { + return { + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : galleryInVMAccessControlProfilePropertiesSerializer(item["properties"]), + }; +} + +/** The List Gallery InVMAccessControlProfiles operation response. */ +export interface _GalleryInVMAccessControlProfileList { + /** The GalleryInVMAccessControlProfile items on this page */ + value: GalleryInVMAccessControlProfile[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _galleryInVMAccessControlProfileListDeserializer( + item: any, +): _GalleryInVMAccessControlProfileList { + return { + value: galleryInVMAccessControlProfileArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryInVMAccessControlProfileArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryInVMAccessControlProfileSerializer(item); + }); +} + +export function galleryInVMAccessControlProfileArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryInVMAccessControlProfileDeserializer(item); + }); +} + +/** Specifies information about the gallery inVMAccessControlProfile version that you want to create or update. */ +export interface GalleryInVMAccessControlProfileVersion extends TrackedResource { + /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ + targetLocations?: TargetRegion[]; + /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ + excludeFromLatest?: boolean; + /** The timestamp for when the Resource Profile Version is published. */ + readonly publishedDate?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; + /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ + mode?: AccessControlRulesMode; + /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ + defaultAccess?: EndpointAccess; + /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ + rules?: AccessControlRules; +} + +export function galleryInVMAccessControlProfileVersionSerializer( + item: GalleryInVMAccessControlProfileVersion, +): any { + return { + tags: item["tags"], + location: item["location"], + properties: areAllPropsUndefined(item, [ + "targetLocations", + "excludeFromLatest", + "mode", + "defaultAccess", + "rules", + ]) + ? undefined + : _galleryInVMAccessControlProfileVersionPropertiesSerializer(item), + }; +} + +export function galleryInVMAccessControlProfileVersionDeserializer( + item: any, +): GalleryInVMAccessControlProfileVersion { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _galleryInVMAccessControlProfileVersionPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of an inVMAccessControlProfile version. */ +export interface GalleryInVMAccessControlProfileVersionProperties extends GalleryResourceProfileVersionPropertiesBase { + /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ + mode: AccessControlRulesMode; + /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ + defaultAccess: EndpointAccess; + /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ + rules?: AccessControlRules; +} + +export function galleryInVMAccessControlProfileVersionPropertiesSerializer( + item: GalleryInVMAccessControlProfileVersionProperties, +): any { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArraySerializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + mode: item["mode"], + defaultAccess: item["defaultAccess"], + rules: !item["rules"] ? item["rules"] : accessControlRulesSerializer(item["rules"]), + }; +} + +export function galleryInVMAccessControlProfileVersionPropertiesDeserializer( + item: any, +): GalleryInVMAccessControlProfileVersionProperties { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArrayDeserializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + mode: item["mode"], + defaultAccess: item["defaultAccess"], + rules: !item["rules"] ? item["rules"] : accessControlRulesDeserializer(item["rules"]), + }; +} + +/** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ +export enum KnownAccessControlRulesMode { + /** Audit */ + Audit = "Audit", + /** Enforce */ + Enforce = "Enforce", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. \ + * {@link KnownAccessControlRulesMode} can be used interchangeably with AccessControlRulesMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Audit** \ + * **Enforce** \ + * **Disabled** + */ +export type AccessControlRulesMode = string; + +/** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ +export enum KnownEndpointAccess { + /** Allow */ + Allow = "Allow", + /** Deny */ + Deny = "Deny", +} + +/** + * This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. \ + * {@link KnownEndpointAccess} can be used interchangeably with EndpointAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** \ + * **Deny** + */ +export type EndpointAccess = string; + +/** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ +export interface AccessControlRules { + /** A list of privileges. */ + privileges?: AccessControlRulesPrivilege[]; + /** A list of roles. */ + roles?: AccessControlRulesRole[]; + /** A list of identities. */ + identities?: AccessControlRulesIdentity[]; + /** A list of role assignments. */ + roleAssignments?: AccessControlRulesRoleAssignment[]; +} + +export function accessControlRulesSerializer(item: AccessControlRules): any { + return { + privileges: !item["privileges"] + ? item["privileges"] + : accessControlRulesPrivilegeArraySerializer(item["privileges"]), + roles: !item["roles"] ? item["roles"] : accessControlRulesRoleArraySerializer(item["roles"]), + identities: !item["identities"] + ? item["identities"] + : accessControlRulesIdentityArraySerializer(item["identities"]), + roleAssignments: !item["roleAssignments"] + ? item["roleAssignments"] + : accessControlRulesRoleAssignmentArraySerializer(item["roleAssignments"]), + }; +} + +export function accessControlRulesDeserializer(item: any): AccessControlRules { + return { + privileges: !item["privileges"] + ? item["privileges"] + : accessControlRulesPrivilegeArrayDeserializer(item["privileges"]), + roles: !item["roles"] ? item["roles"] : accessControlRulesRoleArrayDeserializer(item["roles"]), + identities: !item["identities"] + ? item["identities"] + : accessControlRulesIdentityArrayDeserializer(item["identities"]), + roleAssignments: !item["roleAssignments"] + ? item["roleAssignments"] + : accessControlRulesRoleAssignmentArrayDeserializer(item["roleAssignments"]), + }; +} + +export function accessControlRulesPrivilegeArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesPrivilegeSerializer(item); + }); +} + +export function accessControlRulesPrivilegeArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesPrivilegeDeserializer(item); + }); +} + +/** The properties of an Access Control Rule Privilege. */ +export interface AccessControlRulesPrivilege { + /** The name of the privilege. */ + name: string; + /** The HTTP path corresponding to the privilege. */ + path: string; + /** The query parameters to match in the path. */ + queryParameters?: Record; +} + +export function accessControlRulesPrivilegeSerializer(item: AccessControlRulesPrivilege): any { + return { name: item["name"], path: item["path"], queryParameters: item["queryParameters"] }; +} + +export function accessControlRulesPrivilegeDeserializer(item: any): AccessControlRulesPrivilege { + return { + name: item["name"], + path: item["path"], + queryParameters: !item["queryParameters"] + ? item["queryParameters"] + : Object.fromEntries( + Object.entries(item["queryParameters"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +export function accessControlRulesRoleArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesRoleSerializer(item); + }); +} + +export function accessControlRulesRoleArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesRoleDeserializer(item); + }); +} + +/** The properties of an Access Control Rule Role. */ +export interface AccessControlRulesRole { + /** The name of the role. */ + name: string; + /** A list of privileges needed by this role. */ + privileges: string[]; +} + +export function accessControlRulesRoleSerializer(item: AccessControlRulesRole): any { + return { + name: item["name"], + privileges: item["privileges"].map((p: any) => { + return p; + }), + }; +} + +export function accessControlRulesRoleDeserializer(item: any): AccessControlRulesRole { + return { + name: item["name"], + privileges: item["privileges"].map((p: any) => { + return p; + }), + }; +} + +export function accessControlRulesIdentityArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesIdentitySerializer(item); + }); +} + +export function accessControlRulesIdentityArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesIdentityDeserializer(item); + }); +} + +/** The properties of an Access Control Rule Identity. */ +export interface AccessControlRulesIdentity { + /** The name of the identity. */ + name: string; + /** The username corresponding to this identity. */ + userName?: string; + /** The groupName corresponding to this identity. */ + groupName?: string; + /** The path to the executable. */ + exePath?: string; + /** The process name of the executable. */ + processName?: string; +} + +export function accessControlRulesIdentitySerializer(item: AccessControlRulesIdentity): any { + return { + name: item["name"], + userName: item["userName"], + groupName: item["groupName"], + exePath: item["exePath"], + processName: item["processName"], + }; +} + +export function accessControlRulesIdentityDeserializer(item: any): AccessControlRulesIdentity { + return { + name: item["name"], + userName: item["userName"], + groupName: item["groupName"], + exePath: item["exePath"], + processName: item["processName"], + }; +} + +export function accessControlRulesRoleAssignmentArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesRoleAssignmentSerializer(item); + }); +} + +export function accessControlRulesRoleAssignmentArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return accessControlRulesRoleAssignmentDeserializer(item); + }); +} + +/** The properties of an Access Control Rule RoleAssignment. */ +export interface AccessControlRulesRoleAssignment { + /** The name of the role. */ + role: string; + /** A list of identities that can access the privileges defined by the role. */ + identities: string[]; +} + +export function accessControlRulesRoleAssignmentSerializer( + item: AccessControlRulesRoleAssignment, +): any { + return { + role: item["role"], + identities: item["identities"].map((p: any) => { + return p; + }), + }; +} + +export function accessControlRulesRoleAssignmentDeserializer( + item: any, +): AccessControlRulesRoleAssignment { + return { + role: item["role"], + identities: item["identities"].map((p: any) => { + return p; + }), + }; +} + +/** The properties of a gallery ResourceProfile version. */ +export interface GalleryResourceProfileVersionPropertiesBase { + /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ + targetLocations?: TargetRegion[]; + /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ + excludeFromLatest?: boolean; + /** The timestamp for when the Resource Profile Version is published. */ + readonly publishedDate?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; +} + +export function galleryResourceProfileVersionPropertiesBaseSerializer( + item: GalleryResourceProfileVersionPropertiesBase, +): any { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArraySerializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + }; +} + +export function galleryResourceProfileVersionPropertiesBaseDeserializer( + item: any, +): GalleryResourceProfileVersionPropertiesBase { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArrayDeserializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + }; +} + +/** Specifies information about the gallery inVMAccessControlProfile version that you want to update. */ +export interface GalleryInVMAccessControlProfileVersionUpdate extends UpdateResourceDefinition { + /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ + targetLocations?: TargetRegion[]; + /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ + excludeFromLatest?: boolean; + /** The timestamp for when the Resource Profile Version is published. */ + readonly publishedDate?: Date; + /** The provisioning state, which only appears in the response. */ + readonly provisioningState?: GalleryProvisioningState; + /** This is the replication status of the gallery image version. */ + readonly replicationStatus?: ReplicationStatus; + /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ + mode?: AccessControlRulesMode; + /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ + defaultAccess?: EndpointAccess; + /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ + rules?: AccessControlRules; +} + +export function galleryInVMAccessControlProfileVersionUpdateSerializer( + item: GalleryInVMAccessControlProfileVersionUpdate, +): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "targetLocations", + "excludeFromLatest", + "mode", + "defaultAccess", + "rules", + ]) + ? undefined + : _galleryInVMAccessControlProfileVersionUpdatePropertiesSerializer(item), + }; +} + +/** The List Gallery InVMAccessControlProfile Versions operation response. */ +export interface _GalleryInVMAccessControlProfileVersionList { + /** The GalleryInVMAccessControlProfileVersion items on this page */ + value: GalleryInVMAccessControlProfileVersion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _galleryInVMAccessControlProfileVersionListDeserializer( + item: any, +): _GalleryInVMAccessControlProfileVersionList { + return { + value: galleryInVMAccessControlProfileVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function galleryInVMAccessControlProfileVersionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryInVMAccessControlProfileVersionSerializer(item); + }); +} + +export function galleryInVMAccessControlProfileVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return galleryInVMAccessControlProfileVersionDeserializer(item); + }); +} + +/** Specifies information about the Shared Gallery that you want to create or update. */ +export interface SharedGallery extends PirSharedGalleryResource { + /** The artifact tags of a shared gallery resource. */ + readonly artifactTags?: Record; +} + +export function sharedGalleryDeserializer(item: any): SharedGallery { + return { + ...(!item["identifier"] + ? item["identifier"] + : _pirSharedGalleryResourceIdentifierDeserializer(item["identifier"])), + name: item["name"], + location: item["location"], + ...(!item["properties"] + ? item["properties"] + : _sharedGalleryPropertiesDeserializer(item["properties"])), + }; +} + +/** Specifies the properties of a shared gallery */ +export interface SharedGalleryProperties { + /** The artifact tags of a shared gallery resource. */ + readonly artifactTags?: Record; +} + +export function sharedGalleryPropertiesDeserializer(item: any): SharedGalleryProperties { + return { + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +/** Base information about the shared gallery resource in pir. */ +export interface PirSharedGalleryResource extends PirResource { + /** The unique id of this shared gallery. */ + uniqueId?: string; +} + +export function pirSharedGalleryResourceDeserializer(item: any): PirSharedGalleryResource { + return { + name: item["name"], + location: item["location"], + ...(!item["identifier"] + ? item["identifier"] + : _pirSharedGalleryResourceIdentifierDeserializer(item["identifier"])), + }; +} + +/** The identifier information of shared gallery. */ +export interface SharedGalleryIdentifier { + /** The unique id of this shared gallery. */ + uniqueId?: string; +} + +export function sharedGalleryIdentifierDeserializer(item: any): SharedGalleryIdentifier { + return { + uniqueId: item["uniqueId"], + }; +} + +/** The Resource model definition. */ +export interface PirResource { + /** Resource name */ + readonly name?: string; + /** Resource location */ + readonly location?: string; +} + +export function pirResourceDeserializer(item: any): PirResource { + return { + name: item["name"], + location: item["location"], + }; +} + +/** The List Shared Galleries operation response. */ +export interface _SharedGalleryList { + /** A list of shared galleries. */ + value: SharedGallery[]; + /** The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. */ + nextLink?: string; +} + +export function _sharedGalleryListDeserializer(item: any): _SharedGalleryList { + return { + value: sharedGalleryArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function sharedGalleryArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return sharedGalleryDeserializer(item); + }); +} + +/** Specifies information about the gallery image definition that you want to create or update. */ +export interface SharedGalleryImage extends PirSharedGalleryResource { + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ + osType?: OperatingSystemTypes; + /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ + osState?: OperatingSystemStateTypes; + /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This is the gallery image definition identifier. */ + identifier?: GalleryImageIdentifier; + /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ + recommended?: RecommendedMachineConfiguration; + /** Describes the disallowed disk types. */ + disallowed?: Disallowed; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** A list of gallery image features. */ + features?: GalleryImageFeature[]; + /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ + purchasePlan?: ImagePurchasePlan; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; + /** Privacy statement uri for the current community gallery image. */ + privacyStatementUri?: string; + /** End-user license agreement for the current community gallery image. */ + eula?: string; + /** The artifact tags of a shared gallery resource. */ + artifactTags?: Record; +} + +export function sharedGalleryImageDeserializer(item: any): SharedGalleryImage { + return { + ...(!item["identifier"] + ? item["identifier"] + : _pirSharedGalleryResourceIdentifierDeserializer(item["identifier"])), + name: item["name"], + location: item["location"], + ...(!item["properties"] + ? item["properties"] + : _sharedGalleryImagePropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery image definition. */ +export interface SharedGalleryImageProperties { + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ + osType: OperatingSystemTypes; + /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ + osState: OperatingSystemStateTypes; + /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This is the gallery image definition identifier. */ + identifier: GalleryImageIdentifier; + /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ + recommended?: RecommendedMachineConfiguration; + /** Describes the disallowed disk types. */ + disallowed?: Disallowed; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** A list of gallery image features. */ + features?: GalleryImageFeature[]; + /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ + purchasePlan?: ImagePurchasePlan; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; + /** Privacy statement uri for the current community gallery image. */ + privacyStatementUri?: string; + /** End-user license agreement for the current community gallery image. */ + eula?: string; + /** The artifact tags of a shared gallery resource. */ + artifactTags?: Record; +} + +export function sharedGalleryImagePropertiesDeserializer(item: any): SharedGalleryImageProperties { + return { + osType: item["osType"], + osState: item["osState"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + identifier: galleryImageIdentifierDeserializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationDeserializer(item["recommended"]), + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedDeserializer(item["disallowed"]), + hyperVGeneration: item["hyperVGeneration"], + features: !item["features"] + ? item["features"] + : galleryImageFeatureArrayDeserializer(item["features"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanDeserializer(item["purchasePlan"]), + architecture: item["architecture"], + privacyStatementUri: item["privacyStatementUri"], + eula: item["eula"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +/** The List Shared Gallery Images operation response. */ +export interface _SharedGalleryImageList { + /** A list of shared gallery images. */ + value: SharedGalleryImage[]; + /** The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery images. */ + nextLink?: string; +} + +export function _sharedGalleryImageListDeserializer(item: any): _SharedGalleryImageList { + return { + value: sharedGalleryImageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function sharedGalleryImageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return sharedGalleryImageDeserializer(item); + }); +} + +/** Specifies information about the gallery image version that you want to create or update. */ +export interface SharedGalleryImageVersion extends PirSharedGalleryResource { + /** The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + publishedDate?: Date; + /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ + excludeFromLatest?: boolean; + /** Describes the storage profile of the image version. */ + storageProfile?: SharedGalleryImageVersionStorageProfile; + /** The artifact tags of a shared gallery resource. */ + artifactTags?: Record; +} + +export function sharedGalleryImageVersionDeserializer(item: any): SharedGalleryImageVersion { + return { + ...(!item["identifier"] + ? item["identifier"] + : _pirSharedGalleryResourceIdentifierDeserializer(item["identifier"])), + name: item["name"], + location: item["location"], + ...(!item["properties"] + ? item["properties"] + : _sharedGalleryImageVersionPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery image version. */ +export interface SharedGalleryImageVersionProperties { + /** The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + publishedDate?: Date; + /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ + excludeFromLatest?: boolean; + /** Describes the storage profile of the image version. */ + storageProfile?: SharedGalleryImageVersionStorageProfile; + /** The artifact tags of a shared gallery resource. */ + artifactTags?: Record; +} + +export function sharedGalleryImageVersionPropertiesDeserializer( + item: any, +): SharedGalleryImageVersionProperties { + return { + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + excludeFromLatest: item["excludeFromLatest"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : sharedGalleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +/** This is the storage profile of a Gallery Image Version. */ +export interface SharedGalleryImageVersionStorageProfile { + /** This is the OS disk image. */ + osDiskImage?: SharedGalleryOSDiskImage; + /** A list of data disk images. */ + dataDiskImages?: SharedGalleryDataDiskImage[]; +} + +export function sharedGalleryImageVersionStorageProfileDeserializer( + item: any, +): SharedGalleryImageVersionStorageProfile { + return { + osDiskImage: !item["osDiskImage"] + ? item["osDiskImage"] + : sharedGalleryOSDiskImageDeserializer(item["osDiskImage"]), + dataDiskImages: !item["dataDiskImages"] + ? item["dataDiskImages"] + : sharedGalleryDataDiskImageArrayDeserializer(item["dataDiskImages"]), + }; +} + +/** This is the OS disk image. */ +export interface SharedGalleryOSDiskImage extends SharedGalleryDiskImage {} + +export function sharedGalleryOSDiskImageDeserializer(item: any): SharedGalleryOSDiskImage { + return { + diskSizeGB: item["diskSizeGB"], + hostCaching: item["hostCaching"], + }; +} + +export function sharedGalleryDataDiskImageArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return sharedGalleryDataDiskImageDeserializer(item); + }); +} + +/** This is the data disk image. */ +export interface SharedGalleryDataDiskImage extends SharedGalleryDiskImage { + /** This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. */ + lun: number; +} + +export function sharedGalleryDataDiskImageDeserializer(item: any): SharedGalleryDataDiskImage { + return { + diskSizeGB: item["diskSizeGB"], + hostCaching: item["hostCaching"], + lun: item["lun"], + }; +} + +/** This is the disk image base class. */ +export interface SharedGalleryDiskImage { + /** This property indicates the size of the VHD to be created. */ + readonly diskSizeGB?: number; + /** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ + hostCaching?: SharedGalleryHostCaching; +} + +export function sharedGalleryDiskImageDeserializer(item: any): SharedGalleryDiskImage { + return { + diskSizeGB: item["diskSizeGB"], + hostCaching: item["hostCaching"], + }; +} + +/** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ +export enum KnownSharedGalleryHostCaching { + /** None */ + None = "None", + /** ReadOnly */ + ReadOnly = "ReadOnly", + /** ReadWrite */ + ReadWrite = "ReadWrite", +} + +/** + * The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' \ + * {@link KnownSharedGalleryHostCaching} can be used interchangeably with SharedGalleryHostCaching, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **ReadOnly** \ + * **ReadWrite** + */ +export type SharedGalleryHostCaching = string; + +/** The List Shared Gallery Image versions operation response. */ +export interface _SharedGalleryImageVersionList { + /** The SharedGalleryImageVersion items on this page */ + value: SharedGalleryImageVersion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _sharedGalleryImageVersionListDeserializer( + item: any, +): _SharedGalleryImageVersionList { + return { + value: sharedGalleryImageVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function sharedGalleryImageVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return sharedGalleryImageVersionDeserializer(item); + }); +} + +/** Specifies information about the Community Gallery that you want to create or update. */ +export interface CommunityGallery extends PirCommunityGalleryResource { + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: Record; + /** The metadata of community gallery. */ + communityMetadata?: CommunityGalleryMetadata; +} + +export function communityGalleryDeserializer(item: any): CommunityGallery { + return { + name: item["name"], + location: item["location"], + type: item["type"], + ...(!item["identifier"] + ? item["identifier"] + : _pirCommunityGalleryResourceIdentifierDeserializer(item["identifier"])), + ...(!item["properties"] + ? item["properties"] + : _communityGalleryPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a community gallery. */ +export interface CommunityGalleryProperties { + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: Record; + /** The metadata of community gallery. */ + communityMetadata?: CommunityGalleryMetadata; +} + +export function communityGalleryPropertiesDeserializer(item: any): CommunityGalleryProperties { + return { + disclaimer: item["disclaimer"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + communityMetadata: !item["communityMetadata"] + ? item["communityMetadata"] + : communityGalleryMetadataDeserializer(item["communityMetadata"]), + }; +} + +/** The metadata of community gallery. */ +export interface CommunityGalleryMetadata { + /** The publisher URI of this community gallery. */ + publisherUri?: string; + /** The publisher email id of this community gallery. */ + publisherContact: string; + /** The end-user license agreement for this community gallery. */ + eula?: string; + /** A list of public names the gallery has. */ + publicNames: string[]; + /** The link for the privacy statement of this community gallery from the gallery publisher. */ + privacyStatementUri?: string; +} + +export function communityGalleryMetadataDeserializer(item: any): CommunityGalleryMetadata { + return { + publisherUri: item["publisherUri"], + publisherContact: item["publisherContact"], + eula: item["eula"], + publicNames: item["publicNames"].map((p: any) => { + return p; + }), + privacyStatementUri: item["privacyStatementUri"], + }; +} + +/** Base information about the community gallery resource in azure compute gallery. */ +export interface PirCommunityGalleryResource { + /** Resource name */ + readonly name?: string; + /** Resource location */ + readonly location?: string; + /** Resource type */ + readonly type?: string; + /** The unique id of this community gallery. */ + uniqueId?: string; +} + +export function pirCommunityGalleryResourceDeserializer(item: any): PirCommunityGalleryResource { + return { + name: item["name"], + location: item["location"], + type: item["type"], + ...(!item["identifier"] + ? item["identifier"] + : _pirCommunityGalleryResourceIdentifierDeserializer(item["identifier"])), + }; +} + +/** The identifier information of community gallery. */ +export interface CommunityGalleryIdentifier { + /** The unique id of this community gallery. */ + uniqueId?: string; +} + +export function communityGalleryIdentifierDeserializer(item: any): CommunityGalleryIdentifier { + return { + uniqueId: item["uniqueId"], + }; +} + +/** Specifies information about the gallery image definition that you want to create or update. */ +export interface CommunityGalleryImage extends PirCommunityGalleryResource { + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ + osType?: OperatingSystemTypes; + /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ + osState?: OperatingSystemStateTypes; + /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This is the community gallery image definition identifier. */ + identifier?: CommunityGalleryImageIdentifier; + /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ + recommended?: RecommendedMachineConfiguration; + /** Describes the disallowed disk types. */ + disallowed?: Disallowed; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** A list of gallery image features. */ + features?: GalleryImageFeature[]; + /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ + purchasePlan?: ImagePurchasePlan; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; + /** Privacy statement URI for the current community gallery image. */ + privacyStatementUri?: string; + /** The end-user license agreement for the current community gallery image. */ + eula?: string; + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: Record; +} + +export function communityGalleryImageDeserializer(item: any): CommunityGalleryImage { + return { + name: item["name"], + location: item["location"], + type: item["type"], + ...(!item["identifier"] + ? item["identifier"] + : _pirCommunityGalleryResourceIdentifierDeserializer(item["identifier"])), + ...(!item["properties"] + ? item["properties"] + : _communityGalleryImagePropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery image definition. */ +export interface CommunityGalleryImageProperties { + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ + osType: OperatingSystemTypes; + /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ + osState: OperatingSystemStateTypes; + /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** This is the community gallery image definition identifier. */ + identifier: CommunityGalleryImageIdentifier; + /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ + recommended?: RecommendedMachineConfiguration; + /** Describes the disallowed disk types. */ + disallowed?: Disallowed; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** A list of gallery image features. */ + features?: GalleryImageFeature[]; + /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ + purchasePlan?: ImagePurchasePlan; + /** The architecture of the image. Applicable to OS disks only. */ + architecture?: Architecture; + /** Privacy statement URI for the current community gallery image. */ + privacyStatementUri?: string; + /** The end-user license agreement for the current community gallery image. */ + eula?: string; + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: Record; +} + +export function communityGalleryImagePropertiesDeserializer( + item: any, +): CommunityGalleryImageProperties { + return { + osType: item["osType"], + osState: item["osState"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + identifier: communityGalleryImageIdentifierDeserializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationDeserializer(item["recommended"]), + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedDeserializer(item["disallowed"]), + hyperVGeneration: item["hyperVGeneration"], + features: !item["features"] + ? item["features"] + : galleryImageFeatureArrayDeserializer(item["features"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanDeserializer(item["purchasePlan"]), + architecture: item["architecture"], + privacyStatementUri: item["privacyStatementUri"], + eula: item["eula"], + disclaimer: item["disclaimer"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +/** This is the community gallery image definition identifier. */ +export interface CommunityGalleryImageIdentifier { + /** The name of the gallery image definition publisher. */ + publisher?: string; + /** The name of the gallery image definition offer. */ + offer?: string; + /** The name of the gallery image definition SKU. */ + sku?: string; +} + +export function communityGalleryImageIdentifierDeserializer( + item: any, +): CommunityGalleryImageIdentifier { + return { + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + }; +} + +/** The List Community Gallery Images operation response. */ +export interface _CommunityGalleryImageList { + /** A list of community gallery images. */ + value: CommunityGalleryImage[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _communityGalleryImageListDeserializer(item: any): _CommunityGalleryImageList { + return { + value: communityGalleryImageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function communityGalleryImageArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return communityGalleryImageDeserializer(item); + }); +} + +/** Specifies information about the gallery image version that you want to create or update. */ +export interface CommunityGalleryImageVersion extends PirCommunityGalleryResource { + /** The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + publishedDate?: Date; + /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ + excludeFromLatest?: boolean; + /** Describes the storage profile of the image version. */ + storageProfile?: SharedGalleryImageVersionStorageProfile; + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: Record; +} + +export function communityGalleryImageVersionDeserializer(item: any): CommunityGalleryImageVersion { + return { + name: item["name"], + location: item["location"], + type: item["type"], + ...(!item["identifier"] + ? item["identifier"] + : _pirCommunityGalleryResourceIdentifierDeserializer(item["identifier"])), + ...(!item["properties"] + ? item["properties"] + : _communityGalleryImageVersionPropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a gallery image version. */ +export interface CommunityGalleryImageVersionProperties { + /** The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + publishedDate?: Date; + /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ + endOfLifeDate?: Date; + /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ + excludeFromLatest?: boolean; + /** Describes the storage profile of the image version. */ + storageProfile?: SharedGalleryImageVersionStorageProfile; + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: Record; +} + +export function communityGalleryImageVersionPropertiesDeserializer( + item: any, +): CommunityGalleryImageVersionProperties { + return { + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + excludeFromLatest: item["excludeFromLatest"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : sharedGalleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + disclaimer: item["disclaimer"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +/** The List Community Gallery Image versions operation response. */ +export interface _CommunityGalleryImageVersionList { + /** A list of community gallery image versions. */ + value: CommunityGalleryImageVersion[]; + /** The URI to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of community gallery image versions. */ + nextLink?: string; +} + +export function _communityGalleryImageVersionListDeserializer( + item: any, +): _CommunityGalleryImageVersionList { + return { + value: communityGalleryImageVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function communityGalleryImageVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return communityGalleryImageVersionDeserializer(item); + }); +} + +/** The List Soft-deleted Resources operation response. */ +export interface _GallerySoftDeletedResourceList { + /** The GallerySoftDeletedResource items on this page */ + value: GallerySoftDeletedResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _gallerySoftDeletedResourceListDeserializer( + item: any, +): _GallerySoftDeletedResourceList { + return { + value: gallerySoftDeletedResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function gallerySoftDeletedResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return gallerySoftDeletedResourceDeserializer(item); + }); +} + +/** The details information of soft-deleted resource. */ +export interface GallerySoftDeletedResource extends TrackedResource { + /** arm id of the soft-deleted resource */ + resourceArmId?: string; + /** artifact type of the soft-deleted resource */ + softDeletedArtifactType?: SoftDeletedArtifactTypes; + /** The timestamp for when the resource is soft-deleted. In dateTime offset format. */ + softDeletedTime?: string; +} + +export function gallerySoftDeletedResourceDeserializer(item: any): GallerySoftDeletedResource { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _gallerySoftDeletedResourcePropertiesDeserializer(item["properties"])), + }; +} + +/** Describes the properties of a soft-deleted resource. */ +export interface GallerySoftDeletedResourceProperties { + /** arm id of the soft-deleted resource */ + resourceArmId?: string; + /** artifact type of the soft-deleted resource */ + softDeletedArtifactType?: SoftDeletedArtifactTypes; + /** The timestamp for when the resource is soft-deleted. In dateTime offset format. */ + softDeletedTime?: string; +} + +export function gallerySoftDeletedResourcePropertiesDeserializer( + item: any, +): GallerySoftDeletedResourceProperties { + return { + resourceArmId: item["resourceArmId"], + softDeletedArtifactType: item["softDeletedArtifactType"], + softDeletedTime: item["softDeletedTime"], + }; +} + +/** artifact type of the soft-deleted resource */ +export enum KnownSoftDeletedArtifactTypes { + /** Images */ + Images = "Images", +} + +/** + * artifact type of the soft-deleted resource \ + * {@link KnownSoftDeletedArtifactTypes} can be used interchangeably with SoftDeletedArtifactTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Images** + */ +export type SoftDeletedArtifactTypes = string; + +/** Specifies information about the gallery sharing profile update. */ +export interface SharingUpdate { + /** This property allows you to specify the operation type of gallery sharing update. Possible values are: **Add,** **Remove,** **Reset.** */ + operationType: SharingUpdateOperationTypes; + /** A list of sharing profile groups. */ + groups?: SharingProfileGroup[]; +} + +export function sharingUpdateSerializer(item: SharingUpdate): any { + return { + operationType: item["operationType"], + groups: !item["groups"] ? item["groups"] : sharingProfileGroupArraySerializer(item["groups"]), + }; +} + +export function sharingUpdateDeserializer(item: any): SharingUpdate { + return { + operationType: item["operationType"], + groups: !item["groups"] ? item["groups"] : sharingProfileGroupArrayDeserializer(item["groups"]), + }; +} + +/** This property allows you to specify the operation type of gallery sharing update. Possible values are: **Add,** **Remove,** **Reset.** */ +export enum KnownSharingUpdateOperationTypes { + /** Add */ + Add = "Add", + /** Remove */ + Remove = "Remove", + /** Reset */ + Reset = "Reset", + /** EnableCommunity */ + EnableCommunity = "EnableCommunity", +} + +/** + * This property allows you to specify the operation type of gallery sharing update. Possible values are: **Add,** **Remove,** **Reset.** \ + * {@link KnownSharingUpdateOperationTypes} can be used interchangeably with SharingUpdateOperationTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Add** \ + * **Remove** \ + * **Reset** \ + * **EnableCommunity** + */ +export type SharingUpdateOperationTypes = string; + +/** Known values of {@link SelectPermissions} that the service accepts. */ +export enum KnownSelectPermissions { + /** Permissions */ + Permissions = "Permissions", +} + +/** Type of SelectPermissions */ +export type SelectPermissions = string; + +/** Known values of {@link GalleryExpandParams} that the service accepts. */ +export enum KnownGalleryExpandParams { + /** SharingProfile/Groups */ + SharingProfileGroups = "SharingProfile/Groups", +} + +/** Type of GalleryExpandParams */ +export type GalleryExpandParams = string; + +/** Known values of {@link ReplicationStatusTypes} that the service accepts. */ +export enum KnownReplicationStatusTypes { + /** ReplicationStatus */ + ReplicationStatus = "ReplicationStatus", + /** UefiSettings */ + UefiSettings = "UefiSettings", +} + +/** Type of ReplicationStatusTypes */ +export type ReplicationStatusTypes = string; + +/** Known values of {@link SharedToValues} that the service accepts. */ +export enum KnownSharedToValues { + /** tenant */ + Tenant = "tenant", +} + +/** Type of SharedToValues */ +export type SharedToValues = string; + +export function _galleryPropertiesSerializer(item: Gallery): any { + return { + description: item["description"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryIdentifierSerializer(item["identifier"]), + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : sharingProfileSerializer(item["sharingProfile"]), + softDeletePolicy: !item["softDeletePolicy"] + ? item["softDeletePolicy"] + : softDeletePolicySerializer(item["softDeletePolicy"]), + }; +} + +export function _galleryPropertiesDeserializer(item: any) { + return { + description: item["description"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryIdentifierDeserializer(item["identifier"]), + provisioningState: item["provisioningState"], + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : sharingProfileDeserializer(item["sharingProfile"]), + softDeletePolicy: !item["softDeletePolicy"] + ? item["softDeletePolicy"] + : softDeletePolicyDeserializer(item["softDeletePolicy"]), + sharingStatus: !item["sharingStatus"] + ? item["sharingStatus"] + : sharingStatusDeserializer(item["sharingStatus"]), + }; +} + +export function _galleryUpdatePropertiesSerializer(item: GalleryUpdate): any { + return { + description: item["description"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryIdentifierSerializer(item["identifier"]), + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : sharingProfileSerializer(item["sharingProfile"]), + softDeletePolicy: !item["softDeletePolicy"] + ? item["softDeletePolicy"] + : softDeletePolicySerializer(item["softDeletePolicy"]), + }; +} + +export function _galleryUpdatePropertiesDeserializer(item: any) { + return { + description: item["description"], + identifier: !item["identifier"] + ? item["identifier"] + : galleryIdentifierDeserializer(item["identifier"]), + provisioningState: item["provisioningState"], + sharingProfile: !item["sharingProfile"] + ? item["sharingProfile"] + : sharingProfileDeserializer(item["sharingProfile"]), + softDeletePolicy: !item["softDeletePolicy"] + ? item["softDeletePolicy"] + : softDeletePolicyDeserializer(item["softDeletePolicy"]), + sharingStatus: !item["sharingStatus"] + ? item["sharingStatus"] + : sharingStatusDeserializer(item["sharingStatus"]), + }; +} + +export function _galleryImagePropertiesSerializer(item: GalleryImage): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + osType: item["osType"], + osState: item["osState"], + hyperVGeneration: item["hyperVGeneration"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierSerializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationSerializer(item["recommended"]), + disallowed: !item["disallowed"] ? item["disallowed"] : disallowedSerializer(item["disallowed"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanSerializer(item["purchasePlan"]), + features: !item["features"] + ? item["features"] + : galleryImageFeatureArraySerializer(item["features"]), + architecture: item["architecture"], + allowUpdateImage: item["allowUpdateImage"], + }; +} + +export function _galleryImagePropertiesDeserializer(item: any) { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + osType: item["osType"], + osState: item["osState"], + hyperVGeneration: item["hyperVGeneration"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierDeserializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationDeserializer(item["recommended"]), + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedDeserializer(item["disallowed"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanDeserializer(item["purchasePlan"]), + provisioningState: item["provisioningState"], + features: !item["features"] + ? item["features"] + : galleryImageFeatureArrayDeserializer(item["features"]), + architecture: item["architecture"], + allowUpdateImage: item["allowUpdateImage"], + }; +} + +export function _galleryImageUpdatePropertiesSerializer(item: GalleryImageUpdate): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + osType: item["osType"], + osState: item["osState"], + hyperVGeneration: item["hyperVGeneration"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierSerializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationSerializer(item["recommended"]), + disallowed: !item["disallowed"] ? item["disallowed"] : disallowedSerializer(item["disallowed"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanSerializer(item["purchasePlan"]), + features: !item["features"] + ? item["features"] + : galleryImageFeatureArraySerializer(item["features"]), + architecture: item["architecture"], + allowUpdateImage: item["allowUpdateImage"], + }; +} + +export function _galleryImageUpdatePropertiesDeserializer(item: any) { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + osType: item["osType"], + osState: item["osState"], + hyperVGeneration: item["hyperVGeneration"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierDeserializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationDeserializer(item["recommended"]), + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedDeserializer(item["disallowed"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanDeserializer(item["purchasePlan"]), + provisioningState: item["provisioningState"], + features: !item["features"] + ? item["features"] + : galleryImageFeatureArrayDeserializer(item["features"]), + architecture: item["architecture"], + allowUpdateImage: item["allowUpdateImage"], + }; +} + +export function _galleryImageVersionPropertiesSerializer(item: GalleryImageVersion): any { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryImageVersionPublishingProfileSerializer(item["publishingProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : galleryImageVersionStorageProfileSerializer(item["storageProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryImageVersionSafetyProfileSerializer(item["safetyProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : imageVersionSecurityProfileSerializer(item["securityProfile"]), + restore: item["restore"], + }; +} + +export function _galleryImageVersionPropertiesDeserializer(item: any) { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryImageVersionPublishingProfileDeserializer(item["publishingProfile"]), + provisioningState: item["provisioningState"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : galleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryImageVersionSafetyProfileDeserializer(item["safetyProfile"]), + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : imageVersionSecurityProfileDeserializer(item["securityProfile"]), + restore: item["restore"], + validationsProfile: !item["validationsProfile"] + ? item["validationsProfile"] + : validationsProfileDeserializer(item["validationsProfile"]), + }; +} + +export function _galleryImageVersionUpdatePropertiesSerializer( + item: GalleryImageVersionUpdate, +): any { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryImageVersionPublishingProfileSerializer(item["publishingProfile"]), + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : galleryImageVersionStorageProfileSerializer(item["storageProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryImageVersionSafetyProfileSerializer(item["safetyProfile"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : imageVersionSecurityProfileSerializer(item["securityProfile"]), + restore: item["restore"], + }; +} + +export function _galleryImageVersionUpdatePropertiesDeserializer(item: any) { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryImageVersionPublishingProfileDeserializer(item["publishingProfile"]), + provisioningState: item["provisioningState"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : galleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryImageVersionSafetyProfileDeserializer(item["safetyProfile"]), + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : imageVersionSecurityProfileDeserializer(item["securityProfile"]), + restore: item["restore"], + validationsProfile: !item["validationsProfile"] + ? item["validationsProfile"] + : validationsProfileDeserializer(item["validationsProfile"]), + }; +} + +export function _galleryApplicationPropertiesSerializer(item: GalleryApplication): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + supportedOSType: item["supportedOSType"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArraySerializer(item["customActions"]), + }; +} + +export function _galleryApplicationPropertiesDeserializer(item: any) { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + supportedOSType: item["supportedOSType"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArrayDeserializer(item["customActions"]), + }; +} + +export function _galleryApplicationUpdatePropertiesSerializer(item: GalleryApplicationUpdate): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + supportedOSType: item["supportedOSType"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArraySerializer(item["customActions"]), + }; +} + +export function _galleryApplicationUpdatePropertiesDeserializer(item: any) { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + supportedOSType: item["supportedOSType"], + customActions: !item["customActions"] + ? item["customActions"] + : galleryApplicationCustomActionArrayDeserializer(item["customActions"]), + }; +} + +export function _galleryApplicationVersionPropertiesSerializer( + item: GalleryApplicationVersion, +): any { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryApplicationVersionPublishingProfileSerializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryApplicationVersionSafetyProfileSerializer(item["safetyProfile"]), + }; +} + +export function _galleryApplicationVersionPropertiesDeserializer(item: any) { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryApplicationVersionPublishingProfileDeserializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryApplicationVersionSafetyProfileDeserializer(item["safetyProfile"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + }; +} + +export function _galleryApplicationVersionUpdatePropertiesSerializer( + item: GalleryApplicationVersionUpdate, +): any { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryApplicationVersionPublishingProfileSerializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryApplicationVersionSafetyProfileSerializer(item["safetyProfile"]), + }; +} + +export function _galleryApplicationVersionUpdatePropertiesDeserializer(item: any) { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryApplicationVersionPublishingProfileDeserializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryApplicationVersionSafetyProfileDeserializer(item["safetyProfile"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + }; +} + +export function _galleryScriptUpdatePropertiesSerializer(item: GalleryScriptUpdate): any { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] + ? item["endOfLifeDate"] + : item["endOfLifeDate"].toISOString(), + supportedOSType: item["supportedOSType"], + }; +} + +export function _galleryScriptUpdatePropertiesDeserializer(item: any) { + return { + description: item["description"], + eula: item["eula"], + privacyStatementUri: item["privacyStatementUri"], + releaseNoteUri: item["releaseNoteUri"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + supportedOSType: item["supportedOSType"], + provisioningState: item["provisioningState"], + }; +} + +export function _galleryScriptVersionUpdatePropertiesSerializer( + item: GalleryScriptVersionUpdate, +): any { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryScriptVersionPublishingProfileSerializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryScriptVersionSafetyProfileSerializer(item["safetyProfile"]), + }; +} + +export function _galleryScriptVersionUpdatePropertiesDeserializer(item: any) { + return { + publishingProfile: !item["publishingProfile"] + ? item["publishingProfile"] + : galleryScriptVersionPublishingProfileDeserializer(item["publishingProfile"]), + safetyProfile: !item["safetyProfile"] + ? item["safetyProfile"] + : galleryScriptVersionSafetyProfileDeserializer(item["safetyProfile"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + }; +} + +export function _galleryInVMAccessControlProfileVersionPropertiesSerializer( + item: GalleryInVMAccessControlProfileVersion, +): any { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArraySerializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + mode: item["mode"], + defaultAccess: item["defaultAccess"], + rules: !item["rules"] ? item["rules"] : accessControlRulesSerializer(item["rules"]), + }; +} + +export function _galleryInVMAccessControlProfileVersionPropertiesDeserializer(item: any) { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArrayDeserializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + mode: item["mode"], + defaultAccess: item["defaultAccess"], + rules: !item["rules"] ? item["rules"] : accessControlRulesDeserializer(item["rules"]), + }; +} + +export function _galleryInVMAccessControlProfileVersionUpdatePropertiesSerializer( + item: GalleryInVMAccessControlProfileVersionUpdate, +): any { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArraySerializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + mode: item["mode"], + defaultAccess: item["defaultAccess"], + rules: !item["rules"] ? item["rules"] : accessControlRulesSerializer(item["rules"]), + }; +} + +export function _galleryInVMAccessControlProfileVersionUpdatePropertiesDeserializer(item: any) { + return { + targetLocations: !item["targetLocations"] + ? item["targetLocations"] + : targetRegionArrayDeserializer(item["targetLocations"]), + excludeFromLatest: item["excludeFromLatest"], + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + provisioningState: item["provisioningState"], + replicationStatus: !item["replicationStatus"] + ? item["replicationStatus"] + : replicationStatusDeserializer(item["replicationStatus"]), + mode: item["mode"], + defaultAccess: item["defaultAccess"], + rules: !item["rules"] ? item["rules"] : accessControlRulesDeserializer(item["rules"]), + }; +} + +export function _sharedGalleryPropertiesDeserializer(item: any) { + return { + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +export function _pirSharedGalleryResourceIdentifierDeserializer(item: any) { + return { + uniqueId: item["uniqueId"], + }; +} + +export function _sharedGalleryImagePropertiesDeserializer(item: any) { + return { + osType: item["osType"], + osState: item["osState"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + identifier: !item["identifier"] + ? item["identifier"] + : galleryImageIdentifierDeserializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationDeserializer(item["recommended"]), + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedDeserializer(item["disallowed"]), + hyperVGeneration: item["hyperVGeneration"], + features: !item["features"] + ? item["features"] + : galleryImageFeatureArrayDeserializer(item["features"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanDeserializer(item["purchasePlan"]), + architecture: item["architecture"], + privacyStatementUri: item["privacyStatementUri"], + eula: item["eula"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +export function _sharedGalleryImageVersionPropertiesDeserializer(item: any) { + return { + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + excludeFromLatest: item["excludeFromLatest"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : sharedGalleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +export function _communityGalleryPropertiesDeserializer(item: any) { + return { + disclaimer: item["disclaimer"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + communityMetadata: !item["communityMetadata"] + ? item["communityMetadata"] + : communityGalleryMetadataDeserializer(item["communityMetadata"]), + }; +} + +export function _pirCommunityGalleryResourceIdentifierDeserializer(item: any) { + return { + uniqueId: item["uniqueId"], + }; +} + +export function _communityGalleryImagePropertiesDeserializer(item: any) { + return { + osType: item["osType"], + osState: item["osState"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + identifier: !item["identifier"] + ? item["identifier"] + : communityGalleryImageIdentifierDeserializer(item["identifier"]), + recommended: !item["recommended"] + ? item["recommended"] + : recommendedMachineConfigurationDeserializer(item["recommended"]), + disallowed: !item["disallowed"] + ? item["disallowed"] + : disallowedDeserializer(item["disallowed"]), + hyperVGeneration: item["hyperVGeneration"], + features: !item["features"] + ? item["features"] + : galleryImageFeatureArrayDeserializer(item["features"]), + purchasePlan: !item["purchasePlan"] + ? item["purchasePlan"] + : imagePurchasePlanDeserializer(item["purchasePlan"]), + architecture: item["architecture"], + privacyStatementUri: item["privacyStatementUri"], + eula: item["eula"], + disclaimer: item["disclaimer"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +export function _communityGalleryImageVersionPropertiesDeserializer(item: any) { + return { + publishedDate: !item["publishedDate"] ? item["publishedDate"] : new Date(item["publishedDate"]), + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + excludeFromLatest: item["excludeFromLatest"], + storageProfile: !item["storageProfile"] + ? item["storageProfile"] + : sharedGalleryImageVersionStorageProfileDeserializer(item["storageProfile"]), + disclaimer: item["disclaimer"], + artifactTags: !item["artifactTags"] + ? item["artifactTags"] + : Object.fromEntries( + Object.entries(item["artifactTags"]).map(([k, p]: [string, any]) => [k, p]), + ), + }; +} + +export function _gallerySoftDeletedResourcePropertiesDeserializer(item: any) { + return { + resourceArmId: item["resourceArmId"], + softDeletedArtifactType: item["softDeletedArtifactType"], + softDeletedTime: item["softDeletedTime"], + }; +} diff --git a/sdk/compute/arm-compute/src/models/computeSku/index.ts b/sdk/compute/arm-compute/src/models/computeSku/index.ts new file mode 100644 index 000000000000..30d19e53d28f --- /dev/null +++ b/sdk/compute/arm-compute/src/models/computeSku/index.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + ResourceSku, + ResourceSkuCapacity, + ResourceSkuCapacityScaleType, + ResourceSkuLocationInfo, + ResourceSkuZoneDetails, + ResourceSkuCapabilities, + ExtendedLocationType, + ResourceSkuCosts, + ResourceSkuRestrictions, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionInfo, + ResourceSkuRestrictionsReasonCode, +} from "./models.js"; +export { KnownExtendedLocationType } from "./models.js"; diff --git a/sdk/compute/arm-compute/src/models/computeSku/models.ts b/sdk/compute/arm-compute/src/models/computeSku/models.ts new file mode 100644 index 000000000000..a5608b6fb1f4 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/computeSku/models.ts @@ -0,0 +1,314 @@ +// 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 */ +/** The List Resource Skus operation response. */ +export interface _ResourceSkusResult { + /** The ResourceSku items on this page */ + value: ResourceSku[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _resourceSkusResultDeserializer(item: any): _ResourceSkusResult { + return { + value: resourceSkuArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function resourceSkuArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return resourceSkuDeserializer(item); + }); +} + +/** Describes an available Compute SKU. */ +export interface ResourceSku { + /** The type of resource the SKU applies to. */ + readonly resourceType?: string; + /** The name of SKU. */ + readonly name?: string; + /** Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** */ + readonly tier?: string; + /** The Size of the SKU. */ + readonly size?: string; + /** The Family of this particular SKU. */ + readonly family?: string; + /** The Kind of resources that are supported in this SKU. */ + readonly kind?: string; + /** Specifies the number of virtual machines in the scale set. */ + readonly capacity?: ResourceSkuCapacity; + /** The set of locations that the SKU is available. */ + readonly locations?: string[]; + /** A list of locations and availability zones in those locations where the SKU is available. */ + readonly locationInfo?: ResourceSkuLocationInfo[]; + /** The api versions that support this SKU. */ + readonly apiVersions?: string[]; + /** Metadata for retrieving price info. */ + readonly costs?: ResourceSkuCosts[]; + /** A name value pair to describe the capability. */ + readonly capabilities?: ResourceSkuCapabilities[]; + /** The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. */ + readonly restrictions?: ResourceSkuRestrictions[]; +} + +export function resourceSkuDeserializer(item: any): ResourceSku { + return { + resourceType: item["resourceType"], + name: item["name"], + tier: item["tier"], + size: item["size"], + family: item["family"], + kind: item["kind"], + capacity: !item["capacity"] + ? item["capacity"] + : resourceSkuCapacityDeserializer(item["capacity"]), + locations: !item["locations"] + ? item["locations"] + : item["locations"].map((p: any) => { + return p; + }), + locationInfo: !item["locationInfo"] + ? item["locationInfo"] + : resourceSkuLocationInfoArrayDeserializer(item["locationInfo"]), + apiVersions: !item["apiVersions"] + ? item["apiVersions"] + : item["apiVersions"].map((p: any) => { + return p; + }), + costs: !item["costs"] ? item["costs"] : resourceSkuCostsArrayDeserializer(item["costs"]), + capabilities: !item["capabilities"] + ? item["capabilities"] + : resourceSkuCapabilitiesArrayDeserializer(item["capabilities"]), + restrictions: !item["restrictions"] + ? item["restrictions"] + : resourceSkuRestrictionsArrayDeserializer(item["restrictions"]), + }; +} + +/** Describes scaling information of a SKU. */ +export interface ResourceSkuCapacity { + /** The minimum capacity. */ + readonly minimum?: number; + /** The maximum capacity that can be set. */ + readonly maximum?: number; + /** The default capacity. */ + readonly default?: number; + /** The scale type applicable to the sku. */ + readonly scaleType?: ResourceSkuCapacityScaleType; +} + +export function resourceSkuCapacityDeserializer(item: any): ResourceSkuCapacity { + return { + minimum: item["minimum"], + maximum: item["maximum"], + default: item["default"], + scaleType: item["scaleType"], + }; +} + +/** The scale type applicable to the sku. */ +export type ResourceSkuCapacityScaleType = "Automatic" | "Manual" | "None"; + +export function resourceSkuLocationInfoArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuLocationInfoDeserializer(item); + }); +} + +/** Describes an available Compute SKU Location Information. */ +export interface ResourceSkuLocationInfo { + /** Location of the SKU */ + readonly location?: string; + /** List of availability zones where the SKU is supported. */ + readonly zones?: string[]; + /** Details of capabilities available to a SKU in specific zones. */ + readonly zoneDetails?: ResourceSkuZoneDetails[]; + /** The names of extended locations. */ + readonly extendedLocations?: string[]; + /** The type of the extended location. */ + readonly type?: ExtendedLocationType; +} + +export function resourceSkuLocationInfoDeserializer(item: any): ResourceSkuLocationInfo { + return { + location: item["location"], + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + zoneDetails: !item["zoneDetails"] + ? item["zoneDetails"] + : resourceSkuZoneDetailsArrayDeserializer(item["zoneDetails"]), + extendedLocations: !item["extendedLocations"] + ? item["extendedLocations"] + : item["extendedLocations"].map((p: any) => { + return p; + }), + type: item["type"], + }; +} + +export function resourceSkuZoneDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuZoneDetailsDeserializer(item); + }); +} + +/** Describes The zonal capabilities of a SKU. */ +export interface ResourceSkuZoneDetails { + /** The set of zones that the SKU is available in with the specified capabilities. */ + readonly name?: string[]; + /** A list of capabilities that are available for the SKU in the specified list of zones. */ + readonly capabilities?: ResourceSkuCapabilities[]; +} + +export function resourceSkuZoneDetailsDeserializer(item: any): ResourceSkuZoneDetails { + return { + name: !item["name"] + ? item["name"] + : item["name"].map((p: any) => { + return p; + }), + capabilities: !item["capabilities"] + ? item["capabilities"] + : resourceSkuCapabilitiesArrayDeserializer(item["capabilities"]), + }; +} + +export function resourceSkuCapabilitiesArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuCapabilitiesDeserializer(item); + }); +} + +/** Describes The SKU capabilities object. */ +export interface ResourceSkuCapabilities { + /** An invariant to describe the feature. */ + readonly name?: string; + /** An invariant if the feature is measured by quantity. */ + readonly value?: string; +} + +export function resourceSkuCapabilitiesDeserializer(item: any): ResourceSkuCapabilities { + return { + name: item["name"], + value: item["value"], + }; +} + +/** The type of the extended location. */ +export enum KnownExtendedLocationType { + /** EdgeZone */ + EdgeZone = "EdgeZone", +} + +/** + * The type of the extended location. \ + * {@link KnownExtendedLocationType} can be used interchangeably with ExtendedLocationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EdgeZone** + */ +export type ExtendedLocationType = string; + +export function resourceSkuCostsArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return resourceSkuCostsDeserializer(item); + }); +} + +/** Describes metadata for retrieving price info. */ +export interface ResourceSkuCosts { + /** Used for querying price from commerce. */ + readonly meterID?: string; + /** The multiplier is needed to extend the base metered cost. */ + readonly quantity?: number; + /** An invariant to show the extended unit. */ + readonly extendedUnit?: string; +} + +export function resourceSkuCostsDeserializer(item: any): ResourceSkuCosts { + return { + meterID: item["meterID"], + quantity: item["quantity"], + extendedUnit: item["extendedUnit"], + }; +} + +export function resourceSkuRestrictionsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceSkuRestrictionsDeserializer(item); + }); +} + +/** Describes scaling information of a SKU. */ +export interface ResourceSkuRestrictions { + /** The type of restrictions. */ + readonly type?: ResourceSkuRestrictionsType; + /** The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. */ + readonly values?: string[]; + /** The information about the restriction where the SKU cannot be used. */ + readonly restrictionInfo?: ResourceSkuRestrictionInfo; + /** The reason for restriction. */ + readonly reasonCode?: ResourceSkuRestrictionsReasonCode; +} + +export function resourceSkuRestrictionsDeserializer(item: any): ResourceSkuRestrictions { + return { + type: item["type"], + values: !item["values"] + ? item["values"] + : item["values"].map((p: any) => { + return p; + }), + restrictionInfo: !item["restrictionInfo"] + ? item["restrictionInfo"] + : resourceSkuRestrictionInfoDeserializer(item["restrictionInfo"]), + reasonCode: item["reasonCode"], + }; +} + +/** The type of restrictions. */ +export type ResourceSkuRestrictionsType = "Location" | "Zone"; + +/** Describes an available Compute SKU Restriction Information. */ +export interface ResourceSkuRestrictionInfo { + /** Locations where the SKU is restricted */ + readonly locations?: string[]; + /** List of availability zones where the SKU is restricted. */ + readonly zones?: string[]; +} + +export function resourceSkuRestrictionInfoDeserializer(item: any): ResourceSkuRestrictionInfo { + return { + locations: !item["locations"] + ? item["locations"] + : item["locations"].map((p: any) => { + return p; + }), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + }; +} + +/** The reason for restriction. */ +export type ResourceSkuRestrictionsReasonCode = "QuotaId" | "NotAvailableForSubscription"; diff --git a/sdk/compute/arm-compute/src/models/index.ts b/sdk/compute/arm-compute/src/models/index.ts index d411b20ecb0e..c8d218950890 100644 --- a/sdk/compute/arm-compute/src/models/index.ts +++ b/sdk/compute/arm-compute/src/models/index.ts @@ -1,15259 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type * as coreClient from "@azure/core-client"; - -/** 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 { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** 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" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - 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" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; -} - -/** Localized display information for this particular operation. */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; -} - -/** An error response from the Compute service. */ -export interface CloudError { - /** Api error. */ - error?: ApiError; -} - -/** Api error. */ -export interface ApiError { - /** The Api error details */ - details?: ApiErrorBase[]; - /** The Api inner error */ - innererror?: InnerError; - /** The error code. */ - code?: string; - /** The target of the particular error. */ - target?: string; - /** The error message. */ - message?: string; -} - -/** Api error base. */ -export interface ApiErrorBase { - /** The error code. */ - code?: string; - /** The target of the particular error. */ - target?: string; - /** The error message. */ - message?: string; -} - -/** Inner error details. */ -export interface InnerError { - /** The exception type. */ - exceptiontype?: string; - /** The internal error message or exception dump. */ - errordetail?: string; -} - -/** The List Availability Set operation response. */ -export interface AvailabilitySetListResult { - /** The list of availability sets. */ - value: AvailabilitySet[]; - /** The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. */ - nextLink?: string; -} - -export interface SubResource { - /** Resource Id */ - id?: string; -} - -/** Instance view status. */ -export interface InstanceViewStatus { - /** The status code. */ - code?: string; - /** The level code. */ - level?: StatusLevelTypes; - /** The short localizable label for the status. */ - displayStatus?: string; - /** The detailed status message, including for alerts and error messages. */ - message?: string; - /** The time of the status. */ - time?: Date; -} - -/** 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; -} - -/** Specifies Redeploy related Scheduled Event related configurations. */ -export interface UserInitiatedRedeploy { - /** Specifies Redeploy Scheduled Event related configurations. */ - automaticallyApprove?: boolean; -} - -/** Specifies Reboot related Scheduled Event related configurations. */ -export interface UserInitiatedReboot { - /** Specifies Reboot Scheduled Event related configurations. */ - automaticallyApprove?: boolean; -} - -export interface ScheduledEventsAdditionalPublishingTargets { - /** The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event setting. */ - eventGridAndResourceGraph?: 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; -} - -/** 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; -} - -/** Describes the Availability Set properties related to migration to Flexible Virtual Machine Scale Set. */ -export interface VirtualMachineScaleSetMigrationInfo { - /** - * Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultVirtualMachineScaleSetInfo?: DefaultVirtualMachineScaleSetInfo; - /** - * Specifies the Virtual Machine Scale Set that the Availability Set is migrated to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly migrateToVirtualMachineScaleSet?: SubResource; -} - -/** Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API. */ -export interface DefaultVirtualMachineScaleSetInfo { - /** - * Indicates if the the maximum capacity of the default migrated Virtual Machine Scale Set after its migration will be constrained to a limited number of VMs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly constrainedMaximumCapacity?: boolean; - /** - * The default Virtual Machine ScaleSet Uri that the Availability Set will be moved to upon triggering a seamless migration via the ConvertToVirtualMachineScaleSet API. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultVirtualMachineScaleSet?: SubResource; -} - -/** Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. */ -export interface Sku { - /** The sku name. */ - name?: string; - /** Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** */ - tier?: string; - /** Specifies the number of virtual machines in the scale set. */ - capacity?: number; -} - -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: 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; -} - -/** The List capacity reservation group with resource group response. */ -export interface CapacityReservationGroupListResult { - /** The list of capacity reservation groups. */ - value: CapacityReservationGroup[]; - /** The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of capacity reservation groups. */ - nextLink?: string; -} - -export interface SubResourceReadOnly { - /** - * Resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -export interface CapacityReservationGroupInstanceView { - /** - * List of instance view of the capacity reservations under the capacity reservation group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capacityReservations?: CapacityReservationInstanceViewWithName[]; - /** - * List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sharedSubscriptionIds?: SubResourceReadOnly[]; -} - -/** The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. */ -export interface CapacityReservationInstanceView { - /** Unutilized capacity of the capacity reservation. */ - utilizationInfo?: CapacityReservationUtilization; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; -} - -/** Represents the capacity reservation utilization in terms of resources allocated. */ -export interface CapacityReservationUtilization { - /** - * The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentCapacity?: number; - /** - * A list of all virtual machines resource ids allocated against the capacity reservation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachinesAllocated?: SubResourceReadOnly[]; -} - -export interface ResourceSharingProfile { - /** Specifies an array of subscription resource IDs that capacity reservation group is shared with. Block Capacity Reservations does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ - subscriptionIds?: SubResource[]; -} - -/** The List Dedicated Host Group with resource group response. */ -export interface DedicatedHostGroupListResult { - /** The list of dedicated host groups. */ - value: DedicatedHostGroup[]; - /** The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. */ - nextLink?: string; -} - -export interface DedicatedHostGroupInstanceView { - /** List of instance view of the dedicated hosts under the dedicated host group. */ - hosts?: DedicatedHostInstanceViewWithName[]; -} - -/** The instance view of a dedicated host. */ -export interface DedicatedHostInstanceView { - /** - * Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assetId?: string; - /** Unutilized capacity of the dedicated host. */ - availableCapacity?: DedicatedHostAvailableCapacity; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; -} - -/** Dedicated host unutilized capacity. */ -export interface DedicatedHostAvailableCapacity { - /** The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. */ - allocatableVMs?: DedicatedHostAllocatableVM[]; -} - -/** Represents the dedicated host unutilized capacity in terms of a specific VM size. */ -export interface DedicatedHostAllocatableVM { - /** VM size in terms of which the unutilized capacity is represented. */ - vmSize?: string; - /** Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. */ - count?: number; -} - -/** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ -export interface DedicatedHostGroupPropertiesAdditionalCapabilities { - /** The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated Host Group. For the Virtual Machines to be UltraSSD Enabled, UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided. Please refer to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature. **Note:** The ultraSSDEnabled setting can only be enabled for Host Groups that are created as zonal. Minimum api-version: 2022-03-01. */ - ultraSSDEnabled?: boolean; -} - -/** The List Image operation response. */ -export interface ImageListResult { - /** The list of Images */ - value: Image[]; - /** The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. */ - nextLink?: string; -} - -/** Describes a storage profile. */ -export interface ImageStorageProfile { - /** 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?: ImageOSDisk; - /** 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?: ImageDataDisk[]; - /** Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). */ - zoneResilient?: boolean; -} - -/** Describes a image disk. */ -export interface ImageDisk { - /** The snapshot. */ - snapshot?: SubResource; - /** The managedDisk. */ - managedDisk?: SubResource; - /** The Virtual Hard Disk. */ - blobUri?: string; - /** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.** */ - caching?: CachingTypes; - /** Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. This value cannot be larger than 1023 GB. */ - diskSizeGB?: number; - /** 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 image disk. */ - diskEncryptionSet?: DiskEncryptionSetParameters; -} - -/** The complex type of the extended location. */ -export interface ExtendedLocation { - /** The name of the extended location. */ - name?: string; - /** The type of the extended location. */ - type?: ExtendedLocationTypes; -} - -/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ -export interface PurchasePlan { - /** The publisher ID. */ - publisher: string; - /** The plan ID. */ - name: string; - /** Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. */ - product: string; -} - -/** Contains the os disk image information. */ -export interface OSDiskImage { - /** The operating system of the osDiskImage. */ - operatingSystem: OperatingSystemTypes; -} - -/** Contains the data disk images information. */ -export interface DataDiskImage { - /** - * 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. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lun?: number; -} - -/** Describes automatic OS upgrade properties on the image. */ -export interface AutomaticOSUpgradeProperties { - /** Specifies whether automatic OS upgrade is supported on the image. */ - automaticOSUpgradeSupported: boolean; -} - -/** Specifies the disallowed configuration for a virtual machine image. */ -export interface DisallowedConfiguration { - /** VM disk types which are disallowed. */ - vmDiskType?: VmDiskTypes; -} - -/** Specifies additional capabilities supported by the image */ -export interface VirtualMachineImageFeature { - /** The name of the feature. */ - name?: string; - /** The corresponding value for the feature. */ - value?: string; -} - -/** Describes image deprecation status properties on the image. */ -export interface ImageDeprecationStatus { - /** Describes the state of the image. */ - imageState?: ImageState; - /** The time, in future, at which this image will be marked as deprecated. This scheduled time is chosen by the Publisher. */ - scheduledDeprecationTime?: Date; - /** Describes the alternative option specified by the Publisher for this image when this image is deprecated. */ - alternativeOption?: AlternativeOption; -} - -/** Describes the alternative option specified by the Publisher for this image when this image is deprecated. */ -export interface AlternativeOption { - /** Describes the type of the alternative option. */ - type?: AlternativeType; - /** Indicates the alternative option value specified by the Publisher. This is the Offer name when the type is Offer or the Plan name when the type is Plan. */ - value?: string; -} - -/** The List VmImages in EdgeZone operation response. */ -export interface VmImagesInEdgeZoneListResult { - /** The list of VMImages in EdgeZone */ - value?: VirtualMachineImageResource[]; - /** The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of VmImages. */ - nextLink?: string; -} - -/** Api input base class for LogAnalytics Api. */ -export interface LogAnalyticsInputBase { - /** SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. */ - blobContainerSasUri: string; - /** From time of the query */ - fromTime: Date; - /** To time of the query */ - toTime: Date; - /** Group query result by Throttle Policy applied. */ - groupByThrottlePolicy?: boolean; - /** Group query result by Operation Name. */ - groupByOperationName?: boolean; - /** Group query result by Resource Name. */ - groupByResourceName?: boolean; - /** Group query result by Client Application ID. */ - groupByClientApplicationId?: boolean; - /** Group query result by User Agent. */ - groupByUserAgent?: boolean; -} - -/** LogAnalytics operation status response */ -export interface LogAnalyticsOperationResult { - /** - * LogAnalyticsOutput - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly properties?: LogAnalyticsOutput; -} - -/** LogAnalytics output properties */ -export interface LogAnalyticsOutput { - /** - * Output file Uri path to blob container. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly output?: string; -} - -/** The List Virtual Machine operation response. */ -export interface RunCommandListResult { - /** The list of virtual machine run commands. */ - value: RunCommandDocumentBase[]; - /** The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. */ - nextLink?: string; -} - -/** Describes the properties of a Run Command metadata. */ -export interface RunCommandDocumentBase { - /** The VM run command schema. */ - schema: string; - /** The VM run command id. */ - id: string; - /** The Operating System type. */ - osType: OperatingSystemTypes; - /** The VM run command label. */ - label: string; - /** The VM run command description. */ - description: string; -} - -/** Describes the properties of a run command parameter. */ -export interface RunCommandParameterDefinition { - /** The run command parameter name. */ - name: string; - /** The run command parameter type. */ - type: string; - /** The run command parameter default value. */ - defaultValue?: string; - /** The run command parameter required. */ - required?: boolean; -} - -/** The List Usages operation response. */ -export interface ListUsagesResult { - /** The list of compute resource usages. */ - value: Usage[]; - /** The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information. */ - nextLink?: string; -} - -/** Describes Compute Resource Usage. */ -export interface Usage { - /** An enum describing the unit of usage measurement. */ - unit: "Count"; - /** The current usage of the resource. */ - currentValue: number; - /** The maximum permitted usage of the resource. */ - limit: number; - /** The name of the type of usage. */ - name: UsageName; -} - -/** The Usage Names. */ -export interface UsageName { - /** The name of the resource. */ - value?: string; - /** The localized name of the resource. */ - localizedValue?: string; -} - -/** The List Virtual Machine operation response. */ -export interface VirtualMachineScaleSetListResult { - /** The list of virtual machine scale sets. */ - value: VirtualMachineScaleSet[]; - /** The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. */ - nextLink?: string; -} - -/** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ -export interface Plan { - /** The plan ID. */ - name?: string; - /** The publisher ID. */ - publisher?: string; - /** Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. */ - product?: string; - /** The promotion code. */ - promotionCode?: string; -} - -/** Describes an upgrade policy - automatic, manual, or rolling. */ -export interface UpgradePolicy { - /** Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time. */ - mode?: UpgradeMode; - /** The configuration parameters used while performing a rolling upgrade. */ - rollingUpgradePolicy?: RollingUpgradePolicy; - /** Configuration parameters used for performing automatic OS Upgrade. */ - automaticOSUpgradePolicy?: AutomaticOSUpgradePolicy; -} - -/** The configuration parameters used while performing a rolling upgrade. */ -export interface RollingUpgradePolicy { - /** The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. */ - maxBatchInstancePercent?: number; - /** The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. */ - maxUnhealthyInstancePercent?: number; - /** The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. */ - maxUnhealthyUpgradedInstancePercent?: number; - /** The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). */ - pauseTimeBetweenBatches?: string; - /** Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. */ - enableCrossZoneUpgrade?: boolean; - /** Upgrade all unhealthy instances in a scale set before any healthy instances. */ - prioritizeUnhealthyInstances?: boolean; - /** Rollback failed instances to previous model if the Rolling Upgrade policy is violated. */ - rollbackFailedInstancesOnPolicyBreach?: boolean; - /** Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch. */ - maxSurge?: boolean; -} - -/** The configuration parameters used for performing automatic OS upgrade. */ -export interface AutomaticOSUpgradePolicy { - /** Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false. If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. */ - enableAutomaticOSUpgrade?: boolean; - /** Whether OS image rollback feature should be disabled. Default value is false. */ - disableAutomaticRollback?: boolean; - /** Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. */ - useRollingUpgradePolicy?: boolean; - /** Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS upgrades will send advanced notifications on a per-VM basis that an OS upgrade from rolling upgrades is incoming, via the IMDS tag 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is approved via an ApproveRollingUpgrade call. */ - osRollingUpgradeDeferral?: boolean; -} - -/** Specifies the configuration parameters for automatic repairs on the virtual machine scale set. */ -export interface AutomaticRepairsPolicy { - /** Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. */ - enabled?: boolean; - /** The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). */ - gracePeriod?: string; - /** Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace. */ - repairAction?: RepairAction; -} - -/** Describes a virtual machine scale set virtual machine profile. */ -export interface VirtualMachineScaleSetVMProfile { - /** Specifies the operating system settings for the virtual machines in the scale set. */ - osProfile?: VirtualMachineScaleSetOSProfile; - /** Specifies the storage settings for the virtual machine disks. */ - storageProfile?: VirtualMachineScaleSetStorageProfile; - /** Specifies properties of the network interfaces of the virtual machines in the scale set. */ - networkProfile?: VirtualMachineScaleSetNetworkProfile; - /** Specifies the Security related profile settings for the virtual machines in the scale set. */ - securityProfile?: SecurityProfile; - /** Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. */ - diagnosticsProfile?: DiagnosticsProfile; - /** Specifies a collection of settings for extensions installed on virtual machines in the scale set. */ - extensionProfile?: VirtualMachineScaleSetExtensionProfile; - /** 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 priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview. */ - priority?: VirtualMachinePriorityTypes; - /** Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. */ - evictionPolicy?: VirtualMachineEvictionPolicyTypes; - /** Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. */ - billingProfile?: BillingProfile; - /** Specifies Scheduled Event related configurations. */ - scheduledEventsProfile?: ScheduledEventsProfile; - /** UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. */ - userData?: string; - /** Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01. */ - capacityReservation?: CapacityReservationProfile; - /** Specifies the gallery applications that should be made available to the VM/VMSS */ - applicationProfile?: ApplicationProfile; - /** Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. */ - hardwareProfile?: VirtualMachineScaleSetHardwareProfile; - /** Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01 */ - serviceArtifactReference?: ServiceArtifactReference; - /** Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01 */ - securityPostureReference?: SecurityPostureReference; - /** - * Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; -} - -/** Describes a virtual machine scale set OS profile. */ -export interface VirtualMachineScaleSetOSProfile { - /** Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. */ - computerNamePrefix?: string; - /** Specifies the name of the administrator account.

**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) - * This value contains a credential. Consider obscuring before showing to users - */ - 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. For using cloud-init for your 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 machines in the scale set. 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 scale set. This may only be set to False when no extensions are present on the virtual machine scale set. */ - allowExtensionOperations?: boolean; - /** Optional property which must either be set to True or omitted. */ - requireGuestProvisionSignal?: boolean; -} - -/** 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; - /** - * Indicates whether VMAgent Platform Updates are enabled for the Windows Virtual Machine. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly enableVMAgentPlatformUpdates?: boolean; -} - -/** 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; -} - -/** 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; -} - -/** 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; -} - -/** Describes Windows Remote Management configuration of the VM */ -export interface WinRMConfiguration { - /** The list of Windows Remote Management listeners */ - listeners?: WinRMListener[]; -} - -/** 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; -} - -/** 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; -} - -/** 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[]; -} - -/** 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; -} - -/** 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; -} - -/** 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; -} - -/** 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[]; -} - -/** 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 <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. */ - certificateStore?: string; -} - -/** Describes a virtual machine scale set storage profile. */ -export interface VirtualMachineScaleSetStorageProfile { - /** 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 machines in the scale set. 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?: VirtualMachineScaleSetOSDisk; - /** Specifies the parameters that are used to add data disks to the virtual machines in the scale set. 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?: VirtualMachineScaleSetDataDisk[]; - /** Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01 */ - diskControllerType?: DiskControllerTypes; -} - -/** Describes a virtual machine scale set operating system disk. */ -export interface VirtualMachineScaleSetOSDisk { - /** The disk name. */ - name?: string; - /** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **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 machines in the scale set should be created. The only allowed value is: **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. */ - createOption: DiskCreateOptionTypes; - /** Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. */ - diffDiskSettings?: DiffDiskSettings; - /** 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; - /** 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 information about the unmanaged user image to base the scale set on. */ - image?: VirtualHardDisk; - /** Specifies the container urls that are used to store operating system disks for the scale set. */ - vhdContainers?: string[]; - /** The managed disk parameters. */ - managedDisk?: VirtualMachineScaleSetManagedDiskParameters; - /** Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

**Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.

**Detach** If this value is used, the OS disk is retained after VMSS Flex VM is deleted.

The default value is set to **Delete**. For an Ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. */ - deleteOption?: DiskDeleteOptionTypes; -} - -/** 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. Refer to the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Minimum api-version for NvmeDisk: 2024-03-01. */ - placement?: DiffDiskPlacement; -} - -/** Describes the uri of a disk. */ -export interface VirtualHardDisk { - /** Specifies the virtual hard disk's uri. */ - uri?: string; -} - -/** Describes the parameters of a ScaleSet managed disk. */ -export interface VirtualMachineScaleSetManagedDiskParameters { - /** 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; -} - -/** 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; -} - -/** Describes a virtual machine scale set data disk. */ -export interface VirtualMachineScaleSetDataDisk { - /** The disk name. */ - name?: string; - /** 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; - /** Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.** */ - caching?: CachingTypes; - /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ - writeAcceleratorEnabled?: boolean; - /** The create option. */ - 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?: VirtualMachineScaleSetManagedDiskParameters; - /** Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. */ - diskIopsReadWrite?: number; - /** Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. */ - diskMBpsReadWrite?: number; - /** Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

**Delete** If this value is used, the data disk is deleted when the VMSS Flex VM is deleted.

**Detach** If this value is used, the data disk is retained after VMSS Flex VM is deleted.

The default value is set to **Delete**. */ - deleteOption?: DiskDeleteOptionTypes; -} - -/** Describes a virtual machine scale set network profile. */ -export interface VirtualMachineScaleSetNetworkProfile { - /** A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. */ - healthProbe?: ApiEntityReference; - /** The list of network configurations. */ - networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; - /** specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible' */ - networkApiVersion?: NetworkApiVersion; -} - -/** The API entity reference. */ -export interface ApiEntityReference { - /** The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... */ - id?: string; -} - -/** Describes a virtual machine scale set network profile's network configurations. */ -export interface VirtualMachineScaleSetNetworkConfiguration { - /** The network configuration name. */ - name: string; - /** Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration */ - tags?: { [propertyName: string]: string }; - /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ - primary?: boolean; - /** 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; - /** The network security group. */ - networkSecurityGroup?: SubResource; - /** The dns settings to be applied on the network interfaces. */ - dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; - /** Specifies the IP configurations of the network interface. */ - ipConfigurations?: VirtualMachineScaleSetIPConfiguration[]; - /** Whether IP forwarding enabled on this NIC. */ - enableIPForwarding?: boolean; - /** Specify what happens to the network interface when the VM is deleted */ - deleteOption?: DeleteOptions; - /** 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; -} - -/** Describes a virtual machines scale sets network configuration's DNS settings. */ -export interface VirtualMachineScaleSetNetworkConfigurationDnsSettings { - /** List of DNS servers IP addresses */ - dnsServers?: string[]; -} - -/** Describes a virtual machine scale set network profile's IP configuration. */ -export interface VirtualMachineScaleSetIPConfiguration { - /** The IP configuration name. */ - name: string; - /** Specifies the identifier of the subnet. */ - subnet?: ApiEntityReference; - /** Specifies the primary network interface in case the virtual machine has more than 1 network interface. */ - primary?: boolean; - /** The publicIPAddressConfiguration. */ - publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration; - /** 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?: IPVersion; - /** Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. */ - applicationGatewayBackendAddressPools?: SubResource[]; - /** Specifies an array of references to application security group. */ - applicationSecurityGroups?: SubResource[]; - /** Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. */ - loadBalancerBackendAddressPools?: SubResource[]; - /** Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. */ - loadBalancerInboundNatPools?: SubResource[]; -} - -/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ -export interface VirtualMachineScaleSetPublicIPAddressConfiguration { - /** The publicIP address configuration name. */ - name: string; - /** 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?: { [propertyName: string]: string }; - /** The idle timeout of the public IP address. */ - idleTimeoutInMinutes?: number; - /** The dns settings to be applied on the publicIP addresses . */ - dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; - /** The list of IP tags associated with the public IP address. */ - ipTags?: VirtualMachineScaleSetIpTag[]; - /** 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?: IPVersion; - /** Specify what happens to the public IP when the VM is deleted */ - deleteOption?: DeleteOptions; -} - -/** Describes a virtual machines scale sets network configuration's DNS settings. */ -export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings { - /** The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created */ - domainNameLabel: string; - /** 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 */ - domainNameLabelScope?: DomainNameLabelScopeTypes; -} - -/** Contains the IP tag associated with the public IP address. */ -export interface VirtualMachineScaleSetIpTag { - /** IP tag type. Example: FirstPartyUsage. */ - ipTagType?: string; - /** IP tag associated with the public IP. Example: SQL, Storage etc. */ - tag?: 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; -} - -/** 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 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 api-version: 2023-09-01. */ - proxyAgentSettings?: 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 api-version: 2020-12-01. */ - secureBootEnabled?: boolean; - /** Specifies whether vTPM should be enabled on the virtual machine. Minimum api-version: 2020-12-01. */ - vTpmEnabled?: boolean; -} - -/** 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; -} - -/** 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; -} - -/** 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; -} - -/** Specifies the boot diagnostic settings state. Minimum 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; -} - -/** 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; -} - -/** Describes a virtual machine scale set extension profile. */ -export interface VirtualMachineScaleSetExtensionProfile { - /** The virtual machine scale set child extension resources. */ - extensions?: VirtualMachineScaleSetExtension[]; - /** 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 api-version: 2020-06-01. */ - extensionsTimeBudget?: string; -} - -/** 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; -} - -/** Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01. */ -export interface BillingProfile { - /** Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price.

The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS.

Possible values are:

- Any decimal value greater than zero. Example: 0.01538

-1 – indicates default price to be up-to on-demand.

You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

Minimum api-version: 2019-03-01. */ - maxPrice?: number; -} - -export interface ScheduledEventsProfile { - /** Specifies Terminate Scheduled Event related configurations. */ - terminateNotificationProfile?: TerminateNotificationProfile; - /** Specifies OS Image Scheduled Event related configurations. */ - osImageNotificationProfile?: OSImageNotificationProfile; -} - -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 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; -} - -/** 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 or scaleset vm instances provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details. */ - capacityReservationGroup?: SubResource; -} - -/** Contains the list of gallery applications that should be made available to the VM/VMSS */ -export interface ApplicationProfile { - /** Specifies the gallery applications that should be made available to the VM/VMSS */ - galleryApplications?: VMGalleryApplication[]; -} - -/** 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; -} - -/** Specifies the hardware settings for the virtual machine scale set. */ -export interface VirtualMachineScaleSetHardwareProfile { - /** Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. */ - vmSizeProperties?: VMSizeProperties; -} - -/** Specifies VM Size Property settings on the virtual machine. */ -export interface VMSizeProperties { - /** Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). */ - vCPUsAvailable?: number; - /** Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). **Setting this property to 1 also means that hyper-threading is disabled.** */ - vCPUsPerCore?: number; -} - -/** Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01 */ -export interface ServiceArtifactReference { - /** The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} */ - id?: string; -} - -/** Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01 */ -export interface SecurityPostureReference { - /** The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest */ - id: string; - /** The list of virtual machine extension names to exclude when applying the security posture. */ - excludeExtensions?: string[]; - /** Whether the security posture can be overridden by the user. */ - isOverridable?: boolean; -} - -/** 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; - /** The flag enables the usage of FIPS 140-3 compliant cryptography on the protectedSettings of an extension. Learn more at: https://aka.ms/linuxagentfipssupport. */ - enableFips1403Encryption?: boolean; -} - -/** Describes a scale-in policy for a virtual machine scale set. */ -export interface ScaleInPolicy { - /** The rules to be followed when scaling-in a virtual machine scale set.

Possible values are:

**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

*/ - rules?: VirtualMachineScaleSetScaleInRules[]; - /** This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview) */ - forceDeletion?: boolean; - /** This property allows you to prioritize the deletion of unhealthy and inactive VMs when a virtual machine scale set is being scaled-in.(Feature in Preview) */ - prioritizeUnhealthyVMs?: boolean; -} - -/** Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability and pricing constraint. */ -export interface SpotRestorePolicy { - /** Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints */ - enabled?: boolean; - /** Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances */ - restoreTimeout?: string; -} - -/** Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration mode. With this property the customer is able to specify the base number of regular priority VMs created as the VMSS flex instance scales out and the split between Spot and Regular priority VMs after this base target has been reached. */ -export interface PriorityMixPolicy { - /** The base number of regular priority VMs that will be created in this scale set as it scales out. */ - baseRegularPriorityCount?: number; - /** The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular priority. */ - regularPriorityPercentageAboveBase?: number; -} - -/** Describes an resiliency policy - AutomaticZoneRebalancingPolicy, ResilientVMCreationPolicy and/or ResilientVMDeletionPolicy. */ -export interface ResiliencyPolicy { - /** The configuration parameters used while performing resilient VM creation. */ - resilientVMCreationPolicy?: ResilientVMCreationPolicy; - /** The configuration parameters used while performing resilient VM deletion. */ - resilientVMDeletionPolicy?: ResilientVMDeletionPolicy; - /** The configuration parameters used while performing automatic AZ balancing. */ - automaticZoneRebalancingPolicy?: AutomaticZoneRebalancingPolicy; - /** The configuration parameters used while performing zone allocation. */ - zoneAllocationPolicy?: ZoneAllocationPolicy; -} - -/** The configuration parameters used while performing resilient VM creation. */ -export interface ResilientVMCreationPolicy { - /** Specifies whether resilient VM creation should be enabled on the virtual machine scale set. The default value is false. */ - enabled?: boolean; -} - -/** The configuration parameters used while performing resilient VM deletion. */ -export interface ResilientVMDeletionPolicy { - /** Specifies whether resilient VM deletion should be enabled on the virtual machine scale set. The default value is false. */ - enabled?: boolean; -} - -/** The configuration parameters used while performing automatic AZ balancing. */ -export interface AutomaticZoneRebalancingPolicy { - /** Specifies whether Automatic AZ Balancing should be enabled on the virtual machine scale set. The default value is false. */ - enabled?: boolean; - /** Type of rebalance strategy that will be used for rebalancing virtual machines in the scale set across availability zones. Default and only supported value for now is Recreate. */ - rebalanceStrategy?: RebalanceStrategy; - /** Type of rebalance behavior that will be used for recreating virtual machines in the scale set across availability zones. Default and only supported value for now is CreateBeforeDelete. */ - rebalanceBehavior?: RebalanceBehavior; -} - -/** The configuration parameters for zone allocation of a virtual machine scale set. */ -export interface ZoneAllocationPolicy { - /** The maximum number of availability zones to use if the ZonePlacementPolicy is 'Auto'. If not specified, all availability zones will be used. */ - maxZoneCount?: number; - /** The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set. */ - maxInstancePercentPerZonePolicy?: MaxInstancePercentPerZonePolicy; -} - -/** The configuration parameters used to limit the number of virtual machines per availability zone in the virtual machine scale set. */ -export interface MaxInstancePercentPerZonePolicy { - /** Specifies whether maxInstancePercentPerZonePolicy should be enabled on the virtual machine scale set. */ - enabled?: boolean; - /** Limit on the number of instances in each zone as a percentage of the total capacity of the virtual machine scale set. */ - value?: number; -} - -/** Specifies the sku profile for the virtual machine scale set. With this property the customer is able to specify a list of VM sizes and an allocation strategy. */ -export interface SkuProfile { - /** Specifies the VM sizes for the virtual machine scale set. */ - vmSizes?: SkuProfileVMSize[]; - /** Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. */ - allocationStrategy?: AllocationStrategy; -} - -/** Specifies the VM Size. */ -export interface SkuProfileVMSize { - /** Specifies the name of the VM Size. */ - name?: string; - /** Specifies the rank (a.k.a priority) associated with the VM Size. */ - rank?: number; -} - -/** Identity for the virtual machine scale set. */ -export interface VirtualMachineScaleSetIdentity { - /** - * The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. */ - type?: ResourceIdentityType; - /** The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; -} - -export interface UserAssignedIdentitiesValue { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** Describes the user-defined constraints for resource hardware placement. */ -export interface Placement { - /** Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation. */ - zonePlacementPolicy?: ZonePlacementPolicyType; - /** This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection. */ - includeZones?: string[]; - /** This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection. */ - excludeZones?: string[]; -} - -/** The List Virtual Machine operation response. */ -export interface VirtualMachineListResult { - /** The list of virtual machines. */ - value: VirtualMachine[]; - /** The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. */ - nextLink?: string; -} - -/** Specifies the hardware settings for the virtual machine. */ -export interface HardwareProfile { - /** Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes), [List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list), [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes). The available VM sizes depend on region and availability set. */ - vmSize?: VirtualMachineSizeTypes; - /** Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature is still in preview mode and is not supported for VirtualMachineScaleSet. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. */ - vmSizeProperties?: VMSizeProperties; -} - -/** 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; - /** Specifies whether the regional disks should be aligned/moved to the VM zone. This is applicable only for VMs with placement property set. Please note that this change is irreversible. Minimum api-version: 2024-11-01. */ - alignRegionalDisksToVMZone?: boolean; -} - -/** 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 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:** 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. */ - 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.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. 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; -} - -/** 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; -} - -/** 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; -} - -/** 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:** 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 data disk. 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. */ - 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 Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. */ - diskIopsReadWrite?: number; - /** Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. */ - diskMBpsReadWrite?: number; - /** 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.** 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'. */ - detachOption?: DiskDetachOptionTypes; - /** Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**. */ - deleteOption?: DiskDeleteOptionTypes; -} - -/** 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) - * This value contains a credential. Consider obscuring before showing to users - */ - 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; -} - -/** 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[]; -} - -/** Describes a virtual machine network interface configurations. */ -export interface VirtualMachineNetworkInterfaceConfiguration { - /** The network interface configuration name. */ - name: string; - /** Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration */ - tags?: { [propertyName: string]: string }; - /** 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[]; - 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; -} - -/** Describes a virtual machines network configuration's DNS settings. */ -export interface VirtualMachineNetworkInterfaceDnsSettingsConfiguration { - /** List of DNS servers IP addresses */ - dnsServers?: string[]; -} - -/** Describes a virtual machine network profile's IP configuration. */ -export interface VirtualMachineNetworkInterfaceIPConfiguration { - /** The IP configuration name. */ - name: string; - /** 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[]; -} - -/** Describes a virtual machines IP Configuration's PublicIPAddress configuration */ -export interface VirtualMachinePublicIPAddressConfiguration { - /** The publicIP address configuration name. */ - name: string; - /** 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?: { [propertyName: string]: string }; - /** 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; -} - -/** 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; -} - -/** 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; -} - -/** The instance view of a virtual machine. */ -export interface VirtualMachineInstanceView { - /** Specifies the update domain of the virtual machine. */ - platformUpdateDomain?: number; - /** Specifies the fault domain of the virtual machine. */ - platformFaultDomain?: number; - /** The computer name assigned to the virtual machine. */ - computerName?: string; - /** The Operating System running on the virtual machine. */ - osName?: string; - /** The version of Operating System running on the virtual machine. */ - osVersion?: string; - /** Specifies the HyperVGeneration Type associated with a resource */ - hyperVGeneration?: HyperVGenerationType; - /** The Remote desktop certificate thumbprint. */ - rdpThumbPrint?: string; - /** The VM Agent running on the virtual machine. */ - vmAgent?: VirtualMachineAgentInstanceView; - /** The Maintenance Operation status on the virtual machine. */ - maintenanceRedeployStatus?: MaintenanceRedeployStatus; - /** The virtual machine disk information. */ - disks?: DiskInstanceView[]; - /** The extensions information. */ - extensions?: VirtualMachineExtensionInstanceView[]; - /** - * The health status for the VM. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmHealth?: VirtualMachineHealthStatus; - /** 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. */ - bootDiagnostics?: BootDiagnosticsInstanceView; - /** - * Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. Minimum api-version: 2020-06-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assignedHost?: string; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; - /** [Preview Feature] The status of virtual machine patch operations. */ - patchStatus?: VirtualMachinePatchStatus; - /** - * [Preview Feature] Specifies whether the VM is currently in or out of the Standby Pool. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isVMInStandbyPool?: boolean; -} - -/** The instance view of the VM Agent running on the virtual machine. */ -export interface VirtualMachineAgentInstanceView { - /** The VM Agent full version. */ - vmAgentVersion?: string; - /** The virtual machine extension handler instance view. */ - extensionHandlers?: VirtualMachineExtensionHandlerInstanceView[]; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; -} - -/** The instance view of a virtual machine extension handler. */ -export interface VirtualMachineExtensionHandlerInstanceView { - /** Specifies the type of the extension; an example is "CustomScriptExtension". */ - type?: string; - /** Specifies the version of the script handler. */ - typeHandlerVersion?: string; - /** The extension handler status. */ - status?: InstanceViewStatus; -} - -/** Maintenance Operation Status. */ -export interface MaintenanceRedeployStatus { - /** True, if customer is allowed to perform Maintenance. */ - isCustomerInitiatedMaintenanceAllowed?: boolean; - /** Start Time for the Pre Maintenance Window. */ - preMaintenanceWindowStartTime?: Date; - /** End Time for the Pre Maintenance Window. */ - preMaintenanceWindowEndTime?: Date; - /** Start Time for the Maintenance Window. */ - maintenanceWindowStartTime?: Date; - /** End Time for the Maintenance Window. */ - maintenanceWindowEndTime?: Date; - /** The Last Maintenance Operation Result Code. */ - lastOperationResultCode?: MaintenanceOperationResultCodeTypes; - /** Message returned for the last Maintenance Operation. */ - lastOperationMessage?: string; -} - -/** The instance view of the disk. */ -export interface DiskInstanceView { - /** The disk name. */ - name?: string; - /** Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15 */ - encryptionSettings?: DiskEncryptionSettings[]; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; -} - -/** The instance view of a virtual machine extension. */ -export interface VirtualMachineExtensionInstanceView { - /** The virtual machine extension name. */ - name?: string; - /** Specifies the type of the extension; an example is "CustomScriptExtension". */ - type?: string; - /** Specifies the version of the script handler. */ - typeHandlerVersion?: string; - /** The resource status information. */ - substatuses?: InstanceViewStatus[]; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; -} - -/** The health status of the VM. */ -export interface VirtualMachineHealthStatus { - /** - * The health status information for the VM. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: InstanceViewStatus; -} - -/** The instance view of a virtual machine boot diagnostics. */ -export interface BootDiagnosticsInstanceView { - /** - * The console screenshot blob URI. **Note:** This will **not** be set if boot diagnostics is currently enabled with managed storage. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly consoleScreenshotBlobUri?: string; - /** - * The serial console log blob Uri. **Note:** This will **not** be set if boot diagnostics is currently enabled with managed storage. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly serialConsoleLogBlobUri?: string; - /** - * The boot diagnostics status information for the VM. **Note:** It will be set only if there are errors encountered in enabling boot diagnostics. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: InstanceViewStatus; -} - -/** The status of virtual machine patch operations. */ -export interface VirtualMachinePatchStatus { - /** The available patch summary of the latest assessment operation for the virtual machine. */ - availablePatchSummary?: AvailablePatchSummary; - /** The installation summary of the latest installation operation for the virtual machine. */ - lastPatchInstallationSummary?: LastPatchInstallationSummary; - /** - * The enablement status of the specified patchMode - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly configurationStatuses?: InstanceViewStatus[]; -} - -/** Describes the properties of an virtual machine instance view for available patch summary. */ -export interface AvailablePatchSummary { - /** - * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: PatchOperationStatus; - /** - * The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assessmentActivityId?: string; - /** - * The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly rebootPending?: boolean; - /** - * The number of critical or security patches that have been detected as available and not yet installed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly criticalAndSecurityPatchCount?: number; - /** - * The number of all available patches excluding critical and security. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly otherPatchCount?: number; - /** - * The UTC timestamp when the operation began. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startTime?: Date; - /** - * The UTC timestamp when the operation began. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastModifiedTime?: Date; - /** - * The errors that were encountered during execution of the operation. The details array contains the list of them. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ApiError; -} - -/** Describes the properties of the last installed patch summary. */ -export interface LastPatchInstallationSummary { - /** - * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: PatchOperationStatus; - /** - * The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly installationActivityId?: string; - /** - * Describes whether the operation ran out of time before it completed all its intended actions - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maintenanceWindowExceeded?: boolean; - /** - * The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly notSelectedPatchCount?: number; - /** - * The number of all available patches but excluded explicitly by a customer-specified exclusion list match. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly excludedPatchCount?: number; - /** - * The number of all available patches expected to be installed over the course of the patch installation operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly pendingPatchCount?: number; - /** - * The count of patches that successfully installed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly installedPatchCount?: number; - /** - * The count of patches that failed installation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly failedPatchCount?: number; - /** - * The UTC timestamp when the operation began. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startTime?: Date; - /** - * The UTC timestamp when the operation began. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastModifiedTime?: Date; - /** - * The errors that were encountered during execution of the operation. The details array contains the list of them. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ApiError; -} - -/** Identity for the virtual machine. */ -export interface VirtualMachineIdentity { - /** - * The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. */ - type?: ResourceIdentityType; - /** The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; -} - -/** The List Virtual Machine operation response. */ -export interface VirtualMachineSizeListResult { - /** The list of virtual machine sizes. */ - value?: VirtualMachineSize[]; - /** The link to the next page of items. */ - nextLink?: string; -} - -/** Describes the properties of a VM size. */ -export interface VirtualMachineSize { - /** The name of the virtual machine size. */ - name?: string; - /** The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list */ - numberOfCores?: number; - /** The OS disk size, in MB, allowed by the virtual machine size. */ - osDiskSizeInMB?: number; - /** The resource disk size, in MB, allowed by the virtual machine size. */ - resourceDiskSizeInMB?: number; - /** The amount of memory, in MB, supported by the virtual machine size. */ - memoryInMB?: number; - /** The maximum number of data disks that can be attached to the virtual machine size. */ - maxDataDiskCount?: number; -} - -/** The List Proximity Placement Group operation response. */ -export interface ProximityPlacementGroupListResult { - /** The list of proximity placement groups. */ - value: ProximityPlacementGroup[]; - /** The URI to fetch the next page of proximity placement groups. */ - nextLink?: string; -} - -/** Specifies the user intent of the proximity placement group. */ -export interface ProximityPlacementGroupPropertiesIntent { - /** Specifies possible sizes of virtual machines that can be created in the proximity placement group. */ - vmSizes?: string[]; -} - -/** The List restore point collection operation response. */ -export interface RestorePointCollectionListResult { - /** Gets the list of restore point collections. */ - value: RestorePointCollection[]; - /** The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections. */ - nextLink?: string; -} - -/** The properties of the source resource that this restore point collection is created from. */ -export interface RestorePointCollectionSourceProperties { - /** - * Location of the source resource used to create this restore point collection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** Resource Id of the source resource used to create this restore point collection */ - id?: string; -} - -/** Describes the properties of the Virtual Machine for which the restore point was created. The properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the time of the restore point creation. */ -export interface RestorePointSourceMetadata { - /** - * Gets the hardware profile. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hardwareProfile?: HardwareProfile; - /** Gets the storage profile. */ - storageProfile?: RestorePointSourceVMStorageProfile; - /** - * Gets the OS profile. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osProfile?: OSProfile; - /** - * Gets the diagnostics profile. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diagnosticsProfile?: DiagnosticsProfile; - /** - * Gets the license type, which is for bring your own license scenario. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly licenseType?: string; - /** - * Gets the virtual machine unique id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmId?: string; - /** - * Gets the security profile. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly securityProfile?: SecurityProfile; - /** - * Location of the VM from which the restore point was created. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** - * UserData associated with the source VM for which restore point is captured, which is a base-64 encoded value. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly userData?: string; - /** - * HyperVGeneration of the source VM for which restore point is captured. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hyperVGeneration?: HyperVGenerationTypes; -} - -/** Describes the storage profile. */ -export interface RestorePointSourceVMStorageProfile { - /** Gets the OS disk of the VM captured at the time of the restore point creation. */ - osDisk?: RestorePointSourceVmosDisk; - /** Gets the data disks of the VM captured at the time of the restore point creation. */ - dataDisks?: RestorePointSourceVMDataDisk[]; - /** - * Gets the disk controller type of the VM captured at the time of the restore point creation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskControllerType?: DiskControllerTypes; -} - -/** Describes an Operating System disk. */ -export interface RestorePointSourceVmosDisk { - /** - * Gets the Operating System type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osType?: OperatingSystemType; - /** - * Gets the disk encryption settings. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly encryptionSettings?: DiskEncryptionSettings; - /** - * Gets the disk name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Gets the caching type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly caching?: CachingTypes; - /** - * Gets the disk size in GB. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskSizeGB?: number; - /** Gets the managed disk details */ - managedDisk?: ManagedDiskParameters; - /** Contains Disk Restore Point properties. */ - diskRestorePoint?: DiskRestorePointAttributes; - /** - * Shows true if the disk is write-accelerator enabled. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly writeAcceleratorEnabled?: boolean; -} - -/** Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while creating a restore point. */ -export interface RestorePointEncryption { - /** 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. */ - diskEncryptionSet?: DiskEncryptionSetParameters; - /** The type of key used to encrypt the data of the disk restore point. */ - type?: RestorePointEncryptionType; -} - -/** Describes a data disk. */ -export interface RestorePointSourceVMDataDisk { - /** - * Gets the logical unit number. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lun?: number; - /** - * Gets the disk name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Gets the caching type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly caching?: CachingTypes; - /** - * Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskSizeGB?: number; - /** Contains the managed disk details. */ - managedDisk?: ManagedDiskParameters; - /** Contains Disk Restore Point properties. */ - diskRestorePoint?: DiskRestorePointAttributes; - /** - * Shows true if the disk is write-accelerator enabled. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly writeAcceleratorEnabled?: boolean; -} - -/** The instance view of a restore point. */ -export interface RestorePointInstanceView { - /** The disk restore points information. */ - diskRestorePoints?: DiskRestorePointInstanceView[]; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; -} - -/** The instance view of a disk restore point. */ -export interface DiskRestorePointInstanceView { - /** Disk restore point Id. */ - id?: string; - /** The state of snapshot which determines the access availability of the snapshot. */ - snapshotAccessState?: SnapshotAccessState; - /** The disk restore point replication status information. */ - replicationStatus?: DiskRestorePointReplicationStatus; -} - -/** The instance view of a disk restore point. */ -export interface DiskRestorePointReplicationStatus { - /** The resource status information. */ - status?: InstanceViewStatus; - /** Replication completion percentage. */ - completionPercent?: number; -} - -/** The list SSH public keys operation response. */ -export interface SshPublicKeysGroupListResult { - /** The list of SSH public keys. */ - value: SshPublicKeyResource[]; - /** The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. */ - nextLink?: string; -} - -/** The List Virtual Machine operation response. */ -export interface VirtualMachineScaleSetListWithLinkResult { - /** The list of virtual machine scale sets. */ - value: VirtualMachineScaleSet[]; - /** The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets. */ - nextLink?: string; -} - -/** The Update Resource model definition. */ -export interface UpdateResource { - /** Resource tags */ - tags?: { [propertyName: string]: string }; -} - -/** Describes the Virtual Machine Scale Set to convert from Availability Set. */ -export interface ConvertToVirtualMachineScaleSetInput { - /** Specifies information about the Virtual Machine Scale Set that the Availability Set should be converted to. */ - virtualMachineScaleSetName?: string; -} - -/** Describes the Virtual Machine Scale Set to migrate from Availability Set. */ -export interface MigrateToVirtualMachineScaleSetInput { - /** Specifies information about the Virtual Machine Scale Set that the Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01. */ - virtualMachineScaleSetFlexible: SubResource; -} - -/** The list capacity reservation operation response. */ -export interface CapacityReservationListResult { - /** The list of capacity reservations. */ - value: CapacityReservation[]; - /** The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity reservations. */ - nextLink?: string; -} - -/** Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. */ -export interface ScheduleProfile { - /** The required start date for block capacity reservations. Must be today or within 56 days in the future. For same-day scheduling, requests must be submitted before 11:30 AM UTC. Example: 2025-06-27. */ - start?: string; - /** The required end date for block capacity reservations. Must be after the start date, with a duration of either 1–14 whole days or 3–26 whole weeks. Example: 2025-06-28. */ - end?: string; -} - -/** The list dedicated host operation response. */ -export interface DedicatedHostListResult { - /** The list of dedicated hosts. */ - value: DedicatedHost[]; - /** The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. */ - nextLink?: string; -} - -/** The List Dedicated Host sizes operation response. */ -export interface DedicatedHostSizeListResult { - /** The list of dedicated host sizes. */ - value?: string[]; - /** The link to the next page of items. */ - nextLink?: string; -} - -/** Parameters for GenerateSshKeyPair. */ -export interface SshGenerateKeyPairInputParameters { - /** The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA */ - encryptionType?: SshEncryptionTypes; -} - -/** Response from generation of an SSH key pair. */ -export interface SshPublicKeyGenerateKeyPairResult { - /** Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. */ - privateKey: string; - /** Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. */ - publicKey: string; - /** The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} */ - id: string; -} - -/** Describes a virtual machine scale set virtual machine profile. */ -export interface VirtualMachineScaleSetUpdateVMProfile { - /** The virtual machine scale set OS profile. */ - osProfile?: VirtualMachineScaleSetUpdateOSProfile; - /** The virtual machine scale set storage profile. */ - storageProfile?: VirtualMachineScaleSetUpdateStorageProfile; - /** The virtual machine scale set network profile. */ - networkProfile?: VirtualMachineScaleSetUpdateNetworkProfile; - /** The virtual machine scale set security posture reference. */ - securityPostureReference?: SecurityPostureReferenceUpdate; - /** The virtual machine scale set Security profile */ - securityProfile?: SecurityProfile; - /** The virtual machine scale set diagnostics profile. */ - diagnosticsProfile?: DiagnosticsProfile; - /** The virtual machine scale set extension profile. */ - extensionProfile?: VirtualMachineScaleSetExtensionProfile; - /** The license type, which is for bring your own license scenario. */ - licenseType?: string; - /** Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. */ - billingProfile?: BillingProfile; - /** 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 api-version: 2021-03-01 */ - userData?: string; - /** Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. */ - hardwareProfile?: VirtualMachineScaleSetHardwareProfile; -} - -/** Describes a virtual machine scale set OS profile. */ -export interface VirtualMachineScaleSetUpdateOSProfile { - /** A base-64 encoded string of custom data. */ - customData?: string; - /** The Windows Configuration of the OS profile. */ - windowsConfiguration?: WindowsConfiguration; - /** The Linux Configuration of the OS profile. */ - linuxConfiguration?: LinuxConfiguration; - /** The List of certificates for addition to the VM. */ - secrets?: VaultSecretGroup[]; -} - -/** Describes a virtual machine scale set storage profile. */ -export interface VirtualMachineScaleSetUpdateStorageProfile { - /** The image reference. */ - imageReference?: ImageReference; - /** The OS disk. */ - osDisk?: VirtualMachineScaleSetUpdateOSDisk; - /** The data disks. */ - dataDisks?: VirtualMachineScaleSetDataDisk[]; - /** Specifies the disk controller type configured for the virtual machines in the scale set. **Note:** You need to deallocate the virtual machines in the scale set before updating its disk controller type based on the upgrade mode configured for the scale set. Minimum api-version: 2022-08-01 */ - diskControllerType?: DiskControllerTypes; -} - -/** Describes virtual machine scale set operating system disk Update Object. This should be used for Updating VMSS OS Disk. */ -export interface VirtualMachineScaleSetUpdateOSDisk { - /** The caching type. */ - 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 scale set. */ - diffDiskSettings?: DiffDiskSettings; - /** 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.

diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 */ - diskSizeGB?: number; - /** The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. */ - image?: VirtualHardDisk; - /** The list of virtual hard disk container uris. */ - vhdContainers?: string[]; - /** The managed disk parameters. */ - managedDisk?: VirtualMachineScaleSetManagedDiskParameters; - /** Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

**Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.

**Detach** If this value is used, the OS disk is retained after VMSS Flex VM is deleted.

The default value is set to **Delete**. For an Ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. */ - deleteOption?: DiskDeleteOptionTypes; -} - -/** Describes a virtual machine scale set network profile. */ -export interface VirtualMachineScaleSetUpdateNetworkProfile { - /** A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. */ - healthProbe?: ApiEntityReference; - /** The list of network configurations. */ - networkInterfaceConfigurations?: VirtualMachineScaleSetUpdateNetworkConfiguration[]; - /** specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible' */ - networkApiVersion?: NetworkApiVersion; -} - -/** Describes a virtual machine scale set network profile's network configurations. */ -export interface VirtualMachineScaleSetUpdateNetworkConfiguration { - /** The network configuration name. */ - name?: string; - /** Resource tags applied to the networkInterface address created by this NetworkInterfaceConfiguration */ - tags?: { [propertyName: string]: string }; - /** Whether this is a primary NIC on a virtual machine. */ - primary?: boolean; - /** 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; - /** The network security group. */ - networkSecurityGroup?: SubResource; - /** The dns settings to be applied on the network interfaces. */ - dnsSettings?: VirtualMachineScaleSetNetworkConfigurationDnsSettings; - /** The virtual machine scale set IP Configuration. */ - ipConfigurations?: VirtualMachineScaleSetUpdateIPConfiguration[]; - /** Whether IP forwarding enabled on this NIC. */ - enableIPForwarding?: boolean; - /** Specify what happens to the network interface when the VM is deleted */ - deleteOption?: DeleteOptions; - /** 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; -} - -/** Describes a virtual machine scale set network profile's IP configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual network */ -export interface VirtualMachineScaleSetUpdateIPConfiguration { - /** The IP configuration name. */ - name?: string; - /** The subnet. */ - subnet?: ApiEntityReference; - /** Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. */ - primary?: boolean; - /** The publicIPAddressConfiguration. */ - publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration; - /** 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?: IPVersion; - /** The application gateway backend address pools. */ - applicationGatewayBackendAddressPools?: SubResource[]; - /** Specifies an array of references to application security group. */ - applicationSecurityGroups?: SubResource[]; - /** The load balancer backend address pools. */ - loadBalancerBackendAddressPools?: SubResource[]; - /** The load balancer inbound nat pools. */ - loadBalancerInboundNatPools?: SubResource[]; -} - -/** Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ -export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { - /** The publicIP address configuration name. */ - name?: string; - /** Resource tags applied to the publicIP address created by this PublicIPAddressConfiguration */ - tags?: { [propertyName: string]: string }; - /** The idle timeout of the public IP address. */ - idleTimeoutInMinutes?: number; - /** The dns settings to be applied on the publicIP addresses . */ - dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings; - /** The PublicIPPrefix from which to allocate publicIP addresses. */ - publicIPPrefix?: SubResource; - /** Specify what happens to the public IP when the VM is deleted */ - deleteOption?: DeleteOptions; -} - -/** Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01 */ -export interface SecurityPostureReferenceUpdate { - /** The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest */ - id?: string; - /** The list of virtual machine extension names to exclude when applying the security posture. */ - excludeExtensions?: string[]; - /** Whether the security posture can be overridden by the user. */ - isOverridable?: boolean; -} - -/** Specifies a list of virtual machine instance IDs from the VM scale set. */ -export interface VirtualMachineScaleSetVMInstanceIDs { - /** The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. */ - instanceIds?: string[]; -} - -export interface VMScaleSetConvertToSinglePlacementGroupInput { - /** Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. */ - activePlacementGroupId?: string; -} - -/** Specifies a list of virtual machine instance IDs from the VM scale set. */ -export interface VirtualMachineScaleSetVMInstanceRequiredIDs { - /** The virtual machine scale set instance ids. */ - instanceIds: string[]; -} - -/** The List VM scale set extension operation response. */ -export interface VirtualMachineScaleSetExtensionListResult { - /** The list of VM scale set extensions. */ - value: VirtualMachineScaleSetExtension[]; - /** The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. */ - nextLink?: string; -} - -/** Response after calling a manual recovery walk */ -export interface RecoveryWalkResponse { - /** - * Whether the recovery walk was performed - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly walkPerformed?: boolean; - /** - * The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextPlatformUpdateDomain?: number; -} - -/** The instance view of a virtual machine scale set. */ -export interface VirtualMachineScaleSetInstanceView { - /** - * The instance view status summary for the virtual machine scale set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachine?: VirtualMachineScaleSetInstanceViewStatusesSummary; - /** - * The extensions information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly extensions?: VirtualMachineScaleSetVMExtensionsSummary[]; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; - /** - * The orchestration services information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly orchestrationServices?: OrchestrationServiceSummary[]; -} - -/** Instance view statuses summary for virtual machines of a virtual machine scale set. */ -export interface VirtualMachineScaleSetInstanceViewStatusesSummary { - /** - * The extensions information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusesSummary?: VirtualMachineStatusCodeCount[]; -} - -/** The status code and count of the virtual machine scale set instance view status summary. */ -export interface VirtualMachineStatusCodeCount { - /** - * The instance view status code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The number of instances having a particular status code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly count?: number; -} - -/** Extensions summary for virtual machines of a virtual machine scale set. */ -export interface VirtualMachineScaleSetVMExtensionsSummary { - /** - * The extension name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The extensions information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusesSummary?: VirtualMachineStatusCodeCount[]; -} - -/** Summary for an orchestration service of a virtual machine scale set. */ -export interface OrchestrationServiceSummary { - /** - * The name of the service. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly serviceName?: OrchestrationServiceNames; - /** - * The current state of the service. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly serviceState?: OrchestrationServiceState; - /** - * The latest operation status of the service. Minimum API version for this property is 2025-04-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly latestOperationStatus?: OrchestrationServiceOperationStatus; - /** - * The last UTC time when the operation status changed. Minimum API version for this property is 2025-04-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastStatusChangeTime?: Date; -} - -/** List of Virtual Machine Scale Set OS Upgrade History operation response. */ -export interface VirtualMachineScaleSetListOSUpgradeHistory { - /** The list of OS upgrades performed on the virtual machine scale set. */ - value: UpgradeOperationHistoricalStatusInfo[]; - /** The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. */ - nextLink?: string; -} - -/** Virtual Machine Scale Set OS Upgrade History operation response. */ -export interface UpgradeOperationHistoricalStatusInfo { - /** - * Information about the properties of the upgrade operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly properties?: UpgradeOperationHistoricalStatusInfoProperties; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource location - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; -} - -/** Describes each OS upgrade on the Virtual Machine Scale Set. */ -export interface UpgradeOperationHistoricalStatusInfoProperties { - /** - * Information about the overall status of the upgrade operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly runningStatus?: UpgradeOperationHistoryStatus; - /** - * Counts of the VMs in each state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly progress?: RollingUpgradeProgressInfo; - /** - * Error Details for this upgrade if there are any. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ApiError; - /** - * Invoker of the Upgrade Operation - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startedBy?: UpgradeOperationInvoker; - /** - * Image Reference details - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly targetImageReference?: ImageReference; - /** - * Information about OS rollback if performed - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly rollbackInfo?: RollbackStatusInfo; -} - -/** Information about the current running state of the overall upgrade. */ -export interface UpgradeOperationHistoryStatus { - /** - * Code indicating the current status of the upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: UpgradeState; - /** - * Start time of the upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startTime?: Date; - /** - * End time of the upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly endTime?: Date; -} - -/** Information about the number of virtual machine instances in each upgrade state. */ -export interface RollingUpgradeProgressInfo { - /** - * The number of instances that have been successfully upgraded. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly successfulInstanceCount?: number; - /** - * The number of instances that have failed to be upgraded successfully. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly failedInstanceCount?: number; - /** - * The number of instances that are currently being upgraded. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly inProgressInstanceCount?: number; - /** - * The number of instances that have not yet begun to be upgraded. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly pendingInstanceCount?: number; -} - -/** Information about rollback on failed VM instances after a OS Upgrade operation. */ -export interface RollbackStatusInfo { - /** - * The number of instances which have been successfully rolled back. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly successfullyRolledbackInstanceCount?: number; - /** - * The number of instances which failed to rollback. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly failedRolledbackInstanceCount?: number; - /** - * Error details if OS rollback failed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly rollbackError?: ApiError; -} - -/** Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged */ -export interface VirtualMachineReimageParameters { - /** Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. */ - tempDisk?: boolean; - /** Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk is reimaged to the existing version of OS Disk. */ - exactVersion?: string; - /** Specifies information required for reimaging the non-ephemeral OS disk. */ - osProfile?: OSProfileProvisioningData; -} - -/** Additional parameters for Reimaging Non-Ephemeral Virtual Machine. */ -export interface OSProfileProvisioningData { - /** - * 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) - * This value contains a credential. Consider obscuring before showing to users - */ - 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/). If 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; -} - -/** Information about the current running state of the overall upgrade. */ -export interface RollingUpgradeRunningStatus { - /** - * Code indicating the current status of the upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: RollingUpgradeStatusCode; - /** - * Start time of the upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startTime?: Date; - /** - * The last action performed on the rolling upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastAction?: RollingUpgradeActionType; - /** - * Last action time of the upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastActionTime?: Date; -} - -/** The input for ScaleOut */ -export interface VMScaleSetScaleOutInput { - /** Specifies the number of virtual machines in the scale set. */ - capacity: number; - /** The input properties for ScaleOut */ - properties?: VMScaleSetScaleOutInputProperties; -} - -/** The input properties for ScaleOut */ -export interface VMScaleSetScaleOutInputProperties { - /** The zone in which the scale out is requested for the virtual machine scale set. */ - zone?: string; -} - -/** The input for OrchestrationServiceState */ -export interface OrchestrationServiceStateInput { - /** The name of the service. */ - serviceName: OrchestrationServiceNames; - /** The action to be performed. */ - action: OrchestrationServiceStateAction; -} - -/** The Virtual Machine Scale Set List Skus operation response. */ -export interface VirtualMachineScaleSetListSkusResult { - /** The list of skus available for the virtual machine scale set. */ - value: VirtualMachineScaleSetSku[]; - /** The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus. */ - nextLink?: string; -} - -/** Describes an available virtual machine scale set sku. */ -export interface VirtualMachineScaleSetSku { - /** - * The type of resource the sku applies to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceType?: string; - /** - * The Sku. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sku?: Sku; - /** - * Specifies the number of virtual machines in the scale set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capacity?: VirtualMachineScaleSetSkuCapacity; -} - -/** Describes scaling information of a sku. */ -export interface VirtualMachineScaleSetSkuCapacity { - /** - * The minimum capacity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly minimum?: number; - /** - * The maximum capacity that can be set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maximum?: number; - /** - * The default capacity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly defaultCapacity?: number; - /** - * The scale type applicable to the sku. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly scaleType?: VirtualMachineScaleSetSkuScaleType; -} - -/** The List Virtual Machine Scale Set VMs operation response. */ -export interface VirtualMachineScaleSetVMListResult { - /** The list of virtual machine scale sets VMs. */ - value: VirtualMachineScaleSetVM[]; - /** The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs. */ - nextLink?: string; -} - -/** The instance view of a virtual machine scale set VM. */ -export interface VirtualMachineScaleSetVMInstanceView { - /** The Update Domain count. */ - platformUpdateDomain?: number; - /** The Fault Domain count. */ - platformFaultDomain?: number; - /** The Remote desktop certificate thumbprint. */ - rdpThumbPrint?: string; - /** The VM Agent running on the virtual machine. */ - vmAgent?: VirtualMachineAgentInstanceView; - /** The Maintenance Operation status on the virtual machine. */ - maintenanceRedeployStatus?: MaintenanceRedeployStatus; - /** The disks information. */ - disks?: DiskInstanceView[]; - /** The extensions information. */ - extensions?: VirtualMachineExtensionInstanceView[]; - /** - * The health status for the VM. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmHealth?: VirtualMachineHealthStatus; - /** 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. */ - bootDiagnostics?: BootDiagnosticsInstanceView; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; - /** - * Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. Minimum api-version: 2020-06-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assignedHost?: string; - /** The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. */ - placementGroupId?: string; - /** 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/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). */ - computerName?: string; - /** The Operating System running on the hybrid machine. */ - osName?: string; - /** The version of Operating System running on the hybrid machine. */ - osVersion?: string; - /** The hypervisor generation of the Virtual Machine [V1, V2] */ - hyperVGeneration?: HyperVGeneration; -} - -/** Describes a virtual machine scale set VM network profile. */ -export interface VirtualMachineScaleSetVMNetworkProfileConfiguration { - /** The list of network configurations. */ - networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; -} - -/** The protection policy of a virtual machine scale set VM. */ -export interface VirtualMachineScaleSetVMProtectionPolicy { - /** Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. */ - protectFromScaleIn?: boolean; - /** Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. */ - protectFromScaleSetActions?: boolean; -} - -/** Specifies the input for attaching and detaching a list of managed data disks. */ -export interface AttachDetachDataDisksRequest { - /** The list of managed data disks to be attached. */ - dataDisksToAttach?: DataDisksToAttach[]; - /** The list of managed data disks to be detached. */ - dataDisksToDetach?: DataDisksToDetach[]; -} - -/** Describes the data disk to be attached. */ -export interface DataDisksToAttach { - /** ID of the managed data disk. */ - diskId: string; - /** 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. If not specified, lun would be auto assigned. */ - lun?: number; - /** 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 data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**. */ - deleteOption?: DiskDeleteOptionTypes; - /** Specifies the customer managed disk encryption set resource id for the managed disk. */ - diskEncryptionSet?: DiskEncryptionSetParameters; - /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ - writeAcceleratorEnabled?: boolean; -} - -/** Describes the data disk to be detached. */ -export interface DataDisksToDetach { - /** ID of the managed data disk. */ - diskId: string; - /** Supported options available for Detach of a disk from a VM. Refer to DetachOption object reference for more details. */ - detachOption?: DiskDetachOptionTypes; -} - -/** The List VMSS VM Extension operation response */ -export interface VirtualMachineScaleSetVMExtensionsListResult { - /** The list of VMSS VM extensions */ - value?: VirtualMachineScaleSetVMExtension[]; -} - -/** The SAS URIs of the console screenshot and serial log blobs. */ -export interface RetrieveBootDiagnosticsDataResult { - /** - * The console screenshot blob URI - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly consoleScreenshotBlobUri?: string; - /** - * The serial console log blob URI. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly serialConsoleLogBlobUri?: string; -} - -/** Capture Virtual Machine parameters. */ -export interface RunCommandInput { - /** Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands. */ - commandId: string; - /** Optional. The script to be executed. When this value is given, the given script will override the default script of the command. */ - script?: string[]; - /** The run command parameters. */ - parameters?: RunCommandInputParameter[]; -} - -/** Describes the properties of a run command parameter. */ -export interface RunCommandInputParameter { - /** The run command parameter name. */ - name: string; - /** The run command parameter value. */ - value: string; -} - -export interface RunCommandResult { - /** Run command operation response. */ - value?: InstanceViewStatus[]; -} - -/** The List run command operation response */ -export interface VirtualMachineRunCommandsListResult { - /** The list of run commands. */ - value: VirtualMachineRunCommand[]; - /** The uri to fetch the next page of run commands. */ - nextLink?: string; -} - -/** Describes the script sources for run command. Use only one of these script sources: script, scriptUri, commandId, galleryScriptReferenceId. */ -export interface VirtualMachineRunCommandScriptSource { - /** Specifies the script content to be executed on the VM. */ - script?: string; - /** Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. */ - scriptUri?: string; - /** Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands. */ - commandId?: string; - /** User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. */ - scriptUriManagedIdentity?: RunCommandManagedIdentity; - /** Optional. Specify which shell to use for running the script. These values must match those expected by the extension. Currently supported only for Windows VMs, script uses Powershell 7 when specified. Powershell 7 must be already installed on the machine to use Powershell7 parameter value. */ - scriptShell?: ScriptShellTypes; - /** The resource ID of a Gallery Script version that needs to be executed. Example ID looks like /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}. */ - galleryScriptReferenceId?: string; -} - -/** Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. */ -export interface RunCommandManagedIdentity { - /** Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. */ - clientId?: string; - /** Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. */ - objectId?: string; -} - -/** The instance view of a virtual machine run command. */ -export interface VirtualMachineRunCommandInstanceView { - /** Script execution status. */ - executionState?: ExecutionState; - /** Communicate script configuration errors or execution messages. */ - executionMessage?: string; - /** Exit code returned from script execution. */ - exitCode?: number; - /** Script output stream. */ - output?: string; - /** Script error stream. */ - error?: string; - /** Script start time. */ - startTime?: Date; - /** Script end time. */ - endTime?: Date; - /** The resource status information. */ - statuses?: InstanceViewStatus[]; -} - -/** Describes the properties of an AssessPatches result. */ -export interface VirtualMachineAssessPatchesResult { - /** - * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings." - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: PatchOperationStatus; - /** - * The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assessmentActivityId?: string; - /** - * The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly rebootPending?: boolean; - /** - * The number of critical or security patches that have been detected as available and not yet installed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly criticalAndSecurityPatchCount?: number; - /** - * The number of all available patches excluding critical and security. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly otherPatchCount?: number; - /** - * The UTC timestamp when the operation began. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startDateTime?: Date; - /** - * The list of patches that have been detected as available for installation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly availablePatches?: VirtualMachineSoftwarePatchProperties[]; - /** - * The errors that were encountered during execution of the operation. The details array contains the list of them. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ApiError; -} - -/** Describes the properties of a Virtual Machine software patch. */ -export interface VirtualMachineSoftwarePatchProperties { - /** - * A unique identifier for the patch. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly patchId?: string; - /** - * The friendly name of the patch. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The version number of the patch. This property applies only to Linux patches. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly version?: string; - /** - * The KBID of the patch. Only applies to Windows patches. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly kbId?: string; - /** - * The classification(s) of the patch as provided by the patch publisher. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly classifications?: string[]; - /** - * Describes the reboot requirements of the patch. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly rebootBehavior?: VMGuestPatchRebootBehavior; - /** - * The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly activityId?: string; - /** - * The UTC timestamp when the repository published this patch. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publishedDate?: Date; - /** - * The UTC timestamp of the last update to this patch record. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastModifiedDateTime?: Date; - /** - * Describes the availability of a given patch. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly assessmentState?: PatchAssessmentState; -} - -/** Capture Virtual Machine parameters. */ -export interface VirtualMachineCaptureParameters { - /** The captured virtual hard disk's name prefix. */ - vhdPrefix: string; - /** The destination container name. */ - destinationContainerName: string; - /** Specifies whether to overwrite the destination virtual hard disk, in case of conflict. */ - overwriteVhds: boolean; -} - -/** The List Extension operation response */ -export interface VirtualMachineExtensionsListResult { - /** The list of extensions */ - value?: VirtualMachineExtension[]; -} - -/** Input for InstallPatches as directly received by the API */ -export interface VirtualMachineInstallPatchesParameters { - /** Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours) */ - maximumDuration?: string; - /** Defines when it is acceptable to reboot a VM during a software update operation. */ - rebootSetting: VMGuestPatchRebootSetting; - /** Input for InstallPatches on a Windows VM, as directly received by the API */ - windowsParameters?: WindowsParameters; - /** Input for InstallPatches on a Linux VM, as directly received by the API */ - linuxParameters?: LinuxParameters; -} - -/** Input for InstallPatches on a Windows VM, as directly received by the API */ -export interface WindowsParameters { - /** The update classifications to select when installing patches for Windows. */ - classificationsToInclude?: VMGuestPatchClassificationWindows[]; - /** Kbs to include in the patch operation */ - kbNumbersToInclude?: string[]; - /** Kbs to exclude in the patch operation */ - kbNumbersToExclude?: string[]; - /** Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. */ - excludeKbsRequiringReboot?: boolean; - /** This is used to install patches that were published on or before this given max published date. */ - maxPatchPublishDate?: Date; - /** This is used to include patches that match the given patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only supported as input values in the list. Null, empty and only whitespaces strings as inputs values are not supported. */ - patchNameMasksToInclude?: string[]; - /** This is used to exclude patches that match the given patch name masks. Alphanumeric strings and wildcard expressions consisting of * and ? are only supported as input values in the list. Null, empty and only whitespaces strings as inputs values are not supported. */ - patchNameMasksToExclude?: string[]; -} - -/** Input for InstallPatches on a Linux VM, as directly received by the API */ -export interface LinuxParameters { - /** The update classifications to select when installing patches for Linux. */ - classificationsToInclude?: VMGuestPatchClassificationLinux[]; - /** packages to include in the patch operation. Format: packageName_packageVersion */ - packageNameMasksToInclude?: string[]; - /** packages to exclude in the patch operation. Format: packageName_packageVersion */ - packageNameMasksToExclude?: string[]; - /** This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. */ - maintenanceRunId?: string; -} - -/** The result summary of an installation operation. */ -export interface VirtualMachineInstallPatchesResult { - /** - * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: PatchOperationStatus; - /** - * The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly installationActivityId?: string; - /** - * The reboot state of the VM following completion of the operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly rebootStatus?: VMGuestPatchRebootStatus; - /** - * Whether the operation ran out of time before it completed all its intended actions. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maintenanceWindowExceeded?: boolean; - /** - * The number of patches that were not installed due to the user blocking their installation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly excludedPatchCount?: number; - /** - * The number of patches that were detected as available for install, but did not meet the operation's criteria. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly notSelectedPatchCount?: number; - /** - * The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly pendingPatchCount?: number; - /** - * The number of patches successfully installed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly installedPatchCount?: number; - /** - * The number of patches that could not be installed due to some issue. See errors for details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly failedPatchCount?: number; - /** - * The patches that were installed during the operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly patches?: PatchInstallationDetail[]; - /** - * The UTC timestamp when the operation began. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly startDateTime?: Date; - /** - * The errors that were encountered during execution of the operation. The details array contains the list of them. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ApiError; -} - -/** Information about a specific patch that was encountered during an installation action. */ -export interface PatchInstallationDetail { - /** - * A unique identifier for the patch. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly patchId?: string; - /** - * The friendly name of the patch. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly version?: string; - /** - * The KBID of the patch. Only applies to Windows patches. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly kbId?: string; - /** - * The classification(s) of the patch as provided by the patch publisher. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly classifications?: string[]; - /** - * The state of the patch after the installation operation completed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly installationState?: PatchInstallationState; -} - -/** The input of virtual machine migration from Availability Set to Flexible Virtual Machine Scale Set. */ -export interface MigrateVMToVirtualMachineScaleSetInput { - /** The target zone of VM migration to Flexible Virtual Machine Scale Set. */ - targetZone?: string; - /** The target compute fault domain of VM migration to Flexible Virtual Machine Scale Set. */ - targetFaultDomain?: number; - /** The target Virtual Machine size of VM migration to Flexible Virtual Machine Scale Set. */ - targetVMSize?: string; -} - -/** The List disk access operation response. */ -export interface DiskAccessList { - /** The DiskAccess items on this page */ - value: DiskAccess[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** The Private Endpoint resource. */ -export interface PrivateEndpoint { - /** - * The ARM identifier for Private Endpoint - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** A collection of information about the state of the connection between service consumer and provider. */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - -/** The List disk encryption set operation response. */ -export interface DiskEncryptionSetList { - /** The DiskEncryptionSet items on this page */ - value: DiskEncryptionSet[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots */ -export interface KeyForDiskEncryptionSet { - /** Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. */ - sourceVault?: SourceVault; - /** Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. */ - keyUrl: string; -} - -/** The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} */ -export interface SourceVault { - /** Resource Id */ - id?: string; -} - -/** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ -export interface EncryptionSetIdentity { - /** The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. */ - type?: DiskEncryptionSetIdentityType; - /** - * The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; -} - -/** The List Disks operation response. */ -export interface DiskList { - /** The Disk items on this page */ - value: Disk[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ -export interface DiskPurchasePlan { - /** The plan ID. */ - name: string; - /** The publisher ID. */ - publisher: string; - /** Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. */ - product: string; - /** The Offer Promotion Code. */ - promotionCode?: string; -} - -/** List of supported capabilities persisted on the disk resource for VM use. */ -export interface SupportedCapabilities { - /** The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. */ - diskControllerTypes?: string; - /** True if the image from which the OS disk is created supports accelerated networking. */ - acceleratedNetwork?: boolean; - /** CPU architecture supported by an OS disk. */ - architecture?: Architecture; - /** Refers to the security capability of the disk supported to create a Trusted launch or Confidential VM */ - supportedSecurityOption?: SupportedSecurityOption; -} - -/** Data used when creating a disk. */ -export interface CreationData { - /** This enumerates the possible sources of a disk's creation. */ - createOption: DiskCreateOption; - /** Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. */ - storageAccountId?: string; - /** Disk source information for PIR or user images. */ - imageReference?: ImageDiskReference; - /** Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. */ - galleryImageReference?: ImageDiskReference; - /** If createOption is Import, this is the URI of a blob to be imported into a managed disk. */ - sourceUri?: string; - /** If createOption is Copy, this is the ARM id of the source snapshot or disk. */ - sourceResourceId?: string; - /** - * If this field is set, this is the unique id identifying the source of this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sourceUniqueId?: string; - /** If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). */ - uploadSizeBytes?: number; - /** Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. */ - logicalSectorSize?: number; - /** If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. */ - securityDataUri?: string; - /** If createOption is ImportSecure, this is the URI of a blob to be imported into VM metadata for Confidential VM. */ - securityMetadataUri?: string; - /** Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled. */ - performancePlus?: boolean; - /** Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san volume snapshot. */ - elasticSanResourceId?: string; - /** If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. */ - provisionedBandwidthCopySpeed?: ProvisionedBandwidthCopyOption; - /** For snapshots created from Premium SSD v2 or Ultra disk, this property determines the time in minutes the snapshot is retained for instant access to enable faster restore. */ - instantAccessDurationMinutes?: number; -} - -/** The source image used for creating the disk. */ -export interface ImageDiskReference { - /** A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. */ - id?: string; - /** A relative uri containing a direct shared Azure Compute Gallery image reference. */ - sharedGalleryImageId?: string; - /** A relative uri containing a community Azure Compute Gallery image reference. */ - communityGalleryImageId?: string; - /** If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. */ - lun?: number; -} - -/** Encryption settings for disk or snapshot */ -export interface EncryptionSettingsCollection { - /** Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. */ - enabled: boolean; - /** A collection of encryption settings, one for each disk volume. */ - encryptionSettings?: EncryptionSettingsElement[]; - /** Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. */ - encryptionSettingsVersion?: string; -} - -/** Encryption settings for one disk volume. */ -export interface EncryptionSettingsElement { - /** Key Vault Secret Url and vault id of the disk encryption key */ - diskEncryptionKey?: KeyVaultAndSecretReference; - /** Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. */ - keyEncryptionKey?: KeyVaultAndKeyReference; -} - -/** Key Vault Secret Url and vault id of the encryption key */ -export interface KeyVaultAndSecretReference { - /** Resource id of the KeyVault containing the key or secret */ - sourceVault: SourceVault; - /** Url pointing to a key or secret in KeyVault */ - secretUrl: string; -} - -/** Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey */ -export interface KeyVaultAndKeyReference { - /** Resource id of the KeyVault containing the key or secret */ - sourceVault: SourceVault; - /** Url pointing to a key or secret in KeyVault */ - keyUrl: string; -} - -/** Encryption at rest settings for disk or snapshot */ -export interface Encryption { - /** ResourceId of the disk encryption set to use for enabling encryption at rest. */ - diskEncryptionSetId?: string; - /** The type of key used to encrypt the data of the disk. */ - type?: EncryptionType; -} - -export interface ShareInfoElement { - /** - * A relative URI containing the ID of the VM that has the disk attached. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmUri?: string; -} - -/** Properties of the disk for which update is pending. */ -export interface PropertyUpdatesInProgress { - /** The target performance tier of the disk if a tier change operation is in progress. */ - targetTier?: string; -} - -/** Contains the security related information for the resource. */ -export interface DiskSecurityProfile { - /** Specifies the SecurityType of the VM. Applicable for OS disks only. */ - securityType?: DiskSecurityTypes; - /** ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key */ - secureVMDiskEncryptionSetId?: string; -} - -/** In the case of an availability or connectivity issue with the data disk, specify the behavior of your VM */ -export interface AvailabilityPolicy { - /** Determines on how to handle disks with slow I/O. */ - actionOnDiskDelay?: AvailabilityPolicyDiskDelay; -} - -/** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ -export interface DiskSku { - /** The sku name. */ - name?: DiskStorageAccountTypes; - /** - * The sku tier. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tier?: string; -} - -/** The List Snapshots operation response. */ -export interface SnapshotList { - /** A list of snapshots. */ - value: Snapshot[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ -export interface CopyCompletionError { - /** Indicates the error code if the background copy of a resource created via the CopyStart operation fails. */ - errorCode: CopyCompletionErrorReason; - /** Indicates the error message if the background copy of a resource created via the CopyStart operation fails. */ - errorMessage: string; -} - -/** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ -export interface SnapshotSku { - /** The sku name. */ - name?: SnapshotStorageAccountTypes; - /** - * The sku tier. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tier?: string; -} - -/** Used for updating a disk access resource. */ -export interface DiskAccessUpdate { - /** Resource tags */ - tags?: { [propertyName: string]: string }; -} - -/** A list of private link resources */ -export interface PrivateEndpointConnectionListResult { - /** The PrivateEndpointConnection items on this page */ - value: PrivateEndpointConnection[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** A list of private link resources */ -export interface PrivateLinkResourceListResult { - /** Array of private link resources */ - value?: PrivateLinkResource[]; -} - -/** A private link resource */ -export interface PrivateLinkResource { - /** - * private link resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * private link resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * private link resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The private link resource group id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredMembers?: string[]; - /** The private link resource DNS zone name. */ - requiredZoneNames?: string[]; -} - -/** disk encryption set update resource. */ -export interface DiskEncryptionSetUpdate { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ - identity?: EncryptionSetIdentity; - /** The type of key used to encrypt the data of the disk. */ - encryptionType?: DiskEncryptionSetType; - /** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots */ - activeKey?: KeyForDiskEncryptionSet; - /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ - rotationToLatestKeyVersionEnabled?: boolean; - /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ - federatedClientId?: string; -} - -/** The List resources which are encrypted with the disk encryption set. */ -export interface ResourceUriList { - /** A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. */ - value: string[]; - /** The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. */ - nextLink?: string; -} - -/** Disk update resource. */ -export interface DiskUpdate { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ - sku?: DiskSku; - /** the Operating System type. */ - osType?: OperatingSystemTypes; - /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ - diskSizeGB?: number; - /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ - encryptionSettingsCollection?: EncryptionSettingsCollection; - /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ - diskIopsReadWrite?: number; - /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ - diskMBpsReadWrite?: number; - /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ - diskIopsReadOnly?: number; - /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ - diskMBpsReadOnly?: number; - /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ - maxShares?: number; - /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ - encryption?: Encryption; - /** Policy for accessing the disk via network. */ - networkAccessPolicy?: NetworkAccessPolicy; - /** ARM id of the DiskAccess resource for using private endpoints on disks. */ - diskAccessId?: string; - /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ - tier?: string; - /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ - burstingEnabled?: boolean; - /** Purchase plan information to be added on the OS disk */ - purchasePlan?: DiskPurchasePlan; - /** List of supported capabilities to be added on the OS disk. */ - supportedCapabilities?: SupportedCapabilities; - /** - * Properties of the disk for which update is pending. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; - /** Indicates the OS on a disk supports hibernation. */ - supportsHibernation?: boolean; - /** Policy for controlling export on the disk. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ - dataAccessAuthMode?: DataAccessAuthMode; - /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ - optimizedForFrequentAttach?: boolean; - /** Determines how platform treats disk failures */ - availabilityPolicy?: AvailabilityPolicy; -} - -/** Data used for requesting a SAS. */ -export interface GrantAccessData { - /** The Access Level, accepted values include None, Read, Write. */ - access: AccessLevel; - /** Time duration in seconds until the SAS access expires. */ - durationInSeconds: number; - /** Set this flag to true to get additional SAS for VM guest state */ - getSecureVMGuestStateSAS?: boolean; - /** Used to specify the file format when making request for SAS on a VHDX file format snapshot */ - fileFormat?: FileFormat; -} - -/** A disk access SAS uri. */ -export interface AccessUri { - /** - * A SAS uri for accessing a disk. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accessSAS?: string; - /** - * A SAS uri for accessing a VM guest state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly securityDataAccessSAS?: string; - /** - * A SAS uri for accessing a VM metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly securityMetadataAccessSAS?: string; -} - -/** The List Disk Restore Points operation response. */ -export interface DiskRestorePointList { - /** The DiskRestorePoint items on this page */ - value: DiskRestorePoint[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Snapshot update resource. */ -export interface SnapshotUpdate { - /** Resource tags */ - tags?: { [propertyName: string]: string }; - /** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ - sku?: SnapshotSku; - /** the Operating System type. */ - osType?: OperatingSystemTypes; - /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ - diskSizeGB?: number; - /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ - encryptionSettingsCollection?: EncryptionSettingsCollection; - /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ - encryption?: Encryption; - /** Policy for accessing the disk via network. */ - networkAccessPolicy?: NetworkAccessPolicy; - /** ARM id of the DiskAccess resource for using private endpoints on disks. */ - diskAccessId?: string; - /** Indicates the OS on a snapshot supports hibernation. */ - supportsHibernation?: boolean; - /** Policy for controlling export on the disk. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ - dataAccessAuthMode?: DataAccessAuthMode; - /** List of supported capabilities for the image from which the OS disk was created. */ - supportedCapabilities?: SupportedCapabilities; - /** - * The state of snapshot which determines the access availability of the snapshot. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly snapshotAccessState?: SnapshotAccessState; -} - -/** The List Resource Skus operation response. */ -export interface ResourceSkusResult { - /** The ResourceSku items on this page */ - value: ResourceSku[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Describes an available Compute SKU. */ -export interface ResourceSku { - /** - * The type of resource the SKU applies to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resourceType?: string; - /** - * The name of SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tier?: string; - /** - * The Size of the SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly size?: string; - /** - * The Family of this particular SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly family?: string; - /** - * The Kind of resources that are supported in this SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly kind?: string; - /** - * Specifies the number of virtual machines in the scale set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capacity?: ResourceSkuCapacity; - /** - * The set of locations that the SKU is available. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly locations?: string[]; - /** - * A list of locations and availability zones in those locations where the SKU is available. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly locationInfo?: ResourceSkuLocationInfo[]; - /** - * The api versions that support this SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly apiVersions?: string[]; - /** - * Metadata for retrieving price info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly costs?: ResourceSkuCosts[]; - /** - * A name value pair to describe the capability. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capabilities?: ResourceSkuCapabilities[]; - /** - * The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly restrictions?: ResourceSkuRestrictions[]; -} - -/** Describes scaling information of a SKU. */ -export interface ResourceSkuCapacity { - /** - * The minimum capacity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly minimum?: number; - /** - * The maximum capacity that can be set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maximum?: number; - /** - * The default capacity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly default?: number; - /** - * The scale type applicable to the sku. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly scaleType?: ResourceSkuCapacityScaleType; -} - -/** Describes an available Compute SKU Location Information. */ -export interface ResourceSkuLocationInfo { - /** - * Location of the SKU - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** - * List of availability zones where the SKU is supported. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zones?: string[]; - /** - * Details of capabilities available to a SKU in specific zones. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zoneDetails?: ResourceSkuZoneDetails[]; - /** - * The names of extended locations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly extendedLocations?: string[]; - /** - * The type of the extended location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: ExtendedLocationType; -} - -/** Describes The zonal capabilities of a SKU. */ -export interface ResourceSkuZoneDetails { - /** - * The set of zones that the SKU is available in with the specified capabilities. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string[]; - /** - * A list of capabilities that are available for the SKU in the specified list of zones. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capabilities?: ResourceSkuCapabilities[]; -} - -/** Describes The SKU capabilities object. */ -export interface ResourceSkuCapabilities { - /** - * An invariant to describe the feature. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * An invariant if the feature is measured by quantity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: string; -} - -/** Describes metadata for retrieving price info. */ -export interface ResourceSkuCosts { - /** - * Used for querying price from commerce. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly meterID?: string; - /** - * The multiplier is needed to extend the base metered cost. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly quantity?: number; - /** - * An invariant to show the extended unit. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly extendedUnit?: string; -} - -/** Describes scaling information of a SKU. */ -export interface ResourceSkuRestrictions { - /** - * The type of restrictions. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: ResourceSkuRestrictionsType; - /** - * The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly values?: string[]; - /** - * The information about the restriction where the SKU cannot be used. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly restrictionInfo?: ResourceSkuRestrictionInfo; - /** - * The reason for restriction. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reasonCode?: ResourceSkuRestrictionsReasonCode; -} - -/** Describes an available Compute SKU Restriction Information. */ -export interface ResourceSkuRestrictionInfo { - /** - * Locations where the SKU is restricted - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly locations?: string[]; - /** - * List of availability zones where the SKU is restricted. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zones?: string[]; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: any; -} - -/** The List Galleries operation response. */ -export interface GalleryList { - /** A list of galleries. */ - value: Gallery[]; - /** The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. */ - nextLink?: string; - /** The security profile of a gallery image version */ - securityProfile?: ImageVersionSecurityProfile; -} - -/** Describes the gallery unique name. */ -export interface GalleryIdentifier { - /** - * The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uniqueName?: string; -} - -/** Profile for gallery sharing to subscription or tenant */ -export interface SharingProfile { - /** This property allows you to specify the permission of sharing gallery. Possible values are: **Private,** **Groups,** **Community.** */ - permissions?: GallerySharingPermissionTypes; - /** - * A list of sharing profile groups. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groups?: SharingProfileGroup[]; - /** Information of community gallery if current gallery is shared to community. */ - communityGalleryInfo?: CommunityGalleryInfo; -} - -/** Group of the gallery sharing profile */ -export interface SharingProfileGroup { - /** This property allows you to specify the type of sharing group. Possible values are: **Subscriptions,** **AADTenants.** */ - type?: SharingProfileGroupTypes; - /** A list of subscription/tenant ids the gallery is aimed to be shared to. */ - ids?: string[]; -} - -/** Information of community gallery if current gallery is shared to community */ -export interface CommunityGalleryInfo { - /** The link to the publisher website. Visible to all users. */ - publisherUri?: string; - /** Community gallery publisher support email. The email address of the publisher. Visible to all users. */ - publisherContact?: string; - /** End-user license agreement for community gallery image. */ - eula?: string; - /** The prefix of the gallery name that will be displayed publicly. Visible to all users. */ - publicNamePrefix?: string; - /** - * Contains info about whether community gallery sharing is enabled. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly communityGalleryEnabled?: boolean; - /** - * Community gallery public name list. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publicNames?: string[]; -} - -/** Contains information about the soft deletion policy of the gallery. */ -export interface SoftDeletePolicy { - /** Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. */ - isSoftDeleteEnabled?: boolean; -} - -/** Sharing status of current gallery. */ -export interface SharingStatus { - /** - * Aggregated sharing state of current gallery. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly aggregatedState?: SharingState; - /** Summary of all regional sharing status. */ - summary?: RegionalSharingStatus[]; -} - -/** Gallery regional sharing status */ -export interface RegionalSharingStatus { - /** Region name */ - region?: string; - /** - * Gallery sharing state in current region - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly state?: SharingState; - /** Details of gallery regional sharing failure. */ - details?: string; -} - -/** Identity for the virtual machine. */ -export interface GalleryIdentity { - /** - * The principal id of the gallery identity. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The AAD tenant id of the gallery identity. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The type of identity used for the gallery. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove all identities from the gallery. */ - type?: ResourceIdentityType; - /** The list of user identities associated with the gallery. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentitiesValue; - }; -} - -/** The security profile of a gallery image version */ -export interface ImageVersionSecurityProfile { - /** Contains UEFI settings for the image version. */ - uefiSettings?: GalleryImageVersionUefiSettings; -} - -/** Contains UEFI settings for the image version. */ -export interface GalleryImageVersionUefiSettings { - /** The name of the template(s) that contains default UEFI key signatures that will be added to the image. */ - signatureTemplateNames?: UefiSignatureTemplateName[]; - /** Additional UEFI key signatures that will be added to the image in addition to the signature templates */ - additionalSignatures?: UefiKeySignatures; -} - -/** Additional UEFI key signatures that will be added to the image in addition to the signature templates */ -export interface UefiKeySignatures { - /** The Platform Key of this image version. */ - pk?: UefiKey; - /** The Key Encryption Keys of this image version. */ - kek?: UefiKey[]; - /** The database of UEFI keys for this image version. */ - db?: UefiKey[]; - /** The database of revoked UEFI keys for this image version. */ - dbx?: UefiKey[]; -} - -/** A UEFI key signature. */ -export interface UefiKey { - /** The type of key signature. */ - type?: UefiKeyType; - /** The value of the key signature. */ - value?: string[]; -} - -/** The metadata of community gallery. */ -export interface CommunityGalleryMetadata { - /** The publisher URI of this community gallery. */ - publisherUri?: string; - /** The publisher email id of this community gallery. */ - publisherContact: string; - /** The end-user license agreement for this community gallery. */ - eula?: string; - /** A list of public names the gallery has. */ - publicNames: string[]; - /** The link for the privacy statement of this community gallery from the gallery publisher. */ - privacyStatementUri?: string; -} - -/** Base information about the community gallery resource in azure compute gallery. */ -export interface PirCommunityGalleryResource { - /** - * Resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource location - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** The unique id of this community gallery. */ - uniqueId?: string; -} - -/** The List Community Gallery Images operation response. */ -export interface CommunityGalleryImageList { - /** A list of community gallery images. */ - value: CommunityGalleryImage[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** This is the community gallery image definition identifier. */ -export interface CommunityGalleryImageIdentifier { - /** The name of the gallery image definition publisher. */ - publisher?: string; - /** The name of the gallery image definition offer. */ - offer?: string; - /** The name of the gallery image definition SKU. */ - sku?: string; -} - -/** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ -export interface RecommendedMachineConfiguration { - /** Describes the resource range. */ - vCPUs?: ResourceRange; - /** Describes the resource range. */ - memory?: ResourceRange; -} - -/** Describes the resource range. */ -export interface ResourceRange { - /** The minimum number of the resource. */ - min?: number; - /** The maximum number of the resource. */ - max?: number; -} - -/** Describes the disallowed disk types. */ -export interface Disallowed { - /** A list of disk types. */ - diskTypes?: string[]; -} - -/** A feature for gallery image. */ -export interface GalleryImageFeature { - /** The name of the gallery image feature. */ - name?: string; - /** The value of the gallery image feature. */ - value?: string; - /** The minimum gallery image version which supports this feature. */ - startsAtVersion?: string; -} - -/** Describes the gallery image definition purchase plan. This is used by marketplace images. */ -export interface ImagePurchasePlan { - /** The plan ID. */ - name?: string; - /** The publisher ID. */ - publisher?: string; - /** The product ID. */ - product?: string; -} - -/** The List Community Gallery Image versions operation response. */ -export interface CommunityGalleryImageVersionList { - /** A list of community gallery image versions. */ - value: CommunityGalleryImageVersion[]; - /** The URI to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of community gallery image versions. */ - nextLink?: string; -} - -/** This is the storage profile of a Gallery Image Version. */ -export interface SharedGalleryImageVersionStorageProfile { - /** This is the OS disk image. */ - osDiskImage?: SharedGalleryOSDiskImage; - /** A list of data disk images. */ - dataDiskImages?: SharedGalleryDataDiskImage[]; -} - -/** This is the disk image base class. */ -export interface SharedGalleryDiskImage { - /** - * This property indicates the size of the VHD to be created. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskSizeGB?: number; - /** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ - hostCaching?: SharedGalleryHostCaching; -} - -/** The List Shared Galleries operation response. */ -export interface SharedGalleryList { - /** A list of shared galleries. */ - value: SharedGallery[]; - /** The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. */ - nextLink?: string; -} - -/** The Resource model definition. */ -export interface PirResource { - /** - * Resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource location - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; -} - -/** The List Shared Gallery Images operation response. */ -export interface SharedGalleryImageList { - /** A list of shared gallery images. */ - value: SharedGalleryImage[]; - /** The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery images. */ - nextLink?: string; -} - -/** This is the gallery image definition identifier. */ -export interface GalleryImageIdentifier { - /** The name of the gallery image definition publisher. */ - publisher: string; - /** The name of the gallery image definition offer. */ - offer: string; - /** The name of the gallery image definition SKU. */ - sku: string; -} - -/** The List Shared Gallery Image versions operation response. */ -export interface SharedGalleryImageVersionList { - /** The SharedGalleryImageVersion items on this page */ - value: SharedGalleryImageVersion[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** The Update Resource model definition. */ -export interface UpdateResourceDefinition { - /** - * Resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; -} - -/** The List Gallery Applications operation response. */ -export interface GalleryApplicationList { - /** The GalleryApplication items on this page */ - value: GalleryApplication[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** A custom action that can be performed with a Gallery Application Version. */ -export interface GalleryApplicationCustomAction { - /** The name of the custom action. Must be unique within the Gallery Application Version. */ - name: string; - /** The script to run when executing this custom action. */ - script: string; - /** Description to help the users understand what this custom action does. */ - description?: string; - /** The parameters that this custom action uses */ - parameters?: GalleryApplicationCustomActionParameter[]; -} - -/** The definition of a parameter that can be passed to a custom action of a Gallery Application Version. */ -export interface GalleryApplicationCustomActionParameter { - /** The name of the custom action. Must be unique within the Gallery Application Version. */ - name: string; - /** Indicates whether this parameter must be passed when running the custom action. */ - required?: boolean; - /** Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob */ - type?: GalleryApplicationCustomActionParameterType; - /** The default value of the parameter. Only applies to string types */ - defaultValue?: string; - /** A description to help users understand what this parameter means */ - description?: string; -} - -/** The List Gallery Application version operation response. */ -export interface GalleryApplicationVersionList { - /** A list of gallery Application Versions. */ - value: GalleryApplicationVersion[]; - /** The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. */ - nextLink?: string; -} - -/** The source image from which the Image Version is going to be created. */ -export interface UserArtifactSource { - /** Required. The mediaLink of the artifact, must be a readable storage page blob. */ - mediaLink: string; - /** Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. */ - defaultConfigurationLink?: string; -} - -export interface UserArtifactManage { - /** Required. The path and arguments to install the gallery application. This is limited to 4096 characters. */ - install: string; - /** Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. */ - remove: string; - /** Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. */ - update?: string; -} - -/** Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set. */ -export interface UserArtifactSettings { - /** Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, the package file will be named the same as the Gallery Application name. */ - packageFileName?: string; - /** Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, the config file will be named the Gallery Application name appended with "_config". */ - configFileName?: string; - /** Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot. */ - scriptBehaviorAfterReboot?: GalleryApplicationScriptRebootBehavior; -} - -/** Describes the basic gallery artifact publishing profile. */ -export interface GalleryArtifactPublishingProfileBase { - /** The target regions where the Image Version is going to be replicated to. This property is updatable. */ - targetRegions?: TargetRegion[]; - /** The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. */ - replicaCount?: number; - /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ - excludeFromLatest?: boolean; - /** - * The timestamp for when the gallery image version is published. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publishedDate?: Date; - /** The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** Specifies the storage account type to be used to store the image. Cannot be specified along with storageAccountStrategy. This property is not updatable. */ - storageAccountType?: StorageAccountType; - /** Optional parameter which specifies the mode to be used for replication. This property is not updatable. */ - replicationMode?: ReplicationMode; - /** The target extended locations where the Image Version is going to be replicated to. This property is updatable. */ - targetExtendedLocations?: GalleryTargetExtendedLocation[]; - /** Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property is not updatable. */ - storageAccountStrategy?: StorageAccountStrategy; -} - -/** Describes the target region information. */ -export interface TargetRegion { - /** The name of the region. */ - name: string; - /** The number of replicas of the Image Version to be created per region. This property is updatable. */ - regionalReplicaCount?: number; - /** Specifies the storage account type to be used to store the image. This property is not updatable. */ - storageAccountType?: StorageAccountType; - /** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ - encryption?: EncryptionImages; - /** Contains the flag setting to hide an image when users specify version='latest' */ - excludeFromLatest?: boolean; - /** List of storage sku with replica count to create direct drive replicas. */ - additionalReplicaSets?: AdditionalReplicaSet[]; -} - -/** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ -export interface EncryptionImages { - /** Contains encryption settings for an OS disk image. */ - osDiskImage?: OSDiskImageEncryption; - /** A list of encryption specifications for data disk images. */ - dataDiskImages?: DataDiskImageEncryption[]; -} - -/** Contains security profile for an OS disk image. */ -export interface OSDiskImageSecurityProfile { - /** confidential VM encryption types */ - confidentialVMEncryptionType?: ConfidentialVMEncryptionType; - /** secure VM disk encryption set id */ - secureVMDiskEncryptionSetId?: string; -} - -/** This is the disk image encryption base class. */ -export interface DiskImageEncryption { - /** A relative URI containing the resource ID of the disk encryption set. */ - diskEncryptionSetId?: string; -} - -/** Describes the additional replica set information. */ -export interface AdditionalReplicaSet { - /** Specifies the storage account type to be used to create the direct drive replicas */ - storageAccountType?: StorageAccountType; - /** The number of direct drive replicas of the Image Version to be created.This Property is updatable */ - regionalReplicaCount?: number; -} - -export interface GalleryTargetExtendedLocation { - /** The name of the region. */ - name?: string; - /** The name of the extended location. */ - extendedLocation?: GalleryExtendedLocation; - /** The number of replicas of the Image Version to be created per extended location. This property is updatable. */ - extendedLocationReplicaCount?: number; - /** Specifies the storage account type to be used to store the image. This property is not updatable. */ - storageAccountType?: EdgeZoneStorageAccountType; - /** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ - encryption?: EncryptionImages; -} - -/** The name of the extended location. */ -export interface GalleryExtendedLocation { - name?: string; - /** It is type of the extended location. */ - type?: GalleryExtendedLocationType; -} - -/** This is the safety profile of the Gallery Artifact Version. */ -export interface GalleryArtifactSafetyProfileBase { - /** Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. */ - allowDeletionOfReplicatedLocations?: boolean; -} - -/** This is the replication status of the gallery image version. */ -export interface ReplicationStatus { - /** - * This is the aggregated replication status based on all the regional replication status flags. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly aggregatedState?: AggregatedReplicationState; - /** - * This is a summary of replication status for each region. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly summary?: RegionalReplicationStatus[]; -} - -/** This is the regional replication status. */ -export interface RegionalReplicationStatus { - /** - * The region to which the gallery image version is being replicated to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly region?: string; - /** - * This is the regional replication state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly state?: ReplicationState; - /** - * The details of the replication status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: string; - /** - * It indicates progress of the replication job. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly progress?: number; -} - -/** The List Gallery Images operation response. */ -export interface GalleryImageList { - /** A list of Shared Image Gallery images. */ - value: GalleryImage[]; - /** The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. */ - nextLink?: string; -} - -/** The List Gallery Image version operation response. */ -export interface GalleryImageVersionList { - /** A list of gallery image versions. */ - value: GalleryImageVersion[]; - /** The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image versions. */ - nextLink?: string; -} - -/** This is the storage profile of a Gallery Image Version. */ -export interface GalleryImageVersionStorageProfile { - /** The source of the gallery artifact version. */ - source?: GalleryArtifactVersionFullSource; - /** This is the OS disk image. */ - osDiskImage?: GalleryOSDiskImage; - /** A list of data disk images. */ - dataDiskImages?: GalleryDataDiskImage[]; -} - -/** The gallery artifact version source. */ -export interface GalleryArtifactVersionSource { - /** The id of the gallery artifact version source. */ - id?: string; -} - -/** This is the disk image base class. */ -export interface GalleryDiskImage { - /** - * This property indicates the size of the VHD to be created. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sizeInGB?: number; - /** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ - hostCaching?: HostCaching; - /** The source for the disk image. */ - source?: GalleryDiskImageSource; -} - -/** A policy violation reported against a gallery artifact. */ -export interface PolicyViolation { - /** Describes the nature of the policy violation. */ - category?: PolicyViolationCategory; - /** Describes specific details about why this policy violation was reported. */ - details?: string; -} - -/** This is the validations profile of a Gallery Image Version. */ -export interface ValidationsProfile { - /** The published time of the image version */ - validationEtag?: string; - executedValidations?: ExecutedValidation[]; - /** This specifies the pub, offer, sku and version of the image version metadata */ - platformAttributes?: PlatformAttribute[]; -} - -/** This is the executed Validation. */ -export interface ExecutedValidation { - /** This property specifies the type of image version validation. */ - type?: string; - /** - * This property specifies the status of the validationProfile of the image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly status?: ValidationStatus; - /** This property specifies the valid version of the validation. */ - version?: string; - /** This property specifies the starting timestamp. */ - executionTime?: Date; -} - -/** This is the platform attribute of the image version. */ -export interface PlatformAttribute { - /** - * This property specifies the name of the platformAttribute. It is read-only. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * This property specifies the value of the corresponding name property. It is read-only. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: string; -} - -/** The List Gallery InVMAccessControlProfiles operation response. */ -export interface GalleryInVMAccessControlProfileList { - /** The GalleryInVMAccessControlProfile items on this page */ - value: GalleryInVMAccessControlProfile[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** The properties of a gallery ResourceProfile. */ -export interface GalleryResourceProfilePropertiesBase { - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; -} - -/** The List Gallery InVMAccessControlProfile Versions operation response. */ -export interface GalleryInVMAccessControlProfileVersionList { - /** The GalleryInVMAccessControlProfileVersion items on this page */ - value: GalleryInVMAccessControlProfileVersion[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ -export interface AccessControlRules { - /** A list of privileges. */ - privileges?: AccessControlRulesPrivilege[]; - /** A list of roles. */ - roles?: AccessControlRulesRole[]; - /** A list of identities. */ - identities?: AccessControlRulesIdentity[]; - /** A list of role assignments. */ - roleAssignments?: AccessControlRulesRoleAssignment[]; -} - -/** The properties of an Access Control Rule Privilege. */ -export interface AccessControlRulesPrivilege { - /** The name of the privilege. */ - name: string; - /** The HTTP path corresponding to the privilege. */ - path: string; - /** The query parameters to match in the path. */ - queryParameters?: { [propertyName: string]: string }; -} - -/** The properties of an Access Control Rule Role. */ -export interface AccessControlRulesRole { - /** The name of the role. */ - name: string; - /** A list of privileges needed by this role. */ - privileges: string[]; -} - -/** The properties of an Access Control Rule Identity. */ -export interface AccessControlRulesIdentity { - /** The name of the identity. */ - name: string; - /** The username corresponding to this identity. */ - userName?: string; - /** The groupName corresponding to this identity. */ - groupName?: string; - /** The path to the executable. */ - exePath?: string; - /** The process name of the executable. */ - processName?: string; -} - -/** The properties of an Access Control Rule RoleAssignment. */ -export interface AccessControlRulesRoleAssignment { - /** The name of the role. */ - role: string; - /** A list of identities that can access the privileges defined by the role. */ - identities: string[]; -} - -/** The properties of a gallery ResourceProfile version. */ -export interface GalleryResourceProfileVersionPropertiesBase { - /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ - targetLocations?: TargetRegion[]; - /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ - excludeFromLatest?: boolean; - /** - * The timestamp for when the Resource Profile Version is published. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publishedDate?: Date; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; -} - -/** The List Gallery Script operation response. */ -export interface GalleryScriptList { - /** The GalleryScript items on this page */ - value: GalleryScript[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Describes the properties of a gallery script definition. */ -export interface GalleryScriptProperties { - /** The description of this gallery script definition resource. This property is updatable. */ - description?: string; - /** The Eula agreement (End User License Agreement) for the gallery Script Definition. */ - eula?: string; - /** The privacy statement uri. */ - privacyStatementUri?: string; - /** The release note uri. */ - releaseNoteUri?: string; - /** The end of life date of the gallery Script Definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ - supportedOSType: OperatingSystemTypes; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; -} - -/** Paged collection of GalleryScriptVersion items */ -export interface GalleryScriptVersionList { - /** The GalleryScriptVersion items on this page */ - value: GalleryScriptVersion[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Describes the properties of a gallery script version. */ -export interface GalleryScriptVersionProperties { - /** The publishing profile of a gallery image version. */ - publishingProfile: GalleryScriptVersionPublishingProfile; - /** The safety profile of the Gallery Script Version. */ - safetyProfile?: GalleryScriptVersionSafetyProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; -} - -/** The source script from which the Script Version is going to be created. */ -export interface ScriptSource { - /** Required. The link of the source script, it must be a readable storage blob with SAS URI or publicly accessible URI or managed identity enabled. */ - scriptLink: string; - /** Optional. Any input parameters that needs to passed to the script and are accessed within the script for its execution. */ - parameters?: GalleryScriptParameter[]; -} - -/** The definition of a generic gallery parameter. */ -export interface GenericGalleryParameter { - /** The name of the parameter. */ - name: string; - /** Indicates whether this parameter must be passed. */ - required?: boolean; - /** The default value of the parameter, only applies to string types. */ - defaultValue?: string; - /** A description to help users understand what this parameter means */ - description?: string; -} - -/** Specifies information about the gallery sharing profile update. */ -export interface SharingUpdate { - /** This property allows you to specify the operation type of gallery sharing update. Possible values are: **Add,** **Remove,** **Reset.** */ - operationType: SharingUpdateOperationTypes; - /** A list of sharing profile groups. */ - groups?: SharingProfileGroup[]; -} - -/** The List Soft-deleted Resources operation response. */ -export interface GallerySoftDeletedResourceList { - /** The GallerySoftDeletedResource items on this page */ - value: GallerySoftDeletedResource[]; - /** The link to the next page of items */ - nextLink?: string; -} - -/** Describes the cloud service role instance. */ -export interface RoleInstance { - /** - * Resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource Name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource Type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource Location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** - * Resource tags. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tags?: { [propertyName: string]: string }; - /** The role instance SKU. */ - sku?: InstanceSku; - /** Role instance properties. */ - properties?: RoleInstanceProperties; -} - -/** The role instance SKU. */ -export interface InstanceSku { - /** - * The sku name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The tier of the cloud service role instance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tier?: string; -} - -/** Role instance properties. */ -export interface RoleInstanceProperties { - /** Describes the network profile for the role instance. */ - networkProfile?: RoleInstanceNetworkProfile; - /** The instance view of the role instance. */ - instanceView?: RoleInstanceView; -} - -/** Describes the network profile for the role instance. */ -export interface RoleInstanceNetworkProfile { - /** - * Specifies the list of resource Ids for the network interfaces associated with the role instance. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly networkInterfaces?: SubResource[]; -} - -/** The instance view of the role instance. */ -export interface RoleInstanceView { - /** - * The Update Domain. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly platformUpdateDomain?: number; - /** - * The Fault Domain. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly platformFaultDomain?: number; - /** - * Specifies a unique identifier generated internally for the cloud service associated with this role instance.

NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateId?: string; - /** NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly statuses?: ResourceInstanceViewStatus[]; -} - -/** Instance view status. */ -export interface ResourceInstanceViewStatus { - /** - * The status code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The short localizable label for the status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly displayStatus?: string; - /** - * The detailed status message, including for alerts and error messages. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The time of the status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly time?: Date; - /** The level code. */ - level?: StatusLevelTypes; -} - -/** The list operation result. */ -export interface RoleInstanceListResult { - /** The list of resources. */ - value: RoleInstance[]; - /** The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. */ - nextLink?: string; -} - -/** Describes a role of the cloud service. */ -export interface CloudServiceRole { - /** - * Resource id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource location - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** Describes the cloud service role sku. */ - sku?: CloudServiceRoleSku; - /** The cloud service role properties. */ - properties?: CloudServiceRoleProperties; -} - -/** Describes the cloud service role sku. */ -export interface CloudServiceRoleSku { - /** The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete and recreate the cloud service or move back to the old sku. */ - name?: string; - /** Specifies the tier of the cloud service. Possible Values are

**Standard**

**Basic** */ - tier?: string; - /** Specifies the number of role instances in the cloud service. */ - capacity?: number; -} - -/** The cloud service role properties. */ -export interface CloudServiceRoleProperties { - /** - * Specifies the ID which uniquely identifies a cloud service role. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uniqueId?: string; -} - -/** The list operation result. */ -export interface CloudServiceRoleListResult { - /** The list of resources. */ - value: CloudServiceRole[]; - /** The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. */ - nextLink?: string; -} - -/** Describes the cloud service. */ -export interface CloudService { - /** - * Resource Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Resource location. */ - location: string; - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** Cloud service properties */ - properties?: CloudServiceProperties; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. This field is optional. */ - zones?: string[]; -} - -/** Cloud service properties */ -export interface CloudServiceProperties { - /** - * Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. - * This is a write-only property and is not returned in GET calls. - */ - packageUrl?: string; - /** Specifies the XML service configuration (.cscfg) for the cloud service. */ - configuration?: string; - /** - * Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. - * This is a write-only property and is not returned in GET calls. - */ - configurationUrl?: string; - /** - * (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. - * If false, the service model is still deployed, but the code is not run immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs charges, even if it is poweredoff. - */ - startCloudService?: boolean; - /** - * (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override the role instance count and vm size specified in the .cscfg and .csdef respectively. - * The default value is `false`. - */ - allowModelOverride?: boolean; - /** - * Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates can be initiated manually in each update domain or initiated automatically in all update domains. - * Possible Values are

**Auto**

**Manual**

**Simultaneous**

- * If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If set to Auto, the update is automatically applied to each update domain in sequence. - */ - upgradeMode?: CloudServiceUpgradeMode; - /** Describes the role profile for the cloud service. */ - roleProfile?: CloudServiceRoleProfile; - /** Describes the OS profile for the cloud service. */ - osProfile?: CloudServiceOsProfile; - /** Network Profile for the cloud service. */ - networkProfile?: CloudServiceNetworkProfile; - /** Describes a cloud service extension profile. */ - extensionProfile?: CloudServiceExtensionProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The unique identifier for the cloud service. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uniqueId?: string; -} - -/** Describes the role profile for the cloud service. */ -export interface CloudServiceRoleProfile { - /** List of roles for the cloud service. */ - roles?: CloudServiceRoleProfileProperties[]; -} - -/** Describes the role properties. */ -export interface CloudServiceRoleProfileProperties { - /** Resource name. */ - name?: string; - /** Describes the cloud service role sku. */ - sku?: CloudServiceRoleSku; -} - -/** Describes the OS profile for the cloud service. */ -export interface CloudServiceOsProfile { - /** Specifies set of certificates that should be installed onto the role instances. */ - secrets?: CloudServiceVaultSecretGroup[]; -} - -/** Describes a set of certificates which are all in the same Key Vault. */ -export interface CloudServiceVaultSecretGroup { - /** 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?: CloudServiceVaultCertificate[]; -} - -/** Describes a single certificate reference in a Key Vault, and where the certificate should reside on the role instance. */ -export interface CloudServiceVaultCertificate { - /** This is the URL of a certificate that has been uploaded to Key Vault as a secret. */ - certificateUrl?: string; - /** Flag indicating if the certificate provided is a bootstrap certificate to be used by the Key Vault Extension to fetch the remaining certificates. */ - isBootstrapCertificate?: boolean; -} - -/** Network Profile for the cloud service. */ -export interface CloudServiceNetworkProfile { - /** List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. */ - loadBalancerConfigurations?: LoadBalancerConfiguration[]; - /** - * Slot type for the cloud service. - * Possible values are

**Production**

**Staging**

- * If not specified, the default value is Production. - */ - slotType?: CloudServiceSlotType; - /** The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud service referred by this id must be present otherwise an error will be thrown. */ - swappableCloudService?: SubResource; -} - -/** Describes the load balancer configuration. */ -export interface LoadBalancerConfiguration { - /** Resource Id */ - id?: string; - /** The name of the Load balancer */ - name: string; - /** Properties of the load balancer configuration. */ - properties: LoadBalancerConfigurationProperties; -} - -/** Describes the properties of the load balancer configuration. */ -export interface LoadBalancerConfigurationProperties { - /** Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP configuration. */ - frontendIpConfigurations: LoadBalancerFrontendIpConfiguration[]; -} - -/** Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP configuration. */ -export interface LoadBalancerFrontendIpConfiguration { - /** The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name can be used to access the resource. */ - name: string; - /** Properties of load balancer frontend ip configuration. */ - properties: LoadBalancerFrontendIpConfigurationProperties; -} - -/** Describes a cloud service IP Configuration */ -export interface LoadBalancerFrontendIpConfigurationProperties { - /** The reference to the public ip address resource. */ - publicIPAddress?: SubResource; - /** The reference to the virtual network subnet resource. */ - subnet?: SubResource; - /** The virtual network private IP address of the IP configuration. */ - privateIPAddress?: string; -} - -/** Describes a cloud service extension profile. */ -export interface CloudServiceExtensionProfile { - /** List of extensions for the cloud service. */ - extensions?: Extension[]; -} - -/** Describes a cloud service Extension. */ -export interface Extension { - /** The name of the extension. */ - name?: string; - /** Extension Properties. */ - properties?: CloudServiceExtensionProperties; -} - -/** Extension Properties. */ -export interface CloudServiceExtensionProperties { - /** The name of the extension handler publisher. */ - publisher?: string; - /** Specifies the type of the extension. */ - type?: string; - /** Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor version of the specified major version is selected. If a major version number and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role instance. */ - typeHandlerVersion?: string; - /** Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available. */ - autoUpgradeMinorVersion?: boolean; - /** Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension. */ - settings?: any; - /** Protected settings for the extension which are encrypted before sent to the role instance. */ - protectedSettings?: any; - /** Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance. */ - protectedSettingsFromKeyVault?: CloudServiceVaultAndSecretReference; - /** - * Tag to force apply the provided public and protected settings. - * Changing the tag value allows for re-running the extension without changing any of the public or protected settings. - * If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. - * If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and - * it is up to handler implementation whether to re-run it or not - */ - forceUpdateTag?: string; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied to all roles in the cloud service. */ - rolesAppliedTo?: string[]; -} - -/** Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance. */ -export interface CloudServiceVaultAndSecretReference { - /** The ARM Resource ID of the Key Vault */ - sourceVault?: SubResource; - /** Secret URL which contains the protected settings of the extension */ - secretUrl?: string; -} - -export interface CloudServiceUpdate { - /** Resource tags */ - tags?: { [propertyName: string]: string }; -} - -/** InstanceView of CloudService as a whole */ -export interface CloudServiceInstanceView { - /** Instance view statuses. */ - roleInstance?: InstanceViewStatusesSummary; - /** - * The version of the SDK that was used to generate the package for the cloud service. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sdkVersion?: string; - /** - * Specifies a list of unique identifiers generated internally for the cloud service.

NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateIds?: string[]; - /** NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly statuses?: ResourceInstanceViewStatus[]; -} - -/** Instance view statuses. */ -export interface InstanceViewStatusesSummary { - /** - * The summary. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusesSummary?: StatusCodeCount[]; -} - -/** The status code and count of the cloud service instance view statuses */ -export interface StatusCodeCount { - /** - * The instance view status code - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * Number of instances having this status code - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly count?: number; -} - -/** The list operation result. */ -export interface CloudServiceListResult { - /** The list of resources. */ - value: CloudService[]; - /** The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. */ - nextLink?: string; -} - -/** Specifies a list of role instances from the cloud service. */ -export interface RoleInstances { - /** List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. */ - roleInstances: string[]; -} - -/** Defines an update domain for the cloud service. */ -export interface UpdateDomain { - /** - * Resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource Name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; -} - -/** The list operation result. */ -export interface UpdateDomainListResult { - /** The list of resources. */ - value: UpdateDomain[]; - /** The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. */ - nextLink?: string; -} - -/** Describes a cloud service OS version. */ -export interface OSVersion { - /** - * Resource Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** OS version properties. */ - properties?: OSVersionProperties; -} - -/** OS version properties. */ -export interface OSVersionProperties { - /** - * The family of this OS version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly family?: string; - /** - * The family label of this OS version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly familyLabel?: string; - /** - * The OS version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly version?: string; - /** - * The OS version label. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly label?: string; - /** - * Specifies whether this is the default OS version for its family. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDefault?: boolean; - /** - * Specifies whether this OS version is active. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isActive?: boolean; -} - -/** The list operation result. */ -export interface OSVersionListResult { - /** The list of resources. */ - value: OSVersion[]; - /** The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. */ - nextLink?: string; -} - -/** Describes a cloud service OS family. */ -export interface OSFamily { - /** - * Resource Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource location. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** OS family properties. */ - properties?: OSFamilyProperties; -} - -/** OS family properties. */ -export interface OSFamilyProperties { - /** - * The OS family name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The OS family label. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly label?: string; - /** - * List of OS versions belonging to this family. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly versions?: OSVersionPropertiesBase[]; -} - -/** Configuration view of an OS version. */ -export interface OSVersionPropertiesBase { - /** - * The OS version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly version?: string; - /** - * The OS version label. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly label?: string; - /** - * Specifies whether this is the default OS version for its family. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDefault?: boolean; - /** - * Specifies whether this OS version is active. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isActive?: boolean; -} - -/** The list operation result. */ -export interface OSFamilyListResult { - /** The list of resources. */ - value: OSFamily[]; - /** The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources. */ - nextLink?: string; -} - -/** The Resource model definition with location property as optional. */ -export interface ResourceWithOptionalLocation { - /** Resource location */ - location?: string; - /** - * Resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Resource tags */ - tags?: { [propertyName: string]: 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 {} - -/** Virtual machine image resource information. */ -export interface VirtualMachineImageResource extends SubResource { - /** The name of the resource. */ - name: string; - /** The supported Azure location of the resource. */ - location: string; - /** Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). */ - tags?: { [propertyName: string]: string }; - /** The extended location of the Virtual Machine. */ - extendedLocation?: ExtendedLocation; -} - -/** 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; - /** - * Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly exactVersion?: 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; -} - -/** 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; -} - -/** Describes a network interface reference. */ -export interface NetworkInterfaceReference extends SubResource { - /** 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 interface SubResourceWithColocationStatus extends SubResource { - /** Describes colocation status of a resource in the Proximity Placement Group. */ - colocationStatus?: InstanceViewStatus; -} - -/** Output of virtual machine capture operation. */ -export interface VirtualMachineCaptureResult extends SubResource { - /** - * the schema of the captured virtual machine - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly schema?: string; - /** - * the version of the content - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly contentVersion?: string; - /** - * parameters of the captured virtual machine - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly parameters?: any; - /** - * a list of resource items of the captured virtual machine - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resources?: any[]; -} - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** Describes a Virtual Machine Scale Set Extension. */ -export interface VirtualMachineScaleSetExtension extends SubResourceReadOnly { - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** Resource name */ - name?: string; - /** If a value is provided and is different from the previous value, the extension handler will 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". */ - typePropertiesType?: 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?: any; - /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: any; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Collection of extension names after which this extension needs to be provisioned. */ - provisionAfterExtensions?: string[]; - /** 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; -} - -/** Disk Restore Point details. */ -export interface DiskRestorePointAttributes extends SubResourceReadOnly { - /** Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while creating a restore point. */ - encryption?: RestorePointEncryption; - /** Resource Id of the source disk restore point. */ - sourceDiskRestorePoint?: ApiEntityReference; -} - -/** Describes a Virtual Machine Scale Set Extension. */ -export interface VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { - /** - * The name of the extension. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** If a value is provided and is different from the previous value, the extension handler will 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". */ - typePropertiesType?: 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?: any; - /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: any; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Collection of extension names after which this extension needs to be provisioned. */ - provisionAfterExtensions?: string[]; - /** 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; -} - -/** Describes a VMSS VM Extension. */ -export interface VirtualMachineScaleSetVMExtension extends SubResourceReadOnly { - /** The location of the extension. */ - location?: string; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** 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". */ - typePropertiesType?: 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?: any; - /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: any; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** The virtual machine extension instance view. */ - instanceView?: VirtualMachineExtensionInstanceView; - /** 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[]; -} - -/** Describes a VMSS VM Extension. */ -export interface VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { - /** - * The name of the extension. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** 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". */ - typePropertiesType?: 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?: any; - /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: any; - /** 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; -} - -/** The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the response to the instance view of a capacity reservation group. */ -export interface CapacityReservationInstanceViewWithName extends CapacityReservationInstanceView { - /** - * The name of the capacity reservation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; -} - -/** The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to the instance view of a dedicated host group. */ -export interface DedicatedHostInstanceViewWithName extends DedicatedHostInstanceView { - /** - * The name of the dedicated host. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; -} - -/** Describes an Operating System disk. */ -export interface ImageOSDisk extends ImageDisk { - /** This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. Possible values are: **Windows,** **Linux.** */ - osType: OperatingSystemTypes; - /** The OS State. For managed images, use Generalized. */ - osState: OperatingSystemStateTypes; -} - -/** Describes a data disk. */ -export interface ImageDataDisk extends ImageDisk { - /** 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; -} - -/** Api request input for LogAnalytics getRequestRateByInterval Api. */ -export interface RequestRateByIntervalInput extends LogAnalyticsInputBase { - /** Interval value in minutes used to create LogAnalytics call rate logs. */ - intervalLength: IntervalInMins; -} - -/** Api request input for LogAnalytics getThrottledRequests Api. */ -export interface ThrottledRequestsInput extends LogAnalyticsInputBase {} - -/** Describes the properties of a Run Command. */ -export interface RunCommandDocument extends RunCommandDocumentBase { - /** The script to be executed. */ - script: string[]; - /** The parameters used by the script. */ - parameters?: RunCommandParameterDefinition[]; -} - -/** Specifies information about the availability set that the virtual machine should be assigned to. Only tags may be updated. */ -export interface AvailabilitySetUpdate extends UpdateResource { - /** Sku of the availability set */ - sku?: Sku; - /** Update Domain count. */ - platformUpdateDomainCount?: number; - /** Fault Domain count. */ - platformFaultDomainCount?: number; - /** A list of references to all virtual machines in the availability set. */ - virtualMachines?: SubResource[]; - /** Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. */ - proximityPlacementGroup?: SubResource; - /** - * The resource status information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statuses?: InstanceViewStatus[]; - /** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. */ - scheduledEventsPolicy?: ScheduledEventsPolicy; - /** - * Describes the migration properties on the Availability Set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; -} - -/** Specifies information about the capacity reservation group. Only tags can be updated. */ -export interface CapacityReservationGroupUpdate extends UpdateResource { - /** - * A list of all capacity reservation resource ids that belong to capacity reservation group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capacityReservations?: SubResourceReadOnly[]; - /** - * A list of references to all virtual machines associated to the capacity reservation group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; - /** - * The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: CapacityReservationGroupInstanceView; - /** Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ - sharingProfile?: ResourceSharingProfile; - /** Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. */ - reservationType?: ReservationType; -} - -/** Specifies information about the capacity reservation. sku.capacity cannot be updated for Block Capacity Reservation. Tags can be update for all Capacity Reservation Types. */ -export interface CapacityReservationUpdate extends UpdateResource { - /** SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. **Note:** The SKU name and capacity cannot be updated for Block capacity reservations. */ - sku?: Sku; - /** - * A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reservationId?: string; - /** - * Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly platformFaultDomainCount?: number; - /** - * A list of all virtual machine resource ids that are associated with the capacity reservation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; - /** - * The date time when the capacity reservation was last updated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningTime?: Date; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The Capacity reservation instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: CapacityReservationInstanceView; - /** - * Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; - /** Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. */ - scheduleProfile?: ScheduleProfile; -} - -/** Specifies information about the dedicated host group that the dedicated host should be assigned to. Only tags may be updated. */ -export interface DedicatedHostGroupUpdate extends UpdateResource { - /** Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. */ - zones?: string[]; - /** Number of fault domains that the host group can span. */ - platformFaultDomainCount?: number; - /** - * A list of references to all dedicated hosts in the dedicated host group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hosts?: SubResourceReadOnly[]; - /** - * The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: DedicatedHostGroupInstanceView; - /** Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: 2020-06-01. */ - supportAutomaticPlacement?: boolean; - /** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ - additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; -} - -/** Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may be updated. */ -export interface DedicatedHostUpdate extends UpdateResource { - /** [List all available dedicated host sizes for resizing] (https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes). Resizing can be only used to scale up DedicatedHost. Only name is required to be set. */ - sku?: Sku; - /** Fault domain of the dedicated host within a dedicated host group. */ - platformFaultDomain?: number; - /** Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. */ - autoReplaceOnFailure?: boolean; - /** - * A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime of the host. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hostId?: string; - /** - * A list of references to all virtual machines in the Dedicated Host. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachines?: SubResourceReadOnly[]; - /** Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value is: **None.** */ - licenseType?: DedicatedHostLicenseTypes; - /** - * The date when the host was first provisioned. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningTime?: Date; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The dedicated host instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: DedicatedHostInstanceView; - /** - * Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; -} - -/** The source user image virtual hard disk. Only tags may be updated. */ -export interface ImageUpdate extends UpdateResource { - /** The source virtual machine from which Image is created. */ - sourceVirtualMachine?: SubResource; - /** Specifies the storage settings for the virtual machine disks. */ - storageProfile?: ImageStorageProfile; - /** - * The provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. */ - hyperVGeneration?: HyperVGenerationTypes; -} - -/** Specifies information about the proximity placement group. */ -export interface ProximityPlacementGroupUpdate extends UpdateResource {} - -/** Update Restore Point collection parameters. */ -export interface RestorePointCollectionUpdate extends UpdateResource { - /** The properties of the source resource that this restore point collection is created from. */ - source?: RestorePointCollectionSourceProperties; - /** - * The provisioning state of the restore point collection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The unique id of the restore point collection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly restorePointCollectionId?: string; - /** - * A list containing all restore points created under this restore point collection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly restorePoints?: RestorePoint[]; - /** This property determines whether instant access snapshot is enabled for restore points created under this restore point collection for Premium SSD v2 or Ultra disk. Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for restoring disk with fast restore performance. */ - instantAccess?: boolean; -} - -/** Specifies information about the SSH public key. */ -export interface SshPublicKeyUpdateResource extends UpdateResource { - /** SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. */ - publicKey?: string; -} - -/** Describes a Virtual Machine Scale Set. */ -export interface VirtualMachineScaleSetUpdate extends UpdateResource { - /** The virtual machine scale set sku. */ - sku?: Sku; - /** The purchase plan when deploying a virtual machine scale set from VM Marketplace images. */ - plan?: Plan; - /** The identity of the virtual machine scale set, if configured. */ - identity?: VirtualMachineScaleSetIdentity; - /** The virtual machine scale set zones. */ - zones?: string[]; - /** The upgrade policy. */ - upgradePolicy?: UpgradePolicy; - /** Policy for automatic repairs. */ - automaticRepairsPolicy?: AutomaticRepairsPolicy; - /** The virtual machine profile. */ - virtualMachineProfile?: VirtualMachineScaleSetUpdateVMProfile; - /** Specifies whether the Virtual Machine Scale Set should be overprovisioned. */ - overprovision?: boolean; - /** When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. */ - doNotRunExtensionsOnOverprovisionedVMs?: boolean; - /** When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. */ - singlePlacementGroup?: boolean; - /** Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ - additionalCapabilities?: AdditionalCapabilities; - /** Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. */ - scaleInPolicy?: ScaleInPolicy; - /** Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

Minimum api-version: 2018-04-01. */ - proximityPlacementGroup?: SubResource; - /** Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. */ - priorityMixPolicy?: PriorityMixPolicy; - /** Specifies the Spot Restore properties for the virtual machine scale set. */ - spotRestorePolicy?: SpotRestorePolicy; - /** Policy for Resiliency */ - resiliencyPolicy?: ResiliencyPolicy; - /** Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. */ - zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; - /** Specifies the sku profile for the virtual machine scale set. */ - skuProfile?: SkuProfile; -} - -/** Describes a Virtual Machine run command. */ -export interface VirtualMachineRunCommandUpdate extends UpdateResource { - /** The source of the run command script. */ - source?: VirtualMachineRunCommandScriptSource; - /** The parameters used by the script. */ - parameters?: RunCommandInputParameter[]; - /** The parameters used by the script. */ - protectedParameters?: RunCommandInputParameter[]; - /** Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. */ - asyncExecution?: boolean; - /** Specifies the user account on the VM when executing the run command. */ - runAsUser?: string; - /** Specifies the user account password on the VM when executing the run command. */ - runAsPassword?: string; - /** The timeout in seconds to execute the run command. */ - timeoutInSeconds?: number; - /** Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. */ - outputBlobUri?: string; - /** Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. */ - errorBlobUri?: string; - /** User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ - outputBlobManagedIdentity?: RunCommandManagedIdentity; - /** User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ - errorBlobManagedIdentity?: RunCommandManagedIdentity; - /** - * The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The virtual machine run command instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: VirtualMachineRunCommandInstanceView; - /** Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ - treatFailureAsDeploymentFailure?: boolean; -} - -/** Describes a Virtual Machine Update. */ -export interface VirtualMachineUpdate extends UpdateResource { - /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ - plan?: Plan; - /** The identity of the virtual machine, if configured. */ - identity?: VirtualMachineIdentity; - /** The virtual machine zones. */ - zones?: string[]; - /** Specifies the hardware settings for the virtual machine. */ - hardwareProfile?: HardwareProfile; - /** 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 api-version: 2015-06-15. */ - diagnosticsProfile?: DiagnosticsProfile; - /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. */ - availabilitySet?: SubResource; - /** Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. */ - virtualMachineScaleSet?: SubResource; - /** Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01. */ - proximityPlacementGroup?: SubResource; - /** Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 */ - priority?: VirtualMachinePriorityTypes; - /** Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. */ - evictionPolicy?: VirtualMachineEvictionPolicyTypes; - /** Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. */ - billingProfile?: BillingProfile; - /** Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. */ - host?: SubResource; - /** Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. */ - hostGroup?: SubResource; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The virtual machine instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: VirtualMachineInstanceView; - /** 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 VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmId?: 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 api-version: 2020-06-01. */ - extensionsTimeBudget?: string; - /** Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. */ - platformFaultDomain?: number; - /** 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 api-version: 2021-03-01. */ - userData?: string; - /** Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. */ - capacityReservation?: CapacityReservationProfile; - /** Specifies the gallery applications that should be made available to the VM/VMSS. */ - applicationProfile?: ApplicationProfile; - /** - * Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; -} - -/** Describes a Virtual Machine Extension. */ -export interface VirtualMachineExtensionUpdate extends UpdateResource { - /** 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?: any; - /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: any; - /** 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; -} - -/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ -export interface VirtualMachineScaleSetVMReimageParameters extends VirtualMachineReimageParameters { - /** Parameter to force update ephemeral OS disk for a virtual machine scale set VM */ - forceUpdateOSDiskForEphemeral?: boolean; -} - -/** Specifies information about the Community Gallery that you want to create or update. */ -export interface CommunityGallery extends PirCommunityGalleryResource { - /** The disclaimer for a community gallery resource. */ - disclaimer?: string; - /** The artifact tags of a community gallery resource. */ - artifactTags?: { [propertyName: string]: string }; - /** The metadata of community gallery. */ - communityMetadata?: CommunityGalleryMetadata; -} - -/** Specifies information about the gallery image definition that you want to create or update. */ -export interface CommunityGalleryImage extends PirCommunityGalleryResource { - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ - osType?: OperatingSystemTypes; - /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ - osState?: OperatingSystemStateTypes; - /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This is the community gallery image definition identifier. */ - identifier?: CommunityGalleryImageIdentifier; - /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ - recommended?: RecommendedMachineConfiguration; - /** Describes the disallowed disk types. */ - disallowed?: Disallowed; - /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ - hyperVGeneration?: HyperVGeneration; - /** A list of gallery image features. */ - features?: GalleryImageFeature[]; - /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ - purchasePlan?: ImagePurchasePlan; - /** The architecture of the image. Applicable to OS disks only. */ - architecture?: Architecture; - /** Privacy statement URI for the current community gallery image. */ - privacyStatementUri?: string; - /** The end-user license agreement for the current community gallery image. */ - eula?: string; - /** The disclaimer for a community gallery resource. */ - disclaimer?: string; - /** The artifact tags of a community gallery resource. */ - artifactTags?: { [propertyName: string]: string }; -} - -/** Specifies information about the gallery image version that you want to create or update. */ -export interface CommunityGalleryImageVersion extends PirCommunityGalleryResource { - /** The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ - publishedDate?: Date; - /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ - excludeFromLatest?: boolean; - /** Describes the storage profile of the image version. */ - storageProfile?: SharedGalleryImageVersionStorageProfile; - /** The disclaimer for a community gallery resource. */ - disclaimer?: string; - /** The artifact tags of a community gallery resource. */ - artifactTags?: { [propertyName: string]: string }; -} - -/** This is the OS disk image. */ -export interface SharedGalleryOSDiskImage extends SharedGalleryDiskImage {} - -/** This is the data disk image. */ -export interface SharedGalleryDataDiskImage extends SharedGalleryDiskImage { - /** This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. */ - lun: number; -} - -/** Base information about the shared gallery resource in pir. */ -export interface PirSharedGalleryResource extends PirResource { - /** The unique id of this shared gallery. */ - uniqueId?: string; -} - -/** Specifies information about the Shared Image Gallery that you want to update. */ -export interface GalleryUpdate extends UpdateResourceDefinition { - /** The identity of the gallery, if configured. */ - identity?: GalleryIdentity; - /** The description of this Shared Image Gallery resource. This property is updatable. */ - description?: string; - /** Describes the gallery unique name. */ - identifier?: GalleryIdentifier; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** Profile for gallery sharing to subscription or tenant */ - sharingProfile?: SharingProfile; - /** Contains information about the soft deletion policy of the gallery. */ - softDeletePolicy?: SoftDeletePolicy; - /** - * Sharing status of current gallery. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sharingStatus?: SharingStatus; -} - -/** Specifies information about the gallery Application Definition that you want to update. */ -export interface GalleryApplicationUpdate extends UpdateResourceDefinition { - /** The description of this gallery Application Definition resource. This property is updatable. */ - description?: string; - /** The Eula agreement for the gallery Application Definition. */ - eula?: string; - /** The privacy statement uri. */ - privacyStatementUri?: string; - /** The release note uri. */ - releaseNoteUri?: string; - /** The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ - supportedOSType?: OperatingSystemTypes; - /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ - customActions?: GalleryApplicationCustomAction[]; -} - -/** Specifies information about the gallery Application Version that you want to update. */ -export interface GalleryApplicationVersionUpdate extends UpdateResourceDefinition { - /** The publishing profile of a gallery image version. */ - publishingProfile?: GalleryApplicationVersionPublishingProfile; - /** The safety profile of the Gallery Application Version. */ - safetyProfile?: GalleryApplicationVersionSafetyProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; -} - -/** Specifies information about the gallery image definition that you want to update. */ -export interface GalleryImageUpdate extends UpdateResourceDefinition { - /** The description of this gallery image definition resource. This property is updatable. */ - description?: string; - /** The Eula agreement for the gallery image definition. */ - eula?: string; - /** The privacy statement uri. */ - privacyStatementUri?: string; - /** The release note uri. */ - releaseNoteUri?: string; - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ - osType?: OperatingSystemTypes; - /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ - osState?: OperatingSystemStateTypes; - /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ - hyperVGeneration?: HyperVGeneration; - /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This is the gallery image definition identifier. */ - identifier?: GalleryImageIdentifier; - /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ - recommended?: RecommendedMachineConfiguration; - /** Describes the disallowed disk types. */ - disallowed?: Disallowed; - /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ - purchasePlan?: ImagePurchasePlan; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** A list of gallery image features. */ - features?: GalleryImageFeature[]; - /** The architecture of the image. Applicable to OS disks only. */ - architecture?: Architecture; - /** Optional. Must be set to true if the gallery image features are being updated. */ - allowUpdateImage?: boolean; -} - -/** Specifies information about the gallery image version that you want to update. */ -export interface GalleryImageVersionUpdate extends UpdateResourceDefinition { - /** The publishing profile of a gallery image Version. */ - publishingProfile?: GalleryImageVersionPublishingProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** This is the storage profile of a Gallery Image Version. */ - storageProfile?: GalleryImageVersionStorageProfile; - /** This is the safety profile of the Gallery Image Version. */ - safetyProfile?: GalleryImageVersionSafetyProfile; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; - /** The security profile of a gallery image version */ - securityProfile?: ImageVersionSecurityProfile; - /** Indicates if this is a soft-delete resource restoration request. */ - restore?: boolean; - /** - * This is the validations profile of a Gallery Image Version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly validationsProfile?: ValidationsProfile; -} - -/** Specifies information about the gallery inVMAccessControlProfile that you want to update. */ -export interface GalleryInVMAccessControlProfileUpdate extends UpdateResourceDefinition { - /** Describes the properties of a gallery inVMAccessControlProfile. */ - properties?: GalleryInVMAccessControlProfileProperties; -} - -/** Specifies information about the gallery inVMAccessControlProfile version that you want to update. */ -export interface GalleryInVMAccessControlProfileVersionUpdate extends UpdateResourceDefinition { - /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ - targetLocations?: TargetRegion[]; - /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ - excludeFromLatest?: boolean; - /** - * The timestamp for when the Resource Profile Version is published. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publishedDate?: Date; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; - /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ - mode?: AccessControlRulesMode; - /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ - defaultAccess?: EndpointAccess; - /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ - rules?: AccessControlRules; -} - -/** Specifies information about the gallery Script Definition that you want to update. */ -export interface GalleryScriptUpdate extends UpdateResourceDefinition { - /** The description of this gallery script definition resource. This property is updatable. */ - description?: string; - /** The Eula agreement (End User License Agreement) for the gallery Script Definition. */ - eula?: string; - /** The privacy statement uri. */ - privacyStatementUri?: string; - /** The release note uri. */ - releaseNoteUri?: string; - /** The end of life date of the gallery Script Definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ - supportedOSType?: OperatingSystemTypes; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; -} - -/** Specifies information about the gallery Script Version that you want to update. */ -export interface GalleryScriptVersionUpdate extends UpdateResourceDefinition { - /** The publishing profile of a gallery image version. */ - publishingProfile?: GalleryScriptVersionPublishingProfile; - /** The safety profile of the Gallery Script Version. */ - safetyProfile?: GalleryScriptVersionSafetyProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; -} - -/** The publishing profile of a gallery image version. */ -export interface GalleryApplicationVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { - /** The source image from which the Image Version is going to be created. */ - source: UserArtifactSource; - manageActions?: UserArtifactManage; - /** Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set. */ - settings?: UserArtifactSettings; - /** Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. */ - advancedSettings?: { [propertyName: string]: string }; - /** Optional. Whether or not this application reports health. */ - enableHealthCheck?: boolean; - /** A list of custom actions that can be performed with this Gallery Application Version. */ - customActions?: GalleryApplicationCustomAction[]; -} - -/** The publishing profile of a gallery image Version. */ -export interface GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase {} - -/** The publishing profile of a gallery image version. */ -export interface GalleryScriptVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { - /** The source script from which the Script Version is going to be created. */ - source: ScriptSource; -} - -/** Contains encryption settings for an OS disk image. */ -export interface OSDiskImageEncryption extends DiskImageEncryption { - /** This property specifies the security profile of an OS disk image. */ - securityProfile?: OSDiskImageSecurityProfile; -} - -/** Contains encryption settings for a data disk image. */ -export interface DataDiskImageEncryption extends DiskImageEncryption { - /** This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. */ - lun: number; -} - -/** The safety profile of the Gallery Application Version. */ -export interface GalleryApplicationVersionSafetyProfile extends GalleryArtifactSafetyProfileBase {} - -/** This is the safety profile of the Gallery Image Version. */ -export interface GalleryImageVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { - /** - * Indicates whether this image has been reported as violating Microsoft's policies. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reportedForPolicyViolation?: boolean; - /** - * A list of Policy Violations that have been reported for this Gallery Image Version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policyViolations?: PolicyViolation[]; - /** Indicates whether or not the deletion is blocked for this Gallery Image Version if its End Of Life has not expired. */ - blockDeletionBeforeEndOfLife?: boolean; -} - -/** The safety profile of the Gallery Script Version. */ -export interface GalleryScriptVersionSafetyProfile extends GalleryArtifactSafetyProfileBase {} - -/** The source of the gallery artifact version. */ -export interface GalleryArtifactVersionFullSource extends GalleryArtifactVersionSource { - /** The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a source. */ - communityGalleryImageId?: string; - /** The resource Id of the source virtual machine. Only required when capturing a virtual machine to source this Gallery Image Version. */ - virtualMachineId?: string; -} - -/** The source for the disk image. */ -export interface GalleryDiskImageSource extends GalleryArtifactVersionSource { - /** The uri of the gallery artifact version source. Currently used to specify vhd/blob source. */ - uri?: string; - /** The Storage Account Id that contains the vhd blob being used as a source for this artifact version. */ - storageAccountId?: string; -} - -/** This is the OS disk image. */ -export interface GalleryOSDiskImage extends GalleryDiskImage {} - -/** This is the data disk image. */ -export interface GalleryDataDiskImage extends GalleryDiskImage { - /** This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. */ - lun: number; -} - -/** Describes the properties of a gallery inVMAccessControlProfile. */ -export interface GalleryInVMAccessControlProfileProperties extends GalleryResourceProfilePropertiesBase { - /** The description of this gallery inVMAccessControlProfile resources. This property is updatable. */ - description?: string; - /** This property allows you to specify the OS type of the VMs/VMSS for which this profile can be used against. Possible values are: 'Windows' or 'Linux' */ - osType: OperatingSystemTypes; - /** This property allows you to specify the Endpoint type for which this profile is defining the access control for. Possible values are: 'WireServer' or 'IMDS' */ - applicableHostEndpoint: EndpointTypes; -} - -/** Describes the properties of an inVMAccessControlProfile version. */ -export interface GalleryInVMAccessControlProfileVersionProperties extends GalleryResourceProfileVersionPropertiesBase { - /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ - mode: AccessControlRulesMode; - /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ - defaultAccess: EndpointAccess; - /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ - rules?: AccessControlRules; -} - -/** The definition of a parameter that can be passed to a script of a Gallery Script Version. */ -export interface GalleryScriptParameter extends GenericGalleryParameter { - /** Specifies the type of the Gallery Script parameter. Possible values are: String, Int, Double, Boolean, Enum */ - type?: GalleryScriptParameterType; - /** The minimum value of parameter. */ - minValue?: string; - /** The minimum value of parameter. */ - maxValue?: string; - /** A list of permissible values. Only applicable values are from 'enum' values defined in 'GalleryScriptParameter'. */ - enumValues?: string[]; -} - -/** Describes a Virtual Machine Image. */ -export interface VirtualMachineImage extends VirtualMachineImageResource { - /** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ - plan?: PurchasePlan; - /** Contains the os disk image information. */ - osDiskImage?: OSDiskImage; - /** The list of data disk images information. */ - dataDiskImages?: DataDiskImage[]; - /** Describes automatic OS upgrade properties on the image. */ - automaticOSUpgradeProperties?: AutomaticOSUpgradeProperties; - /** Specifies the HyperVGeneration Type */ - hyperVGeneration?: HyperVGenerationTypes; - /** Specifies disallowed configuration for the VirtualMachine created from the image */ - disallowed?: DisallowedConfiguration; - features?: VirtualMachineImageFeature[]; - /** Specifies the Architecture Type */ - architecture?: ArchitectureTypes; - /** Describes image deprecation status properties on the image. */ - imageDeprecationStatus?: ImageDeprecationStatus; -} - -/** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability set. */ -export interface AvailabilitySet extends TrackedResource { - /** Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. */ - sku?: Sku; - /** Update Domain count. */ - platformUpdateDomainCount?: number; - /** Fault Domain count. */ - platformFaultDomainCount?: number; - /** A list of references to all virtual machines in the availability set. */ - virtualMachines?: SubResource[]; - /** Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. */ - proximityPlacementGroup?: SubResource; - /** - * The resource status information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statuses?: InstanceViewStatus[]; - /** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. */ - scheduledEventsPolicy?: ScheduledEventsPolicy; - /** - * Describes the migration properties on the Availability Set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachineScaleSetMigrationInfo?: VirtualMachineScaleSetMigrationInfo; -} - -/** Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group. */ -export interface CapacityReservationGroup extends TrackedResource { - /** The availability zones. */ - zones?: string[]; - /** - * A list of all capacity reservation resource ids that belong to capacity reservation group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capacityReservations?: SubResourceReadOnly[]; - /** - * A list of references to all virtual machines associated to the capacity reservation group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; - /** - * The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: CapacityReservationGroupInstanceView; - /** Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. */ - sharingProfile?: ResourceSharingProfile; - /** Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. */ - reservationType?: ReservationType; -} - -/** Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another dedicated host group. */ -export interface DedicatedHostGroup extends TrackedResource { - /** The availability zones. */ - zones?: string[]; - /** Number of fault domains that the host group can span. */ - platformFaultDomainCount?: number; - /** - * A list of references to all dedicated hosts in the dedicated host group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hosts?: SubResourceReadOnly[]; - /** - * The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: DedicatedHostGroupInstanceView; - /** Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: 2020-06-01. */ - supportAutomaticPlacement?: boolean; - /** Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. */ - additionalCapabilities?: DedicatedHostGroupPropertiesAdditionalCapabilities; -} - -/** 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. */ -export interface Image extends TrackedResource { - /** The extended location of the Image. */ - extendedLocation?: ExtendedLocation; - /** The source virtual machine from which Image is created. */ - sourceVirtualMachine?: SubResource; - /** Specifies the storage settings for the virtual machine disks. */ - storageProfile?: ImageStorageProfile; - /** - * The provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. */ - hyperVGeneration?: HyperVGenerationTypes; -} - -/** Describes a Virtual Machine Extension Image. */ -export interface VirtualMachineExtensionImage extends TrackedResource { - /** The operating system this extension supports. */ - operatingSystem?: string; - /** The type of role (IaaS or PaaS) this extension supports. */ - computeRole?: string; - /** The schema defined by publisher, where extension consumers should provide settings in a matching schema. */ - handlerSchema?: string; - /** Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. */ - vmScaleSetEnabled?: boolean; - /** Whether the handler can support multiple extensions. */ - supportsMultipleExtensions?: boolean; -} - -/** Describes a Virtual Machine Scale Set. */ -export interface VirtualMachineScaleSet extends TrackedResource { - /** The virtual machine scale set sku. */ - sku?: Sku; - /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ - plan?: Plan; - /** The identity of the virtual machine scale set, if configured. */ - identity?: VirtualMachineScaleSetIdentity; - /** The availability zones. */ - zones?: string[]; - /** The extended location of the Virtual Machine Scale Set. */ - extendedLocation?: ExtendedLocation; - /** - * Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** Placement section specifies the user-defined constraints for virtual machine scale set hardware placement. This property cannot be changed once VMSS is provisioned. Minimum api-version: 2025-04-01. */ - placement?: Placement; - /** The upgrade policy. */ - upgradePolicy?: UpgradePolicy; - /** The ScheduledEventsPolicy. */ - scheduledEventsPolicy?: ScheduledEventsPolicy; - /** Policy for automatic repairs. */ - automaticRepairsPolicy?: AutomaticRepairsPolicy; - /** The virtual machine profile. */ - virtualMachineProfile?: VirtualMachineScaleSetVMProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Specifies whether the Virtual Machine Scale Set should be overprovisioned. */ - overprovision?: boolean; - /** When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. */ - doNotRunExtensionsOnOverprovisionedVMs?: boolean; - /** - * Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uniqueId?: string; - /** When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. */ - singlePlacementGroup?: boolean; - /** Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. */ - zoneBalance?: boolean; - /** Fault Domain count for each placement group. */ - platformFaultDomainCount?: number; - /** Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum api-version: 2018-04-01. */ - proximityPlacementGroup?: SubResource; - /** Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: 2020-06-01. */ - hostGroup?: SubResource; - /** Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ - additionalCapabilities?: AdditionalCapabilities; - /** Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. */ - scaleInPolicy?: ScaleInPolicy; - /** Specifies the orchestration mode for the virtual machine scale set. */ - orchestrationMode?: OrchestrationMode; - /** Specifies the Spot Restore properties for the virtual machine scale set. */ - spotRestorePolicy?: SpotRestorePolicy; - /** Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. */ - priorityMixPolicy?: PriorityMixPolicy; - /** - * Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; - /** Optional property which must either be set to True or omitted. */ - constrainedMaximumCapacity?: boolean; - /** Policy for Resiliency */ - resiliencyPolicy?: ResiliencyPolicy; - /** Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. */ - zonalPlatformFaultDomainAlignMode?: ZonalPlatformFaultDomainAlignMode; - /** Specifies the sku profile for the virtual machine scale set. */ - skuProfile?: SkuProfile; - /** Specifies the high speed interconnect placement for the virtual machine scale set. */ - highSpeedInterconnectPlacement?: HighSpeedInterconnectPlacement; -} - -/** Describes a Virtual Machine Extension. */ -export interface VirtualMachineExtension extends TrackedResource { - /** 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". */ - typePropertiesType?: 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?: any; - /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: any; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** The virtual machine extension instance view. */ - instanceView?: VirtualMachineExtensionInstanceView; - /** 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[]; -} - -/** Describes a Virtual Machine. */ -export interface VirtualMachine extends TrackedResource { - /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ - plan?: Plan; - /** - * The virtual machine child extension resources. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resources?: VirtualMachineExtension[]; - /** The identity of the virtual machine, if configured. */ - identity?: VirtualMachineIdentity; - /** The availability zones. */ - zones?: string[]; - /** The extended location of the Virtual Machine. */ - extendedLocation?: ExtendedLocation; - /** - * ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This property is used by platform for internal resource group delete optimization. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managedBy?: string; - /** - * Etag is property returned in Create/Update/Get response of the VM, so that customer can supply it in the header to ensure optimistic updates. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** Placement section specifies the user-defined constraints for virtual machine hardware placement. This property cannot be changed once VM is provisioned. Minimum api-version: 2024-11-01. */ - placement?: Placement; - /** Specifies the hardware settings for the virtual machine. */ - hardwareProfile?: HardwareProfile; - /** 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 api-version: 2015-06-15. */ - diagnosticsProfile?: DiagnosticsProfile; - /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. */ - availabilitySet?: SubResource; - /** Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. */ - virtualMachineScaleSet?: SubResource; - /** Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01. */ - proximityPlacementGroup?: SubResource; - /** Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 */ - priority?: VirtualMachinePriorityTypes; - /** Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. */ - evictionPolicy?: VirtualMachineEvictionPolicyTypes; - /** Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. */ - billingProfile?: BillingProfile; - /** Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. */ - host?: SubResource; - /** Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01. */ - hostGroup?: SubResource; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The virtual machine instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: VirtualMachineInstanceView; - /** 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 VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmId?: 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 api-version: 2020-06-01. */ - extensionsTimeBudget?: string; - /** Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01. */ - platformFaultDomain?: number; - /** 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 api-version: 2021-03-01. */ - userData?: string; - /** Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. */ - capacityReservation?: CapacityReservationProfile; - /** Specifies the gallery applications that should be made available to the VM/VMSS. */ - applicationProfile?: ApplicationProfile; - /** - * Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; -} - -/** Specifies information about the proximity placement group. */ -export interface ProximityPlacementGroup extends TrackedResource { - /** The availability zones. */ - zones?: string[]; - /** Specifies the type of the proximity placement group. Possible values are: **Standard** : Co-locate resources within an Azure region or Availability Zone. **Ultra** : For future use. */ - proximityPlacementGroupType?: ProximityPlacementGroupType; - /** - * A list of references to all virtual machines in the proximity placement group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachines?: SubResourceWithColocationStatus[]; - /** - * A list of references to all virtual machine scale sets in the proximity placement group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachineScaleSets?: SubResourceWithColocationStatus[]; - /** - * A list of references to all availability sets in the proximity placement group. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly availabilitySets?: SubResourceWithColocationStatus[]; - /** Describes colocation status of the Proximity Placement Group. */ - colocationStatus?: InstanceViewStatus; - /** Specifies the user intent of the proximity placement group. */ - intent?: ProximityPlacementGroupPropertiesIntent; -} - -/** Create or update Restore Point collection parameters. */ -export interface RestorePointCollection extends TrackedResource { - /** The properties of the source resource that this restore point collection is created from. */ - source?: RestorePointCollectionSourceProperties; - /** - * The provisioning state of the restore point collection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The unique id of the restore point collection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly restorePointCollectionId?: string; - /** - * A list containing all restore points created under this restore point collection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly restorePoints?: RestorePoint[]; - /** This property determines whether instant access snapshot is enabled for restore points created under this restore point collection for Premium SSD v2 or Ultra disk. Instant access snapshot for Premium SSD v2 or Ultra disk is instantaneously available for restoring disk with fast restore performance. */ - instantAccess?: boolean; -} - -/** Specifies information about the SSH public key. */ -export interface SshPublicKeyResource extends TrackedResource { - /** SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. */ - publicKey?: string; -} - -/** Specifies information about the capacity reservation. */ -export interface CapacityReservation extends TrackedResource { - /** SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. */ - sku: Sku; - /** The availability zones. */ - zones?: string[]; - /** - * A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reservationId?: string; - /** - * Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly platformFaultDomainCount?: number; - /** - * A list of all virtual machine resource ids that are associated with the capacity reservation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachinesAssociated?: SubResourceReadOnly[]; - /** - * The date time when the capacity reservation was last updated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningTime?: Date; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The Capacity reservation instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: CapacityReservationInstanceView; - /** - * Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; - /** Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. */ - scheduleProfile?: ScheduleProfile; -} - -/** Specifies information about the Dedicated host. */ -export interface DedicatedHost extends TrackedResource { - /** SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. */ - sku: Sku; - /** Fault domain of the dedicated host within a dedicated host group. */ - platformFaultDomain?: number; - /** Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. */ - autoReplaceOnFailure?: boolean; - /** - * A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime of the host. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hostId?: string; - /** - * A list of references to all virtual machines in the Dedicated Host. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly virtualMachines?: SubResourceReadOnly[]; - /** Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: **None,** **Windows_Server_Hybrid,** **Windows_Server_Perpetual.** The default value is: **None.** */ - licenseType?: DedicatedHostLicenseTypes; - /** - * The date when the host was first provisioned. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningTime?: Date; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The dedicated host instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: DedicatedHostInstanceView; - /** - * Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; -} - -/** The status of the latest virtual machine scale set rolling upgrade. */ -export interface RollingUpgradeStatusInfo extends TrackedResource { - /** - * The rolling upgrade policies applied for this upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly policy?: RollingUpgradePolicy; - /** - * Information about the current running state of the overall upgrade. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly runningStatus?: RollingUpgradeRunningStatus; - /** - * Information about the number of virtual machine instances in each upgrade state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly progress?: RollingUpgradeProgressInfo; - /** - * Error details for this upgrade, if there are any. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: ApiError; -} - -/** Describes a virtual machine scale set virtual machine. */ -export interface VirtualMachineScaleSetVM extends TrackedResource { - /** - * The virtual machine instance ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceId?: string; - /** - * The virtual machine SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sku?: Sku; - /** Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. */ - plan?: Plan; - /** - * The virtual machine child extension resources. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resources?: VirtualMachineExtension[]; - /** - * The virtual machine zones. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zones?: string[]; - /** The identity of the virtual machine, if configured. */ - identity?: VirtualMachineIdentity; - /** - * Etag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header to ensure optimistic updates. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** - * Specifies whether the latest model has been applied to the virtual machine. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly latestModelApplied?: boolean; - /** - * Azure VM unique ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly vmId?: string; - /** - * The virtual machine instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: VirtualMachineScaleSetVMInstanceView; - /** Specifies the hardware settings for the virtual machine. */ - hardwareProfile?: HardwareProfile; - /** Specifies the resilient VM deletion status for the virtual machine. */ - resilientVMDeletionStatus?: ResilientVMDeletionStatus; - /** Specifies the storage settings for the virtual machine disks. */ - storageProfile?: StorageProfile; - /** Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. */ - additionalCapabilities?: AdditionalCapabilities; - /** Specifies the operating system settings for the virtual machine. */ - osProfile?: OSProfile; - /** Specifies the Security related profile settings for the virtual machine. */ - securityProfile?: SecurityProfile; - /** Specifies the network interfaces of the virtual machine. */ - networkProfile?: NetworkProfile; - /** Specifies the network profile configuration of the virtual machine. */ - networkProfileConfiguration?: VirtualMachineScaleSetVMNetworkProfileConfiguration; - /** Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. */ - diagnosticsProfile?: DiagnosticsProfile; - /** Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. */ - availabilitySet?: SubResource; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** 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 whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly modelDefinitionApplied?: string; - /** Specifies the protection policy of the virtual machine. */ - protectionPolicy?: VirtualMachineScaleSetVMProtectionPolicy; - /** UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01 */ - userData?: string; - /** - * Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; -} - -/** Describes a Virtual Machine run command. */ -export interface VirtualMachineRunCommand extends TrackedResource { - /** The source of the run command script. */ - source?: VirtualMachineRunCommandScriptSource; - /** The parameters used by the script. */ - parameters?: RunCommandInputParameter[]; - /** The parameters used by the script. */ - protectedParameters?: RunCommandInputParameter[]; - /** Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. */ - asyncExecution?: boolean; - /** Specifies the user account on the VM when executing the run command. */ - runAsUser?: string; - /** Specifies the user account password on the VM when executing the run command. */ - runAsPassword?: string; - /** The timeout in seconds to execute the run command. */ - timeoutInSeconds?: number; - /** Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. */ - outputBlobUri?: string; - /** Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. */ - errorBlobUri?: string; - /** User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ - outputBlobManagedIdentity?: RunCommandManagedIdentity; - /** User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged */ - errorBlobManagedIdentity?: RunCommandManagedIdentity; - /** - * The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The virtual machine run command instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: VirtualMachineRunCommandInstanceView; - /** Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results */ - treatFailureAsDeploymentFailure?: boolean; -} - -/** disk access resource. */ -export interface DiskAccess extends TrackedResource { - /** The extended location where the disk access will be created. Extended location cannot be changed. */ - extendedLocation?: ExtendedLocation; - /** - * A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** - * The disk access resource provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** - * The time when the disk access was created. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; -} - -/** disk encryption set resource. */ -export interface DiskEncryptionSet extends TrackedResource { - /** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ - identity?: EncryptionSetIdentity; - /** The type of key used to encrypt the data of the disk. */ - encryptionType?: DiskEncryptionSetType; - /** The key vault key which is currently used by this disk encryption set. */ - activeKey?: KeyForDiskEncryptionSet; - /** - * A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly previousKeys?: KeyForDiskEncryptionSet[]; - /** - * The disk encryption set provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ - rotationToLatestKeyVersionEnabled?: boolean; - /** - * The time when the active key of this disk encryption set was updated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastKeyRotationTimestamp?: Date; - /** - * The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly autoKeyRotationError?: ApiError; - /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ - federatedClientId?: string; -} - -/** Disk resource. */ -export interface Disk extends TrackedResource { - /** - * A relative URI containing the ID of the VM that has the disk attached. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managedBy?: string; - /** - * List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managedByExtended?: string[]; - /** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ - sku?: DiskSku; - /** The Logical zone list for Disk. */ - zones?: string[]; - /** The extended location where the disk will be created. Extended location cannot be changed. */ - extendedLocation?: ExtendedLocation; - /** - * The time when the disk was created. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; - /** The Operating System type. */ - osType?: OperatingSystemTypes; - /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ - hyperVGeneration?: HyperVGeneration; - /** Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} */ - purchasePlan?: DiskPurchasePlan; - /** List of supported capabilities for the image from which the OS disk was created. */ - supportedCapabilities?: SupportedCapabilities; - /** Disk source information. CreationData information cannot be changed after the disk has been created. */ - creationData?: CreationData; - /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ - diskSizeGB?: number; - /** - * The size of the disk in bytes. This field is read only. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskSizeBytes?: number; - /** - * Unique Guid identifying the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uniqueId?: string; - /** Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ - encryptionSettingsCollection?: EncryptionSettingsCollection; - /** - * The disk provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ - diskIopsReadWrite?: number; - /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ - diskMBpsReadWrite?: number; - /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ - diskIopsReadOnly?: number; - /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ - diskMBpsReadOnly?: number; - /** - * The state of the disk. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskState?: DiskState; - /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ - encryption?: Encryption; - /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ - maxShares?: number; - /** - * Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly shareInfo?: ShareInfoElement[]; - /** Policy for accessing the disk via network. */ - networkAccessPolicy?: NetworkAccessPolicy; - /** ARM id of the DiskAccess resource for using private endpoints on disks. */ - diskAccessId?: string; - /** - * Latest time when bursting was last enabled on a disk. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly burstingEnabledTime?: Date; - /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ - tier?: string; - /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ - burstingEnabled?: boolean; - /** - * Properties of the disk for which update is pending. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; - /** Indicates the OS on a disk supports hibernation. */ - supportsHibernation?: boolean; - /** Contains the security related information for the resource. */ - securityProfile?: DiskSecurityProfile; - /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ - completionPercent?: number; - /** Policy for controlling export on the disk. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ - dataAccessAuthMode?: DataAccessAuthMode; - /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ - optimizedForFrequentAttach?: boolean; - /** - * The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached or detached from a VM or the time when the VM to which the disk was attached was deallocated or started. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastOwnershipUpdateTime?: Date; - /** Determines how platform treats disk failures */ - availabilityPolicy?: AvailabilityPolicy; -} - -/** Snapshot resource. */ -export interface Snapshot extends TrackedResource { - /** - * Unused. Always Null. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly managedBy?: string; - /** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ - sku?: SnapshotSku; - /** The extended location where the snapshot will be created. Extended location cannot be changed. */ - extendedLocation?: ExtendedLocation; - /** - * The time when the snapshot was created. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; - /** The Operating System type. */ - osType?: OperatingSystemTypes; - /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ - hyperVGeneration?: HyperVGeneration; - /** Purchase plan information for the image from which the source disk for the snapshot was originally created. */ - purchasePlan?: DiskPurchasePlan; - /** List of supported capabilities for the image from which the source disk from the snapshot was originally created. */ - supportedCapabilities?: SupportedCapabilities; - /** Disk source information. CreationData information cannot be changed after the disk has been created. */ - creationData?: CreationData; - /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ - diskSizeGB?: number; - /** - * The size of the disk in bytes. This field is read only. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskSizeBytes?: number; - /** - * The state of the snapshot. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly diskState?: DiskState; - /** - * Unique Guid identifying the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly uniqueId?: string; - /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ - encryptionSettingsCollection?: EncryptionSettingsCollection; - /** - * The disk provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. */ - incremental?: boolean; - /** - * Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly incrementalSnapshotFamilyId?: string; - /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ - encryption?: Encryption; - /** Policy for accessing the disk via network. */ - networkAccessPolicy?: NetworkAccessPolicy; - /** ARM id of the DiskAccess resource for using private endpoints on disks. */ - diskAccessId?: string; - /** Contains the security related information for the resource. */ - securityProfile?: DiskSecurityProfile; - /** Indicates the OS on a snapshot supports hibernation. */ - supportsHibernation?: boolean; - /** Policy for controlling export on the disk. */ - publicNetworkAccess?: PublicNetworkAccess; - /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ - completionPercent?: number; - /** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ - copyCompletionError?: CopyCompletionError; - /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ - dataAccessAuthMode?: DataAccessAuthMode; - /** - * The state of snapshot which determines the access availability of the snapshot. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly snapshotAccessState?: SnapshotAccessState; -} - -/** Specifies information about the Shared Image Gallery that you want to create or update. */ -export interface Gallery extends TrackedResource { - /** The identity of the gallery, if configured. */ - identity?: GalleryIdentity; - /** The description of this Shared Image Gallery resource. This property is updatable. */ - description?: string; - /** Describes the gallery unique name. */ - identifier?: GalleryIdentifier; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** Profile for gallery sharing to subscription or tenant */ - sharingProfile?: SharingProfile; - /** Contains information about the soft deletion policy of the gallery. */ - softDeletePolicy?: SoftDeletePolicy; - /** - * Sharing status of current gallery. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sharingStatus?: SharingStatus; -} - -/** Specifies information about the gallery Application Definition that you want to create or update. */ -export interface GalleryApplication extends TrackedResource { - /** The description of this gallery Application Definition resource. This property is updatable. */ - description?: string; - /** The Eula agreement for the gallery Application Definition. */ - eula?: string; - /** The privacy statement uri. */ - privacyStatementUri?: string; - /** The release note uri. */ - releaseNoteUri?: string; - /** The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ - supportedOSType?: OperatingSystemTypes; - /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ - customActions?: GalleryApplicationCustomAction[]; -} - -/** Specifies information about the gallery Application Version that you want to create or update. */ -export interface GalleryApplicationVersion extends TrackedResource { - /** The publishing profile of a gallery image version. */ - publishingProfile?: GalleryApplicationVersionPublishingProfile; - /** The safety profile of the Gallery Application Version. */ - safetyProfile?: GalleryApplicationVersionSafetyProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; -} - -/** Specifies information about the gallery image definition that you want to create or update. */ -export interface GalleryImage extends TrackedResource { - /** The description of this gallery image definition resource. This property is updatable. */ - description?: string; - /** The Eula agreement for the gallery image definition. */ - eula?: string; - /** The privacy statement uri. */ - privacyStatementUri?: string; - /** The release note uri. */ - releaseNoteUri?: string; - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ - osType?: OperatingSystemTypes; - /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ - osState?: OperatingSystemStateTypes; - /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ - hyperVGeneration?: HyperVGeneration; - /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This is the gallery image definition identifier. */ - identifier?: GalleryImageIdentifier; - /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ - recommended?: RecommendedMachineConfiguration; - /** Describes the disallowed disk types. */ - disallowed?: Disallowed; - /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ - purchasePlan?: ImagePurchasePlan; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** A list of gallery image features. */ - features?: GalleryImageFeature[]; - /** The architecture of the image. Applicable to OS disks only. */ - architecture?: Architecture; - /** Optional. Must be set to true if the gallery image features are being updated. */ - allowUpdateImage?: boolean; -} - -/** Specifies information about the gallery image version that you want to create or update. */ -export interface GalleryImageVersion extends TrackedResource { - /** The publishing profile of a gallery image Version. */ - publishingProfile?: GalleryImageVersionPublishingProfile; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** This is the storage profile of a Gallery Image Version. */ - storageProfile?: GalleryImageVersionStorageProfile; - /** This is the safety profile of the Gallery Image Version. */ - safetyProfile?: GalleryImageVersionSafetyProfile; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; - /** The security profile of a gallery image version */ - securityProfile?: ImageVersionSecurityProfile; - /** Indicates if this is a soft-delete resource restoration request. */ - restore?: boolean; - /** - * This is the validations profile of a Gallery Image Version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly validationsProfile?: ValidationsProfile; -} - -/** Specifies information about the gallery inVMAccessControlProfile that you want to create or update. */ -export interface GalleryInVMAccessControlProfile extends TrackedResource { - /** Describes the properties of a gallery inVMAccessControlProfile. */ - properties?: GalleryInVMAccessControlProfileProperties; -} - -/** Specifies information about the gallery inVMAccessControlProfile version that you want to create or update. */ -export interface GalleryInVMAccessControlProfileVersion extends TrackedResource { - /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ - targetLocations?: TargetRegion[]; - /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ - excludeFromLatest?: boolean; - /** - * The timestamp for when the Resource Profile Version is published. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publishedDate?: Date; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: GalleryProvisioningState; - /** - * This is the replication status of the gallery image version. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationStatus?: ReplicationStatus; - /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ - mode?: AccessControlRulesMode; - /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ - defaultAccess?: EndpointAccess; - /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ - rules?: AccessControlRules; -} - -/** Specifies information about the gallery Script Definition that you want to create or update. */ -export interface GalleryScript extends TrackedResource { - /** Describes the properties of a gallery Script Definition. */ - properties?: GalleryScriptProperties; -} - -/** Concrete tracked resource types can be created by aliasing this type using a specific property type. */ -export interface GalleryScriptVersion extends TrackedResource { - /** Describes the properties of a gallery Script Version. */ - properties?: GalleryScriptVersionProperties; -} - -/** The details information of soft-deleted resource. */ -export interface GallerySoftDeletedResource extends TrackedResource { - /** arm id of the soft-deleted resource */ - resourceArmId?: string; - /** artifact type of the soft-deleted resource */ - softDeletedArtifactType?: SoftDeletedArtifactTypes; - /** The timestamp for when the resource is soft-deleted. In dateTime offset format. */ - softDeletedTime?: string; -} - -/** Restore Point details. */ -export interface RestorePoint extends ProxyResource { - /** List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks will be included. */ - excludeDisks?: ApiEntityReference[]; - /** Gets the details of the VM captured at the time of the restore point creation. */ - sourceMetadata?: RestorePointSourceMetadata; - /** - * Gets the provisioning state of the restore point. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details. */ - consistencyMode?: ConsistencyModeTypes; - /** Gets the creation time of the restore point. */ - timeCreated?: Date; - /** Resource Id of the source restore point from which a copy needs to be created. */ - sourceRestorePoint?: ApiEntityReference; - /** - * The restore point instance view. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instanceView?: RestorePointInstanceView; - /** This property determines the time in minutes the snapshot is retained as instant access for restoring Premium SSD v2 or Ultra disk with fast restore performance in this restore point. */ - instantAccessDurationMinutes?: number; -} - -/** The Private Endpoint Connection resource. */ -export interface PrivateEndpointConnection extends ProxyResource { - /** - * The resource of private end point. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpoint?: PrivateEndpoint; - /** A collection of information about the state of the connection between DiskAccess and Virtual Network. */ - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - /** - * The provisioning state of the private endpoint connection resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; -} - -/** Properties of disk restore point */ -export interface DiskRestorePoint extends ProxyResource { - /** - * The timestamp of restorePoint creation - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timeCreated?: Date; - /** - * arm id of source disk or source disk restore point. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sourceResourceId?: string; - /** - * The Operating System type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osType?: OperatingSystemTypes; - /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ - hyperVGeneration?: HyperVGeneration; - /** Purchase plan information for the the image from which the OS disk was created. */ - purchasePlan?: DiskPurchasePlan; - /** List of supported capabilities for the image from which the OS disk was created. */ - supportedCapabilities?: SupportedCapabilities; - /** - * id of the backing snapshot's MIS family - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly familyId?: string; - /** - * unique incarnation id of the source disk - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sourceUniqueId?: string; - /** - * Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly encryption?: Encryption; - /** Indicates the OS on a disk supports hibernation. */ - supportsHibernation?: boolean; - /** Policy for accessing the disk via network. */ - networkAccessPolicy?: NetworkAccessPolicy; - /** Policy for controlling export on the disk. */ - publicNetworkAccess?: PublicNetworkAccess; - /** ARM id of the DiskAccess resource for using private endpoints on disks. */ - diskAccessId?: string; - /** Percentage complete for the background copy of disk restore point when source resource is from a different region. */ - completionPercent?: number; - /** - * Replication state of disk restore point when source resource is from a different region. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly replicationState?: string; - /** - * Location of source disk or source disk restore point when source resource is from a different region. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sourceResourceLocation?: string; - /** Contains the security related information for the resource. */ - securityProfile?: DiskSecurityProfile; - /** - * Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly logicalSectorSize?: number; -} - -/** Describes a Virtual Machine Scale Set VM Reimage Parameters. */ -export interface VirtualMachineScaleSetReimageParameters extends VirtualMachineScaleSetVMReimageParameters { - /** The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. */ - instanceIds?: string[]; -} - -/** Specifies information about the Shared Gallery that you want to create or update. */ -export interface SharedGallery extends PirSharedGalleryResource { - /** - * The artifact tags of a shared gallery resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly artifactTags?: { [propertyName: string]: string }; -} - -/** Specifies information about the gallery image definition that you want to create or update. */ -export interface SharedGalleryImage extends PirSharedGalleryResource { - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ - osType?: OperatingSystemTypes; - /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ - osState?: OperatingSystemStateTypes; - /** The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** This is the gallery image definition identifier. */ - identifier?: GalleryImageIdentifier; - /** The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. */ - recommended?: RecommendedMachineConfiguration; - /** Describes the disallowed disk types. */ - disallowed?: Disallowed; - /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ - hyperVGeneration?: HyperVGeneration; - /** A list of gallery image features. */ - features?: GalleryImageFeature[]; - /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ - purchasePlan?: ImagePurchasePlan; - /** The architecture of the image. Applicable to OS disks only. */ - architecture?: Architecture; - /** Privacy statement uri for the current community gallery image. */ - privacyStatementUri?: string; - /** End-user license agreement for the current community gallery image. */ - eula?: string; - /** The artifact tags of a shared gallery resource. */ - artifactTags?: { [propertyName: string]: string }; -} - -/** Specifies information about the gallery image version that you want to create or update. */ -export interface SharedGalleryImageVersion extends PirSharedGalleryResource { - /** The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ - publishedDate?: Date; - /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ - endOfLifeDate?: Date; - /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ - excludeFromLatest?: boolean; - /** Describes the storage profile of the image version. */ - storageProfile?: SharedGalleryImageVersionStorageProfile; - /** The artifact tags of a shared gallery resource. */ - artifactTags?: { [propertyName: string]: string }; -} - -/** Defines headers for AvailabilitySets_convertToVirtualMachineScaleSet operation. */ -export interface AvailabilitySetsConvertToVirtualMachineScaleSetHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Images_createOrUpdate operation. */ -export interface ImagesCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Images_update operation. */ -export interface ImagesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Images_delete operation. */ -export interface ImagesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for LogAnalytics_exportRequestRateByInterval operation. */ -export interface LogAnalyticsExportRequestRateByIntervalHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for LogAnalytics_exportThrottledRequests operation. */ -export interface LogAnalyticsExportThrottledRequestsHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineRunCommands_createOrUpdate operation. */ -export interface VirtualMachineRunCommandsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineRunCommands_update operation. */ -export interface VirtualMachineRunCommandsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineRunCommands_delete operation. */ -export interface VirtualMachineRunCommandsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_createOrUpdate operation. */ -export interface VirtualMachineScaleSetsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_update operation. */ -export interface VirtualMachineScaleSetsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_delete operation. */ -export interface VirtualMachineScaleSetsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_approveRollingUpgrade operation. */ -export interface VirtualMachineScaleSetsApproveRollingUpgradeHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_deallocate operation. */ -export interface VirtualMachineScaleSetsDeallocateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_deleteInstances operation. */ -export interface VirtualMachineScaleSetsDeleteInstancesHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_updateInstances operation. */ -export interface VirtualMachineScaleSetsUpdateInstancesHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_performMaintenance operation. */ -export interface VirtualMachineScaleSetsPerformMaintenanceHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_powerOff operation. */ -export interface VirtualMachineScaleSetsPowerOffHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_reapply operation. */ -export interface VirtualMachineScaleSetsReapplyHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_redeploy operation. */ -export interface VirtualMachineScaleSetsRedeployHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_reimage operation. */ -export interface VirtualMachineScaleSetsReimageHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_reimageAll operation. */ -export interface VirtualMachineScaleSetsReimageAllHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_restart operation. */ -export interface VirtualMachineScaleSetsRestartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_scaleOut operation. */ -export interface VirtualMachineScaleSetsScaleOutHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_setOrchestrationServiceState operation. */ -export interface VirtualMachineScaleSetsSetOrchestrationServiceStateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSets_start operation. */ -export interface VirtualMachineScaleSetsStartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_createOrUpdate operation. */ -export interface VirtualMachinesCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_update operation. */ -export interface VirtualMachinesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_delete operation. */ -export interface VirtualMachinesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_assessPatches operation. */ -export interface VirtualMachinesAssessPatchesHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_attachDetachDataDisks operation. */ -export interface VirtualMachinesAttachDetachDataDisksHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_capture operation. */ -export interface VirtualMachinesCaptureHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_convertToManagedDisks operation. */ -export interface VirtualMachinesConvertToManagedDisksHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_deallocate operation. */ -export interface VirtualMachinesDeallocateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_installPatches operation. */ -export interface VirtualMachinesInstallPatchesHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_migrateToVMScaleSet operation. */ -export interface VirtualMachinesMigrateToVMScaleSetHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_performMaintenance operation. */ -export interface VirtualMachinesPerformMaintenanceHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_powerOff operation. */ -export interface VirtualMachinesPowerOffHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_reapply operation. */ -export interface VirtualMachinesReapplyHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_redeploy operation. */ -export interface VirtualMachinesRedeployHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_reimage operation. */ -export interface VirtualMachinesReimageHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_restart operation. */ -export interface VirtualMachinesRestartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_runCommand operation. */ -export interface VirtualMachinesRunCommandHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachines_start operation. */ -export interface VirtualMachinesStartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for RestorePointCollections_delete operation. */ -export interface RestorePointCollectionsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for CapacityReservations_createOrUpdate operation. */ -export interface CapacityReservationsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for CapacityReservations_update operation. */ -export interface CapacityReservationsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for CapacityReservations_delete operation. */ -export interface CapacityReservationsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DedicatedHosts_createOrUpdate operation. */ -export interface DedicatedHostsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DedicatedHosts_update operation. */ -export interface DedicatedHostsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DedicatedHosts_delete operation. */ -export interface DedicatedHostsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DedicatedHosts_redeploy operation. */ -export interface DedicatedHostsRedeployHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DedicatedHosts_restart operation. */ -export interface DedicatedHostsRestartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for RestorePoints_create operation. */ -export interface RestorePointsCreateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for RestorePoints_delete operation. */ -export interface RestorePointsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetRollingUpgrades_startExtensionUpgrade operation. */ -export interface VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetRollingUpgrades_startOSUpgrade operation. */ -export interface VirtualMachineScaleSetRollingUpgradesStartOSUpgradeHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetRollingUpgrades_cancel operation. */ -export interface VirtualMachineScaleSetRollingUpgradesCancelHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetExtensions_createOrUpdate operation. */ -export interface VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetExtensions_update operation. */ -export interface VirtualMachineScaleSetExtensionsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetExtensions_delete operation. */ -export interface VirtualMachineScaleSetExtensionsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_update operation. */ -export interface VirtualMachineScaleSetVMsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_delete operation. */ -export interface VirtualMachineScaleSetVMsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_approveRollingUpgrade operation. */ -export interface VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_attachDetachDataDisks operation. */ -export interface VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_deallocate operation. */ -export interface VirtualMachineScaleSetVMsDeallocateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_performMaintenance operation. */ -export interface VirtualMachineScaleSetVMsPerformMaintenanceHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_powerOff operation. */ -export interface VirtualMachineScaleSetVMsPowerOffHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_redeploy operation. */ -export interface VirtualMachineScaleSetVMsRedeployHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_reimage operation. */ -export interface VirtualMachineScaleSetVMsReimageHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_reimageAll operation. */ -export interface VirtualMachineScaleSetVMsReimageAllHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_restart operation. */ -export interface VirtualMachineScaleSetVMsRestartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_runCommand operation. */ -export interface VirtualMachineScaleSetVMsRunCommandHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMs_start operation. */ -export interface VirtualMachineScaleSetVMsStartHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMExtensions_createOrUpdate operation. */ -export interface VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMExtensions_update operation. */ -export interface VirtualMachineScaleSetVMExtensionsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMExtensions_delete operation. */ -export interface VirtualMachineScaleSetVMExtensionsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMRunCommands_createOrUpdate operation. */ -export interface VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMRunCommands_update operation. */ -export interface VirtualMachineScaleSetVMRunCommandsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineScaleSetVMRunCommands_delete operation. */ -export interface VirtualMachineScaleSetVMRunCommandsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineExtensions_createOrUpdate operation. */ -export interface VirtualMachineExtensionsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineExtensions_update operation. */ -export interface VirtualMachineExtensionsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for VirtualMachineExtensions_delete operation. */ -export interface VirtualMachineExtensionsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskAccesses_createOrUpdate operation. */ -export interface DiskAccessesCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskAccesses_update operation. */ -export interface DiskAccessesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskAccesses_delete operation. */ -export interface DiskAccessesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskAccesses_updateAPrivateEndpointConnection operation. */ -export interface DiskAccessesUpdateAPrivateEndpointConnectionHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskAccesses_deleteAPrivateEndpointConnection operation. */ -export interface DiskAccessesDeleteAPrivateEndpointConnectionHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskEncryptionSets_createOrUpdate operation. */ -export interface DiskEncryptionSetsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskEncryptionSets_update operation. */ -export interface DiskEncryptionSetsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskEncryptionSets_delete operation. */ -export interface DiskEncryptionSetsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Disks_createOrUpdate operation. */ -export interface DisksCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Disks_update operation. */ -export interface DisksUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Disks_delete operation. */ -export interface DisksDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Disks_grantAccess operation. */ -export interface DisksGrantAccessHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Disks_revokeAccess operation. */ -export interface DisksRevokeAccessHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Snapshots_createOrUpdate operation. */ -export interface SnapshotsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Snapshots_update operation. */ -export interface SnapshotsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Snapshots_delete operation. */ -export interface SnapshotsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Snapshots_grantAccess operation. */ -export interface SnapshotsGrantAccessHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Snapshots_revokeAccess operation. */ -export interface SnapshotsRevokeAccessHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskRestorePoint_grantAccess operation. */ -export interface DiskRestorePointGrantAccessHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for DiskRestorePoint_revokeAccess operation. */ -export interface DiskRestorePointRevokeAccessHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Galleries_createOrUpdate operation. */ -export interface GalleriesCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Galleries_update operation. */ -export interface GalleriesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for Galleries_delete operation. */ -export interface GalleriesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryApplications_createOrUpdate operation. */ -export interface GalleryApplicationsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryApplications_update operation. */ -export interface GalleryApplicationsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryApplications_delete operation. */ -export interface GalleryApplicationsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryApplicationVersions_createOrUpdate operation. */ -export interface GalleryApplicationVersionsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryApplicationVersions_update operation. */ -export interface GalleryApplicationVersionsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryApplicationVersions_delete operation. */ -export interface GalleryApplicationVersionsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryImages_createOrUpdate operation. */ -export interface GalleryImagesCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryImages_update operation. */ -export interface GalleryImagesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryImages_delete operation. */ -export interface GalleryImagesDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryImageVersions_createOrUpdate operation. */ -export interface GalleryImageVersionsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryImageVersions_update operation. */ -export interface GalleryImageVersionsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryImageVersions_delete operation. */ -export interface GalleryImageVersionsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryInVMAccessControlProfiles_createOrUpdate operation. */ -export interface GalleryInVMAccessControlProfilesCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryInVMAccessControlProfiles_update operation. */ -export interface GalleryInVMAccessControlProfilesUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryInVMAccessControlProfiles_delete operation. */ -export interface GalleryInVMAccessControlProfilesDeleteHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; -} - -/** Defines headers for GalleryInVMAccessControlProfileVersions_createOrUpdate operation. */ -export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryInVMAccessControlProfileVersions_update operation. */ -export interface GalleryInVMAccessControlProfileVersionsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryInVMAccessControlProfileVersions_delete operation. */ -export interface GalleryInVMAccessControlProfileVersionsDeleteHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; -} - -/** Defines headers for GalleryScripts_createOrUpdate operation. */ -export interface GalleryScriptsCreateOrUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryScripts_update operation. */ -export interface GalleryScriptsUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryScripts_delete operation. */ -export interface GalleryScriptsDeleteHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryScriptVersions_createOrUpdate operation. */ -export interface GalleryScriptVersionsCreateOrUpdateHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryScriptVersions_update operation. */ -export interface GalleryScriptVersionsUpdateHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GalleryScriptVersions_delete operation. */ -export interface GalleryScriptVersionsDeleteHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for GallerySharingProfile_update operation. */ -export interface GallerySharingProfileUpdateHeaders { - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system", -} - -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal", -} - -/** - * Defines values for ActionType. \ - * {@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** - */ -export type ActionType = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key", -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - -/** Known values of {@link ExpandTypesForGetCapacityReservationGroups} that the service accepts. */ -export enum KnownExpandTypesForGetCapacityReservationGroups { - /** VirtualMachineScaleSetVMsRef */ - VirtualMachineScaleSetVMsRef = "virtualMachineScaleSetVMs/$ref", - /** VirtualMachinesRef */ - VirtualMachinesRef = "virtualMachines/$ref", -} - -/** - * Defines values for ExpandTypesForGetCapacityReservationGroups. \ - * {@link KnownExpandTypesForGetCapacityReservationGroups} can be used interchangeably with ExpandTypesForGetCapacityReservationGroups, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **virtualMachineScaleSetVMs\/$ref** \ - * **virtualMachines\/$ref** - */ -export type ExpandTypesForGetCapacityReservationGroups = string; - -/** Known values of {@link ResourceIdOptionsForGetCapacityReservationGroups} that the service accepts. */ -export enum KnownResourceIdOptionsForGetCapacityReservationGroups { - /** CreatedInSubscription */ - CreatedInSubscription = "CreatedInSubscription", - /** SharedWithSubscription */ - SharedWithSubscription = "SharedWithSubscription", - /** All */ - All = "All", -} - -/** - * Defines values for ResourceIdOptionsForGetCapacityReservationGroups. \ - * {@link KnownResourceIdOptionsForGetCapacityReservationGroups} can be used interchangeably with ResourceIdOptionsForGetCapacityReservationGroups, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **CreatedInSubscription** \ - * **SharedWithSubscription** \ - * **All** - */ -export type ResourceIdOptionsForGetCapacityReservationGroups = string; - -/** Known values of {@link ReservationType} that the service accepts. */ -export enum KnownReservationType { - /** To consume on demand allocated capacity reservation when a capacity reservation group is provided. */ - Targeted = "Targeted", - /** To consume scheduled allocated block capacity reservation when a capacity reservation group is provided. */ - Block = "Block", -} - -/** - * Defines values for ReservationType. \ - * {@link KnownReservationType} can be used interchangeably with ReservationType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Targeted**: To consume on demand allocated capacity reservation when a capacity reservation group is provided. \ - * **Block**: To consume scheduled allocated block capacity reservation when a capacity reservation group is provided. - */ -export type ReservationType = string; - -/** Known values of {@link StorageAccountTypes} that the service accepts. */ -export enum KnownStorageAccountTypes { - /** StandardLRS */ - StandardLRS = "Standard_LRS", - /** PremiumLRS */ - PremiumLRS = "Premium_LRS", - /** StandardSSDLRS */ - StandardSSDLRS = "StandardSSD_LRS", - /** UltraSSDLRS */ - UltraSSDLRS = "UltraSSD_LRS", - /** PremiumZRS */ - PremiumZRS = "Premium_ZRS", - /** StandardSSDZRS */ - StandardSSDZRS = "StandardSSD_ZRS", - /** PremiumV2LRS */ - PremiumV2LRS = "PremiumV2_LRS", -} - -/** - * Defines values for StorageAccountTypes. \ - * {@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** \ - * **Premium_LRS** \ - * **StandardSSD_LRS** \ - * **UltraSSD_LRS** \ - * **Premium_ZRS** \ - * **StandardSSD_ZRS** \ - * **PremiumV2_LRS** - */ -export type StorageAccountTypes = string; - -/** Known values of {@link HyperVGenerationTypes} that the service accepts. */ -export enum KnownHyperVGenerationTypes { - /** V1 */ - V1 = "V1", - /** V2 */ - V2 = "V2", -} - -/** - * Defines values for HyperVGenerationTypes. \ - * {@link KnownHyperVGenerationTypes} can be used interchangeably with HyperVGenerationTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **V1** \ - * **V2** - */ -export type HyperVGenerationTypes = string; - -/** Known values of {@link ExtendedLocationTypes} that the service accepts. */ -export enum KnownExtendedLocationTypes { - /** EdgeZone */ - EdgeZone = "EdgeZone", -} - -/** - * Defines values for ExtendedLocationTypes. \ - * {@link KnownExtendedLocationTypes} can be used interchangeably with ExtendedLocationTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EdgeZone** - */ -export type ExtendedLocationTypes = string; - -/** Known values of {@link VmDiskTypes} that the service accepts. */ -export enum KnownVmDiskTypes { - /** None */ - None = "None", - /** Unmanaged */ - Unmanaged = "Unmanaged", -} - -/** - * Defines values for VmDiskTypes. \ - * {@link KnownVmDiskTypes} can be used interchangeably with VmDiskTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Unmanaged** - */ -export type VmDiskTypes = string; - -/** Known values of {@link ArchitectureTypes} that the service accepts. */ -export enum KnownArchitectureTypes { - /** X64 */ - X64 = "x64", - /** Arm64 */ - Arm64 = "Arm64", -} - -/** - * Defines values for ArchitectureTypes. \ - * {@link KnownArchitectureTypes} can be used interchangeably with ArchitectureTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **x64** \ - * **Arm64** - */ -export type ArchitectureTypes = string; - -/** Known values of {@link ImageState} that the service accepts. */ -export enum KnownImageState { - /** Active */ - Active = "Active", - /** ScheduledForDeprecation */ - ScheduledForDeprecation = "ScheduledForDeprecation", - /** Deprecated */ - Deprecated = "Deprecated", -} - -/** - * Defines values for ImageState. \ - * {@link KnownImageState} can be used interchangeably with ImageState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Active** \ - * **ScheduledForDeprecation** \ - * **Deprecated** - */ -export type ImageState = string; - -/** Known values of {@link AlternativeType} that the service accepts. */ -export enum KnownAlternativeType { - /** None */ - None = "None", - /** Offer */ - Offer = "Offer", - /** Plan */ - Plan = "Plan", -} - -/** - * Defines values for AlternativeType. \ - * {@link KnownAlternativeType} can be used interchangeably with AlternativeType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Offer** \ - * **Plan** - */ -export type AlternativeType = string; - -/** Known values of {@link RepairAction} that the service accepts. */ -export enum KnownRepairAction { - /** Replace */ - Replace = "Replace", - /** Restart */ - Restart = "Restart", - /** Reimage */ - Reimage = "Reimage", -} - -/** - * Defines values for RepairAction. \ - * {@link KnownRepairAction} can be used interchangeably with RepairAction, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Replace** \ - * **Restart** \ - * **Reimage** - */ -export type RepairAction = string; - -/** Known values of {@link WindowsVMGuestPatchMode} that the service accepts. */ -export enum KnownWindowsVMGuestPatchMode { - /** Manual */ - Manual = "Manual", - /** AutomaticByOS */ - AutomaticByOS = "AutomaticByOS", - /** AutomaticByPlatform */ - AutomaticByPlatform = "AutomaticByPlatform", -} - -/** - * Defines values for WindowsVMGuestPatchMode. \ - * {@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** \ - * **AutomaticByOS** \ - * **AutomaticByPlatform** - */ -export type WindowsVMGuestPatchMode = string; - -/** Known values of {@link WindowsPatchAssessmentMode} that the service accepts. */ -export enum KnownWindowsPatchAssessmentMode { - /** ImageDefault */ - ImageDefault = "ImageDefault", - /** AutomaticByPlatform */ - AutomaticByPlatform = "AutomaticByPlatform", -} - -/** - * Defines values for WindowsPatchAssessmentMode. \ - * {@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** \ - * **AutomaticByPlatform** - */ -export type WindowsPatchAssessmentMode = string; - -/** Known values of {@link WindowsVMGuestPatchAutomaticByPlatformRebootSetting} that the service accepts. */ -export enum KnownWindowsVMGuestPatchAutomaticByPlatformRebootSetting { - /** Unknown */ - Unknown = "Unknown", - /** IfRequired */ - IfRequired = "IfRequired", - /** Never */ - Never = "Never", - /** Always */ - Always = "Always", -} - -/** - * Defines values for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. \ - * {@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** \ - * **IfRequired** \ - * **Never** \ - * **Always** - */ -export type WindowsVMGuestPatchAutomaticByPlatformRebootSetting = string; - -/** Known values of {@link LinuxVMGuestPatchMode} that the service accepts. */ -export enum KnownLinuxVMGuestPatchMode { - /** ImageDefault */ - ImageDefault = "ImageDefault", - /** AutomaticByPlatform */ - AutomaticByPlatform = "AutomaticByPlatform", -} - -/** - * Defines values for LinuxVMGuestPatchMode. \ - * {@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** \ - * **AutomaticByPlatform** - */ -export type LinuxVMGuestPatchMode = string; - -/** Known values of {@link LinuxPatchAssessmentMode} that the service accepts. */ -export enum KnownLinuxPatchAssessmentMode { - /** ImageDefault */ - ImageDefault = "ImageDefault", - /** AutomaticByPlatform */ - AutomaticByPlatform = "AutomaticByPlatform", -} - -/** - * Defines values for LinuxPatchAssessmentMode. \ - * {@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** \ - * **AutomaticByPlatform** - */ -export type LinuxPatchAssessmentMode = string; - -/** Known values of {@link LinuxVMGuestPatchAutomaticByPlatformRebootSetting} that the service accepts. */ -export enum KnownLinuxVMGuestPatchAutomaticByPlatformRebootSetting { - /** Unknown */ - Unknown = "Unknown", - /** IfRequired */ - IfRequired = "IfRequired", - /** Never */ - Never = "Never", - /** Always */ - Always = "Always", -} - -/** - * Defines values for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. \ - * {@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** \ - * **IfRequired** \ - * **Never** \ - * **Always** - */ -export type LinuxVMGuestPatchAutomaticByPlatformRebootSetting = string; - -/** Known values of {@link DiskCreateOptionTypes} that the service accepts. */ -export enum KnownDiskCreateOptionTypes { - /** FromImage */ - FromImage = "FromImage", - /** Empty */ - Empty = "Empty", - /** Attach */ - Attach = "Attach", - /** Copy */ - Copy = "Copy", - /** Restore */ - Restore = "Restore", -} - -/** - * Defines values for DiskCreateOptionTypes. \ - * {@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** \ - * **Empty** \ - * **Attach** \ - * **Copy** \ - * **Restore** - */ -export type DiskCreateOptionTypes = string; - -/** Known values of {@link DiffDiskOptions} that the service accepts. */ -export enum KnownDiffDiskOptions { - /** Local */ - Local = "Local", -} - -/** - * Defines values for DiffDiskOptions. \ - * {@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** - */ -export type DiffDiskOptions = string; - -/** Known values of {@link DiffDiskPlacement} that the service accepts. */ -export enum KnownDiffDiskPlacement { - /** CacheDisk */ - CacheDisk = "CacheDisk", - /** ResourceDisk */ - ResourceDisk = "ResourceDisk", - /** NvmeDisk */ - NvmeDisk = "NvmeDisk", -} - -/** - * Defines values for DiffDiskPlacement. \ - * {@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** \ - * **ResourceDisk** \ - * **NvmeDisk** - */ -export type DiffDiskPlacement = string; - -/** Known values of {@link SecurityEncryptionTypes} that the service accepts. */ -export enum KnownSecurityEncryptionTypes { - /** VMGuestStateOnly */ - VMGuestStateOnly = "VMGuestStateOnly", - /** DiskWithVMGuestState */ - DiskWithVMGuestState = "DiskWithVMGuestState", - /** NonPersistedTPM */ - NonPersistedTPM = "NonPersistedTPM", -} - -/** - * Defines values for SecurityEncryptionTypes. \ - * {@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** \ - * **DiskWithVMGuestState** \ - * **NonPersistedTPM** - */ -export type SecurityEncryptionTypes = string; - -/** Known values of {@link DiskDeleteOptionTypes} that the service accepts. */ -export enum KnownDiskDeleteOptionTypes { - /** Delete */ - Delete = "Delete", - /** Detach */ - Detach = "Detach", -} - -/** - * Defines values for DiskDeleteOptionTypes. \ - * {@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** \ - * **Detach** - */ -export type DiskDeleteOptionTypes = string; - -/** Known values of {@link DiskControllerTypes} that the service accepts. */ -export enum KnownDiskControllerTypes { - /** Scsi */ - Scsi = "SCSI", - /** NVMe */ - NVMe = "NVMe", -} - -/** - * Defines values for 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** \ - * **NVMe** - */ -export type DiskControllerTypes = string; - -/** Known values of {@link DomainNameLabelScopeTypes} that the service accepts. */ -export enum KnownDomainNameLabelScopeTypes { - /** TenantReuse */ - TenantReuse = "TenantReuse", - /** SubscriptionReuse */ - SubscriptionReuse = "SubscriptionReuse", - /** ResourceGroupReuse */ - ResourceGroupReuse = "ResourceGroupReuse", - /** NoReuse */ - NoReuse = "NoReuse", -} - -/** - * Defines values for DomainNameLabelScopeTypes. \ - * {@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** \ - * **SubscriptionReuse** \ - * **ResourceGroupReuse** \ - * **NoReuse** - */ -export type DomainNameLabelScopeTypes = string; - -/** Known values of {@link IPVersion} that the service accepts. */ -export enum KnownIPVersion { - /** IPv4 */ - IPv4 = "IPv4", - /** IPv6 */ - IPv6 = "IPv6", -} - -/** - * Defines values for IPVersion. \ - * {@link KnownIPVersion} can be used interchangeably with IPVersion, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **IPv4** \ - * **IPv6** - */ -export type IPVersion = string; - -/** Known values of {@link DeleteOptions} that the service accepts. */ -export enum KnownDeleteOptions { - /** Delete */ - Delete = "Delete", - /** Detach */ - Detach = "Detach", -} - -/** - * Defines values for DeleteOptions. \ - * {@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** \ - * **Detach** - */ -export type DeleteOptions = string; - -/** Known values of {@link PublicIPAddressSkuName} that the service accepts. */ -export enum KnownPublicIPAddressSkuName { - /** Basic */ - Basic = "Basic", - /** Standard */ - Standard = "Standard", -} - -/** - * Defines values for PublicIPAddressSkuName. \ - * {@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** \ - * **Standard** - */ -export type PublicIPAddressSkuName = string; - -/** Known values of {@link PublicIPAddressSkuTier} that the service accepts. */ -export enum KnownPublicIPAddressSkuTier { - /** Regional */ - Regional = "Regional", - /** Global */ - Global = "Global", -} - -/** - * Defines values for PublicIPAddressSkuTier. \ - * {@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** \ - * **Global** - */ -export type PublicIPAddressSkuTier = string; - -/** Known values of {@link NetworkInterfaceAuxiliaryMode} that the service accepts. */ -export enum KnownNetworkInterfaceAuxiliaryMode { - /** None */ - None = "None", - /** AcceleratedConnections */ - AcceleratedConnections = "AcceleratedConnections", - /** Floating */ - Floating = "Floating", -} - -/** - * Defines values for NetworkInterfaceAuxiliaryMode. \ - * {@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** \ - * **AcceleratedConnections** \ - * **Floating** - */ -export type NetworkInterfaceAuxiliaryMode = string; - -/** Known values of {@link NetworkInterfaceAuxiliarySku} that the service accepts. */ -export enum KnownNetworkInterfaceAuxiliarySku { - /** None */ - None = "None", - /** A1 */ - A1 = "A1", - /** A2 */ - A2 = "A2", - /** A4 */ - A4 = "A4", - /** A8 */ - A8 = "A8", -} - -/** - * Defines values for NetworkInterfaceAuxiliarySku. \ - * {@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** \ - * **A1** \ - * **A2** \ - * **A4** \ - * **A8** - */ -export type NetworkInterfaceAuxiliarySku = string; - -/** Known values of {@link NetworkApiVersion} that the service accepts. */ -export enum KnownNetworkApiVersion { - /** TwoThousandTwenty1101 */ - TwoThousandTwenty1101 = "2020-11-01", - /** TwoThousandTwentyTwo1101 */ - TwoThousandTwentyTwo1101 = "2022-11-01", -} - -/** - * Defines values for NetworkApiVersion. \ - * {@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** \ - * **2022-11-01** - */ -export type NetworkApiVersion = string; - -/** Known values of {@link SecurityTypes} that the service accepts. */ -export enum KnownSecurityTypes { - /** TrustedLaunch */ - TrustedLaunch = "TrustedLaunch", - /** ConfidentialVM */ - ConfidentialVM = "ConfidentialVM", -} - -/** - * Defines values for SecurityTypes. \ - * {@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** \ - * **ConfidentialVM** - */ -export type SecurityTypes = string; - -/** Known values of {@link Mode} that the service accepts. */ -export enum KnownMode { - /** Audit */ - Audit = "Audit", - /** Enforce */ - Enforce = "Enforce", -} - -/** - * Defines values for 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** \ - * **Enforce** - */ -export type Mode = string; - -/** Known values of {@link Modes} that the service accepts. */ -export enum KnownModes { - /** Audit */ - Audit = "Audit", - /** Enforce */ - Enforce = "Enforce", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for Modes. \ - * {@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** \ - * **Enforce** \ - * **Disabled** - */ -export type Modes = string; - -/** Known values of {@link VirtualMachinePriorityTypes} that the service accepts. */ -export enum KnownVirtualMachinePriorityTypes { - /** Regular */ - Regular = "Regular", - /** Low */ - Low = "Low", - /** Spot */ - Spot = "Spot", -} - -/** - * Defines values for VirtualMachinePriorityTypes. \ - * {@link KnownVirtualMachinePriorityTypes} can be used interchangeably with VirtualMachinePriorityTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Regular** \ - * **Low** \ - * **Spot** - */ -export type VirtualMachinePriorityTypes = string; - -/** Known values of {@link VirtualMachineEvictionPolicyTypes} that the service accepts. */ -export enum KnownVirtualMachineEvictionPolicyTypes { - /** Deallocate */ - Deallocate = "Deallocate", - /** Delete */ - Delete = "Delete", -} - -/** - * Defines values for VirtualMachineEvictionPolicyTypes. \ - * {@link KnownVirtualMachineEvictionPolicyTypes} can be used interchangeably with VirtualMachineEvictionPolicyTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Deallocate** \ - * **Delete** - */ -export type VirtualMachineEvictionPolicyTypes = string; - -/** Known values of {@link VirtualMachineScaleSetScaleInRules} that the service accepts. */ -export enum KnownVirtualMachineScaleSetScaleInRules { - /** Default */ - Default = "Default", - /** OldestVM */ - OldestVM = "OldestVM", - /** NewestVM */ - NewestVM = "NewestVM", -} - -/** - * Defines values for VirtualMachineScaleSetScaleInRules. \ - * {@link KnownVirtualMachineScaleSetScaleInRules} can be used interchangeably with VirtualMachineScaleSetScaleInRules, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Default** \ - * **OldestVM** \ - * **NewestVM** - */ -export type VirtualMachineScaleSetScaleInRules = string; - -/** Known values of {@link OrchestrationMode} that the service accepts. */ -export enum KnownOrchestrationMode { - /** Uniform */ - Uniform = "Uniform", - /** Flexible */ - Flexible = "Flexible", -} - -/** - * Defines values for OrchestrationMode. \ - * {@link KnownOrchestrationMode} can be used interchangeably with OrchestrationMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Uniform** \ - * **Flexible** - */ -export type OrchestrationMode = string; - -/** Known values of {@link RebalanceStrategy} that the service accepts. */ -export enum KnownRebalanceStrategy { - /** Recreate */ - Recreate = "Recreate", -} - -/** - * Defines values for RebalanceStrategy. \ - * {@link KnownRebalanceStrategy} can be used interchangeably with RebalanceStrategy, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Recreate** - */ -export type RebalanceStrategy = string; - -/** Known values of {@link RebalanceBehavior} that the service accepts. */ -export enum KnownRebalanceBehavior { - /** CreateBeforeDelete */ - CreateBeforeDelete = "CreateBeforeDelete", -} - -/** - * Defines values for RebalanceBehavior. \ - * {@link KnownRebalanceBehavior} can be used interchangeably with RebalanceBehavior, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **CreateBeforeDelete** - */ -export type RebalanceBehavior = string; - -/** Known values of {@link ZonalPlatformFaultDomainAlignMode} that the service accepts. */ -export enum KnownZonalPlatformFaultDomainAlignMode { - /** Aligned */ - Aligned = "Aligned", - /** Unaligned */ - Unaligned = "Unaligned", -} - -/** - * Defines values for ZonalPlatformFaultDomainAlignMode. \ - * {@link KnownZonalPlatformFaultDomainAlignMode} can be used interchangeably with ZonalPlatformFaultDomainAlignMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Aligned** \ - * **Unaligned** - */ -export type ZonalPlatformFaultDomainAlignMode = string; - -/** Known values of {@link AllocationStrategy} that the service accepts. */ -export enum KnownAllocationStrategy { - /** LowestPrice */ - LowestPrice = "LowestPrice", - /** CapacityOptimized */ - CapacityOptimized = "CapacityOptimized", - /** Prioritized */ - Prioritized = "Prioritized", -} - -/** - * Defines values for AllocationStrategy. \ - * {@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** \ - * **CapacityOptimized** \ - * **Prioritized** - */ -export type AllocationStrategy = string; - -/** Known values of {@link HighSpeedInterconnectPlacement} that the service accepts. */ -export enum KnownHighSpeedInterconnectPlacement { - /** No high speed interconnect placement */ - None = "None", - /** Trunk high speed interconnect placement */ - Trunk = "Trunk", -} - -/** - * Defines values for HighSpeedInterconnectPlacement. \ - * {@link KnownHighSpeedInterconnectPlacement} can be used interchangeably with HighSpeedInterconnectPlacement, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None**: No high speed interconnect placement \ - * **Trunk**: Trunk high speed interconnect placement - */ -export type HighSpeedInterconnectPlacement = string; - -/** Known values of {@link ZonePlacementPolicyType} that the service accepts. */ -export enum KnownZonePlacementPolicyType { - /** Any */ - Any = "Any", - /** Automatic zone placement in a Virtual Machine Scale Set. */ - Auto = "Auto", -} - -/** - * Defines values for ZonePlacementPolicyType. \ - * {@link KnownZonePlacementPolicyType} can be used interchangeably with ZonePlacementPolicyType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Any** \ - * **Auto**: Automatic zone placement in a Virtual Machine Scale Set. - */ -export type ZonePlacementPolicyType = string; - -/** Known values of {@link VirtualMachineSizeTypes} that the service accepts. */ -export enum KnownVirtualMachineSizeTypes { - /** BasicA0 */ - BasicA0 = "Basic_A0", - /** BasicA1 */ - BasicA1 = "Basic_A1", - /** BasicA2 */ - BasicA2 = "Basic_A2", - /** BasicA3 */ - BasicA3 = "Basic_A3", - /** BasicA4 */ - BasicA4 = "Basic_A4", - /** StandardA0 */ - StandardA0 = "Standard_A0", - /** StandardA1 */ - StandardA1 = "Standard_A1", - /** StandardA2 */ - StandardA2 = "Standard_A2", - /** StandardA3 */ - StandardA3 = "Standard_A3", - /** StandardA4 */ - StandardA4 = "Standard_A4", - /** StandardA5 */ - StandardA5 = "Standard_A5", - /** StandardA6 */ - StandardA6 = "Standard_A6", - /** StandardA7 */ - StandardA7 = "Standard_A7", - /** StandardA8 */ - StandardA8 = "Standard_A8", - /** StandardA9 */ - StandardA9 = "Standard_A9", - /** StandardA10 */ - StandardA10 = "Standard_A10", - /** StandardA11 */ - StandardA11 = "Standard_A11", - /** StandardA1V2 */ - StandardA1V2 = "Standard_A1_v2", - /** StandardA2V2 */ - StandardA2V2 = "Standard_A2_v2", - /** StandardA4V2 */ - StandardA4V2 = "Standard_A4_v2", - /** StandardA8V2 */ - StandardA8V2 = "Standard_A8_v2", - /** StandardA2MV2 */ - StandardA2MV2 = "Standard_A2m_v2", - /** StandardA4MV2 */ - StandardA4MV2 = "Standard_A4m_v2", - /** StandardA8MV2 */ - StandardA8MV2 = "Standard_A8m_v2", - /** StandardB1S */ - StandardB1S = "Standard_B1s", - /** StandardB1Ms */ - StandardB1Ms = "Standard_B1ms", - /** StandardB2S */ - StandardB2S = "Standard_B2s", - /** StandardB2Ms */ - StandardB2Ms = "Standard_B2ms", - /** StandardB4Ms */ - StandardB4Ms = "Standard_B4ms", - /** StandardB8Ms */ - StandardB8Ms = "Standard_B8ms", - /** StandardD1 */ - StandardD1 = "Standard_D1", - /** StandardD2 */ - StandardD2 = "Standard_D2", - /** StandardD3 */ - StandardD3 = "Standard_D3", - /** StandardD4 */ - StandardD4 = "Standard_D4", - /** StandardD11 */ - StandardD11 = "Standard_D11", - /** StandardD12 */ - StandardD12 = "Standard_D12", - /** StandardD13 */ - StandardD13 = "Standard_D13", - /** StandardD14 */ - StandardD14 = "Standard_D14", - /** StandardD1V2 */ - StandardD1V2 = "Standard_D1_v2", - /** StandardD2V2 */ - StandardD2V2 = "Standard_D2_v2", - /** StandardD3V2 */ - StandardD3V2 = "Standard_D3_v2", - /** StandardD4V2 */ - StandardD4V2 = "Standard_D4_v2", - /** StandardD5V2 */ - StandardD5V2 = "Standard_D5_v2", - /** StandardD2V3 */ - StandardD2V3 = "Standard_D2_v3", - /** StandardD4V3 */ - StandardD4V3 = "Standard_D4_v3", - /** StandardD8V3 */ - StandardD8V3 = "Standard_D8_v3", - /** StandardD16V3 */ - StandardD16V3 = "Standard_D16_v3", - /** StandardD32V3 */ - StandardD32V3 = "Standard_D32_v3", - /** StandardD64V3 */ - StandardD64V3 = "Standard_D64_v3", - /** StandardD2SV3 */ - StandardD2SV3 = "Standard_D2s_v3", - /** StandardD4SV3 */ - StandardD4SV3 = "Standard_D4s_v3", - /** StandardD8SV3 */ - StandardD8SV3 = "Standard_D8s_v3", - /** StandardD16SV3 */ - StandardD16SV3 = "Standard_D16s_v3", - /** StandardD32SV3 */ - StandardD32SV3 = "Standard_D32s_v3", - /** StandardD64SV3 */ - StandardD64SV3 = "Standard_D64s_v3", - /** StandardD11V2 */ - StandardD11V2 = "Standard_D11_v2", - /** StandardD12V2 */ - StandardD12V2 = "Standard_D12_v2", - /** StandardD13V2 */ - StandardD13V2 = "Standard_D13_v2", - /** StandardD14V2 */ - StandardD14V2 = "Standard_D14_v2", - /** StandardD15V2 */ - StandardD15V2 = "Standard_D15_v2", - /** StandardDS1 */ - StandardDS1 = "Standard_DS1", - /** StandardDS2 */ - StandardDS2 = "Standard_DS2", - /** StandardDS3 */ - StandardDS3 = "Standard_DS3", - /** StandardDS4 */ - StandardDS4 = "Standard_DS4", - /** StandardDS11 */ - StandardDS11 = "Standard_DS11", - /** StandardDS12 */ - StandardDS12 = "Standard_DS12", - /** StandardDS13 */ - StandardDS13 = "Standard_DS13", - /** StandardDS14 */ - StandardDS14 = "Standard_DS14", - /** StandardDS1V2 */ - StandardDS1V2 = "Standard_DS1_v2", - /** StandardDS2V2 */ - StandardDS2V2 = "Standard_DS2_v2", - /** StandardDS3V2 */ - StandardDS3V2 = "Standard_DS3_v2", - /** StandardDS4V2 */ - StandardDS4V2 = "Standard_DS4_v2", - /** StandardDS5V2 */ - StandardDS5V2 = "Standard_DS5_v2", - /** StandardDS11V2 */ - StandardDS11V2 = "Standard_DS11_v2", - /** StandardDS12V2 */ - StandardDS12V2 = "Standard_DS12_v2", - /** StandardDS13V2 */ - StandardDS13V2 = "Standard_DS13_v2", - /** StandardDS14V2 */ - StandardDS14V2 = "Standard_DS14_v2", - /** StandardDS15V2 */ - StandardDS15V2 = "Standard_DS15_v2", - /** StandardDS134V2 */ - StandardDS134V2 = "Standard_DS13-4_v2", - /** StandardDS132V2 */ - StandardDS132V2 = "Standard_DS13-2_v2", - /** StandardDS148V2 */ - StandardDS148V2 = "Standard_DS14-8_v2", - /** StandardDS144V2 */ - StandardDS144V2 = "Standard_DS14-4_v2", - /** StandardE2V3 */ - StandardE2V3 = "Standard_E2_v3", - /** StandardE4V3 */ - StandardE4V3 = "Standard_E4_v3", - /** StandardE8V3 */ - StandardE8V3 = "Standard_E8_v3", - /** StandardE16V3 */ - StandardE16V3 = "Standard_E16_v3", - /** StandardE32V3 */ - StandardE32V3 = "Standard_E32_v3", - /** StandardE64V3 */ - StandardE64V3 = "Standard_E64_v3", - /** StandardE2SV3 */ - StandardE2SV3 = "Standard_E2s_v3", - /** StandardE4SV3 */ - StandardE4SV3 = "Standard_E4s_v3", - /** StandardE8SV3 */ - StandardE8SV3 = "Standard_E8s_v3", - /** StandardE16SV3 */ - StandardE16SV3 = "Standard_E16s_v3", - /** StandardE32SV3 */ - StandardE32SV3 = "Standard_E32s_v3", - /** StandardE64SV3 */ - StandardE64SV3 = "Standard_E64s_v3", - /** StandardE3216V3 */ - StandardE3216V3 = "Standard_E32-16_v3", - /** StandardE328SV3 */ - StandardE328SV3 = "Standard_E32-8s_v3", - /** StandardE6432SV3 */ - StandardE6432SV3 = "Standard_E64-32s_v3", - /** StandardE6416SV3 */ - StandardE6416SV3 = "Standard_E64-16s_v3", - /** StandardF1 */ - StandardF1 = "Standard_F1", - /** StandardF2 */ - StandardF2 = "Standard_F2", - /** StandardF4 */ - StandardF4 = "Standard_F4", - /** StandardF8 */ - StandardF8 = "Standard_F8", - /** StandardF16 */ - StandardF16 = "Standard_F16", - /** StandardF1S */ - StandardF1S = "Standard_F1s", - /** StandardF2S */ - StandardF2S = "Standard_F2s", - /** StandardF4S */ - StandardF4S = "Standard_F4s", - /** StandardF8S */ - StandardF8S = "Standard_F8s", - /** StandardF16S */ - StandardF16S = "Standard_F16s", - /** StandardF2SV2 */ - StandardF2SV2 = "Standard_F2s_v2", - /** StandardF4SV2 */ - StandardF4SV2 = "Standard_F4s_v2", - /** StandardF8SV2 */ - StandardF8SV2 = "Standard_F8s_v2", - /** StandardF16SV2 */ - StandardF16SV2 = "Standard_F16s_v2", - /** StandardF32SV2 */ - StandardF32SV2 = "Standard_F32s_v2", - /** StandardF64SV2 */ - StandardF64SV2 = "Standard_F64s_v2", - /** StandardF72SV2 */ - StandardF72SV2 = "Standard_F72s_v2", - /** StandardG1 */ - StandardG1 = "Standard_G1", - /** StandardG2 */ - StandardG2 = "Standard_G2", - /** StandardG3 */ - StandardG3 = "Standard_G3", - /** StandardG4 */ - StandardG4 = "Standard_G4", - /** StandardG5 */ - StandardG5 = "Standard_G5", - /** StandardGS1 */ - StandardGS1 = "Standard_GS1", - /** StandardGS2 */ - StandardGS2 = "Standard_GS2", - /** StandardGS3 */ - StandardGS3 = "Standard_GS3", - /** StandardGS4 */ - StandardGS4 = "Standard_GS4", - /** StandardGS5 */ - StandardGS5 = "Standard_GS5", - /** StandardGS48 */ - StandardGS48 = "Standard_GS4-8", - /** StandardGS44 */ - StandardGS44 = "Standard_GS4-4", - /** StandardGS516 */ - StandardGS516 = "Standard_GS5-16", - /** StandardGS58 */ - StandardGS58 = "Standard_GS5-8", - /** StandardH8 */ - StandardH8 = "Standard_H8", - /** StandardH16 */ - StandardH16 = "Standard_H16", - /** StandardH8M */ - StandardH8M = "Standard_H8m", - /** StandardH16M */ - StandardH16M = "Standard_H16m", - /** StandardH16R */ - StandardH16R = "Standard_H16r", - /** StandardH16Mr */ - StandardH16Mr = "Standard_H16mr", - /** StandardL4S */ - StandardL4S = "Standard_L4s", - /** StandardL8S */ - StandardL8S = "Standard_L8s", - /** StandardL16S */ - StandardL16S = "Standard_L16s", - /** StandardL32S */ - StandardL32S = "Standard_L32s", - /** StandardM64S */ - StandardM64S = "Standard_M64s", - /** StandardM64Ms */ - StandardM64Ms = "Standard_M64ms", - /** StandardM128S */ - StandardM128S = "Standard_M128s", - /** StandardM128Ms */ - StandardM128Ms = "Standard_M128ms", - /** StandardM6432Ms */ - StandardM6432Ms = "Standard_M64-32ms", - /** StandardM6416Ms */ - StandardM6416Ms = "Standard_M64-16ms", - /** StandardM12864Ms */ - StandardM12864Ms = "Standard_M128-64ms", - /** StandardM12832Ms */ - StandardM12832Ms = "Standard_M128-32ms", - /** StandardNC6 */ - StandardNC6 = "Standard_NC6", - /** StandardNC12 */ - StandardNC12 = "Standard_NC12", - /** StandardNC24 */ - StandardNC24 = "Standard_NC24", - /** StandardNC24R */ - StandardNC24R = "Standard_NC24r", - /** StandardNC6SV2 */ - StandardNC6SV2 = "Standard_NC6s_v2", - /** StandardNC12SV2 */ - StandardNC12SV2 = "Standard_NC12s_v2", - /** StandardNC24SV2 */ - StandardNC24SV2 = "Standard_NC24s_v2", - /** StandardNC24RsV2 */ - StandardNC24RsV2 = "Standard_NC24rs_v2", - /** StandardNC6SV3 */ - StandardNC6SV3 = "Standard_NC6s_v3", - /** StandardNC12SV3 */ - StandardNC12SV3 = "Standard_NC12s_v3", - /** StandardNC24SV3 */ - StandardNC24SV3 = "Standard_NC24s_v3", - /** StandardNC24RsV3 */ - StandardNC24RsV3 = "Standard_NC24rs_v3", - /** StandardND6S */ - StandardND6S = "Standard_ND6s", - /** StandardND12S */ - StandardND12S = "Standard_ND12s", - /** StandardND24S */ - StandardND24S = "Standard_ND24s", - /** StandardND24Rs */ - StandardND24Rs = "Standard_ND24rs", - /** StandardNV6 */ - StandardNV6 = "Standard_NV6", - /** StandardNV12 */ - StandardNV12 = "Standard_NV12", - /** StandardNV24 */ - StandardNV24 = "Standard_NV24", -} - -/** - * Defines values for VirtualMachineSizeTypes. \ - * {@link KnownVirtualMachineSizeTypes} can be used interchangeably with VirtualMachineSizeTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Basic_A0** \ - * **Basic_A1** \ - * **Basic_A2** \ - * **Basic_A3** \ - * **Basic_A4** \ - * **Standard_A0** \ - * **Standard_A1** \ - * **Standard_A2** \ - * **Standard_A3** \ - * **Standard_A4** \ - * **Standard_A5** \ - * **Standard_A6** \ - * **Standard_A7** \ - * **Standard_A8** \ - * **Standard_A9** \ - * **Standard_A10** \ - * **Standard_A11** \ - * **Standard_A1_v2** \ - * **Standard_A2_v2** \ - * **Standard_A4_v2** \ - * **Standard_A8_v2** \ - * **Standard_A2m_v2** \ - * **Standard_A4m_v2** \ - * **Standard_A8m_v2** \ - * **Standard_B1s** \ - * **Standard_B1ms** \ - * **Standard_B2s** \ - * **Standard_B2ms** \ - * **Standard_B4ms** \ - * **Standard_B8ms** \ - * **Standard_D1** \ - * **Standard_D2** \ - * **Standard_D3** \ - * **Standard_D4** \ - * **Standard_D11** \ - * **Standard_D12** \ - * **Standard_D13** \ - * **Standard_D14** \ - * **Standard_D1_v2** \ - * **Standard_D2_v2** \ - * **Standard_D3_v2** \ - * **Standard_D4_v2** \ - * **Standard_D5_v2** \ - * **Standard_D2_v3** \ - * **Standard_D4_v3** \ - * **Standard_D8_v3** \ - * **Standard_D16_v3** \ - * **Standard_D32_v3** \ - * **Standard_D64_v3** \ - * **Standard_D2s_v3** \ - * **Standard_D4s_v3** \ - * **Standard_D8s_v3** \ - * **Standard_D16s_v3** \ - * **Standard_D32s_v3** \ - * **Standard_D64s_v3** \ - * **Standard_D11_v2** \ - * **Standard_D12_v2** \ - * **Standard_D13_v2** \ - * **Standard_D14_v2** \ - * **Standard_D15_v2** \ - * **Standard_DS1** \ - * **Standard_DS2** \ - * **Standard_DS3** \ - * **Standard_DS4** \ - * **Standard_DS11** \ - * **Standard_DS12** \ - * **Standard_DS13** \ - * **Standard_DS14** \ - * **Standard_DS1_v2** \ - * **Standard_DS2_v2** \ - * **Standard_DS3_v2** \ - * **Standard_DS4_v2** \ - * **Standard_DS5_v2** \ - * **Standard_DS11_v2** \ - * **Standard_DS12_v2** \ - * **Standard_DS13_v2** \ - * **Standard_DS14_v2** \ - * **Standard_DS15_v2** \ - * **Standard_DS13-4_v2** \ - * **Standard_DS13-2_v2** \ - * **Standard_DS14-8_v2** \ - * **Standard_DS14-4_v2** \ - * **Standard_E2_v3** \ - * **Standard_E4_v3** \ - * **Standard_E8_v3** \ - * **Standard_E16_v3** \ - * **Standard_E32_v3** \ - * **Standard_E64_v3** \ - * **Standard_E2s_v3** \ - * **Standard_E4s_v3** \ - * **Standard_E8s_v3** \ - * **Standard_E16s_v3** \ - * **Standard_E32s_v3** \ - * **Standard_E64s_v3** \ - * **Standard_E32-16_v3** \ - * **Standard_E32-8s_v3** \ - * **Standard_E64-32s_v3** \ - * **Standard_E64-16s_v3** \ - * **Standard_F1** \ - * **Standard_F2** \ - * **Standard_F4** \ - * **Standard_F8** \ - * **Standard_F16** \ - * **Standard_F1s** \ - * **Standard_F2s** \ - * **Standard_F4s** \ - * **Standard_F8s** \ - * **Standard_F16s** \ - * **Standard_F2s_v2** \ - * **Standard_F4s_v2** \ - * **Standard_F8s_v2** \ - * **Standard_F16s_v2** \ - * **Standard_F32s_v2** \ - * **Standard_F64s_v2** \ - * **Standard_F72s_v2** \ - * **Standard_G1** \ - * **Standard_G2** \ - * **Standard_G3** \ - * **Standard_G4** \ - * **Standard_G5** \ - * **Standard_GS1** \ - * **Standard_GS2** \ - * **Standard_GS3** \ - * **Standard_GS4** \ - * **Standard_GS5** \ - * **Standard_GS4-8** \ - * **Standard_GS4-4** \ - * **Standard_GS5-16** \ - * **Standard_GS5-8** \ - * **Standard_H8** \ - * **Standard_H16** \ - * **Standard_H8m** \ - * **Standard_H16m** \ - * **Standard_H16r** \ - * **Standard_H16mr** \ - * **Standard_L4s** \ - * **Standard_L8s** \ - * **Standard_L16s** \ - * **Standard_L32s** \ - * **Standard_M64s** \ - * **Standard_M64ms** \ - * **Standard_M128s** \ - * **Standard_M128ms** \ - * **Standard_M64-32ms** \ - * **Standard_M64-16ms** \ - * **Standard_M128-64ms** \ - * **Standard_M128-32ms** \ - * **Standard_NC6** \ - * **Standard_NC12** \ - * **Standard_NC24** \ - * **Standard_NC24r** \ - * **Standard_NC6s_v2** \ - * **Standard_NC12s_v2** \ - * **Standard_NC24s_v2** \ - * **Standard_NC24rs_v2** \ - * **Standard_NC6s_v3** \ - * **Standard_NC12s_v3** \ - * **Standard_NC24s_v3** \ - * **Standard_NC24rs_v3** \ - * **Standard_ND6s** \ - * **Standard_ND12s** \ - * **Standard_ND24s** \ - * **Standard_ND24rs** \ - * **Standard_NV6** \ - * **Standard_NV12** \ - * **Standard_NV24** - */ -export type VirtualMachineSizeTypes = string; - -/** Known values of {@link DiskDetachOptionTypes} that the service accepts. */ -export enum KnownDiskDetachOptionTypes { - /** ForceDetach */ - ForceDetach = "ForceDetach", -} - -/** - * Defines values for DiskDetachOptionTypes. \ - * {@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** - */ -export type DiskDetachOptionTypes = string; - -/** Known values of {@link IPVersions} that the service accepts. */ -export enum KnownIPVersions { - /** IPv4 */ - IPv4 = "IPv4", - /** IPv6 */ - IPv6 = "IPv6", -} - -/** - * Defines values for IPVersions. \ - * {@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** \ - * **IPv6** - */ -export type IPVersions = string; - -/** Known values of {@link PublicIPAllocationMethod} that the service accepts. */ -export enum KnownPublicIPAllocationMethod { - /** Dynamic */ - Dynamic = "Dynamic", - /** Static */ - Static = "Static", -} - -/** - * Defines values for PublicIPAllocationMethod. \ - * {@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** \ - * **Static** - */ -export type PublicIPAllocationMethod = string; - -/** Known values of {@link HyperVGenerationType} that the service accepts. */ -export enum KnownHyperVGenerationType { - /** V1 */ - V1 = "V1", - /** V2 */ - V2 = "V2", -} - -/** - * Defines values for HyperVGenerationType. \ - * {@link KnownHyperVGenerationType} can be used interchangeably with HyperVGenerationType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **V1** \ - * **V2** - */ -export type HyperVGenerationType = string; - -/** Known values of {@link PatchOperationStatus} that the service accepts. */ -export enum KnownPatchOperationStatus { - /** Unknown */ - Unknown = "Unknown", - /** InProgress */ - InProgress = "InProgress", - /** Failed */ - Failed = "Failed", - /** Succeeded */ - Succeeded = "Succeeded", - /** CompletedWithWarnings */ - CompletedWithWarnings = "CompletedWithWarnings", -} - -/** - * Defines values for PatchOperationStatus. \ - * {@link KnownPatchOperationStatus} can be used interchangeably with PatchOperationStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **InProgress** \ - * **Failed** \ - * **Succeeded** \ - * **CompletedWithWarnings** - */ -export type PatchOperationStatus = string; - -/** Known values of {@link ProximityPlacementGroupType} that the service accepts. */ -export enum KnownProximityPlacementGroupType { - /** Standard */ - Standard = "Standard", - /** Ultra */ - Ultra = "Ultra", -} - -/** - * Defines values for ProximityPlacementGroupType. \ - * {@link KnownProximityPlacementGroupType} can be used interchangeably with ProximityPlacementGroupType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard** \ - * **Ultra** - */ -export type ProximityPlacementGroupType = string; - -/** Known values of {@link OperatingSystemType} that the service accepts. */ -export enum KnownOperatingSystemType { - /** Windows */ - Windows = "Windows", - /** Linux */ - Linux = "Linux", -} - -/** - * Defines values for OperatingSystemType. \ - * {@link KnownOperatingSystemType} can be used interchangeably with OperatingSystemType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Windows** \ - * **Linux** - */ -export type OperatingSystemType = string; - -/** Known values of {@link RestorePointEncryptionType} that the service accepts. */ -export enum KnownRestorePointEncryptionType { - /** Disk Restore Point is encrypted at rest with Platform managed key. */ - EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", - /** Disk Restore Point is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ - EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", - /** Disk Restore Point is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ - EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", -} - -/** - * Defines values for RestorePointEncryptionType. \ - * {@link KnownRestorePointEncryptionType} can be used interchangeably with RestorePointEncryptionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EncryptionAtRestWithPlatformKey**: Disk Restore Point is encrypted at rest with Platform managed key. \ - * **EncryptionAtRestWithCustomerKey**: Disk Restore Point is encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ - * **EncryptionAtRestWithPlatformAndCustomerKeys**: Disk Restore Point is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. - */ -export type RestorePointEncryptionType = string; - -/** Known values of {@link ConsistencyModeTypes} that the service accepts. */ -export enum KnownConsistencyModeTypes { - /** CrashConsistent */ - CrashConsistent = "CrashConsistent", - /** FileSystemConsistent */ - FileSystemConsistent = "FileSystemConsistent", - /** ApplicationConsistent */ - ApplicationConsistent = "ApplicationConsistent", -} - -/** - * Defines values for ConsistencyModeTypes. \ - * {@link KnownConsistencyModeTypes} can be used interchangeably with ConsistencyModeTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **CrashConsistent** \ - * **FileSystemConsistent** \ - * **ApplicationConsistent** - */ -export type ConsistencyModeTypes = string; - -/** Known values of {@link SnapshotAccessState} that the service accepts. */ -export enum KnownSnapshotAccessState { - /** Default value. */ - Unknown = "Unknown", - /** The snapshot cannot be used for restore, copy or download to offline. */ - Pending = "Pending", - /** The snapshot can be used for restore, copy to different region, and download to offline. */ - Available = "Available", - /** The snapshot can be used for restoring disks with fast performance but cannot be copied or downloaded. */ - InstantAccess = "InstantAccess", - /** The snapshot can be used for restoring disks with fast performance, copied and downloaded. */ - AvailableWithInstantAccess = "AvailableWithInstantAccess", -} - -/** - * Defines values for SnapshotAccessState. \ - * {@link KnownSnapshotAccessState} can be used interchangeably with SnapshotAccessState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown**: Default value. \ - * **Pending**: The snapshot cannot be used for restore, copy or download to offline. \ - * **Available**: The snapshot can be used for restore, copy to different region, and download to offline. \ - * **InstantAccess**: The snapshot can be used for restoring disks with fast performance but cannot be copied or downloaded. \ - * **AvailableWithInstantAccess**: The snapshot can be used for restoring disks with fast performance, copied and downloaded. - */ -export type SnapshotAccessState = string; - -/** Known values of {@link ExpandTypesForListVMs} that the service accepts. */ -export enum KnownExpandTypesForListVMs { - /** InstanceView */ - InstanceView = "instanceView", -} - -/** - * Defines values for ExpandTypesForListVMs. \ - * {@link KnownExpandTypesForListVMs} can be used interchangeably with ExpandTypesForListVMs, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **instanceView** - */ -export type ExpandTypesForListVMs = string; - -/** Known values of {@link CapacityReservationGroupInstanceViewTypes} that the service accepts. */ -export enum KnownCapacityReservationGroupInstanceViewTypes { - /** InstanceView */ - InstanceView = "instanceView", -} - -/** - * Defines values for CapacityReservationGroupInstanceViewTypes. \ - * {@link KnownCapacityReservationGroupInstanceViewTypes} can be used interchangeably with CapacityReservationGroupInstanceViewTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **instanceView** - */ -export type CapacityReservationGroupInstanceViewTypes = string; - -/** Known values of {@link CapacityReservationInstanceViewTypes} that the service accepts. */ -export enum KnownCapacityReservationInstanceViewTypes { - /** InstanceView */ - InstanceView = "instanceView", -} - -/** - * Defines values for CapacityReservationInstanceViewTypes. \ - * {@link KnownCapacityReservationInstanceViewTypes} can be used interchangeably with CapacityReservationInstanceViewTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **instanceView** - */ -export type CapacityReservationInstanceViewTypes = string; - -/** Known values of {@link RestorePointCollectionExpandOptions} that the service accepts. */ -export enum KnownRestorePointCollectionExpandOptions { - /** RestorePoints */ - RestorePoints = "restorePoints", -} - -/** - * Defines values for RestorePointCollectionExpandOptions. \ - * {@link KnownRestorePointCollectionExpandOptions} can be used interchangeably with RestorePointCollectionExpandOptions, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **restorePoints** - */ -export type RestorePointCollectionExpandOptions = string; - -/** Known values of {@link RestorePointExpandOptions} that the service accepts. */ -export enum KnownRestorePointExpandOptions { - /** InstanceView */ - InstanceView = "instanceView", -} - -/** - * Defines values for RestorePointExpandOptions. \ - * {@link KnownRestorePointExpandOptions} can be used interchangeably with RestorePointExpandOptions, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **instanceView** - */ -export type RestorePointExpandOptions = string; - -/** Known values of {@link SshEncryptionTypes} that the service accepts. */ -export enum KnownSshEncryptionTypes { - /** RSA */ - RSA = "RSA", - /** Ed25519 */ - Ed25519 = "Ed25519", -} - -/** - * Defines values for SshEncryptionTypes. \ - * {@link KnownSshEncryptionTypes} can be used interchangeably with SshEncryptionTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **RSA** \ - * **Ed25519** - */ -export type SshEncryptionTypes = string; - -/** Known values of {@link ExpandTypesForGetVMScaleSets} that the service accepts. */ -export enum KnownExpandTypesForGetVMScaleSets { - /** UserData */ - UserData = "userData", -} - -/** - * Defines values for ExpandTypesForGetVMScaleSets. \ - * {@link KnownExpandTypesForGetVMScaleSets} can be used interchangeably with ExpandTypesForGetVMScaleSets, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **userData** - */ -export type ExpandTypesForGetVMScaleSets = string; - -/** Known values of {@link OrchestrationServiceNames} that the service accepts. */ -export enum KnownOrchestrationServiceNames { - /** AutomaticRepairs */ - AutomaticRepairs = "AutomaticRepairs", - /** AutomaticZoneRebalancing orchestration service. */ - AutomaticZoneRebalancing = "AutomaticZoneRebalancing", -} - -/** - * Defines values for OrchestrationServiceNames. \ - * {@link KnownOrchestrationServiceNames} can be used interchangeably with OrchestrationServiceNames, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **AutomaticRepairs** \ - * **AutomaticZoneRebalancing**: AutomaticZoneRebalancing orchestration service. - */ -export type OrchestrationServiceNames = string; - -/** Known values of {@link OrchestrationServiceState} that the service accepts. */ -export enum KnownOrchestrationServiceState { - /** NotRunning */ - NotRunning = "NotRunning", - /** Running */ - Running = "Running", - /** Suspended */ - Suspended = "Suspended", -} - -/** - * Defines values for OrchestrationServiceState. \ - * {@link KnownOrchestrationServiceState} can be used interchangeably with OrchestrationServiceState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NotRunning** \ - * **Running** \ - * **Suspended** - */ -export type OrchestrationServiceState = string; - -/** Known values of {@link OrchestrationServiceOperationStatus} that the service accepts. */ -export enum KnownOrchestrationServiceOperationStatus { - /** InProgress orchestration service operation status. */ - InProgress = "InProgress", - /** Completed orchestration service operation status. */ - Completed = "Completed", -} - -/** - * Defines values for OrchestrationServiceOperationStatus. \ - * {@link KnownOrchestrationServiceOperationStatus} can be used interchangeably with OrchestrationServiceOperationStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **InProgress**: InProgress orchestration service operation status. \ - * **Completed**: Completed orchestration service operation status. - */ -export type OrchestrationServiceOperationStatus = string; - -/** Known values of {@link OrchestrationServiceStateAction} that the service accepts. */ -export enum KnownOrchestrationServiceStateAction { - /** Resume */ - Resume = "Resume", - /** Suspend */ - Suspend = "Suspend", -} - -/** - * Defines values for OrchestrationServiceStateAction. \ - * {@link KnownOrchestrationServiceStateAction} can be used interchangeably with OrchestrationServiceStateAction, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Resume** \ - * **Suspend** - */ -export type OrchestrationServiceStateAction = string; - -/** Known values of {@link HyperVGeneration} that the service accepts. */ -export enum KnownHyperVGeneration { - /** V1 */ - V1 = "V1", - /** V2 */ - V2 = "V2", -} - -/** - * Defines values for HyperVGeneration. \ - * {@link KnownHyperVGeneration} can be used interchangeably with HyperVGeneration, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **V1** \ - * **V2** - */ -export type HyperVGeneration = string; - -/** Known values of {@link ResilientVMDeletionStatus} that the service accepts. */ -export enum KnownResilientVMDeletionStatus { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", - /** InProgress */ - InProgress = "InProgress", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for ResilientVMDeletionStatus. \ - * {@link KnownResilientVMDeletionStatus} can be used interchangeably with ResilientVMDeletionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** \ - * **InProgress** \ - * **Failed** - */ -export type ResilientVMDeletionStatus = string; - -/** Known values of {@link ScriptShellTypes} that the service accepts. */ -export enum KnownScriptShellTypes { - /** Default script shell type. */ - Default = "Default", - /** Powershell7 script shell type. */ - Powershell7 = "Powershell7", -} - -/** - * Defines values for ScriptShellTypes. \ - * {@link KnownScriptShellTypes} can be used interchangeably with ScriptShellTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Default**: Default script shell type. \ - * **Powershell7**: Powershell7 script shell type. - */ -export type ScriptShellTypes = string; - -/** Known values of {@link ExecutionState} that the service accepts. */ -export enum KnownExecutionState { - /** Unknown */ - Unknown = "Unknown", - /** Pending */ - Pending = "Pending", - /** Running */ - Running = "Running", - /** Failed */ - Failed = "Failed", - /** Succeeded */ - Succeeded = "Succeeded", - /** TimedOut */ - TimedOut = "TimedOut", - /** Canceled */ - Canceled = "Canceled", -} - -/** - * Defines values for ExecutionState. \ - * {@link KnownExecutionState} can be used interchangeably with ExecutionState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **Pending** \ - * **Running** \ - * **Failed** \ - * **Succeeded** \ - * **TimedOut** \ - * **Canceled** - */ -export type ExecutionState = string; - -/** Known values of {@link ExpandTypeForListVMs} that the service accepts. */ -export enum KnownExpandTypeForListVMs { - /** InstanceView */ - InstanceView = "instanceView", -} - -/** - * Defines values for ExpandTypeForListVMs. \ - * {@link KnownExpandTypeForListVMs} can be used interchangeably with ExpandTypeForListVMs, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **instanceView** - */ -export type ExpandTypeForListVMs = string; - -/** Known values of {@link VMGuestPatchRebootBehavior} that the service accepts. */ -export enum KnownVMGuestPatchRebootBehavior { - /** Unknown */ - Unknown = "Unknown", - /** NeverReboots */ - NeverReboots = "NeverReboots", - /** AlwaysRequiresReboot */ - AlwaysRequiresReboot = "AlwaysRequiresReboot", - /** CanRequestReboot */ - CanRequestReboot = "CanRequestReboot", -} - -/** - * Defines values for VMGuestPatchRebootBehavior. \ - * {@link KnownVMGuestPatchRebootBehavior} can be used interchangeably with VMGuestPatchRebootBehavior, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **NeverReboots** \ - * **AlwaysRequiresReboot** \ - * **CanRequestReboot** - */ -export type VMGuestPatchRebootBehavior = string; - -/** Known values of {@link PatchAssessmentState} that the service accepts. */ -export enum KnownPatchAssessmentState { - /** Unknown */ - Unknown = "Unknown", - /** Available */ - Available = "Available", -} - -/** - * Defines values for PatchAssessmentState. \ - * {@link KnownPatchAssessmentState} can be used interchangeably with PatchAssessmentState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **Available** - */ -export type PatchAssessmentState = string; - -/** Known values of {@link VMGuestPatchRebootSetting} that the service accepts. */ -export enum KnownVMGuestPatchRebootSetting { - /** IfRequired */ - IfRequired = "IfRequired", - /** Never */ - Never = "Never", - /** Always */ - Always = "Always", -} - -/** - * Defines values for VMGuestPatchRebootSetting. \ - * {@link KnownVMGuestPatchRebootSetting} can be used interchangeably with VMGuestPatchRebootSetting, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **IfRequired** \ - * **Never** \ - * **Always** - */ -export type VMGuestPatchRebootSetting = string; - -/** Known values of {@link VMGuestPatchClassificationWindows} that the service accepts. */ -export enum KnownVMGuestPatchClassificationWindows { - /** Critical */ - Critical = "Critical", - /** Security */ - Security = "Security", - /** UpdateRollUp */ - UpdateRollUp = "UpdateRollUp", - /** FeaturePack */ - FeaturePack = "FeaturePack", - /** ServicePack */ - ServicePack = "ServicePack", - /** Definition */ - Definition = "Definition", - /** Tools */ - Tools = "Tools", - /** Updates */ - Updates = "Updates", -} - -/** - * Defines values for VMGuestPatchClassificationWindows. \ - * {@link KnownVMGuestPatchClassificationWindows} can be used interchangeably with VMGuestPatchClassificationWindows, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Critical** \ - * **Security** \ - * **UpdateRollUp** \ - * **FeaturePack** \ - * **ServicePack** \ - * **Definition** \ - * **Tools** \ - * **Updates** - */ -export type VMGuestPatchClassificationWindows = string; - -/** Known values of {@link VMGuestPatchClassificationLinux} that the service accepts. */ -export enum KnownVMGuestPatchClassificationLinux { - /** Critical */ - Critical = "Critical", - /** Security */ - Security = "Security", - /** Other */ - Other = "Other", -} - -/** - * Defines values for VMGuestPatchClassificationLinux. \ - * {@link KnownVMGuestPatchClassificationLinux} can be used interchangeably with VMGuestPatchClassificationLinux, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Critical** \ - * **Security** \ - * **Other** - */ -export type VMGuestPatchClassificationLinux = string; - -/** Known values of {@link VMGuestPatchRebootStatus} that the service accepts. */ -export enum KnownVMGuestPatchRebootStatus { - /** Unknown */ - Unknown = "Unknown", - /** NotNeeded */ - NotNeeded = "NotNeeded", - /** Required */ - Required = "Required", - /** Started */ - Started = "Started", - /** Failed */ - Failed = "Failed", - /** Completed */ - Completed = "Completed", -} - -/** - * Defines values for VMGuestPatchRebootStatus. \ - * {@link KnownVMGuestPatchRebootStatus} can be used interchangeably with VMGuestPatchRebootStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **NotNeeded** \ - * **Required** \ - * **Started** \ - * **Failed** \ - * **Completed** - */ -export type VMGuestPatchRebootStatus = string; - -/** Known values of {@link PatchInstallationState} that the service accepts. */ -export enum KnownPatchInstallationState { - /** Unknown */ - Unknown = "Unknown", - /** Installed */ - Installed = "Installed", - /** Failed */ - Failed = "Failed", - /** Excluded */ - Excluded = "Excluded", - /** NotSelected */ - NotSelected = "NotSelected", - /** Pending */ - Pending = "Pending", -} - -/** - * Defines values for PatchInstallationState. \ - * {@link KnownPatchInstallationState} can be used interchangeably with PatchInstallationState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **Installed** \ - * **Failed** \ - * **Excluded** \ - * **NotSelected** \ - * **Pending** - */ -export type PatchInstallationState = string; - -/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Rejected */ - Rejected = "Rejected", -} - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ -export enum KnownPrivateEndpointConnectionProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Creating */ - Creating = "Creating", - /** Deleting */ - Deleting = "Deleting", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for PrivateEndpointConnectionProvisioningState. \ - * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Creating** \ - * **Deleting** \ - * **Failed** - */ -export type PrivateEndpointConnectionProvisioningState = string; - -/** Known values of {@link DiskEncryptionSetType} that the service accepts. */ -export enum KnownDiskEncryptionSetType { - /** Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ - EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", - /** Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ - EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", - /** Confidential VM supported disk and VM guest state would be encrypted with customer managed key. */ - ConfidentialVmEncryptedWithCustomerKey = "ConfidentialVmEncryptedWithCustomerKey", -} - -/** - * Defines values for DiskEncryptionSetType. \ - * {@link KnownDiskEncryptionSetType} can be used interchangeably with DiskEncryptionSetType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EncryptionAtRestWithCustomerKey**: Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ - * **EncryptionAtRestWithPlatformAndCustomerKeys**: Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. \ - * **ConfidentialVmEncryptedWithCustomerKey**: Confidential VM supported disk and VM guest state would be encrypted with customer managed key. - */ -export type DiskEncryptionSetType = string; - -/** Known values of {@link DiskEncryptionSetIdentityType} that the service accepts. */ -export enum KnownDiskEncryptionSetIdentityType { - /** SystemAssigned */ - SystemAssigned = "SystemAssigned", - /** UserAssigned */ - UserAssigned = "UserAssigned", - /** SystemAssignedUserAssigned */ - SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", - /** None */ - None = "None", -} - -/** - * Defines values for DiskEncryptionSetIdentityType. \ - * {@link KnownDiskEncryptionSetIdentityType} can be used interchangeably with DiskEncryptionSetIdentityType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **SystemAssigned** \ - * **UserAssigned** \ - * **SystemAssigned, UserAssigned** \ - * **None** - */ -export type DiskEncryptionSetIdentityType = string; - -/** Known values of {@link Architecture} that the service accepts. */ -export enum KnownArchitecture { - /** X64 */ - X64 = "x64", - /** Arm64 */ - Arm64 = "Arm64", -} - -/** - * Defines values for Architecture. \ - * {@link KnownArchitecture} can be used interchangeably with Architecture, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **x64** \ - * **Arm64** - */ -export type Architecture = string; - -/** Known values of {@link SupportedSecurityOption} that the service accepts. */ -export enum KnownSupportedSecurityOption { - /** The disk supports creating Trusted Launch VMs. */ - TrustedLaunchSupported = "TrustedLaunchSupported", - /** The disk supports creating both Trusted Launch and Confidential VMs. */ - TrustedLaunchAndConfidentialVMSupported = "TrustedLaunchAndConfidentialVMSupported", -} - -/** - * Defines values for SupportedSecurityOption. \ - * {@link KnownSupportedSecurityOption} can be used interchangeably with SupportedSecurityOption, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **TrustedLaunchSupported**: The disk supports creating Trusted Launch VMs. \ - * **TrustedLaunchAndConfidentialVMSupported**: The disk supports creating both Trusted Launch and Confidential VMs. - */ -export type SupportedSecurityOption = string; - -/** Known values of {@link DiskCreateOption} that the service accepts. */ -export enum KnownDiskCreateOption { - /** Create an empty data disk of a size given by diskSizeGB. */ - Empty = "Empty", - /** Disk will be attached to a VM. */ - Attach = "Attach", - /** Create a new disk from a platform image specified by the given imageReference or galleryImageReference. */ - FromImage = "FromImage", - /** Create a disk by importing from a blob specified by a sourceUri in a storage account specified by storageAccountId. */ - Import = "Import", - /** Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. */ - Copy = "Copy", - /** Create a new disk by copying from a backup recovery point. */ - Restore = "Restore", - /** Create a new disk by obtaining a write token and using it to directly upload the contents of the disk. */ - Upload = "Upload", - /** Create a new disk by using a deep copy process, where the resource creation is considered complete only after all data has been copied from the source. */ - CopyStart = "CopyStart", - /** Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. */ - ImportSecure = "ImportSecure", - /** Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. */ - UploadPreparedSecure = "UploadPreparedSecure", - /** Create a new disk by exporting from elastic san volume snapshot */ - CopyFromSanSnapshot = "CopyFromSanSnapshot", -} - -/** - * Defines values for DiskCreateOption. \ - * {@link KnownDiskCreateOption} can be used interchangeably with DiskCreateOption, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Empty**: Create an empty data disk of a size given by diskSizeGB. \ - * **Attach**: Disk will be attached to a VM. \ - * **FromImage**: Create a new disk from a platform image specified by the given imageReference or galleryImageReference. \ - * **Import**: Create a disk by importing from a blob specified by a sourceUri in a storage account specified by storageAccountId. \ - * **Copy**: Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. \ - * **Restore**: Create a new disk by copying from a backup recovery point. \ - * **Upload**: Create a new disk by obtaining a write token and using it to directly upload the contents of the disk. \ - * **CopyStart**: Create a new disk by using a deep copy process, where the resource creation is considered complete only after all data has been copied from the source. \ - * **ImportSecure**: Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. \ - * **UploadPreparedSecure**: Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. \ - * **CopyFromSanSnapshot**: Create a new disk by exporting from elastic san volume snapshot - */ -export type DiskCreateOption = string; - -/** Known values of {@link ProvisionedBandwidthCopyOption} that the service accepts. */ -export enum KnownProvisionedBandwidthCopyOption { - /** None */ - None = "None", - /** Enhanced */ - Enhanced = "Enhanced", -} - -/** - * Defines values for ProvisionedBandwidthCopyOption. \ - * {@link KnownProvisionedBandwidthCopyOption} can be used interchangeably with ProvisionedBandwidthCopyOption, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Enhanced** - */ -export type ProvisionedBandwidthCopyOption = string; - -/** Known values of {@link DiskState} that the service accepts. */ -export enum KnownDiskState { - /** The disk is not being used and can be attached to a VM. */ - Unattached = "Unattached", - /** The disk is currently attached to a running VM. */ - Attached = "Attached", - /** The disk is attached to a stopped-deallocated VM. */ - Reserved = "Reserved", - /** The disk is attached to a VM which is in hibernated state. */ - Frozen = "Frozen", - /** The disk currently has an Active SAS Uri associated with it. */ - ActiveSAS = "ActiveSAS", - /** The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. */ - ActiveSASFrozen = "ActiveSASFrozen", - /** A disk is ready to be created by upload by requesting a write token. */ - ReadyToUpload = "ReadyToUpload", - /** A disk is created for upload and a write token has been issued for uploading to it. */ - ActiveUpload = "ActiveUpload", -} - -/** - * Defines values for DiskState. \ - * {@link KnownDiskState} can be used interchangeably with DiskState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unattached**: The disk is not being used and can be attached to a VM. \ - * **Attached**: The disk is currently attached to a running VM. \ - * **Reserved**: The disk is attached to a stopped-deallocated VM. \ - * **Frozen**: The disk is attached to a VM which is in hibernated state. \ - * **ActiveSAS**: The disk currently has an Active SAS Uri associated with it. \ - * **ActiveSASFrozen**: The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. \ - * **ReadyToUpload**: A disk is ready to be created by upload by requesting a write token. \ - * **ActiveUpload**: A disk is created for upload and a write token has been issued for uploading to it. - */ -export type DiskState = string; - -/** Known values of {@link EncryptionType} that the service accepts. */ -export enum KnownEncryptionType { - /** Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is not a valid encryption type for disk encryption sets. */ - EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", - /** Disk is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ - EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", - /** Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ - EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", -} - -/** - * Defines values for EncryptionType. \ - * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EncryptionAtRestWithPlatformKey**: Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is not a valid encryption type for disk encryption sets. \ - * **EncryptionAtRestWithCustomerKey**: Disk is encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ - * **EncryptionAtRestWithPlatformAndCustomerKeys**: Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. - */ -export type EncryptionType = string; - -/** Known values of {@link NetworkAccessPolicy} that the service accepts. */ -export enum KnownNetworkAccessPolicy { - /** The disk can be exported or uploaded to from any network. */ - AllowAll = "AllowAll", - /** The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. */ - AllowPrivate = "AllowPrivate", - /** The disk cannot be exported. */ - DenyAll = "DenyAll", -} - -/** - * Defines values for NetworkAccessPolicy. \ - * {@link KnownNetworkAccessPolicy} can be used interchangeably with NetworkAccessPolicy, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **AllowAll**: The disk can be exported or uploaded to from any network. \ - * **AllowPrivate**: The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. \ - * **DenyAll**: The disk cannot be exported. - */ -export type NetworkAccessPolicy = string; - -/** Known values of {@link DiskSecurityTypes} that the service accepts. */ -export enum KnownDiskSecurityTypes { - /** Trusted Launch provides security features such as secure boot and virtual Trusted Platform Module (vTPM) */ - TrustedLaunch = "TrustedLaunch", - /** Indicates Confidential VM disk with only VM guest state encrypted */ - ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", - /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform managed key */ - ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", - /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer managed key */ - ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", - /** Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not persisted across VM reboots. */ - ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", -} - -/** - * Defines values for DiskSecurityTypes. \ - * {@link KnownDiskSecurityTypes} can be used interchangeably with DiskSecurityTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **TrustedLaunch**: Trusted Launch provides security features such as secure boot and virtual Trusted Platform Module (vTPM) \ - * **ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey**: Indicates Confidential VM disk with only VM guest state encrypted \ - * **ConfidentialVM_DiskEncryptedWithPlatformKey**: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform managed key \ - * **ConfidentialVM_DiskEncryptedWithCustomerKey**: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer managed key \ - * **ConfidentialVM_NonPersistedTPM**: Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not persisted across VM reboots. - */ -export type DiskSecurityTypes = string; - -/** Known values of {@link PublicNetworkAccess} that the service accepts. */ -export enum KnownPublicNetworkAccess { - /** You can generate a SAS URI to access the underlying data of the disk publicly on the internet when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. */ - Enabled = "Enabled", - /** You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. */ - Disabled = "Disabled", -} - -/** - * Defines values for PublicNetworkAccess. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled**: You can generate a SAS URI to access the underlying data of the disk publicly on the internet when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. \ - * **Disabled**: You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. - */ -export type PublicNetworkAccess = string; - -/** Known values of {@link DataAccessAuthMode} that the service accepts. */ -export enum KnownDataAccessAuthMode { - /** When export\/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export\/upload the data. Please refer to aka.ms\/DisksAzureADAuth. */ - AzureActiveDirectory = "AzureActiveDirectory", - /** No additional authentication would be performed when accessing export\/upload URL. */ - None = "None", -} - -/** - * Defines values for DataAccessAuthMode. \ - * {@link KnownDataAccessAuthMode} can be used interchangeably with DataAccessAuthMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **AzureActiveDirectory**: When export\/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export\/upload the data. Please refer to aka.ms\/DisksAzureADAuth. \ - * **None**: No additional authentication would be performed when accessing export\/upload URL. - */ -export type DataAccessAuthMode = string; - -/** Known values of {@link AvailabilityPolicyDiskDelay} that the service accepts. */ -export enum KnownAvailabilityPolicyDiskDelay { - /** Defaults to behavior without av policy specified, which is VM restart upon slow disk io. */ - None = "None", - /** Upon a disk io failure or slow response, try detaching then reattaching the disk. */ - AutomaticReattach = "AutomaticReattach", -} - -/** - * Defines values for AvailabilityPolicyDiskDelay. \ - * {@link KnownAvailabilityPolicyDiskDelay} can be used interchangeably with AvailabilityPolicyDiskDelay, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None**: Defaults to behavior without av policy specified, which is VM restart upon slow disk io. \ - * **AutomaticReattach**: Upon a disk io failure or slow response, try detaching then reattaching the disk. - */ -export type AvailabilityPolicyDiskDelay = string; - -/** Known values of {@link DiskStorageAccountTypes} that the service accepts. */ -export enum KnownDiskStorageAccountTypes { - /** Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. */ - StandardLRS = "Standard_LRS", - /** Premium SSD locally redundant storage. Best for production and performance sensitive workloads. */ - PremiumLRS = "Premium_LRS", - /** Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev\/test. */ - StandardSSDLRS = "StandardSSD_LRS", - /** Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. */ - UltraSSDLRS = "UltraSSD_LRS", - /** Premium SSD zone redundant storage. Best for the production workloads that need storage resiliency against zone failures. */ - PremiumZRS = "Premium_ZRS", - /** Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications and dev\/test that need storage resiliency against zone failures. */ - StandardSSDZRS = "StandardSSD_ZRS", - /** Premium SSD v2 locally redundant storage. Best for production and performance-sensitive workloads that consistently require low latency and high IOPS and throughput. */ - PremiumV2LRS = "PremiumV2_LRS", -} - -/** - * Defines values for DiskStorageAccountTypes. \ - * {@link KnownDiskStorageAccountTypes} can be used interchangeably with DiskStorageAccountTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard_LRS**: Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. \ - * **Premium_LRS**: Premium SSD locally redundant storage. Best for production and performance sensitive workloads. \ - * **StandardSSD_LRS**: Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev\/test. \ - * **UltraSSD_LRS**: Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. \ - * **Premium_ZRS**: Premium SSD zone redundant storage. Best for the production workloads that need storage resiliency against zone failures. \ - * **StandardSSD_ZRS**: Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications and dev\/test that need storage resiliency against zone failures. \ - * **PremiumV2_LRS**: Premium SSD v2 locally redundant storage. Best for production and performance-sensitive workloads that consistently require low latency and high IOPS and throughput. - */ -export type DiskStorageAccountTypes = string; - -/** Known values of {@link CopyCompletionErrorReason} that the service accepts. */ -export enum KnownCopyCompletionErrorReason { - /** Indicates that the source snapshot was deleted while the background copy of the resource created via CopyStart operation was in progress. */ - CopySourceNotFound = "CopySourceNotFound", -} - -/** - * Defines values for CopyCompletionErrorReason. \ - * {@link KnownCopyCompletionErrorReason} can be used interchangeably with CopyCompletionErrorReason, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **CopySourceNotFound**: Indicates that the source snapshot was deleted while the background copy of the resource created via CopyStart operation was in progress. - */ -export type CopyCompletionErrorReason = string; - -/** Known values of {@link SnapshotStorageAccountTypes} that the service accepts. */ -export enum KnownSnapshotStorageAccountTypes { - /** Standard HDD locally redundant storage */ - StandardLRS = "Standard_LRS", - /** Premium SSD locally redundant storage */ - PremiumLRS = "Premium_LRS", - /** Standard zone redundant storage */ - StandardZRS = "Standard_ZRS", -} - -/** - * Defines values for SnapshotStorageAccountTypes. \ - * {@link KnownSnapshotStorageAccountTypes} can be used interchangeably with SnapshotStorageAccountTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard_LRS**: Standard HDD locally redundant storage \ - * **Premium_LRS**: Premium SSD locally redundant storage \ - * **Standard_ZRS**: Standard zone redundant storage - */ -export type SnapshotStorageAccountTypes = string; - -/** Known values of {@link AccessLevel} that the service accepts. */ -export enum KnownAccessLevel { - /** None */ - None = "None", - /** Read */ - Read = "Read", - /** Write */ - Write = "Write", -} - -/** - * Defines values for AccessLevel. \ - * {@link KnownAccessLevel} can be used interchangeably with AccessLevel, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Read** \ - * **Write** - */ -export type AccessLevel = string; - -/** Known values of {@link FileFormat} that the service accepts. */ -export enum KnownFileFormat { - /** A VHD file is a disk image file in the Virtual Hard Disk file format. */ - VHD = "VHD", - /** A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. */ - Vhdx = "VHDX", -} - -/** - * Defines values for FileFormat. \ - * {@link KnownFileFormat} can be used interchangeably with FileFormat, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **VHD**: A VHD file is a disk image file in the Virtual Hard Disk file format. \ - * **VHDX**: A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. - */ -export type FileFormat = string; - -/** Known values of {@link ExtendedLocationType} that the service accepts. */ -export enum KnownExtendedLocationType { - /** EdgeZone */ - EdgeZone = "EdgeZone", -} - -/** - * Defines values for ExtendedLocationType. \ - * {@link KnownExtendedLocationType} can be used interchangeably with ExtendedLocationType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EdgeZone** - */ -export type ExtendedLocationType = string; - -/** Known values of {@link GalleryProvisioningState} that the service accepts. */ -export enum KnownGalleryProvisioningState { - /** Creating */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Failed */ - Failed = "Failed", - /** Succeeded */ - Succeeded = "Succeeded", - /** Deleting */ - Deleting = "Deleting", - /** Migrating */ - Migrating = "Migrating", -} - -/** - * Defines values for GalleryProvisioningState. \ - * {@link KnownGalleryProvisioningState} can be used interchangeably with GalleryProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Creating** \ - * **Updating** \ - * **Failed** \ - * **Succeeded** \ - * **Deleting** \ - * **Migrating** - */ -export type GalleryProvisioningState = string; - -/** Known values of {@link GallerySharingPermissionTypes} that the service accepts. */ -export enum KnownGallerySharingPermissionTypes { - /** Private */ - Private = "Private", - /** Groups */ - Groups = "Groups", - /** Community */ - Community = "Community", -} - -/** - * Defines values for GallerySharingPermissionTypes. \ - * {@link KnownGallerySharingPermissionTypes} can be used interchangeably with GallerySharingPermissionTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Private** \ - * **Groups** \ - * **Community** - */ -export type GallerySharingPermissionTypes = string; - -/** Known values of {@link SharingProfileGroupTypes} that the service accepts. */ -export enum KnownSharingProfileGroupTypes { - /** Subscriptions */ - Subscriptions = "Subscriptions", - /** AADTenants */ - AADTenants = "AADTenants", -} - -/** - * Defines values for SharingProfileGroupTypes. \ - * {@link KnownSharingProfileGroupTypes} can be used interchangeably with SharingProfileGroupTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Subscriptions** \ - * **AADTenants** - */ -export type SharingProfileGroupTypes = string; - -/** Known values of {@link SharingState} that the service accepts. */ -export enum KnownSharingState { - /** Succeeded */ - Succeeded = "Succeeded", - /** InProgress */ - InProgress = "InProgress", - /** Failed */ - Failed = "Failed", - /** Unknown */ - Unknown = "Unknown", -} - -/** - * Defines values for SharingState. \ - * {@link KnownSharingState} can be used interchangeably with SharingState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **InProgress** \ - * **Failed** \ - * **Unknown** - */ -export type SharingState = string; - -/** Known values of {@link UefiSignatureTemplateName} that the service accepts. */ -export enum KnownUefiSignatureTemplateName { - /** NoSignatureTemplate */ - NoSignatureTemplate = "NoSignatureTemplate", - /** MicrosoftUefiCertificateAuthorityTemplate */ - MicrosoftUefiCertificateAuthorityTemplate = "MicrosoftUefiCertificateAuthorityTemplate", - /** MicrosoftWindowsTemplate */ - MicrosoftWindowsTemplate = "MicrosoftWindowsTemplate", -} - -/** - * Defines values for UefiSignatureTemplateName. \ - * {@link KnownUefiSignatureTemplateName} can be used interchangeably with UefiSignatureTemplateName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NoSignatureTemplate** \ - * **MicrosoftUefiCertificateAuthorityTemplate** \ - * **MicrosoftWindowsTemplate** - */ -export type UefiSignatureTemplateName = string; - -/** Known values of {@link UefiKeyType} that the service accepts. */ -export enum KnownUefiKeyType { - /** Sha256 */ - Sha256 = "sha256", - /** X509 */ - X509 = "x509", -} - -/** - * Defines values for UefiKeyType. \ - * {@link KnownUefiKeyType} can be used interchangeably with UefiKeyType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **sha256** \ - * **x509** - */ -export type UefiKeyType = string; - -/** Known values of {@link SharedGalleryHostCaching} that the service accepts. */ -export enum KnownSharedGalleryHostCaching { - /** None */ - None = "None", - /** ReadOnly */ - ReadOnly = "ReadOnly", - /** ReadWrite */ - ReadWrite = "ReadWrite", -} - -/** - * Defines values for SharedGalleryHostCaching. \ - * {@link KnownSharedGalleryHostCaching} can be used interchangeably with SharedGalleryHostCaching, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **ReadOnly** \ - * **ReadWrite** - */ -export type SharedGalleryHostCaching = string; - -/** Known values of {@link SharedToValues} that the service accepts. */ -export enum KnownSharedToValues { - /** Tenant */ - Tenant = "tenant", -} - -/** - * Defines values for SharedToValues. \ - * {@link KnownSharedToValues} can be used interchangeably with SharedToValues, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **tenant** - */ -export type SharedToValues = string; - -/** Known values of {@link SelectPermissions} that the service accepts. */ -export enum KnownSelectPermissions { - /** Permissions */ - Permissions = "Permissions", -} - -/** - * Defines values for SelectPermissions. \ - * {@link KnownSelectPermissions} can be used interchangeably with SelectPermissions, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Permissions** - */ -export type SelectPermissions = string; - -/** Known values of {@link GalleryExpandParams} that the service accepts. */ -export enum KnownGalleryExpandParams { - /** SharingProfileGroups */ - SharingProfileGroups = "SharingProfile/Groups", -} - -/** - * Defines values for GalleryExpandParams. \ - * {@link KnownGalleryExpandParams} can be used interchangeably with GalleryExpandParams, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **SharingProfile\/Groups** - */ -export type GalleryExpandParams = string; - -/** Known values of {@link GalleryApplicationScriptRebootBehavior} that the service accepts. */ -export enum KnownGalleryApplicationScriptRebootBehavior { - /** None */ - None = "None", - /** Rerun */ - Rerun = "Rerun", -} - -/** - * Defines values for GalleryApplicationScriptRebootBehavior. \ - * {@link KnownGalleryApplicationScriptRebootBehavior} can be used interchangeably with GalleryApplicationScriptRebootBehavior, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Rerun** - */ -export type GalleryApplicationScriptRebootBehavior = string; - -/** Known values of {@link StorageAccountType} that the service accepts. */ -export enum KnownStorageAccountType { - /** StandardLRS */ - StandardLRS = "Standard_LRS", - /** StandardZRS */ - StandardZRS = "Standard_ZRS", - /** PremiumLRS */ - PremiumLRS = "Premium_LRS", - /** PremiumV2LRS */ - PremiumV2LRS = "PremiumV2_LRS", -} - -/** - * Defines values for StorageAccountType. \ - * {@link KnownStorageAccountType} can be used interchangeably with StorageAccountType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard_LRS** \ - * **Standard_ZRS** \ - * **Premium_LRS** \ - * **PremiumV2_LRS** - */ -export type StorageAccountType = string; - -/** Known values of {@link ConfidentialVMEncryptionType} that the service accepts. */ -export enum KnownConfidentialVMEncryptionType { - /** EncryptedVMGuestStateOnlyWithPmk */ - EncryptedVMGuestStateOnlyWithPmk = "EncryptedVMGuestStateOnlyWithPmk", - /** EncryptedWithPmk */ - EncryptedWithPmk = "EncryptedWithPmk", - /** EncryptedWithCmk */ - EncryptedWithCmk = "EncryptedWithCmk", - /** NonPersistedTPM */ - NonPersistedTPM = "NonPersistedTPM", -} - -/** - * Defines values for ConfidentialVMEncryptionType. \ - * {@link KnownConfidentialVMEncryptionType} can be used interchangeably with ConfidentialVMEncryptionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EncryptedVMGuestStateOnlyWithPmk** \ - * **EncryptedWithPmk** \ - * **EncryptedWithCmk** \ - * **NonPersistedTPM** - */ -export type ConfidentialVMEncryptionType = string; - -/** Known values of {@link ReplicationMode} that the service accepts. */ -export enum KnownReplicationMode { - /** Full */ - Full = "Full", - /** Shallow */ - Shallow = "Shallow", -} - -/** - * Defines values for ReplicationMode. \ - * {@link KnownReplicationMode} can be used interchangeably with ReplicationMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Full** \ - * **Shallow** - */ -export type ReplicationMode = string; - -/** Known values of {@link GalleryExtendedLocationType} that the service accepts. */ -export enum KnownGalleryExtendedLocationType { - /** EdgeZone */ - EdgeZone = "EdgeZone", - /** Unknown */ - Unknown = "Unknown", -} - -/** - * Defines values for GalleryExtendedLocationType. \ - * {@link KnownGalleryExtendedLocationType} can be used interchangeably with GalleryExtendedLocationType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **EdgeZone** \ - * **Unknown** - */ -export type GalleryExtendedLocationType = string; - -/** Known values of {@link EdgeZoneStorageAccountType} that the service accepts. */ -export enum KnownEdgeZoneStorageAccountType { - /** StandardLRS */ - StandardLRS = "Standard_LRS", - /** StandardZRS */ - StandardZRS = "Standard_ZRS", - /** StandardSSDLRS */ - StandardSSDLRS = "StandardSSD_LRS", - /** PremiumLRS */ - PremiumLRS = "Premium_LRS", -} - -/** - * Defines values for EdgeZoneStorageAccountType. \ - * {@link KnownEdgeZoneStorageAccountType} can be used interchangeably with EdgeZoneStorageAccountType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard_LRS** \ - * **Standard_ZRS** \ - * **StandardSSD_LRS** \ - * **Premium_LRS** - */ -export type EdgeZoneStorageAccountType = string; - -/** Known values of {@link StorageAccountStrategy} that the service accepts. */ -export enum KnownStorageAccountStrategy { - /** Choose Standard_ZRS storage if the region supports it, else choose Standard_LRS storage, unless overridden by specifying regional storageAccountType. If no storageAccountStrategy is specified, this is the default strategy (from API version 2025-03-03 onwards). */ - PreferStandardZRS = "PreferStandard_ZRS", - /** Choose Standard_LRS storage unless overridden by specifying regional storageAccountType. */ - DefaultStandardLRS = "DefaultStandard_LRS", -} - -/** - * Defines values for StorageAccountStrategy. \ - * {@link KnownStorageAccountStrategy} can be used interchangeably with StorageAccountStrategy, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **PreferStandard_ZRS**: Choose Standard_ZRS storage if the region supports it, else choose Standard_LRS storage, unless overridden by specifying regional storageAccountType. If no storageAccountStrategy is specified, this is the default strategy (from API version 2025-03-03 onwards). \ - * **DefaultStandard_LRS**: Choose Standard_LRS storage unless overridden by specifying regional storageAccountType. - */ -export type StorageAccountStrategy = string; - -/** Known values of {@link AggregatedReplicationState} that the service accepts. */ -export enum KnownAggregatedReplicationState { - /** Unknown */ - Unknown = "Unknown", - /** InProgress */ - InProgress = "InProgress", - /** Completed */ - Completed = "Completed", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for AggregatedReplicationState. \ - * {@link KnownAggregatedReplicationState} can be used interchangeably with AggregatedReplicationState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **InProgress** \ - * **Completed** \ - * **Failed** - */ -export type AggregatedReplicationState = string; - -/** Known values of {@link ReplicationState} that the service accepts. */ -export enum KnownReplicationState { - /** Unknown */ - Unknown = "Unknown", - /** Replicating */ - Replicating = "Replicating", - /** Completed */ - Completed = "Completed", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for ReplicationState. \ - * {@link KnownReplicationState} can be used interchangeably with ReplicationState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **Replicating** \ - * **Completed** \ - * **Failed** - */ -export type ReplicationState = string; - -/** Known values of {@link ReplicationStatusTypes} that the service accepts. */ -export enum KnownReplicationStatusTypes { - /** ReplicationStatus */ - ReplicationStatus = "ReplicationStatus", - /** UefiSettings */ - UefiSettings = "UefiSettings", -} - -/** - * Defines values for ReplicationStatusTypes. \ - * {@link KnownReplicationStatusTypes} can be used interchangeably with ReplicationStatusTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **ReplicationStatus** \ - * **UefiSettings** - */ -export type ReplicationStatusTypes = string; - -/** Known values of {@link PolicyViolationCategory} that the service accepts. */ -export enum KnownPolicyViolationCategory { - /** Other */ - Other = "Other", - /** ImageFlaggedUnsafe */ - ImageFlaggedUnsafe = "ImageFlaggedUnsafe", - /** CopyrightValidation */ - CopyrightValidation = "CopyrightValidation", - /** IpTheft */ - IpTheft = "IpTheft", -} - -/** - * Defines values for PolicyViolationCategory. \ - * {@link KnownPolicyViolationCategory} can be used interchangeably with PolicyViolationCategory, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Other** \ - * **ImageFlaggedUnsafe** \ - * **CopyrightValidation** \ - * **IpTheft** - */ -export type PolicyViolationCategory = string; - -/** Known values of {@link ValidationStatus} that the service accepts. */ -export enum KnownValidationStatus { - /** Unknown */ - Unknown = "Unknown", - /** Failed */ - Failed = "Failed", - /** Succeeded */ - Succeeded = "Succeeded", -} - -/** - * Defines values for ValidationStatus. \ - * {@link KnownValidationStatus} can be used interchangeably with ValidationStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown** \ - * **Failed** \ - * **Succeeded** - */ -export type ValidationStatus = string; - -/** Known values of {@link AccessControlRulesMode} that the service accepts. */ -export enum KnownAccessControlRulesMode { - /** Audit */ - Audit = "Audit", - /** Enforce */ - Enforce = "Enforce", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for AccessControlRulesMode. \ - * {@link KnownAccessControlRulesMode} can be used interchangeably with AccessControlRulesMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Audit** \ - * **Enforce** \ - * **Disabled** - */ -export type AccessControlRulesMode = string; - -/** Known values of {@link EndpointAccess} that the service accepts. */ -export enum KnownEndpointAccess { - /** Allow */ - Allow = "Allow", - /** Deny */ - Deny = "Deny", -} - -/** - * Defines values for EndpointAccess. \ - * {@link KnownEndpointAccess} can be used interchangeably with EndpointAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Allow** \ - * **Deny** - */ -export type EndpointAccess = string; - -/** Known values of {@link GalleryScriptParameterType} that the service accepts. */ -export enum KnownGalleryScriptParameterType { - /** String gallery script parameter type */ - String = "String", - /** Int gallery script parameter type */ - Int = "Int", - /** Double gallery script parameter type */ - Double = "Double", - /** Boolean gallery script parameter type */ - Boolean = "Boolean", - /** Enum gallery script parameter type */ - Enum = "Enum", -} - -/** - * Defines values for GalleryScriptParameterType. \ - * {@link KnownGalleryScriptParameterType} can be used interchangeably with GalleryScriptParameterType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **String**: String gallery script parameter type \ - * **Int**: Int gallery script parameter type \ - * **Double**: Double gallery script parameter type \ - * **Boolean**: Boolean gallery script parameter type \ - * **Enum**: Enum gallery script parameter type - */ -export type GalleryScriptParameterType = string; - -/** Known values of {@link SharingUpdateOperationTypes} that the service accepts. */ -export enum KnownSharingUpdateOperationTypes { - /** Add */ - Add = "Add", - /** Remove */ - Remove = "Remove", - /** Reset */ - Reset = "Reset", - /** EnableCommunity */ - EnableCommunity = "EnableCommunity", -} - -/** - * Defines values for SharingUpdateOperationTypes. \ - * {@link KnownSharingUpdateOperationTypes} can be used interchangeably with SharingUpdateOperationTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Add** \ - * **Remove** \ - * **Reset** \ - * **EnableCommunity** - */ -export type SharingUpdateOperationTypes = string; - -/** Known values of {@link SoftDeletedArtifactTypes} that the service accepts. */ -export enum KnownSoftDeletedArtifactTypes { - /** Images */ - Images = "Images", -} - -/** - * Defines values for SoftDeletedArtifactTypes. \ - * {@link KnownSoftDeletedArtifactTypes} can be used interchangeably with SoftDeletedArtifactTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Images** - */ -export type SoftDeletedArtifactTypes = string; - -/** Known values of {@link CloudServiceUpgradeMode} that the service accepts. */ -export enum KnownCloudServiceUpgradeMode { - /** Auto */ - Auto = "Auto", - /** Manual */ - Manual = "Manual", - /** Simultaneous */ - Simultaneous = "Simultaneous", -} - -/** - * Defines values for CloudServiceUpgradeMode. \ - * {@link KnownCloudServiceUpgradeMode} can be used interchangeably with CloudServiceUpgradeMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Auto** \ - * **Manual** \ - * **Simultaneous** - */ -export type CloudServiceUpgradeMode = string; - -/** Known values of {@link CloudServiceSlotType} that the service accepts. */ -export enum KnownCloudServiceSlotType { - /** Production */ - Production = "Production", - /** Staging */ - Staging = "Staging", -} - -/** - * Defines values for CloudServiceSlotType. \ - * {@link KnownCloudServiceSlotType} can be used interchangeably with CloudServiceSlotType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Production** \ - * **Staging** - */ -export type CloudServiceSlotType = string; - -/** Known values of {@link AvailabilitySetSkuTypes} that the service accepts. */ -export enum KnownAvailabilitySetSkuTypes { - /** Classic */ - Classic = "Classic", - /** Aligned */ - Aligned = "Aligned", -} - -/** - * Defines values for AvailabilitySetSkuTypes. \ - * {@link KnownAvailabilitySetSkuTypes} can be used interchangeably with AvailabilitySetSkuTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Classic** \ - * **Aligned** - */ -export type AvailabilitySetSkuTypes = string; -/** Defines values for StatusLevelTypes. */ -export type StatusLevelTypes = "Info" | "Warning" | "Error"; -/** Defines values for OperatingSystemTypes. */ -export type OperatingSystemTypes = "Windows" | "Linux"; -/** Defines values for OperatingSystemStateTypes. */ -export type OperatingSystemStateTypes = "Generalized" | "Specialized"; -/** Defines values for CachingTypes. */ -export type CachingTypes = "None" | "ReadOnly" | "ReadWrite"; -/** Defines values for IntervalInMins. */ -export type IntervalInMins = "ThreeMins" | "FiveMins" | "ThirtyMins" | "SixtyMins"; -/** Defines values for UpgradeMode. */ -export type UpgradeMode = "Automatic" | "Manual" | "Rolling"; -/** Defines values for SettingNames. */ -export type SettingNames = "AutoLogon" | "FirstLogonCommands"; -/** Defines values for ProtocolTypes. */ -export type ProtocolTypes = "Http" | "Https"; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; -/** Defines values for MaintenanceOperationResultCodeTypes. */ -export type MaintenanceOperationResultCodeTypes = - | "None" - | "RetryLater" - | "MaintenanceAborted" - | "MaintenanceCompleted"; -/** Defines values for InstanceViewTypes. */ -export type InstanceViewTypes = "instanceView" | "userData" | "resiliencyView"; -/** Defines values for DedicatedHostLicenseTypes. */ -export type DedicatedHostLicenseTypes = - | "None" - | "Windows_Server_Hybrid" - | "Windows_Server_Perpetual"; -/** Defines values for UpgradeState. */ -export type UpgradeState = "RollingForward" | "Cancelled" | "Completed" | "Faulted"; -/** Defines values for UpgradeOperationInvoker. */ -export type UpgradeOperationInvoker = "Unknown" | "User" | "Platform"; -/** Defines values for RollingUpgradeStatusCode. */ -export type RollingUpgradeStatusCode = "RollingForward" | "Cancelled" | "Completed" | "Faulted"; -/** Defines values for RollingUpgradeActionType. */ -export type RollingUpgradeActionType = "Start" | "Cancel"; -/** Defines values for VirtualMachineScaleSetSkuScaleType. */ -export type VirtualMachineScaleSetSkuScaleType = "Automatic" | "None"; -/** Defines values for ResourceSkuCapacityScaleType. */ -export type ResourceSkuCapacityScaleType = "Automatic" | "Manual" | "None"; -/** Defines values for ResourceSkuRestrictionsType. */ -export type ResourceSkuRestrictionsType = "Location" | "Zone"; -/** Defines values for ResourceSkuRestrictionsReasonCode. */ -export type ResourceSkuRestrictionsReasonCode = "QuotaId" | "NotAvailableForSubscription"; -/** Defines values for GalleryApplicationCustomActionParameterType. */ -export type GalleryApplicationCustomActionParameterType = - | "String" - | "ConfigurationDataBlob" - | "LogOutputBlob"; -/** Defines values for HostCaching. */ -export type HostCaching = "None" | "ReadOnly" | "ReadWrite"; -/** Defines values for EndpointTypes. */ -export type EndpointTypes = "WireServer" | "IMDS"; - -/** Optional parameters. */ -export interface OperationsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListBySubscriptionOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply to the operation. Allowed values are 'instanceView'. */ - expand?: string; -} - -/** Contains response data for the listBySubscription operation. */ -export type AvailabilitySetsListBySubscriptionResponse = AvailabilitySetListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type AvailabilitySetsListResponse = AvailabilitySetListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AvailabilitySetsGetResponse = AvailabilitySet; - -/** Optional parameters. */ -export interface AvailabilitySetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type AvailabilitySetsCreateOrUpdateResponse = AvailabilitySet; - -/** Optional parameters. */ -export interface AvailabilitySetsUpdateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type AvailabilitySetsUpdateResponse = AvailabilitySet; - -/** Optional parameters. */ -export interface AvailabilitySetsDeleteOptionalParams extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams - extends coreClient.OperationOptions { - /** Parameters supplied to the migrate operation on the availability set. */ - parameters?: ConvertToVirtualMachineScaleSetInput; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the convertToVirtualMachineScaleSet operation. */ -export type AvailabilitySetsConvertToVirtualMachineScaleSetResponse = - AvailabilitySetsConvertToVirtualMachineScaleSetHeaders; - -/** Optional parameters. */ -export interface AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface AvailabilitySetsListAvailableSizesOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAvailableSizes operation. */ -export type AvailabilitySetsListAvailableSizesResponse = VirtualMachineSizeListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type AvailabilitySetsListBySubscriptionNextResponse = AvailabilitySetListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type AvailabilitySetsListNextResponse = AvailabilitySetListResult; - -/** Optional parameters. */ -export interface AvailabilitySetsListAvailableSizesNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAvailableSizesNext operation. */ -export type AvailabilitySetsListAvailableSizesNextResponse = VirtualMachineSizeListResult; - -/** Optional parameters. */ -export interface CapacityReservationGroupsListBySubscriptionOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. */ - expand?: ExpandTypesForGetCapacityReservationGroups; - /** The query option to fetch Capacity Reservation Group Resource Ids.
'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription.
'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription.
'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created in the subscription. */ - resourceIdsOnly?: ResourceIdOptionsForGetCapacityReservationGroups; -} - -/** Contains response data for the listBySubscription operation. */ -export type CapacityReservationGroupsListBySubscriptionResponse = - CapacityReservationGroupListResult; - -/** Optional parameters. */ -export interface CapacityReservationGroupsListByResourceGroupOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. */ - expand?: ExpandTypesForGetCapacityReservationGroups; -} - -/** Contains response data for the listByResourceGroup operation. */ -export type CapacityReservationGroupsListByResourceGroupResponse = - CapacityReservationGroupListResult; - -/** Optional parameters. */ -export interface CapacityReservationGroupsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. */ - expand?: CapacityReservationGroupInstanceViewTypes; -} - -/** Contains response data for the get operation. */ -export type CapacityReservationGroupsGetResponse = CapacityReservationGroup; - -/** Optional parameters. */ -export interface CapacityReservationGroupsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type CapacityReservationGroupsCreateOrUpdateResponse = CapacityReservationGroup; - -/** Optional parameters. */ -export interface CapacityReservationGroupsUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type CapacityReservationGroupsUpdateResponse = CapacityReservationGroup; - -/** Optional parameters. */ -export interface CapacityReservationGroupsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface CapacityReservationGroupsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type CapacityReservationGroupsListBySubscriptionNextResponse = - CapacityReservationGroupListResult; - -/** Optional parameters. */ -export interface CapacityReservationGroupsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type CapacityReservationGroupsListByResourceGroupNextResponse = - CapacityReservationGroupListResult; - -/** Optional parameters. */ -export interface DedicatedHostGroupsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type DedicatedHostGroupsListBySubscriptionResponse = DedicatedHostGroupListResult; - -/** Optional parameters. */ -export interface DedicatedHostGroupsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type DedicatedHostGroupsListByResourceGroupResponse = DedicatedHostGroupListResult; - -/** Optional parameters. */ -export interface DedicatedHostGroupsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host group. */ - expand?: InstanceViewTypes; -} - -/** Contains response data for the get operation. */ -export type DedicatedHostGroupsGetResponse = DedicatedHostGroup; - -/** Optional parameters. */ -export interface DedicatedHostGroupsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type DedicatedHostGroupsCreateOrUpdateResponse = DedicatedHostGroup; - -/** Optional parameters. */ -export interface DedicatedHostGroupsUpdateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type DedicatedHostGroupsUpdateResponse = DedicatedHostGroup; - -/** Optional parameters. */ -export interface DedicatedHostGroupsDeleteOptionalParams extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface DedicatedHostGroupsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type DedicatedHostGroupsListBySubscriptionNextResponse = DedicatedHostGroupListResult; - -/** Optional parameters. */ -export interface DedicatedHostGroupsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type DedicatedHostGroupsListByResourceGroupNextResponse = DedicatedHostGroupListResult; - -/** Optional parameters. */ -export interface ImagesListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type ImagesListResponse = ImageListResult; - -/** Optional parameters. */ -export interface ImagesListByResourceGroupOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ImagesListByResourceGroupResponse = ImageListResult; - -/** Optional parameters. */ -export interface ImagesGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the get operation. */ -export type ImagesGetResponse = Image; - -/** Optional parameters. */ -export interface ImagesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type ImagesCreateOrUpdateResponse = Image; - -/** Optional parameters. */ -export interface ImagesUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type ImagesUpdateResponse = Image; - -/** Optional parameters. */ -export interface ImagesDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface ImagesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type ImagesListNextResponse = ImageListResult; - -/** Optional parameters. */ -export interface ImagesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ImagesListByResourceGroupNextResponse = ImageListResult; - -/** Optional parameters. */ -export interface VirtualMachineImagesEdgeZoneListPublishersOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listPublishers operation. */ -export type VirtualMachineImagesEdgeZoneListPublishersResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesEdgeZoneListOffersOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listOffers operation. */ -export type VirtualMachineImagesEdgeZoneListOffersResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesEdgeZoneListSkusOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listSkus operation. */ -export type VirtualMachineImagesEdgeZoneListSkusResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesEdgeZoneListOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; - /** An integer value specifying the number of images to return that matches supplied values. */ - top?: number; - /** Specifies the order of the results returned. Formatted as an OData query. */ - orderby?: string; -} - -/** Contains response data for the list operation. */ -export type VirtualMachineImagesEdgeZoneListResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesEdgeZoneGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VirtualMachineImagesEdgeZoneGetResponse = VirtualMachineImage; - -/** Optional parameters. */ -export interface VirtualMachineImagesListByEdgeZoneOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByEdgeZone operation. */ -export type VirtualMachineImagesListByEdgeZoneResponse = VmImagesInEdgeZoneListResult; - -/** Optional parameters. */ -export interface VirtualMachineImagesListPublishersOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listPublishers operation. */ -export type VirtualMachineImagesListPublishersResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesListOffersOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listOffers operation. */ -export type VirtualMachineImagesListOffersResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesListSkusOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listSkus operation. */ -export type VirtualMachineImagesListSkusResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesListOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; - /** An integer value specifying the number of images to return that matches supplied values. */ - top?: number; - /** Specifies the order of the results returned. Formatted as an OData query. */ - orderby?: string; -} - -/** Contains response data for the list operation. */ -export type VirtualMachineImagesListResponse = VirtualMachineImageResource[]; - -/** Optional parameters. */ -export interface VirtualMachineImagesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VirtualMachineImagesGetResponse = VirtualMachineImage; - -/** Optional parameters. */ -export interface VirtualMachineImagesListWithPropertiesOptionalParams - extends coreClient.OperationOptions { - /** An integer value specifying the number of images to return that matches supplied values. */ - top?: number; - /** Specifies the order of the results returned. Formatted as an OData query. */ - orderby?: string; -} - -/** Contains response data for the listWithProperties operation. */ -export type VirtualMachineImagesListWithPropertiesResponse = VirtualMachineImage[]; - -/** Optional parameters. */ -export interface LogAnalyticsExportRequestRateByIntervalOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the exportRequestRateByInterval operation. */ -export type LogAnalyticsExportRequestRateByIntervalResponse = LogAnalyticsOperationResult; - -/** Optional parameters. */ -export interface LogAnalyticsExportThrottledRequestsOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the exportThrottledRequests operation. */ -export type LogAnalyticsExportThrottledRequestsResponse = LogAnalyticsOperationResult; - -/** Optional parameters. */ -export interface VirtualMachineExtensionImagesListTypesOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listTypes operation. */ -export type VirtualMachineExtensionImagesListTypesResponse = VirtualMachineExtensionImage[]; - -/** Optional parameters. */ -export interface VirtualMachineExtensionImagesListVersionsOptionalParams - extends coreClient.OperationOptions { - /** An integer value specifying the number of images to return that matches supplied values. */ - top?: number; - /** Specifies the order of the results returned. Formatted as an OData query. */ - orderby?: string; - /** The filter to apply on the operation. */ - filter?: string; -} - -/** Contains response data for the listVersions operation. */ -export type VirtualMachineExtensionImagesListVersionsResponse = VirtualMachineExtensionImage[]; - -/** Optional parameters. */ -export interface VirtualMachineExtensionImagesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VirtualMachineExtensionImagesGetResponse = VirtualMachineExtensionImage; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type VirtualMachineRunCommandsListResponse = RunCommandListResult; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type VirtualMachineRunCommandsGetResponse = RunCommandDocument; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsListByVirtualMachineOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the listByVirtualMachine operation. */ -export type VirtualMachineRunCommandsListByVirtualMachineResponse = - VirtualMachineRunCommandsListResult; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsGetByVirtualMachineOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the getByVirtualMachine operation. */ -export type VirtualMachineRunCommandsGetByVirtualMachineResponse = VirtualMachineRunCommand; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type VirtualMachineRunCommandsCreateOrUpdateResponse = VirtualMachineRunCommand; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachineRunCommandsUpdateResponse = VirtualMachineRunCommandsUpdateHeaders & - VirtualMachineRunCommand; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachineRunCommandsListNextResponse = RunCommandListResult; - -/** Optional parameters. */ -export interface VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByVirtualMachineNext operation. */ -export type VirtualMachineRunCommandsListByVirtualMachineNextResponse = - VirtualMachineRunCommandsListResult; - -/** Optional parameters. */ -export interface UsageListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type UsageListResponse = ListUsagesResult; - -/** Optional parameters. */ -export interface UsageListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type UsageListNextResponse = ListUsagesResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListByLocationOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocation operation. */ -export type VirtualMachineScaleSetsListByLocationResponse = VirtualMachineScaleSetListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListAllOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listAll operation. */ -export type VirtualMachineScaleSetsListAllResponse = VirtualMachineScaleSetListWithLinkResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type VirtualMachineScaleSetsListResponse = VirtualMachineScaleSetListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was provided by the user during the VM scale set Create/Update operation */ - expand?: ExpandTypesForGetVMScaleSets; -} - -/** Contains response data for the get operation. */ -export type VirtualMachineScaleSetsGetResponse = VirtualMachineScaleSet; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ - ifNoneMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type VirtualMachineScaleSetsCreateOrUpdateResponse = VirtualMachineScaleSet; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsUpdateOptionalParams extends coreClient.OperationOptions { - /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ - ifNoneMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachineScaleSetsUpdateResponse = VirtualMachineScaleSetsUpdateHeaders & - VirtualMachineScaleSet; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsDeleteOptionalParams extends coreClient.OperationOptions { - /** Optional parameter to force delete a VM scale set. (Feature in Preview) */ - forceDeletion?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams - extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the approveRollingUpgrade operation. */ -export type VirtualMachineScaleSetsApproveRollingUpgradeResponse = - VirtualMachineScaleSetsApproveRollingUpgradeHeaders; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsDeallocateOptionalParams - extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible OrchestrationMode only) */ - hibernate?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsDeleteInstancesOptionalParams - extends coreClient.OperationOptions { - /** Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) */ - forceDeletion?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams - extends coreClient.OperationOptions { - /** The zone in which the manual recovery walk is requested for cross zone virtual machine scale set */ - zone?: string; - /** The placement group id for which the manual recovery walk is requested. */ - placementGroupId?: string; -} - -/** Contains response data for the forceRecoveryServiceFabricPlatformUpdateDomainWalk operation. */ -export type VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse = - RecoveryWalkResponse; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsGetInstanceViewOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getInstanceView operation. */ -export type VirtualMachineScaleSetsGetInstanceViewResponse = VirtualMachineScaleSetInstanceView; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsUpdateInstancesOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getOSUpgradeHistory operation. */ -export type VirtualMachineScaleSetsGetOSUpgradeHistoryResponse = - VirtualMachineScaleSetListOSUpgradeHistory; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsPerformMaintenanceOptionalParams - extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsPowerOffOptionalParams extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified */ - skipShutdown?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsReapplyOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsRedeployOptionalParams extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsReimageOptionalParams extends coreClient.OperationOptions { - /** Parameters for Reimaging VM ScaleSet. */ - vmScaleSetReimageInput?: VirtualMachineScaleSetReimageParameters; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsReimageAllOptionalParams - extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsRestartOptionalParams extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsScaleOutOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListSkusOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listSkus operation. */ -export type VirtualMachineScaleSetsListSkusResponse = VirtualMachineScaleSetListSkusResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsStartOptionalParams extends coreClient.OperationOptions { - /** A list of virtual machine instance IDs from the VM scale set. */ - vmInstanceIDs?: VirtualMachineScaleSetVMInstanceIDs; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListByLocationNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocationNext operation. */ -export type VirtualMachineScaleSetsListByLocationNextResponse = VirtualMachineScaleSetListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListAllNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAllNext operation. */ -export type VirtualMachineScaleSetsListAllNextResponse = VirtualMachineScaleSetListWithLinkResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachineScaleSetsListNextResponse = VirtualMachineScaleSetListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsGetOSUpgradeHistoryNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getOSUpgradeHistoryNext operation. */ -export type VirtualMachineScaleSetsGetOSUpgradeHistoryNextResponse = - VirtualMachineScaleSetListOSUpgradeHistory; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetsListSkusNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listSkusNext operation. */ -export type VirtualMachineScaleSetsListSkusNextResponse = VirtualMachineScaleSetListSkusResult; - -/** Optional parameters. */ -export interface VirtualMachinesListByLocationOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocation operation. */ -export type VirtualMachinesListByLocationResponse = VirtualMachineListResult; - -/** Optional parameters. */ -export interface VirtualMachinesListAllOptionalParams extends coreClient.OperationOptions { - /** The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' */ - filter?: string; - /** statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. */ - statusOnly?: string; - /** The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this can only be specified if a valid $filter option is specified */ - expand?: ExpandTypesForListVMs; -} - -/** Contains response data for the listAll operation. */ -export type VirtualMachinesListAllResponse = VirtualMachineListResult; - -/** Optional parameters. */ -export interface VirtualMachinesListOptionalParams extends coreClient.OperationOptions { - /** The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' */ - filter?: string; - /** The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this can only be specified if a valid $filter option is specified */ - expand?: ExpandTypeForListVMs; -} - -/** Contains response data for the list operation. */ -export type VirtualMachinesListResponse = VirtualMachineListResult; - -/** Optional parameters. */ -export interface VirtualMachinesGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. */ - expand?: InstanceViewTypes; -} - -/** Contains response data for the get operation. */ -export type VirtualMachinesGetResponse = VirtualMachine; - -/** Optional parameters. */ -export interface VirtualMachinesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ - ifNoneMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type VirtualMachinesCreateOrUpdateResponse = VirtualMachine; - -/** Optional parameters. */ -export interface VirtualMachinesUpdateOptionalParams extends coreClient.OperationOptions { - /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ - ifNoneMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachinesUpdateResponse = VirtualMachinesUpdateHeaders & VirtualMachine; - -/** Optional parameters. */ -export interface VirtualMachinesDeleteOptionalParams extends coreClient.OperationOptions { - /** Optional parameter to force delete virtual machines. */ - forceDeletion?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesAssessPatchesOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the assessPatches operation. */ -export type VirtualMachinesAssessPatchesResponse = VirtualMachineAssessPatchesResult; - -/** Optional parameters. */ -export interface VirtualMachinesAttachDetachDataDisksOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the attachDetachDataDisks operation. */ -export type VirtualMachinesAttachDetachDataDisksResponse = StorageProfile; - -/** Optional parameters. */ -export interface VirtualMachinesCaptureOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the capture operation. */ -export type VirtualMachinesCaptureResponse = VirtualMachineCaptureResult; - -/** Optional parameters. */ -export interface VirtualMachinesConvertToManagedDisksOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesDeallocateOptionalParams extends coreClient.OperationOptions { - /** Optional parameter to hibernate a virtual machine. */ - hibernate?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesGeneralizeOptionalParams extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface VirtualMachinesInstallPatchesOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the installPatches operation. */ -export type VirtualMachinesInstallPatchesResponse = VirtualMachineInstallPatchesResult; - -/** Optional parameters. */ -export interface VirtualMachinesInstanceViewOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the instanceView operation. */ -export type VirtualMachinesInstanceViewResponse = VirtualMachineInstanceView; - -/** Optional parameters. */ -export interface VirtualMachinesMigrateToVMScaleSetOptionalParams - extends coreClient.OperationOptions { - /** Parameters supplied to the Migrate Virtual Machine operation. */ - parameters?: MigrateVMToVirtualMachineScaleSetInput; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the migrateToVMScaleSet operation. */ -export type VirtualMachinesMigrateToVMScaleSetResponse = VirtualMachinesMigrateToVMScaleSetHeaders; - -/** Optional parameters. */ -export interface VirtualMachinesPerformMaintenanceOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesPowerOffOptionalParams extends coreClient.OperationOptions { - /** The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified */ - skipShutdown?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesReapplyOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesRedeployOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesReimageOptionalParams extends coreClient.OperationOptions { - /** Parameters supplied to the Reimage Virtual Machine operation. */ - parameters?: VirtualMachineReimageParameters; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesRestartOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams - extends coreClient.OperationOptions { - /** Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. */ - sasUriExpirationTimeInMinutes?: number; -} - -/** Contains response data for the retrieveBootDiagnosticsData operation. */ -export type VirtualMachinesRetrieveBootDiagnosticsDataResponse = RetrieveBootDiagnosticsDataResult; - -/** Optional parameters. */ -export interface VirtualMachinesRunCommandOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the runCommand operation. */ -export type VirtualMachinesRunCommandResponse = RunCommandResult; - -/** Optional parameters. */ -export interface VirtualMachinesSimulateEvictionOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface VirtualMachinesStartOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachinesListAvailableSizesOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAvailableSizes operation. */ -export type VirtualMachinesListAvailableSizesResponse = VirtualMachineSizeListResult; - -/** Optional parameters. */ -export interface VirtualMachinesListByLocationNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByLocationNext operation. */ -export type VirtualMachinesListByLocationNextResponse = VirtualMachineListResult; - -/** Optional parameters. */ -export interface VirtualMachinesListAllNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listAllNext operation. */ -export type VirtualMachinesListAllNextResponse = VirtualMachineListResult; - -/** Optional parameters. */ -export interface VirtualMachinesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachinesListNextResponse = VirtualMachineListResult; - -/** Optional parameters. */ -export interface VirtualMachinesListAvailableSizesNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAvailableSizesNext operation. */ -export type VirtualMachinesListAvailableSizesNextResponse = VirtualMachineSizeListResult; - -/** Optional parameters. */ -export interface VirtualMachineSizesListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type VirtualMachineSizesListResponse = VirtualMachineSizeListResult; - -/** Optional parameters. */ -export interface VirtualMachineSizesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachineSizesListNextResponse = VirtualMachineSizeListResult; - -/** Optional parameters. */ -export interface ProximityPlacementGroupsListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type ProximityPlacementGroupsListBySubscriptionResponse = ProximityPlacementGroupListResult; - -/** Optional parameters. */ -export interface ProximityPlacementGroupsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type ProximityPlacementGroupsListByResourceGroupResponse = ProximityPlacementGroupListResult; - -/** Optional parameters. */ -export interface ProximityPlacementGroupsGetOptionalParams extends coreClient.OperationOptions { - /** includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. */ - includeColocationStatus?: string; -} - -/** Contains response data for the get operation. */ -export type ProximityPlacementGroupsGetResponse = ProximityPlacementGroup; - -/** Optional parameters. */ -export interface ProximityPlacementGroupsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type ProximityPlacementGroupsCreateOrUpdateResponse = ProximityPlacementGroup; - -/** Optional parameters. */ -export interface ProximityPlacementGroupsUpdateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type ProximityPlacementGroupsUpdateResponse = ProximityPlacementGroup; - -/** Optional parameters. */ -export interface ProximityPlacementGroupsDeleteOptionalParams extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface ProximityPlacementGroupsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type ProximityPlacementGroupsListBySubscriptionNextResponse = - ProximityPlacementGroupListResult; - -/** Optional parameters. */ -export interface ProximityPlacementGroupsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type ProximityPlacementGroupsListByResourceGroupNextResponse = - ProximityPlacementGroupListResult; - -/** Optional parameters. */ -export interface RestorePointCollectionsListAllOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listAll operation. */ -export type RestorePointCollectionsListAllResponse = RestorePointCollectionListResult; - -/** Optional parameters. */ -export interface RestorePointCollectionsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type RestorePointCollectionsListResponse = RestorePointCollectionListResult; - -/** Optional parameters. */ -export interface RestorePointCollectionsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points in the restorePointCollection. */ - expand?: RestorePointCollectionExpandOptions; -} - -/** Contains response data for the get operation. */ -export type RestorePointCollectionsGetResponse = RestorePointCollection; - -/** Optional parameters. */ -export interface RestorePointCollectionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type RestorePointCollectionsCreateOrUpdateResponse = RestorePointCollection; - -/** Optional parameters. */ -export interface RestorePointCollectionsUpdateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type RestorePointCollectionsUpdateResponse = RestorePointCollection; - -/** Optional parameters. */ -export interface RestorePointCollectionsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface RestorePointCollectionsListAllNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAllNext operation. */ -export type RestorePointCollectionsListAllNextResponse = RestorePointCollectionListResult; - -/** Optional parameters. */ -export interface RestorePointCollectionsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type RestorePointCollectionsListNextResponse = RestorePointCollectionListResult; - -/** Optional parameters. */ -export interface SshPublicKeysListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type SshPublicKeysListBySubscriptionResponse = SshPublicKeysGroupListResult; - -/** Optional parameters. */ -export interface SshPublicKeysListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type SshPublicKeysListByResourceGroupResponse = SshPublicKeysGroupListResult; - -/** Optional parameters. */ -export interface SshPublicKeysGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type SshPublicKeysGetResponse = SshPublicKeyResource; - -/** Optional parameters. */ -export interface SshPublicKeysCreateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the create operation. */ -export type SshPublicKeysCreateResponse = SshPublicKeyResource; - -/** Optional parameters. */ -export interface SshPublicKeysUpdateOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type SshPublicKeysUpdateResponse = SshPublicKeyResource; - -/** Optional parameters. */ -export interface SshPublicKeysDeleteOptionalParams extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface SshPublicKeysGenerateKeyPairOptionalParams extends coreClient.OperationOptions { - /** Parameters supplied to generate the SSH public key. */ - parameters?: SshGenerateKeyPairInputParameters; -} - -/** Contains response data for the generateKeyPair operation. */ -export type SshPublicKeysGenerateKeyPairResponse = SshPublicKeyGenerateKeyPairResult; - -/** Optional parameters. */ -export interface SshPublicKeysListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type SshPublicKeysListBySubscriptionNextResponse = SshPublicKeysGroupListResult; - -/** Optional parameters. */ -export interface SshPublicKeysListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type SshPublicKeysListByResourceGroupNextResponse = SshPublicKeysGroupListResult; - -/** Optional parameters. */ -export interface CapacityReservationsListByCapacityReservationGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByCapacityReservationGroup operation. */ -export type CapacityReservationsListByCapacityReservationGroupResponse = - CapacityReservationListResult; - -/** Optional parameters. */ -export interface CapacityReservationsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. */ - expand?: CapacityReservationInstanceViewTypes; -} - -/** Contains response data for the get operation. */ -export type CapacityReservationsGetResponse = CapacityReservation; - -/** Optional parameters. */ -export interface CapacityReservationsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type CapacityReservationsCreateOrUpdateResponse = CapacityReservation; - -/** Optional parameters. */ -export interface CapacityReservationsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type CapacityReservationsUpdateResponse = CapacityReservation; - -/** Optional parameters. */ -export interface CapacityReservationsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CapacityReservationsListByCapacityReservationGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByCapacityReservationGroupNext operation. */ -export type CapacityReservationsListByCapacityReservationGroupNextResponse = - CapacityReservationListResult; - -/** Optional parameters. */ -export interface DedicatedHostsListByHostGroupOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByHostGroup operation. */ -export type DedicatedHostsListByHostGroupResponse = DedicatedHostListResult; - -/** Optional parameters. */ -export interface DedicatedHostsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated host. 'UserData' is not supported for dedicated host. */ - expand?: InstanceViewTypes; -} - -/** Contains response data for the get operation. */ -export type DedicatedHostsGetResponse = DedicatedHost; - -/** Optional parameters. */ -export interface DedicatedHostsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type DedicatedHostsCreateOrUpdateResponse = DedicatedHost; - -/** Optional parameters. */ -export interface DedicatedHostsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type DedicatedHostsUpdateResponse = DedicatedHostsUpdateHeaders & DedicatedHost; - -/** Optional parameters. */ -export interface DedicatedHostsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DedicatedHostsListAvailableSizesOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAvailableSizes operation. */ -export type DedicatedHostsListAvailableSizesResponse = DedicatedHostSizeListResult; - -/** Optional parameters. */ -export interface DedicatedHostsRedeployOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the redeploy operation. */ -export type DedicatedHostsRedeployResponse = DedicatedHostsRedeployHeaders; - -/** Optional parameters. */ -export interface DedicatedHostsRestartOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the restart operation. */ -export type DedicatedHostsRestartResponse = DedicatedHostsRestartHeaders; - -/** Optional parameters. */ -export interface DedicatedHostsListByHostGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByHostGroupNext operation. */ -export type DedicatedHostsListByHostGroupNextResponse = DedicatedHostListResult; - -/** Optional parameters. */ -export interface DedicatedHostsListAvailableSizesNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAvailableSizesNext operation. */ -export type DedicatedHostsListAvailableSizesNextResponse = DedicatedHostSizeListResult; - -/** Optional parameters. */ -export interface RestorePointsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore point. */ - expand?: RestorePointExpandOptions; -} - -/** Contains response data for the get operation. */ -export type RestorePointsGetResponse = RestorePoint; - -/** Optional parameters. */ -export interface RestorePointsCreateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the create operation. */ -export type RestorePointsCreateResponse = RestorePointsCreateHeaders & RestorePoint; - -/** Optional parameters. */ -export interface RestorePointsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetRollingUpgradesCancelOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getLatest operation. */ -export type VirtualMachineScaleSetRollingUpgradesGetLatestResponse = RollingUpgradeStatusInfo; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetExtensionsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type VirtualMachineScaleSetExtensionsListResponse = - VirtualMachineScaleSetExtensionListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetExtensionsGetOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the get operation. */ -export type VirtualMachineScaleSetExtensionsGetResponse = VirtualMachineScaleSetExtension; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type VirtualMachineScaleSetExtensionsCreateOrUpdateResponse = - VirtualMachineScaleSetExtension; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetExtensionsUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachineScaleSetExtensionsUpdateResponse = VirtualMachineScaleSetExtension; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetExtensionsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetExtensionsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachineScaleSetExtensionsListNextResponse = - VirtualMachineScaleSetExtensionListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsListOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply to the operation. Allowed values are 'instanceView'. */ - expand?: string; - /** The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. */ - filter?: string; - /** The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. */ - select?: string; -} - -/** Contains response data for the list operation. */ -export type VirtualMachineScaleSetVMsListResponse = VirtualMachineScaleSetVMListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. */ - expand?: InstanceViewTypes; -} - -/** Contains response data for the get operation. */ -export type VirtualMachineScaleSetVMsGetResponse = VirtualMachineScaleSetVM; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsUpdateOptionalParams extends coreClient.OperationOptions { - /** The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result in error from server as they are not supported. */ - ifNoneMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachineScaleSetVMsUpdateResponse = VirtualMachineScaleSetVM; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsDeleteOptionalParams extends coreClient.OperationOptions { - /** Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) */ - forceDeletion?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the approveRollingUpgrade operation. */ -export type VirtualMachineScaleSetVMsApproveRollingUpgradeResponse = - VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the attachDetachDataDisks operation. */ -export type VirtualMachineScaleSetVMsAttachDetachDataDisksResponse = StorageProfile; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsDeallocateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsGetInstanceViewOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getInstanceView operation. */ -export type VirtualMachineScaleSetVMsGetInstanceViewResponse = VirtualMachineScaleSetVMInstanceView; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsPowerOffOptionalParams - extends coreClient.OperationOptions { - /** The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified */ - skipShutdown?: boolean; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsRedeployOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsReimageOptionalParams - extends coreClient.OperationOptions { - /** Parameters for the Reimaging Virtual machine in ScaleSet. */ - vmScaleSetVMReimageInput?: VirtualMachineScaleSetVMReimageParameters; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsReimageAllOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsRestartOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams - extends coreClient.OperationOptions { - /** Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. **Note:** If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. */ - sasUriExpirationTimeInMinutes?: number; -} - -/** Contains response data for the retrieveBootDiagnosticsData operation. */ -export type VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataResponse = - RetrieveBootDiagnosticsDataResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsRunCommandOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the runCommand operation. */ -export type VirtualMachineScaleSetVMsRunCommandResponse = RunCommandResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsSimulateEvictionOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsStartOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachineScaleSetVMsListNextResponse = VirtualMachineScaleSetVMListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMExtensionsListOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the list operation. */ -export type VirtualMachineScaleSetVMExtensionsListResponse = - VirtualMachineScaleSetVMExtensionsListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMExtensionsGetOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the get operation. */ -export type VirtualMachineScaleSetVMExtensionsGetResponse = VirtualMachineScaleSetVMExtension; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse = - VirtualMachineScaleSetVMExtension; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMExtensionsUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachineScaleSetVMExtensionsUpdateResponse = - VirtualMachineScaleSetVMExtensionsUpdateHeaders & VirtualMachineScaleSetVMExtension; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMExtensionsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMRunCommandsListOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the list operation. */ -export type VirtualMachineScaleSetVMRunCommandsListResponse = VirtualMachineRunCommandsListResult; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMRunCommandsGetOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the get operation. */ -export type VirtualMachineScaleSetVMRunCommandsGetResponse = VirtualMachineRunCommand; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse = VirtualMachineRunCommand; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachineScaleSetVMRunCommandsUpdateResponse = - VirtualMachineScaleSetVMRunCommandsUpdateHeaders & VirtualMachineRunCommand; - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface VirtualMachineScaleSetVMRunCommandsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type VirtualMachineScaleSetVMRunCommandsListNextResponse = - VirtualMachineRunCommandsListResult; - -/** Optional parameters. */ -export interface VirtualMachineExtensionsListOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the list operation. */ -export type VirtualMachineExtensionsListResponse = VirtualMachineExtensionsListResult; - -/** Optional parameters. */ -export interface VirtualMachineExtensionsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} - -/** Contains response data for the get operation. */ -export type VirtualMachineExtensionsGetResponse = VirtualMachineExtension; - -/** Optional parameters. */ -export interface VirtualMachineExtensionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type VirtualMachineExtensionsCreateOrUpdateResponse = VirtualMachineExtension; - -/** Optional parameters. */ -export interface VirtualMachineExtensionsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type VirtualMachineExtensionsUpdateResponse = VirtualMachineExtensionsUpdateHeaders & - VirtualMachineExtension; - -/** Optional parameters. */ -export interface VirtualMachineExtensionsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DiskAccessesListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type DiskAccessesListResponse = DiskAccessList; - -/** Optional parameters. */ -export interface DiskAccessesListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type DiskAccessesListByResourceGroupResponse = DiskAccessList; - -/** Optional parameters. */ -export interface DiskAccessesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DiskAccessesGetResponse = DiskAccess; - -/** Optional parameters. */ -export interface DiskAccessesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type DiskAccessesCreateOrUpdateResponse = DiskAccess; - -/** Optional parameters. */ -export interface DiskAccessesUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type DiskAccessesUpdateResponse = DiskAccess; - -/** Optional parameters. */ -export interface DiskAccessesDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DiskAccessesListPrivateEndpointConnectionsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listPrivateEndpointConnections operation. */ -export type DiskAccessesListPrivateEndpointConnectionsResponse = - PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface DiskAccessesGetAPrivateEndpointConnectionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getAPrivateEndpointConnection operation. */ -export type DiskAccessesGetAPrivateEndpointConnectionResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the updateAPrivateEndpointConnection operation. */ -export type DiskAccessesUpdateAPrivateEndpointConnectionResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DiskAccessesGetPrivateLinkResourcesOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getPrivateLinkResources operation. */ -export type DiskAccessesGetPrivateLinkResourcesResponse = PrivateLinkResourceListResult; - -/** Optional parameters. */ -export interface DiskAccessesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type DiskAccessesListNextResponse = DiskAccessList; - -/** Optional parameters. */ -export interface DiskAccessesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type DiskAccessesListByResourceGroupNextResponse = DiskAccessList; - -/** Optional parameters. */ -export interface DiskAccessesListPrivateEndpointConnectionsNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listPrivateEndpointConnectionsNext operation. */ -export type DiskAccessesListPrivateEndpointConnectionsNextResponse = - PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface DiskEncryptionSetsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type DiskEncryptionSetsListResponse = DiskEncryptionSetList; - -/** Optional parameters. */ -export interface DiskEncryptionSetsListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type DiskEncryptionSetsListByResourceGroupResponse = DiskEncryptionSetList; - -/** Optional parameters. */ -export interface DiskEncryptionSetsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DiskEncryptionSetsGetResponse = DiskEncryptionSet; - -/** Optional parameters. */ -export interface DiskEncryptionSetsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type DiskEncryptionSetsCreateOrUpdateResponse = DiskEncryptionSet; - -/** Optional parameters. */ -export interface DiskEncryptionSetsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type DiskEncryptionSetsUpdateResponse = DiskEncryptionSet; - -/** Optional parameters. */ -export interface DiskEncryptionSetsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DiskEncryptionSetsListAssociatedResourcesOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAssociatedResources operation. */ -export type DiskEncryptionSetsListAssociatedResourcesResponse = ResourceUriList; - -/** Optional parameters. */ -export interface DiskEncryptionSetsListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type DiskEncryptionSetsListNextResponse = DiskEncryptionSetList; - -/** Optional parameters. */ -export interface DiskEncryptionSetsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type DiskEncryptionSetsListByResourceGroupNextResponse = DiskEncryptionSetList; - -/** Optional parameters. */ -export interface DiskEncryptionSetsListAssociatedResourcesNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listAssociatedResourcesNext operation. */ -export type DiskEncryptionSetsListAssociatedResourcesNextResponse = ResourceUriList; - -/** Optional parameters. */ -export interface DisksListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type DisksListResponse = DiskList; - -/** Optional parameters. */ -export interface DisksListByResourceGroupOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type DisksListByResourceGroupResponse = DiskList; - -/** Optional parameters. */ -export interface DisksGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DisksGetResponse = Disk; - -/** Optional parameters. */ -export interface DisksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type DisksCreateOrUpdateResponse = Disk; - -/** Optional parameters. */ -export interface DisksUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type DisksUpdateResponse = Disk; - -/** Optional parameters. */ -export interface DisksDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DisksGrantAccessOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the grantAccess operation. */ -export type DisksGrantAccessResponse = AccessUri; - -/** Optional parameters. */ -export interface DisksRevokeAccessOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DisksListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type DisksListNextResponse = DiskList; - -/** Optional parameters. */ -export interface DisksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type DisksListByResourceGroupNextResponse = DiskList; - -/** Optional parameters. */ -export interface SnapshotsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type SnapshotsListResponse = SnapshotList; - -/** Optional parameters. */ -export interface SnapshotsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type SnapshotsListByResourceGroupResponse = SnapshotList; - -/** Optional parameters. */ -export interface SnapshotsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type SnapshotsGetResponse = Snapshot; - -/** Optional parameters. */ -export interface SnapshotsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type SnapshotsCreateOrUpdateResponse = Snapshot; - -/** Optional parameters. */ -export interface SnapshotsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type SnapshotsUpdateResponse = Snapshot; - -/** Optional parameters. */ -export interface SnapshotsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface SnapshotsGrantAccessOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the grantAccess operation. */ -export type SnapshotsGrantAccessResponse = AccessUri; - -/** Optional parameters. */ -export interface SnapshotsRevokeAccessOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface SnapshotsListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type SnapshotsListNextResponse = SnapshotList; - -/** Optional parameters. */ -export interface SnapshotsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type SnapshotsListByResourceGroupNextResponse = SnapshotList; - -/** Optional parameters. */ -export interface DiskRestorePointListByRestorePointOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByRestorePoint operation. */ -export type DiskRestorePointListByRestorePointResponse = DiskRestorePointList; - -/** Optional parameters. */ -export interface DiskRestorePointGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type DiskRestorePointGetResponse = DiskRestorePoint; - -/** Optional parameters. */ -export interface DiskRestorePointGrantAccessOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the grantAccess operation. */ -export type DiskRestorePointGrantAccessResponse = AccessUri; - -/** Optional parameters. */ -export interface DiskRestorePointRevokeAccessOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface DiskRestorePointListByRestorePointNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByRestorePointNext operation. */ -export type DiskRestorePointListByRestorePointNextResponse = DiskRestorePointList; - -/** Optional parameters. */ -export interface ResourceSkusListOptionalParams extends coreClient.OperationOptions { - /** The filter to apply on the operation. Only **location** filter is supported currently. */ - filter?: string; - /** To Include Extended Locations information or not in the response. */ - includeExtendedLocations?: string; -} - -/** Contains response data for the list operation. */ -export type ResourceSkusListResponse = ResourceSkusResult; - -/** Optional parameters. */ -export interface ResourceSkusListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type ResourceSkusListNextResponse = ResourceSkusResult; - -/** Optional parameters. */ -export interface GalleriesListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type GalleriesListResponse = GalleryList; - -/** Optional parameters. */ -export interface GalleriesListByResourceGroupOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type GalleriesListByResourceGroupResponse = GalleryList; - -/** Optional parameters. */ -export interface GalleriesGetOptionalParams extends coreClient.OperationOptions { - /** The select expression to apply on the operation. */ - select?: SelectPermissions; - /** The expand query option to apply on the operation. */ - expand?: GalleryExpandParams; -} - -/** Contains response data for the get operation. */ -export type GalleriesGetResponse = Gallery; - -/** Optional parameters. */ -export interface GalleriesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleriesCreateOrUpdateResponse = Gallery; - -/** Optional parameters. */ -export interface GalleriesUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleriesUpdateResponse = GalleriesUpdateHeaders & Gallery; - -/** Optional parameters. */ -export interface GalleriesDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface GalleriesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type GalleriesListNextResponse = GalleryList; - -/** Optional parameters. */ -export interface GalleriesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type GalleriesListByResourceGroupNextResponse = GalleryList; - -/** Optional parameters. */ -export interface CommunityGalleriesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CommunityGalleriesGetResponse = CommunityGallery; - -/** Optional parameters. */ -export interface CommunityGalleryImagesListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type CommunityGalleryImagesListResponse = CommunityGalleryImageList; - -/** Optional parameters. */ -export interface CommunityGalleryImagesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CommunityGalleryImagesGetResponse = CommunityGalleryImage; - -/** Optional parameters. */ -export interface CommunityGalleryImagesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type CommunityGalleryImagesListNextResponse = CommunityGalleryImageList; - -/** Optional parameters. */ -export interface CommunityGalleryImageVersionsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type CommunityGalleryImageVersionsListResponse = CommunityGalleryImageVersionList; - -/** Optional parameters. */ -export interface CommunityGalleryImageVersionsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CommunityGalleryImageVersionsGetResponse = CommunityGalleryImageVersion; - -/** Optional parameters. */ -export interface CommunityGalleryImageVersionsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type CommunityGalleryImageVersionsListNextResponse = CommunityGalleryImageVersionList; - -/** Optional parameters. */ -export interface SharedGalleriesListOptionalParams extends coreClient.OperationOptions { - /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ - sharedTo?: SharedToValues; -} - -/** Contains response data for the list operation. */ -export type SharedGalleriesListResponse = SharedGalleryList; - -/** Optional parameters. */ -export interface SharedGalleriesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type SharedGalleriesGetResponse = SharedGallery; - -/** Optional parameters. */ -export interface SharedGalleriesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type SharedGalleriesListNextResponse = SharedGalleryList; - -/** Optional parameters. */ -export interface SharedGalleryImagesListOptionalParams extends coreClient.OperationOptions { - /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ - sharedTo?: SharedToValues; -} - -/** Contains response data for the list operation. */ -export type SharedGalleryImagesListResponse = SharedGalleryImageList; - -/** Optional parameters. */ -export interface SharedGalleryImagesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type SharedGalleryImagesGetResponse = SharedGalleryImage; - -/** Optional parameters. */ -export interface SharedGalleryImagesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type SharedGalleryImagesListNextResponse = SharedGalleryImageList; - -/** Optional parameters. */ -export interface SharedGalleryImageVersionsListOptionalParams extends coreClient.OperationOptions { - /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ - sharedTo?: SharedToValues; -} - -/** Contains response data for the list operation. */ -export type SharedGalleryImageVersionsListResponse = SharedGalleryImageVersionList; - -/** Optional parameters. */ -export interface SharedGalleryImageVersionsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type SharedGalleryImageVersionsGetResponse = SharedGalleryImageVersion; - -/** Optional parameters. */ -export interface SharedGalleryImageVersionsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type SharedGalleryImageVersionsListNextResponse = SharedGalleryImageVersionList; - -/** Optional parameters. */ -export interface GalleryApplicationsListByGalleryOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGallery operation. */ -export type GalleryApplicationsListByGalleryResponse = GalleryApplicationList; - -/** Optional parameters. */ -export interface GalleryApplicationsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GalleryApplicationsGetResponse = GalleryApplication; - -/** Optional parameters. */ -export interface GalleryApplicationsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryApplicationsCreateOrUpdateResponse = GalleryApplication; - -/** Optional parameters. */ -export interface GalleryApplicationsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryApplicationsUpdateResponse = GalleryApplicationsUpdateHeaders & - GalleryApplication; - -/** Optional parameters. */ -export interface GalleryApplicationsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface GalleryApplicationsListByGalleryNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryNext operation. */ -export type GalleryApplicationsListByGalleryNextResponse = GalleryApplicationList; - -/** Optional parameters. */ -export interface GalleryApplicationVersionsListByGalleryApplicationOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryApplication operation. */ -export type GalleryApplicationVersionsListByGalleryApplicationResponse = - GalleryApplicationVersionList; - -/** Optional parameters. */ -export interface GalleryApplicationVersionsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: ReplicationStatusTypes; -} - -/** Contains response data for the get operation. */ -export type GalleryApplicationVersionsGetResponse = GalleryApplicationVersion; - -/** Optional parameters. */ -export interface GalleryApplicationVersionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryApplicationVersionsCreateOrUpdateResponse = GalleryApplicationVersion; - -/** Optional parameters. */ -export interface GalleryApplicationVersionsUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryApplicationVersionsUpdateResponse = GalleryApplicationVersionsUpdateHeaders & - GalleryApplicationVersion; - -/** Optional parameters. */ -export interface GalleryApplicationVersionsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface GalleryApplicationVersionsListByGalleryApplicationNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryApplicationNext operation. */ -export type GalleryApplicationVersionsListByGalleryApplicationNextResponse = - GalleryApplicationVersionList; - -/** Optional parameters. */ -export interface GalleryImagesListByGalleryOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByGallery operation. */ -export type GalleryImagesListByGalleryResponse = GalleryImageList; - -/** Optional parameters. */ -export interface GalleryImagesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GalleryImagesGetResponse = GalleryImage; - -/** Optional parameters. */ -export interface GalleryImagesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryImagesCreateOrUpdateResponse = GalleryImage; - -/** Optional parameters. */ -export interface GalleryImagesUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryImagesUpdateResponse = GalleryImagesUpdateHeaders & GalleryImage; - -/** Optional parameters. */ -export interface GalleryImagesDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface GalleryImagesListByGalleryNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryNext operation. */ -export type GalleryImagesListByGalleryNextResponse = GalleryImageList; - -/** Optional parameters. */ -export interface GalleryImageVersionsListByGalleryImageOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryImage operation. */ -export type GalleryImageVersionsListByGalleryImageResponse = GalleryImageVersionList; - -/** Optional parameters. */ -export interface GalleryImageVersionsGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: ReplicationStatusTypes; -} - -/** Contains response data for the get operation. */ -export type GalleryImageVersionsGetResponse = GalleryImageVersion; - -/** Optional parameters. */ -export interface GalleryImageVersionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryImageVersionsCreateOrUpdateResponse = GalleryImageVersion; - -/** Optional parameters. */ -export interface GalleryImageVersionsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryImageVersionsUpdateResponse = GalleryImageVersionsUpdateHeaders & - GalleryImageVersion; - -/** Optional parameters. */ -export interface GalleryImageVersionsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface GalleryImageVersionsListByGalleryImageNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryImageNext operation. */ -export type GalleryImageVersionsListByGalleryImageNextResponse = GalleryImageVersionList; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfilesListByGalleryOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGallery operation. */ -export type GalleryInVMAccessControlProfilesListByGalleryResponse = - GalleryInVMAccessControlProfileList; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfilesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GalleryInVMAccessControlProfilesGetResponse = GalleryInVMAccessControlProfile; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryInVMAccessControlProfilesCreateOrUpdateResponse = - GalleryInVMAccessControlProfile; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfilesUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryInVMAccessControlProfilesUpdateResponse = - GalleryInVMAccessControlProfilesUpdateHeaders & GalleryInVMAccessControlProfile; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfilesDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the delete operation. */ -export type GalleryInVMAccessControlProfilesDeleteResponse = - GalleryInVMAccessControlProfilesDeleteHeaders; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryNext operation. */ -export type GalleryInVMAccessControlProfilesListByGalleryNextResponse = - GalleryInVMAccessControlProfileList; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryInVMAccessControlProfile operation. */ -export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse = - GalleryInVMAccessControlProfileVersionList; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfileVersionsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GalleryInVMAccessControlProfileVersionsGetResponse = - GalleryInVMAccessControlProfileVersion; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse = - GalleryInVMAccessControlProfileVersion; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfileVersionsUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryInVMAccessControlProfileVersionsUpdateResponse = - GalleryInVMAccessControlProfileVersionsUpdateHeaders & GalleryInVMAccessControlProfileVersion; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfileVersionsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the delete operation. */ -export type GalleryInVMAccessControlProfileVersionsDeleteResponse = - GalleryInVMAccessControlProfileVersionsDeleteHeaders; - -/** Optional parameters. */ -export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryInVMAccessControlProfileNext operation. */ -export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextResponse = - GalleryInVMAccessControlProfileVersionList; - -/** Optional parameters. */ -export interface GalleryScriptsListByGalleryOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listByGallery operation. */ -export type GalleryScriptsListByGalleryResponse = GalleryScriptList; - -/** Optional parameters. */ -export interface GalleryScriptsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GalleryScriptsGetResponse = GalleryScript; - -/** Optional parameters. */ -export interface GalleryScriptsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryScriptsCreateOrUpdateResponse = GalleryScript; - -/** Optional parameters. */ -export interface GalleryScriptsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryScriptsUpdateResponse = GalleryScript; - -/** Optional parameters. */ -export interface GalleryScriptsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the delete operation. */ -export type GalleryScriptsDeleteResponse = GalleryScriptsDeleteHeaders; - -/** Optional parameters. */ -export interface GalleryScriptsListByGalleryNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryNext operation. */ -export type GalleryScriptsListByGalleryNextResponse = GalleryScriptList; - -/** Optional parameters. */ -export interface GalleryScriptVersionsListByGalleryScriptOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryScript operation. */ -export type GalleryScriptVersionsListByGalleryScriptResponse = GalleryScriptVersionList; - -/** Optional parameters. */ -export interface GalleryScriptVersionsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GalleryScriptVersionsGetResponse = GalleryScriptVersion; - -/** Optional parameters. */ -export interface GalleryScriptVersionsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GalleryScriptVersionsCreateOrUpdateResponse = GalleryScriptVersion; - -/** Optional parameters. */ -export interface GalleryScriptVersionsUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GalleryScriptVersionsUpdateResponse = GalleryScriptVersion; - -/** Optional parameters. */ -export interface GalleryScriptVersionsDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the delete operation. */ -export type GalleryScriptVersionsDeleteResponse = GalleryScriptVersionsDeleteHeaders; - -/** Optional parameters. */ -export interface GalleryScriptVersionsListByGalleryScriptNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByGalleryScriptNext operation. */ -export type GalleryScriptVersionsListByGalleryScriptNextResponse = GalleryScriptVersionList; - -/** Optional parameters. */ -export interface GallerySharingProfileUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GallerySharingProfileUpdateResponse = SharingUpdate; - -/** Optional parameters. */ -export interface SoftDeletedResourceListByArtifactNameOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByArtifactName operation. */ -export type SoftDeletedResourceListByArtifactNameResponse = GallerySoftDeletedResourceList; - -/** Optional parameters. */ -export interface SoftDeletedResourceListByArtifactNameNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByArtifactNameNext operation. */ -export type SoftDeletedResourceListByArtifactNameNextResponse = GallerySoftDeletedResourceList; - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesGetOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply to the operation. 'UserData' is not supported for cloud services. */ - expand?: InstanceViewTypes; -} - -/** Contains response data for the get operation. */ -export type CloudServiceRoleInstancesGetResponse = RoleInstance; - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesGetInstanceViewOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getInstanceView operation. */ -export type CloudServiceRoleInstancesGetInstanceViewResponse = RoleInstanceView; - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesListOptionalParams extends coreClient.OperationOptions { - /** The expand expression to apply to the operation. 'UserData' is not supported for cloud services. */ - expand?: InstanceViewTypes; -} - -/** Contains response data for the list operation. */ -export type CloudServiceRoleInstancesListResponse = RoleInstanceListResult; - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesRestartOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesReimageOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesRebuildOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getRemoteDesktopFile operation. */ -export type CloudServiceRoleInstancesGetRemoteDesktopFileResponse = { - /** - * BROWSER ONLY - * - * The response body as a browser Blob. - * Always `undefined` in node.js. - */ - blobBody?: Promise; - /** - * NODEJS ONLY - * - * The response body as a node.js Readable stream. - * Always `undefined` in the browser. - */ - readableStreamBody?: NodeJS.ReadableStream; -}; - -/** Optional parameters. */ -export interface CloudServiceRoleInstancesListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type CloudServiceRoleInstancesListNextResponse = RoleInstanceListResult; - -/** Optional parameters. */ -export interface CloudServiceRolesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CloudServiceRolesGetResponse = CloudServiceRole; - -/** Optional parameters. */ -export interface CloudServiceRolesListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type CloudServiceRolesListResponse = CloudServiceRoleListResult; - -/** Optional parameters. */ -export interface CloudServiceRolesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type CloudServiceRolesListNextResponse = CloudServiceRoleListResult; - -/** Optional parameters. */ -export interface CloudServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - /** The cloud service object. */ - parameters?: CloudService; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type CloudServicesCreateOrUpdateResponse = CloudService; - -/** Optional parameters. */ -export interface CloudServicesUpdateOptionalParams extends coreClient.OperationOptions { - /** The cloud service object. */ - parameters?: CloudServiceUpdate; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type CloudServicesUpdateResponse = CloudService; - -/** Optional parameters. */ -export interface CloudServicesDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CloudServicesGetResponse = CloudService; - -/** Optional parameters. */ -export interface CloudServicesGetInstanceViewOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the getInstanceView operation. */ -export type CloudServicesGetInstanceViewResponse = CloudServiceInstanceView; - -/** Optional parameters. */ -export interface CloudServicesListAllOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listAll operation. */ -export type CloudServicesListAllResponse = CloudServiceListResult; - -/** Optional parameters. */ -export interface CloudServicesListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type CloudServicesListResponse = CloudServiceListResult; - -/** Optional parameters. */ -export interface CloudServicesStartOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesPowerOffOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesRestartOptionalParams extends coreClient.OperationOptions { - /** List of cloud service role instance names. */ - parameters?: RoleInstances; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesReimageOptionalParams extends coreClient.OperationOptions { - /** List of cloud service role instance names. */ - parameters?: RoleInstances; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesRebuildOptionalParams extends coreClient.OperationOptions { - /** List of cloud service role instance names. */ - parameters?: RoleInstances; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesDeleteInstancesOptionalParams extends coreClient.OperationOptions { - /** List of cloud service role instance names. */ - parameters?: RoleInstances; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesListAllNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listAllNext operation. */ -export type CloudServicesListAllNextResponse = CloudServiceListResult; - -/** Optional parameters. */ -export interface CloudServicesListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type CloudServicesListNextResponse = CloudServiceListResult; - -/** Optional parameters. */ -export interface CloudServicesUpdateDomainWalkUpdateDomainOptionalParams - extends coreClient.OperationOptions { - /** The update domain object. */ - parameters?: UpdateDomain; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CloudServicesUpdateDomainGetUpdateDomainOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getUpdateDomain operation. */ -export type CloudServicesUpdateDomainGetUpdateDomainResponse = UpdateDomain; - -/** Optional parameters. */ -export interface CloudServicesUpdateDomainListUpdateDomainsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listUpdateDomains operation. */ -export type CloudServicesUpdateDomainListUpdateDomainsResponse = UpdateDomainListResult; - -/** Optional parameters. */ -export interface CloudServicesUpdateDomainListUpdateDomainsNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listUpdateDomainsNext operation. */ -export type CloudServicesUpdateDomainListUpdateDomainsNextResponse = UpdateDomainListResult; - -/** Optional parameters. */ -export interface CloudServiceOperatingSystemsGetOSVersionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getOSVersion operation. */ -export type CloudServiceOperatingSystemsGetOSVersionResponse = OSVersion; - -/** Optional parameters. */ -export interface CloudServiceOperatingSystemsListOSVersionsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listOSVersions operation. */ -export type CloudServiceOperatingSystemsListOSVersionsResponse = OSVersionListResult; - -/** Optional parameters. */ -export interface CloudServiceOperatingSystemsGetOSFamilyOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getOSFamily operation. */ -export type CloudServiceOperatingSystemsGetOSFamilyResponse = OSFamily; - -/** Optional parameters. */ -export interface CloudServiceOperatingSystemsListOSFamiliesOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listOSFamilies operation. */ -export type CloudServiceOperatingSystemsListOSFamiliesResponse = OSFamilyListResult; - -/** Optional parameters. */ -export interface CloudServiceOperatingSystemsListOSVersionsNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listOSVersionsNext operation. */ -export type CloudServiceOperatingSystemsListOSVersionsNextResponse = OSVersionListResult; - -/** Optional parameters. */ -export interface CloudServiceOperatingSystemsListOSFamiliesNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listOSFamiliesNext operation. */ -export type CloudServiceOperatingSystemsListOSFamiliesNextResponse = OSFamilyListResult; - -/** Optional parameters. */ -export interface ComputeManagementClientOptionalParams extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +export type { + Operation, + OperationDisplay, + Origin, + ActionType, + TrackedResource, + Resource, + SystemData, + CreatedByType, + ErrorDetail, + ErrorAdditionalInfo, + ProxyResource, + ErrorResponse, +} from "./models.js"; +export { KnownOrigin, KnownActionType, KnownCreatedByType } from "./models.js"; diff --git a/sdk/compute/arm-compute/src/models/mappers.ts b/sdk/compute/arm-compute/src/models/mappers.ts deleted file mode 100644 index fe53af4d76e4..000000000000 --- a/sdk/compute/arm-compute/src/models/mappers.ts +++ /dev/null @@ -1,22714 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type * as coreClient from "@azure/core-client"; - -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean", - }, - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay", - }, - }, - origin: { - serializedName: "origin", - readOnly: true, - type: { - name: "String", - }, - }, - actionType: { - serializedName: "actionType", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String", - }, - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String", - }, - }, - operation: { - serializedName: "operation", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudError", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ApiError", - }, - }, - }, - }, -}; - -export const ApiError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApiError", - modelProperties: { - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApiErrorBase", - }, - }, - }, - }, - innererror: { - serializedName: "innererror", - type: { - name: "Composite", - className: "InnerError", - }, - }, - code: { - serializedName: "code", - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ApiErrorBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApiErrorBase", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const InnerError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InnerError", - modelProperties: { - exceptiontype: { - serializedName: "exceptiontype", - type: { - name: "String", - }, - }, - errordetail: { - serializedName: "errordetail", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AvailabilitySetListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AvailabilitySet", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SubResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubResource", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const InstanceViewStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InstanceViewStatus", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String", - }, - }, - level: { - serializedName: "level", - type: { - name: "Enum", - allowedValues: ["Info", "Warning", "Error"], - }, - }, - displayStatus: { - serializedName: "displayStatus", - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - type: { - name: "String", - }, - }, - time: { - serializedName: "time", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const ScheduledEventsPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduledEventsPolicy", - modelProperties: { - userInitiatedRedeploy: { - serializedName: "userInitiatedRedeploy", - type: { - name: "Composite", - className: "UserInitiatedRedeploy", - }, - }, - userInitiatedReboot: { - serializedName: "userInitiatedReboot", - type: { - name: "Composite", - className: "UserInitiatedReboot", - }, - }, - scheduledEventsAdditionalPublishingTargets: { - serializedName: "scheduledEventsAdditionalPublishingTargets", - type: { - name: "Composite", - className: "ScheduledEventsAdditionalPublishingTargets", - }, - }, - allInstancesDown: { - serializedName: "allInstancesDown", - type: { - name: "Composite", - className: "AllInstancesDown", - }, - }, - }, - }, -}; - -export const UserInitiatedRedeploy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserInitiatedRedeploy", - modelProperties: { - automaticallyApprove: { - serializedName: "automaticallyApprove", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const UserInitiatedReboot: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserInitiatedReboot", - modelProperties: { - automaticallyApprove: { - serializedName: "automaticallyApprove", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ScheduledEventsAdditionalPublishingTargets: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduledEventsAdditionalPublishingTargets", - modelProperties: { - eventGridAndResourceGraph: { - serializedName: "eventGridAndResourceGraph", - type: { - name: "Composite", - className: "EventGridAndResourceGraph", - }, - }, - }, - }, -}; - -export const EventGridAndResourceGraph: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EventGridAndResourceGraph", - modelProperties: { - enable: { - serializedName: "enable", - type: { - name: "Boolean", - }, - }, - scheduledEventsApiVersion: { - serializedName: "scheduledEventsApiVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AllInstancesDown: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AllInstancesDown", - modelProperties: { - automaticallyApprove: { - serializedName: "automaticallyApprove", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetMigrationInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetMigrationInfo", - modelProperties: { - defaultVirtualMachineScaleSetInfo: { - serializedName: "defaultVirtualMachineScaleSetInfo", - type: { - name: "Composite", - className: "DefaultVirtualMachineScaleSetInfo", - }, - }, - migrateToVirtualMachineScaleSet: { - serializedName: "migrateToVirtualMachineScaleSet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, -}; - -export const DefaultVirtualMachineScaleSetInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DefaultVirtualMachineScaleSetInfo", - modelProperties: { - constrainedMaximumCapacity: { - serializedName: "constrainedMaximumCapacity", - readOnly: true, - type: { - name: "Boolean", - }, - }, - defaultVirtualMachineScaleSet: { - serializedName: "defaultVirtualMachineScaleSet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, -}; - -export const Sku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Sku", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - type: { - name: "String", - }, - }, - capacity: { - serializedName: "capacity", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - }, - }, -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String", - }, - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String", - }, - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime", - }, - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String", - }, - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String", - }, - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const CapacityReservationGroupListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationGroupListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CapacityReservationGroup", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SubResourceReadOnly: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubResourceReadOnly", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CapacityReservationGroupInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationGroupInstanceView", - modelProperties: { - capacityReservations: { - serializedName: "capacityReservations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CapacityReservationInstanceViewWithName", - }, - }, - }, - }, - sharedSubscriptionIds: { - serializedName: "sharedSubscriptionIds", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - }, - }, -}; - -export const CapacityReservationInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationInstanceView", - modelProperties: { - utilizationInfo: { - serializedName: "utilizationInfo", - type: { - name: "Composite", - className: "CapacityReservationUtilization", - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const CapacityReservationUtilization: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationUtilization", - modelProperties: { - currentCapacity: { - serializedName: "currentCapacity", - readOnly: true, - type: { - name: "Number", - }, - }, - virtualMachinesAllocated: { - serializedName: "virtualMachinesAllocated", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceSharingProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSharingProfile", - modelProperties: { - subscriptionIds: { - serializedName: "subscriptionIds", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - }, - }, -}; - -export const DedicatedHostGroupListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostGroupListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DedicatedHostGroup", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DedicatedHostGroupInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostGroupInstanceView", - modelProperties: { - hosts: { - serializedName: "hosts", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DedicatedHostInstanceViewWithName", - }, - }, - }, - }, - }, - }, -}; - -export const DedicatedHostInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostInstanceView", - modelProperties: { - assetId: { - serializedName: "assetId", - readOnly: true, - type: { - name: "String", - }, - }, - availableCapacity: { - serializedName: "availableCapacity", - type: { - name: "Composite", - className: "DedicatedHostAvailableCapacity", - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const DedicatedHostAvailableCapacity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostAvailableCapacity", - modelProperties: { - allocatableVMs: { - serializedName: "allocatableVMs", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DedicatedHostAllocatableVM", - }, - }, - }, - }, - }, - }, -}; - -export const DedicatedHostAllocatableVM: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostAllocatableVM", - modelProperties: { - vmSize: { - serializedName: "vmSize", - type: { - name: "String", - }, - }, - count: { - serializedName: "count", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DedicatedHostGroupPropertiesAdditionalCapabilities: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostGroupPropertiesAdditionalCapabilities", - modelProperties: { - ultraSSDEnabled: { - serializedName: "ultraSSDEnabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ImageListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Image", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ImageStorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageStorageProfile", - modelProperties: { - osDisk: { - serializedName: "osDisk", - type: { - name: "Composite", - className: "ImageOSDisk", - }, - }, - dataDisks: { - serializedName: "dataDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ImageDataDisk", - }, - }, - }, - }, - zoneResilient: { - serializedName: "zoneResilient", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ImageDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageDisk", - modelProperties: { - snapshot: { - serializedName: "snapshot", - type: { - name: "Composite", - className: "SubResource", - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "SubResource", - }, - }, - blobUri: { - serializedName: "blobUri", - type: { - name: "String", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - diskEncryptionSet: { - serializedName: "diskEncryptionSet", - type: { - name: "Composite", - className: "DiskEncryptionSetParameters", - }, - }, - }, - }, -}; - -export const ExtendedLocation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExtendedLocation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PurchasePlan: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PurchasePlan", - modelProperties: { - publisher: { - serializedName: "publisher", - required: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - product: { - serializedName: "product", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OSDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSDiskImage", - modelProperties: { - operatingSystem: { - serializedName: "operatingSystem", - required: true, - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - }, - }, -}; - -export const DataDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataDiskImage", - modelProperties: { - lun: { - serializedName: "lun", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const AutomaticOSUpgradeProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutomaticOSUpgradeProperties", - modelProperties: { - automaticOSUpgradeSupported: { - serializedName: "automaticOSUpgradeSupported", - required: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const DisallowedConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DisallowedConfiguration", - modelProperties: { - vmDiskType: { - serializedName: "vmDiskType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineImageFeature: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineImageFeature", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ImageDeprecationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageDeprecationStatus", - modelProperties: { - imageState: { - serializedName: "imageState", - type: { - name: "String", - }, - }, - scheduledDeprecationTime: { - serializedName: "scheduledDeprecationTime", - type: { - name: "DateTime", - }, - }, - alternativeOption: { - serializedName: "alternativeOption", - type: { - name: "Composite", - className: "AlternativeOption", - }, - }, - }, - }, -}; - -export const AlternativeOption: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AlternativeOption", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VmImagesInEdgeZoneListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VmImagesInEdgeZoneListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const LogAnalyticsInputBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogAnalyticsInputBase", - modelProperties: { - blobContainerSasUri: { - serializedName: "blobContainerSasUri", - required: true, - type: { - name: "String", - }, - }, - fromTime: { - serializedName: "fromTime", - required: true, - type: { - name: "DateTime", - }, - }, - toTime: { - serializedName: "toTime", - required: true, - type: { - name: "DateTime", - }, - }, - groupByThrottlePolicy: { - serializedName: "groupByThrottlePolicy", - type: { - name: "Boolean", - }, - }, - groupByOperationName: { - serializedName: "groupByOperationName", - type: { - name: "Boolean", - }, - }, - groupByResourceName: { - serializedName: "groupByResourceName", - type: { - name: "Boolean", - }, - }, - groupByClientApplicationId: { - serializedName: "groupByClientApplicationId", - type: { - name: "Boolean", - }, - }, - groupByUserAgent: { - serializedName: "groupByUserAgent", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const LogAnalyticsOperationResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogAnalyticsOperationResult", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "LogAnalyticsOutput", - }, - }, - }, - }, -}; - -export const LogAnalyticsOutput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogAnalyticsOutput", - modelProperties: { - output: { - serializedName: "output", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RunCommandListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RunCommandDocumentBase", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RunCommandDocumentBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandDocumentBase", - modelProperties: { - schema: { - serializedName: "$schema", - required: true, - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - osType: { - serializedName: "osType", - required: true, - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - label: { - serializedName: "label", - required: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RunCommandParameterDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandParameterDefinition", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - defaultValue: { - serializedName: "defaultValue", - type: { - name: "String", - }, - }, - required: { - serializedName: "required", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ListUsagesResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ListUsagesResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Usage", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Usage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Usage", - modelProperties: { - unit: { - defaultValue: "Count", - isConstant: true, - serializedName: "unit", - type: { - name: "String", - }, - }, - currentValue: { - serializedName: "currentValue", - required: true, - type: { - name: "Number", - }, - }, - limit: { - serializedName: "limit", - required: true, - type: { - name: "Number", - }, - }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "UsageName", - }, - }, - }, - }, -}; - -export const UsageName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UsageName", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - localizedValue: { - serializedName: "localizedValue", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSet", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Plan: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Plan", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "publisher", - type: { - name: "String", - }, - }, - product: { - serializedName: "product", - type: { - name: "String", - }, - }, - promotionCode: { - serializedName: "promotionCode", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpgradePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpgradePolicy", - modelProperties: { - mode: { - serializedName: "mode", - type: { - name: "Enum", - allowedValues: ["Automatic", "Manual", "Rolling"], - }, - }, - rollingUpgradePolicy: { - serializedName: "rollingUpgradePolicy", - type: { - name: "Composite", - className: "RollingUpgradePolicy", - }, - }, - automaticOSUpgradePolicy: { - serializedName: "automaticOSUpgradePolicy", - type: { - name: "Composite", - className: "AutomaticOSUpgradePolicy", - }, - }, - }, - }, -}; - -export const RollingUpgradePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RollingUpgradePolicy", - modelProperties: { - maxBatchInstancePercent: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 5, - }, - serializedName: "maxBatchInstancePercent", - type: { - name: "Number", - }, - }, - maxUnhealthyInstancePercent: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 5, - }, - serializedName: "maxUnhealthyInstancePercent", - type: { - name: "Number", - }, - }, - maxUnhealthyUpgradedInstancePercent: { - constraints: { - InclusiveMaximum: 100, - }, - serializedName: "maxUnhealthyUpgradedInstancePercent", - type: { - name: "Number", - }, - }, - pauseTimeBetweenBatches: { - serializedName: "pauseTimeBetweenBatches", - type: { - name: "String", - }, - }, - enableCrossZoneUpgrade: { - serializedName: "enableCrossZoneUpgrade", - type: { - name: "Boolean", - }, - }, - prioritizeUnhealthyInstances: { - serializedName: "prioritizeUnhealthyInstances", - type: { - name: "Boolean", - }, - }, - rollbackFailedInstancesOnPolicyBreach: { - serializedName: "rollbackFailedInstancesOnPolicyBreach", - type: { - name: "Boolean", - }, - }, - maxSurge: { - serializedName: "maxSurge", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AutomaticOSUpgradePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutomaticOSUpgradePolicy", - modelProperties: { - enableAutomaticOSUpgrade: { - serializedName: "enableAutomaticOSUpgrade", - type: { - name: "Boolean", - }, - }, - disableAutomaticRollback: { - serializedName: "disableAutomaticRollback", - type: { - name: "Boolean", - }, - }, - useRollingUpgradePolicy: { - serializedName: "useRollingUpgradePolicy", - type: { - name: "Boolean", - }, - }, - osRollingUpgradeDeferral: { - serializedName: "osRollingUpgradeDeferral", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AutomaticRepairsPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutomaticRepairsPolicy", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - gracePeriod: { - serializedName: "gracePeriod", - type: { - name: "String", - }, - }, - repairAction: { - serializedName: "repairAction", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMProfile", - modelProperties: { - osProfile: { - serializedName: "osProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetOSProfile", - }, - }, - storageProfile: { - serializedName: "storageProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetStorageProfile", - }, - }, - networkProfile: { - serializedName: "networkProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkProfile", - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "SecurityProfile", - }, - }, - diagnosticsProfile: { - serializedName: "diagnosticsProfile", - type: { - name: "Composite", - className: "DiagnosticsProfile", - }, - }, - extensionProfile: { - serializedName: "extensionProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionProfile", - }, - }, - licenseType: { - serializedName: "licenseType", - type: { - name: "String", - }, - }, - priority: { - serializedName: "priority", - type: { - name: "String", - }, - }, - evictionPolicy: { - serializedName: "evictionPolicy", - type: { - name: "String", - }, - }, - billingProfile: { - serializedName: "billingProfile", - type: { - name: "Composite", - className: "BillingProfile", - }, - }, - scheduledEventsProfile: { - serializedName: "scheduledEventsProfile", - type: { - name: "Composite", - className: "ScheduledEventsProfile", - }, - }, - userData: { - serializedName: "userData", - type: { - name: "String", - }, - }, - capacityReservation: { - serializedName: "capacityReservation", - type: { - name: "Composite", - className: "CapacityReservationProfile", - }, - }, - applicationProfile: { - serializedName: "applicationProfile", - type: { - name: "Composite", - className: "ApplicationProfile", - }, - }, - hardwareProfile: { - serializedName: "hardwareProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetHardwareProfile", - }, - }, - serviceArtifactReference: { - serializedName: "serviceArtifactReference", - type: { - name: "Composite", - className: "ServiceArtifactReference", - }, - }, - securityPostureReference: { - serializedName: "securityPostureReference", - type: { - name: "Composite", - className: "SecurityPostureReference", - }, - }, - timeCreated: { - serializedName: "timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetOSProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetOSProfile", - modelProperties: { - computerNamePrefix: { - serializedName: "computerNamePrefix", - type: { - name: "String", - }, - }, - adminUsername: { - serializedName: "adminUsername", - type: { - name: "String", - }, - }, - adminPassword: { - serializedName: "adminPassword", - type: { - name: "String", - }, - }, - customData: { - serializedName: "customData", - type: { - name: "String", - }, - }, - windowsConfiguration: { - serializedName: "windowsConfiguration", - type: { - name: "Composite", - className: "WindowsConfiguration", - }, - }, - linuxConfiguration: { - serializedName: "linuxConfiguration", - type: { - name: "Composite", - className: "LinuxConfiguration", - }, - }, - secrets: { - serializedName: "secrets", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VaultSecretGroup", - }, - }, - }, - }, - allowExtensionOperations: { - serializedName: "allowExtensionOperations", - type: { - name: "Boolean", - }, - }, - requireGuestProvisionSignal: { - serializedName: "requireGuestProvisionSignal", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const WindowsConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WindowsConfiguration", - modelProperties: { - provisionVMAgent: { - serializedName: "provisionVMAgent", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpdates: { - serializedName: "enableAutomaticUpdates", - type: { - name: "Boolean", - }, - }, - timeZone: { - serializedName: "timeZone", - type: { - name: "String", - }, - }, - additionalUnattendContent: { - serializedName: "additionalUnattendContent", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AdditionalUnattendContent", - }, - }, - }, - }, - patchSettings: { - serializedName: "patchSettings", - type: { - name: "Composite", - className: "PatchSettings", - }, - }, - winRM: { - serializedName: "winRM", - type: { - name: "Composite", - className: "WinRMConfiguration", - }, - }, - enableVMAgentPlatformUpdates: { - serializedName: "enableVMAgentPlatformUpdates", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AdditionalUnattendContent: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AdditionalUnattendContent", - modelProperties: { - passName: { - defaultValue: "OobeSystem", - isConstant: true, - serializedName: "passName", - type: { - name: "String", - }, - }, - componentName: { - defaultValue: "Microsoft-Windows-Shell-Setup", - isConstant: true, - serializedName: "componentName", - type: { - name: "String", - }, - }, - settingName: { - serializedName: "settingName", - type: { - name: "Enum", - allowedValues: ["AutoLogon", "FirstLogonCommands"], - }, - }, - content: { - serializedName: "content", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PatchSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PatchSettings", - modelProperties: { - patchMode: { - serializedName: "patchMode", - type: { - name: "String", - }, - }, - enableHotpatching: { - serializedName: "enableHotpatching", - type: { - name: "Boolean", - }, - }, - assessmentMode: { - serializedName: "assessmentMode", - type: { - name: "String", - }, - }, - automaticByPlatformSettings: { - serializedName: "automaticByPlatformSettings", - type: { - name: "Composite", - className: "WindowsVMGuestPatchAutomaticByPlatformSettings", - }, - }, - }, - }, -}; - -export const WindowsVMGuestPatchAutomaticByPlatformSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WindowsVMGuestPatchAutomaticByPlatformSettings", - modelProperties: { - rebootSetting: { - serializedName: "rebootSetting", - type: { - name: "String", - }, - }, - bypassPlatformSafetyChecksOnUserSchedule: { - serializedName: "bypassPlatformSafetyChecksOnUserSchedule", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const WinRMConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WinRMConfiguration", - modelProperties: { - listeners: { - serializedName: "listeners", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WinRMListener", - }, - }, - }, - }, - }, - }, -}; - -export const WinRMListener: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WinRMListener", - modelProperties: { - protocol: { - serializedName: "protocol", - type: { - name: "Enum", - allowedValues: ["Http", "Https"], - }, - }, - certificateUrl: { - serializedName: "certificateUrl", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const LinuxConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LinuxConfiguration", - modelProperties: { - disablePasswordAuthentication: { - serializedName: "disablePasswordAuthentication", - type: { - name: "Boolean", - }, - }, - ssh: { - serializedName: "ssh", - type: { - name: "Composite", - className: "SshConfiguration", - }, - }, - provisionVMAgent: { - serializedName: "provisionVMAgent", - type: { - name: "Boolean", - }, - }, - patchSettings: { - serializedName: "patchSettings", - type: { - name: "Composite", - className: "LinuxPatchSettings", - }, - }, - enableVMAgentPlatformUpdates: { - serializedName: "enableVMAgentPlatformUpdates", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const SshConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SshConfiguration", - modelProperties: { - publicKeys: { - serializedName: "publicKeys", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SshPublicKey", - }, - }, - }, - }, - }, - }, -}; - -export const SshPublicKey: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SshPublicKey", - modelProperties: { - path: { - serializedName: "path", - type: { - name: "String", - }, - }, - keyData: { - serializedName: "keyData", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const LinuxPatchSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LinuxPatchSettings", - modelProperties: { - patchMode: { - serializedName: "patchMode", - type: { - name: "String", - }, - }, - assessmentMode: { - serializedName: "assessmentMode", - type: { - name: "String", - }, - }, - automaticByPlatformSettings: { - serializedName: "automaticByPlatformSettings", - type: { - name: "Composite", - className: "LinuxVMGuestPatchAutomaticByPlatformSettings", - }, - }, - }, - }, -}; - -export const LinuxVMGuestPatchAutomaticByPlatformSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LinuxVMGuestPatchAutomaticByPlatformSettings", - modelProperties: { - rebootSetting: { - serializedName: "rebootSetting", - type: { - name: "String", - }, - }, - bypassPlatformSafetyChecksOnUserSchedule: { - serializedName: "bypassPlatformSafetyChecksOnUserSchedule", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VaultSecretGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VaultSecretGroup", - modelProperties: { - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SubResource", - }, - }, - vaultCertificates: { - serializedName: "vaultCertificates", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VaultCertificate", - }, - }, - }, - }, - }, - }, -}; - -export const VaultCertificate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VaultCertificate", - modelProperties: { - certificateUrl: { - serializedName: "certificateUrl", - type: { - name: "String", - }, - }, - certificateStore: { - serializedName: "certificateStore", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetStorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetStorageProfile", - modelProperties: { - imageReference: { - serializedName: "imageReference", - type: { - name: "Composite", - className: "ImageReference", - }, - }, - osDisk: { - serializedName: "osDisk", - type: { - name: "Composite", - className: "VirtualMachineScaleSetOSDisk", - }, - }, - dataDisks: { - serializedName: "dataDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetDataDisk", - }, - }, - }, - }, - diskControllerType: { - serializedName: "diskControllerType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetOSDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetOSDisk", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - type: { - name: "Boolean", - }, - }, - createOption: { - serializedName: "createOption", - required: true, - type: { - name: "String", - }, - }, - diffDiskSettings: { - serializedName: "diffDiskSettings", - type: { - name: "Composite", - className: "DiffDiskSettings", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - osType: { - serializedName: "osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - image: { - serializedName: "image", - type: { - name: "Composite", - className: "VirtualHardDisk", - }, - }, - vhdContainers: { - serializedName: "vhdContainers", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "VirtualMachineScaleSetManagedDiskParameters", - }, - }, - deleteOption: { - serializedName: "deleteOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiffDiskSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiffDiskSettings", - modelProperties: { - option: { - serializedName: "option", - type: { - name: "String", - }, - }, - placement: { - serializedName: "placement", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualHardDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualHardDisk", - modelProperties: { - uri: { - serializedName: "uri", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetManagedDiskParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetManagedDiskParameters", - modelProperties: { - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - diskEncryptionSet: { - serializedName: "diskEncryptionSet", - type: { - name: "Composite", - className: "DiskEncryptionSetParameters", - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "VMDiskSecurityProfile", - }, - }, - }, - }, -}; - -export const VMDiskSecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMDiskSecurityProfile", - modelProperties: { - securityEncryptionType: { - serializedName: "securityEncryptionType", - type: { - name: "String", - }, - }, - diskEncryptionSet: { - serializedName: "diskEncryptionSet", - type: { - name: "Composite", - className: "DiskEncryptionSetParameters", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetDataDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetDataDisk", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - lun: { - serializedName: "lun", - required: true, - type: { - name: "Number", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - type: { - name: "Boolean", - }, - }, - createOption: { - serializedName: "createOption", - required: true, - type: { - name: "String", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "VirtualMachineScaleSetManagedDiskParameters", - }, - }, - diskIopsReadWrite: { - serializedName: "diskIOPSReadWrite", - type: { - name: "Number", - }, - }, - diskMBpsReadWrite: { - serializedName: "diskMBpsReadWrite", - type: { - name: "Number", - }, - }, - deleteOption: { - serializedName: "deleteOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetNetworkProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkProfile", - modelProperties: { - healthProbe: { - serializedName: "healthProbe", - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - networkInterfaceConfigurations: { - serializedName: "networkInterfaceConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkConfiguration", - }, - }, - }, - }, - networkApiVersion: { - serializedName: "networkApiVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ApiEntityReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApiEntityReference", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetNetworkConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkConfiguration", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - primary: { - serializedName: "properties.primary", - type: { - name: "Boolean", - }, - }, - enableAcceleratedNetworking: { - serializedName: "properties.enableAcceleratedNetworking", - type: { - name: "Boolean", - }, - }, - disableTcpStateTracking: { - serializedName: "properties.disableTcpStateTracking", - type: { - name: "Boolean", - }, - }, - enableFpga: { - serializedName: "properties.enableFpga", - type: { - name: "Boolean", - }, - }, - networkSecurityGroup: { - serializedName: "properties.networkSecurityGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - dnsSettings: { - serializedName: "properties.dnsSettings", - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkConfigurationDnsSettings", - }, - }, - ipConfigurations: { - serializedName: "properties.ipConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetIPConfiguration", - }, - }, - }, - }, - enableIPForwarding: { - serializedName: "properties.enableIPForwarding", - type: { - name: "Boolean", - }, - }, - deleteOption: { - serializedName: "properties.deleteOption", - type: { - name: "String", - }, - }, - auxiliaryMode: { - serializedName: "properties.auxiliaryMode", - type: { - name: "String", - }, - }, - auxiliarySku: { - serializedName: "properties.auxiliarySku", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetNetworkConfigurationDnsSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkConfigurationDnsSettings", - modelProperties: { - dnsServers: { - serializedName: "dnsServers", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetIPConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetIPConfiguration", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - subnet: { - serializedName: "properties.subnet", - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - primary: { - serializedName: "properties.primary", - type: { - name: "Boolean", - }, - }, - publicIPAddressConfiguration: { - serializedName: "properties.publicIPAddressConfiguration", - type: { - name: "Composite", - className: "VirtualMachineScaleSetPublicIPAddressConfiguration", - }, - }, - privateIPAddressVersion: { - serializedName: "properties.privateIPAddressVersion", - type: { - name: "String", - }, - }, - applicationGatewayBackendAddressPools: { - serializedName: "properties.applicationGatewayBackendAddressPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - applicationSecurityGroups: { - serializedName: "properties.applicationSecurityGroups", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - loadBalancerBackendAddressPools: { - serializedName: "properties.loadBalancerBackendAddressPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - loadBalancerInboundNatPools: { - serializedName: "properties.loadBalancerInboundNatPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetPublicIPAddressConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetPublicIPAddressConfiguration", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "PublicIPAddressSku", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - idleTimeoutInMinutes: { - serializedName: "properties.idleTimeoutInMinutes", - type: { - name: "Number", - }, - }, - dnsSettings: { - serializedName: "properties.dnsSettings", - type: { - name: "Composite", - className: "VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings", - }, - }, - ipTags: { - serializedName: "properties.ipTags", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetIpTag", - }, - }, - }, - }, - publicIPPrefix: { - serializedName: "properties.publicIPPrefix", - type: { - name: "Composite", - className: "SubResource", - }, - }, - publicIPAddressVersion: { - serializedName: "properties.publicIPAddressVersion", - type: { - name: "String", - }, - }, - deleteOption: { - serializedName: "properties.deleteOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings", - modelProperties: { - domainNameLabel: { - serializedName: "domainNameLabel", - required: true, - type: { - name: "String", - }, - }, - domainNameLabelScope: { - serializedName: "domainNameLabelScope", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const VirtualMachineScaleSetIpTag: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetIpTag", - modelProperties: { - ipTagType: { - serializedName: "ipTagType", - type: { - name: "String", - }, - }, - tag: { - serializedName: "tag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PublicIPAddressSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PublicIPAddressSku", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SecurityProfile", - modelProperties: { - uefiSettings: { - serializedName: "uefiSettings", - type: { - name: "Composite", - className: "UefiSettings", - }, - }, - encryptionAtHost: { - serializedName: "encryptionAtHost", - type: { - name: "Boolean", - }, - }, - securityType: { - serializedName: "securityType", - type: { - name: "String", - }, - }, - encryptionIdentity: { - serializedName: "encryptionIdentity", - type: { - name: "Composite", - className: "EncryptionIdentity", - }, - }, - proxyAgentSettings: { - serializedName: "proxyAgentSettings", - type: { - name: "Composite", - className: "ProxyAgentSettings", - }, - }, - }, - }, -}; - -export const UefiSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UefiSettings", - modelProperties: { - secureBootEnabled: { - serializedName: "secureBootEnabled", - type: { - name: "Boolean", - }, - }, - vTpmEnabled: { - serializedName: "vTpmEnabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const EncryptionIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionIdentity", - modelProperties: { - userAssignedIdentityResourceId: { - serializedName: "userAssignedIdentityResourceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProxyAgentSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyAgentSettings", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - mode: { - serializedName: "mode", - type: { - name: "String", - }, - }, - keyIncarnationId: { - serializedName: "keyIncarnationId", - type: { - name: "Number", - }, - }, - wireServer: { - serializedName: "wireServer", - type: { - name: "Composite", - className: "HostEndpointSettings", - }, - }, - imds: { - serializedName: "imds", - type: { - name: "Composite", - className: "HostEndpointSettings", - }, - }, - addProxyAgentExtension: { - serializedName: "addProxyAgentExtension", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const HostEndpointSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "HostEndpointSettings", - modelProperties: { - mode: { - serializedName: "mode", - type: { - name: "String", - }, - }, - inVMAccessControlProfileReferenceId: { - serializedName: "inVMAccessControlProfileReferenceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiagnosticsProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiagnosticsProfile", - modelProperties: { - bootDiagnostics: { - serializedName: "bootDiagnostics", - type: { - name: "Composite", - className: "BootDiagnostics", - }, - }, - }, - }, -}; - -export const BootDiagnostics: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BootDiagnostics", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - storageUri: { - serializedName: "storageUri", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetExtensionProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionProfile", - modelProperties: { - extensions: { - serializedName: "extensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtension", - }, - }, - }, - }, - extensionsTimeBudget: { - serializedName: "extensionsTimeBudget", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const KeyVaultSecretReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultSecretReference", - modelProperties: { - secretUrl: { - serializedName: "secretUrl", - required: true, - type: { - name: "String", - }, - }, - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, -}; - -export const BillingProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BillingProfile", - modelProperties: { - maxPrice: { - serializedName: "maxPrice", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ScheduledEventsProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduledEventsProfile", - modelProperties: { - terminateNotificationProfile: { - serializedName: "terminateNotificationProfile", - type: { - name: "Composite", - className: "TerminateNotificationProfile", - }, - }, - osImageNotificationProfile: { - serializedName: "osImageNotificationProfile", - type: { - name: "Composite", - className: "OSImageNotificationProfile", - }, - }, - }, - }, -}; - -export const TerminateNotificationProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TerminateNotificationProfile", - modelProperties: { - notBeforeTimeout: { - serializedName: "notBeforeTimeout", - type: { - name: "String", - }, - }, - enable: { - serializedName: "enable", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const OSImageNotificationProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSImageNotificationProfile", - modelProperties: { - notBeforeTimeout: { - serializedName: "notBeforeTimeout", - type: { - name: "String", - }, - }, - enable: { - serializedName: "enable", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const CapacityReservationProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationProfile", - modelProperties: { - capacityReservationGroup: { - serializedName: "capacityReservationGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, -}; - -export const ApplicationProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationProfile", - modelProperties: { - galleryApplications: { - serializedName: "galleryApplications", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VMGalleryApplication", - }, - }, - }, - }, - }, - }, -}; - -export const VMGalleryApplication: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMGalleryApplication", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "String", - }, - }, - order: { - serializedName: "order", - type: { - name: "Number", - }, - }, - packageReferenceId: { - serializedName: "packageReferenceId", - required: true, - type: { - name: "String", - }, - }, - configurationReference: { - serializedName: "configurationReference", - type: { - name: "String", - }, - }, - treatFailureAsDeploymentFailure: { - serializedName: "treatFailureAsDeploymentFailure", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetHardwareProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetHardwareProfile", - modelProperties: { - vmSizeProperties: { - serializedName: "vmSizeProperties", - type: { - name: "Composite", - className: "VMSizeProperties", - }, - }, - }, - }, -}; - -export const VMSizeProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMSizeProperties", - modelProperties: { - vCPUsAvailable: { - serializedName: "vCPUsAvailable", - type: { - name: "Number", - }, - }, - vCPUsPerCore: { - serializedName: "vCPUsPerCore", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ServiceArtifactReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceArtifactReference", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SecurityPostureReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SecurityPostureReference", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - excludeExtensions: { - serializedName: "excludeExtensions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - isOverridable: { - serializedName: "isOverridable", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AdditionalCapabilities: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AdditionalCapabilities", - modelProperties: { - ultraSSDEnabled: { - serializedName: "ultraSSDEnabled", - type: { - name: "Boolean", - }, - }, - hibernationEnabled: { - serializedName: "hibernationEnabled", - type: { - name: "Boolean", - }, - }, - enableFips1403Encryption: { - serializedName: "enableFips1403Encryption", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ScaleInPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScaleInPolicy", - modelProperties: { - rules: { - serializedName: "rules", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - forceDeletion: { - serializedName: "forceDeletion", - type: { - name: "Boolean", - }, - }, - prioritizeUnhealthyVMs: { - serializedName: "prioritizeUnhealthyVMs", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const SpotRestorePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SpotRestorePolicy", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - restoreTimeout: { - serializedName: "restoreTimeout", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PriorityMixPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PriorityMixPolicy", - modelProperties: { - baseRegularPriorityCount: { - serializedName: "baseRegularPriorityCount", - type: { - name: "Number", - }, - }, - regularPriorityPercentageAboveBase: { - constraints: { - InclusiveMaximum: 100, - }, - serializedName: "regularPriorityPercentageAboveBase", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ResiliencyPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResiliencyPolicy", - modelProperties: { - resilientVMCreationPolicy: { - serializedName: "resilientVMCreationPolicy", - type: { - name: "Composite", - className: "ResilientVMCreationPolicy", - }, - }, - resilientVMDeletionPolicy: { - serializedName: "resilientVMDeletionPolicy", - type: { - name: "Composite", - className: "ResilientVMDeletionPolicy", - }, - }, - automaticZoneRebalancingPolicy: { - serializedName: "automaticZoneRebalancingPolicy", - type: { - name: "Composite", - className: "AutomaticZoneRebalancingPolicy", - }, - }, - zoneAllocationPolicy: { - serializedName: "zoneAllocationPolicy", - type: { - name: "Composite", - className: "ZoneAllocationPolicy", - }, - }, - }, - }, -}; - -export const ResilientVMCreationPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResilientVMCreationPolicy", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ResilientVMDeletionPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResilientVMDeletionPolicy", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AutomaticZoneRebalancingPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutomaticZoneRebalancingPolicy", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - rebalanceStrategy: { - serializedName: "rebalanceStrategy", - type: { - name: "String", - }, - }, - rebalanceBehavior: { - serializedName: "rebalanceBehavior", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ZoneAllocationPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ZoneAllocationPolicy", - modelProperties: { - maxZoneCount: { - serializedName: "maxZoneCount", - type: { - name: "Number", - }, - }, - maxInstancePercentPerZonePolicy: { - serializedName: "maxInstancePercentPerZonePolicy", - type: { - name: "Composite", - className: "MaxInstancePercentPerZonePolicy", - }, - }, - }, - }, -}; - -export const MaxInstancePercentPerZonePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MaxInstancePercentPerZonePolicy", - modelProperties: { - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - value: { - constraints: { - InclusiveMaximum: 100, - }, - serializedName: "value", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SkuProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuProfile", - modelProperties: { - vmSizes: { - serializedName: "vmSizes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuProfileVMSize", - }, - }, - }, - }, - allocationStrategy: { - serializedName: "allocationStrategy", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SkuProfileVMSize: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuProfileVMSize", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - rank: { - serializedName: "rank", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - }, - }, - }, - }, - }, - }, -}; - -export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Placement: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Placement", - modelProperties: { - zonePlacementPolicy: { - serializedName: "zonePlacementPolicy", - type: { - name: "String", - }, - }, - includeZones: { - serializedName: "includeZones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - excludeZones: { - serializedName: "excludeZones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachine", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const HardwareProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "HardwareProfile", - modelProperties: { - vmSize: { - serializedName: "vmSize", - type: { - name: "String", - }, - }, - vmSizeProperties: { - serializedName: "vmSizeProperties", - type: { - name: "Composite", - className: "VMSizeProperties", - }, - }, - }, - }, -}; - -export const StorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StorageProfile", - modelProperties: { - imageReference: { - serializedName: "imageReference", - type: { - name: "Composite", - className: "ImageReference", - }, - }, - osDisk: { - serializedName: "osDisk", - type: { - name: "Composite", - className: "OSDisk", - }, - }, - dataDisks: { - serializedName: "dataDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataDisk", - }, - }, - }, - }, - diskControllerType: { - serializedName: "diskControllerType", - type: { - name: "String", - }, - }, - alignRegionalDisksToVMZone: { - serializedName: "alignRegionalDisksToVMZone", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const OSDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSDisk", - modelProperties: { - osType: { - serializedName: "osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - encryptionSettings: { - serializedName: "encryptionSettings", - type: { - name: "Composite", - className: "DiskEncryptionSettings", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - vhd: { - serializedName: "vhd", - type: { - name: "Composite", - className: "VirtualHardDisk", - }, - }, - image: { - serializedName: "image", - type: { - name: "Composite", - className: "VirtualHardDisk", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - type: { - name: "Boolean", - }, - }, - diffDiskSettings: { - serializedName: "diffDiskSettings", - type: { - name: "Composite", - className: "DiffDiskSettings", - }, - }, - createOption: { - serializedName: "createOption", - required: true, - type: { - name: "String", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "ManagedDiskParameters", - }, - }, - deleteOption: { - serializedName: "deleteOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskEncryptionSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSettings", - modelProperties: { - diskEncryptionKey: { - serializedName: "diskEncryptionKey", - type: { - name: "Composite", - className: "KeyVaultSecretReference", - }, - }, - keyEncryptionKey: { - serializedName: "keyEncryptionKey", - type: { - name: "Composite", - className: "KeyVaultKeyReference", - }, - }, - enabled: { - serializedName: "enabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const KeyVaultKeyReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultKeyReference", - modelProperties: { - keyUrl: { - serializedName: "keyUrl", - required: true, - type: { - name: "String", - }, - }, - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, -}; - -export const DataDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataDisk", - modelProperties: { - lun: { - serializedName: "lun", - required: true, - type: { - name: "Number", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - vhd: { - serializedName: "vhd", - type: { - name: "Composite", - className: "VirtualHardDisk", - }, - }, - image: { - serializedName: "image", - type: { - name: "Composite", - className: "VirtualHardDisk", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - type: { - name: "Boolean", - }, - }, - createOption: { - serializedName: "createOption", - required: true, - type: { - name: "String", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "ManagedDiskParameters", - }, - }, - sourceResource: { - serializedName: "sourceResource", - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - toBeDetached: { - serializedName: "toBeDetached", - type: { - name: "Boolean", - }, - }, - diskIopsReadWrite: { - serializedName: "diskIOPSReadWrite", - type: { - name: "Number", - }, - }, - diskMBpsReadWrite: { - serializedName: "diskMBpsReadWrite", - type: { - name: "Number", - }, - }, - detachOption: { - serializedName: "detachOption", - type: { - name: "String", - }, - }, - deleteOption: { - serializedName: "deleteOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OSProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSProfile", - modelProperties: { - computerName: { - serializedName: "computerName", - type: { - name: "String", - }, - }, - adminUsername: { - serializedName: "adminUsername", - type: { - name: "String", - }, - }, - adminPassword: { - serializedName: "adminPassword", - type: { - name: "String", - }, - }, - customData: { - serializedName: "customData", - type: { - name: "String", - }, - }, - windowsConfiguration: { - serializedName: "windowsConfiguration", - type: { - name: "Composite", - className: "WindowsConfiguration", - }, - }, - linuxConfiguration: { - serializedName: "linuxConfiguration", - type: { - name: "Composite", - className: "LinuxConfiguration", - }, - }, - secrets: { - serializedName: "secrets", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VaultSecretGroup", - }, - }, - }, - }, - allowExtensionOperations: { - serializedName: "allowExtensionOperations", - type: { - name: "Boolean", - }, - }, - requireGuestProvisionSignal: { - serializedName: "requireGuestProvisionSignal", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const NetworkProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkProfile", - modelProperties: { - networkInterfaces: { - serializedName: "networkInterfaces", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NetworkInterfaceReference", - }, - }, - }, - }, - networkApiVersion: { - serializedName: "networkApiVersion", - type: { - name: "String", - }, - }, - networkInterfaceConfigurations: { - serializedName: "networkInterfaceConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineNetworkInterfaceConfiguration", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineNetworkInterfaceConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineNetworkInterfaceConfiguration", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - primary: { - serializedName: "properties.primary", - type: { - name: "Boolean", - }, - }, - deleteOption: { - serializedName: "properties.deleteOption", - type: { - name: "String", - }, - }, - enableAcceleratedNetworking: { - serializedName: "properties.enableAcceleratedNetworking", - type: { - name: "Boolean", - }, - }, - disableTcpStateTracking: { - serializedName: "properties.disableTcpStateTracking", - type: { - name: "Boolean", - }, - }, - enableFpga: { - serializedName: "properties.enableFpga", - type: { - name: "Boolean", - }, - }, - enableIPForwarding: { - serializedName: "properties.enableIPForwarding", - type: { - name: "Boolean", - }, - }, - networkSecurityGroup: { - serializedName: "properties.networkSecurityGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - dnsSettings: { - serializedName: "properties.dnsSettings", - type: { - name: "Composite", - className: "VirtualMachineNetworkInterfaceDnsSettingsConfiguration", - }, - }, - ipConfigurations: { - serializedName: "properties.ipConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineNetworkInterfaceIPConfiguration", - }, - }, - }, - }, - dscpConfiguration: { - serializedName: "properties.dscpConfiguration", - type: { - name: "Composite", - className: "SubResource", - }, - }, - auxiliaryMode: { - serializedName: "properties.auxiliaryMode", - type: { - name: "String", - }, - }, - auxiliarySku: { - serializedName: "properties.auxiliarySku", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineNetworkInterfaceDnsSettingsConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineNetworkInterfaceDnsSettingsConfiguration", - modelProperties: { - dnsServers: { - serializedName: "dnsServers", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineNetworkInterfaceIPConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineNetworkInterfaceIPConfiguration", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - subnet: { - serializedName: "properties.subnet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - primary: { - serializedName: "properties.primary", - type: { - name: "Boolean", - }, - }, - publicIPAddressConfiguration: { - serializedName: "properties.publicIPAddressConfiguration", - type: { - name: "Composite", - className: "VirtualMachinePublicIPAddressConfiguration", - }, - }, - privateIPAddressVersion: { - serializedName: "properties.privateIPAddressVersion", - type: { - name: "String", - }, - }, - applicationSecurityGroups: { - serializedName: "properties.applicationSecurityGroups", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - applicationGatewayBackendAddressPools: { - serializedName: "properties.applicationGatewayBackendAddressPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - loadBalancerBackendAddressPools: { - serializedName: "properties.loadBalancerBackendAddressPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachinePublicIPAddressConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinePublicIPAddressConfiguration", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "PublicIPAddressSku", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - idleTimeoutInMinutes: { - serializedName: "properties.idleTimeoutInMinutes", - type: { - name: "Number", - }, - }, - deleteOption: { - serializedName: "properties.deleteOption", - type: { - name: "String", - }, - }, - dnsSettings: { - serializedName: "properties.dnsSettings", - type: { - name: "Composite", - className: "VirtualMachinePublicIPAddressDnsSettingsConfiguration", - }, - }, - ipTags: { - serializedName: "properties.ipTags", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineIpTag", - }, - }, - }, - }, - publicIPPrefix: { - serializedName: "properties.publicIPPrefix", - type: { - name: "Composite", - className: "SubResource", - }, - }, - publicIPAddressVersion: { - serializedName: "properties.publicIPAddressVersion", - type: { - name: "String", - }, - }, - publicIPAllocationMethod: { - serializedName: "properties.publicIPAllocationMethod", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachinePublicIPAddressDnsSettingsConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinePublicIPAddressDnsSettingsConfiguration", - modelProperties: { - domainNameLabel: { - serializedName: "domainNameLabel", - required: true, - type: { - name: "String", - }, - }, - domainNameLabelScope: { - serializedName: "domainNameLabelScope", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineIpTag: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineIpTag", - modelProperties: { - ipTagType: { - serializedName: "ipTagType", - type: { - name: "String", - }, - }, - tag: { - serializedName: "tag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstanceView", - modelProperties: { - platformUpdateDomain: { - serializedName: "platformUpdateDomain", - type: { - name: "Number", - }, - }, - platformFaultDomain: { - serializedName: "platformFaultDomain", - type: { - name: "Number", - }, - }, - computerName: { - serializedName: "computerName", - type: { - name: "String", - }, - }, - osName: { - serializedName: "osName", - type: { - name: "String", - }, - }, - osVersion: { - serializedName: "osVersion", - type: { - name: "String", - }, - }, - hyperVGeneration: { - serializedName: "hyperVGeneration", - type: { - name: "String", - }, - }, - rdpThumbPrint: { - serializedName: "rdpThumbPrint", - type: { - name: "String", - }, - }, - vmAgent: { - serializedName: "vmAgent", - type: { - name: "Composite", - className: "VirtualMachineAgentInstanceView", - }, - }, - maintenanceRedeployStatus: { - serializedName: "maintenanceRedeployStatus", - type: { - name: "Composite", - className: "MaintenanceRedeployStatus", - }, - }, - disks: { - serializedName: "disks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiskInstanceView", - }, - }, - }, - }, - extensions: { - serializedName: "extensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtensionInstanceView", - }, - }, - }, - }, - vmHealth: { - serializedName: "vmHealth", - type: { - name: "Composite", - className: "VirtualMachineHealthStatus", - }, - }, - bootDiagnostics: { - serializedName: "bootDiagnostics", - type: { - name: "Composite", - className: "BootDiagnosticsInstanceView", - }, - }, - assignedHost: { - serializedName: "assignedHost", - readOnly: true, - type: { - name: "String", - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - patchStatus: { - serializedName: "patchStatus", - type: { - name: "Composite", - className: "VirtualMachinePatchStatus", - }, - }, - isVMInStandbyPool: { - serializedName: "isVMInStandbyPool", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VirtualMachineAgentInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineAgentInstanceView", - modelProperties: { - vmAgentVersion: { - serializedName: "vmAgentVersion", - type: { - name: "String", - }, - }, - extensionHandlers: { - serializedName: "extensionHandlers", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtensionHandlerInstanceView", - }, - }, - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionHandlerInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionHandlerInstanceView", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "typeHandlerVersion", - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, -}; - -export const MaintenanceRedeployStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MaintenanceRedeployStatus", - modelProperties: { - isCustomerInitiatedMaintenanceAllowed: { - serializedName: "isCustomerInitiatedMaintenanceAllowed", - type: { - name: "Boolean", - }, - }, - preMaintenanceWindowStartTime: { - serializedName: "preMaintenanceWindowStartTime", - type: { - name: "DateTime", - }, - }, - preMaintenanceWindowEndTime: { - serializedName: "preMaintenanceWindowEndTime", - type: { - name: "DateTime", - }, - }, - maintenanceWindowStartTime: { - serializedName: "maintenanceWindowStartTime", - type: { - name: "DateTime", - }, - }, - maintenanceWindowEndTime: { - serializedName: "maintenanceWindowEndTime", - type: { - name: "DateTime", - }, - }, - lastOperationResultCode: { - serializedName: "lastOperationResultCode", - type: { - name: "Enum", - allowedValues: ["None", "RetryLater", "MaintenanceAborted", "MaintenanceCompleted"], - }, - }, - lastOperationMessage: { - serializedName: "lastOperationMessage", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskInstanceView", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - encryptionSettings: { - serializedName: "encryptionSettings", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiskEncryptionSettings", - }, - }, - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionInstanceView", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "typeHandlerVersion", - type: { - name: "String", - }, - }, - substatuses: { - serializedName: "substatuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineHealthStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineHealthStatus", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, -}; - -export const BootDiagnosticsInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BootDiagnosticsInstanceView", - modelProperties: { - consoleScreenshotBlobUri: { - serializedName: "consoleScreenshotBlobUri", - readOnly: true, - type: { - name: "String", - }, - }, - serialConsoleLogBlobUri: { - serializedName: "serialConsoleLogBlobUri", - readOnly: true, - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, -}; - -export const VirtualMachinePatchStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinePatchStatus", - modelProperties: { - availablePatchSummary: { - serializedName: "availablePatchSummary", - type: { - name: "Composite", - className: "AvailablePatchSummary", - }, - }, - lastPatchInstallationSummary: { - serializedName: "lastPatchInstallationSummary", - type: { - name: "Composite", - className: "LastPatchInstallationSummary", - }, - }, - configurationStatuses: { - serializedName: "configurationStatuses", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const AvailablePatchSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailablePatchSummary", - modelProperties: { - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String", - }, - }, - assessmentActivityId: { - serializedName: "assessmentActivityId", - readOnly: true, - type: { - name: "String", - }, - }, - rebootPending: { - serializedName: "rebootPending", - readOnly: true, - type: { - name: "Boolean", - }, - }, - criticalAndSecurityPatchCount: { - serializedName: "criticalAndSecurityPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - otherPatchCount: { - serializedName: "otherPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - startTime: { - serializedName: "startTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - lastModifiedTime: { - serializedName: "lastModifiedTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ApiError", - }, - }, - }, - }, -}; - -export const LastPatchInstallationSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LastPatchInstallationSummary", - modelProperties: { - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String", - }, - }, - installationActivityId: { - serializedName: "installationActivityId", - readOnly: true, - type: { - name: "String", - }, - }, - maintenanceWindowExceeded: { - serializedName: "maintenanceWindowExceeded", - readOnly: true, - type: { - name: "Boolean", - }, - }, - notSelectedPatchCount: { - serializedName: "notSelectedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - excludedPatchCount: { - serializedName: "excludedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - pendingPatchCount: { - serializedName: "pendingPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - installedPatchCount: { - serializedName: "installedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - failedPatchCount: { - serializedName: "failedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - startTime: { - serializedName: "startTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - lastModifiedTime: { - serializedName: "lastModifiedTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ApiError", - }, - }, - }, - }, -}; - -export const VirtualMachineIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineSizeListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineSizeListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineSize", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineSize: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineSize", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - numberOfCores: { - serializedName: "numberOfCores", - type: { - name: "Number", - }, - }, - osDiskSizeInMB: { - serializedName: "osDiskSizeInMB", - type: { - name: "Number", - }, - }, - resourceDiskSizeInMB: { - serializedName: "resourceDiskSizeInMB", - type: { - name: "Number", - }, - }, - memoryInMB: { - serializedName: "memoryInMB", - type: { - name: "Number", - }, - }, - maxDataDiskCount: { - serializedName: "maxDataDiskCount", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ProximityPlacementGroupListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProximityPlacementGroupListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProximityPlacementGroup", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProximityPlacementGroupPropertiesIntent: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProximityPlacementGroupPropertiesIntent", - modelProperties: { - vmSizes: { - serializedName: "vmSizes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const RestorePointCollectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointCollectionListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorePointCollection", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RestorePointCollectionSourceProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointCollectionSourceProperties", - modelProperties: { - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RestorePointSourceMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointSourceMetadata", - modelProperties: { - hardwareProfile: { - serializedName: "hardwareProfile", - type: { - name: "Composite", - className: "HardwareProfile", - }, - }, - storageProfile: { - serializedName: "storageProfile", - type: { - name: "Composite", - className: "RestorePointSourceVMStorageProfile", - }, - }, - osProfile: { - serializedName: "osProfile", - type: { - name: "Composite", - className: "OSProfile", - }, - }, - diagnosticsProfile: { - serializedName: "diagnosticsProfile", - type: { - name: "Composite", - className: "DiagnosticsProfile", - }, - }, - licenseType: { - serializedName: "licenseType", - readOnly: true, - type: { - name: "String", - }, - }, - vmId: { - serializedName: "vmId", - readOnly: true, - type: { - name: "String", - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "SecurityProfile", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - userData: { - serializedName: "userData", - readOnly: true, - type: { - name: "String", - }, - }, - hyperVGeneration: { - serializedName: "hyperVGeneration", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RestorePointSourceVMStorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointSourceVMStorageProfile", - modelProperties: { - osDisk: { - serializedName: "osDisk", - type: { - name: "Composite", - className: "RestorePointSourceVmosDisk", - }, - }, - dataDisks: { - serializedName: "dataDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorePointSourceVMDataDisk", - }, - }, - }, - }, - diskControllerType: { - serializedName: "diskControllerType", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RestorePointSourceVmosDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointSourceVmosDisk", - modelProperties: { - osType: { - serializedName: "osType", - readOnly: true, - type: { - name: "String", - }, - }, - encryptionSettings: { - serializedName: "encryptionSettings", - type: { - name: "Composite", - className: "DiskEncryptionSettings", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - caching: { - serializedName: "caching", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - readOnly: true, - type: { - name: "Number", - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "ManagedDiskParameters", - }, - }, - diskRestorePoint: { - serializedName: "diskRestorePoint", - type: { - name: "Composite", - className: "DiskRestorePointAttributes", - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const RestorePointEncryption: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointEncryption", - modelProperties: { - diskEncryptionSet: { - serializedName: "diskEncryptionSet", - type: { - name: "Composite", - className: "DiskEncryptionSetParameters", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RestorePointSourceVMDataDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointSourceVMDataDisk", - modelProperties: { - lun: { - serializedName: "lun", - readOnly: true, - type: { - name: "Number", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - caching: { - serializedName: "caching", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - readOnly: true, - type: { - name: "Number", - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "ManagedDiskParameters", - }, - }, - diskRestorePoint: { - serializedName: "diskRestorePoint", - type: { - name: "Composite", - className: "DiskRestorePointAttributes", - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const RestorePointInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointInstanceView", - modelProperties: { - diskRestorePoints: { - serializedName: "diskRestorePoints", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiskRestorePointInstanceView", - }, - }, - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const DiskRestorePointInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskRestorePointInstanceView", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - snapshotAccessState: { - serializedName: "snapshotAccessState", - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "replicationStatus", - type: { - name: "Composite", - className: "DiskRestorePointReplicationStatus", - }, - }, - }, - }, -}; - -export const DiskRestorePointReplicationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskRestorePointReplicationStatus", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - completionPercent: { - serializedName: "completionPercent", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SshPublicKeysGroupListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SshPublicKeysGroupListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SshPublicKeyResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetListWithLinkResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetListWithLinkResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSet", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpdateResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpdateResource", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const ConvertToVirtualMachineScaleSetInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ConvertToVirtualMachineScaleSetInput", - modelProperties: { - virtualMachineScaleSetName: { - serializedName: "virtualMachineScaleSetName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const MigrateToVirtualMachineScaleSetInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MigrateToVirtualMachineScaleSetInput", - modelProperties: { - virtualMachineScaleSetFlexible: { - serializedName: "virtualMachineScaleSetFlexible", - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, -}; - -export const CapacityReservationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CapacityReservation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ScheduleProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduleProfile", - modelProperties: { - start: { - serializedName: "start", - type: { - name: "String", - }, - }, - end: { - serializedName: "end", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DedicatedHostListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DedicatedHost", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DedicatedHostSizeListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostSizeListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SshGenerateKeyPairInputParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SshGenerateKeyPairInputParameters", - modelProperties: { - encryptionType: { - serializedName: "encryptionType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SshPublicKeyGenerateKeyPairResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SshPublicKeyGenerateKeyPairResult", - modelProperties: { - privateKey: { - serializedName: "privateKey", - required: true, - type: { - name: "String", - }, - }, - publicKey: { - serializedName: "publicKey", - required: true, - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdateVMProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateVMProfile", - modelProperties: { - osProfile: { - serializedName: "osProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateOSProfile", - }, - }, - storageProfile: { - serializedName: "storageProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateStorageProfile", - }, - }, - networkProfile: { - serializedName: "networkProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateNetworkProfile", - }, - }, - securityPostureReference: { - serializedName: "securityPostureReference", - type: { - name: "Composite", - className: "SecurityPostureReferenceUpdate", - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "SecurityProfile", - }, - }, - diagnosticsProfile: { - serializedName: "diagnosticsProfile", - type: { - name: "Composite", - className: "DiagnosticsProfile", - }, - }, - extensionProfile: { - serializedName: "extensionProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionProfile", - }, - }, - licenseType: { - serializedName: "licenseType", - type: { - name: "String", - }, - }, - billingProfile: { - serializedName: "billingProfile", - type: { - name: "Composite", - className: "BillingProfile", - }, - }, - scheduledEventsProfile: { - serializedName: "scheduledEventsProfile", - type: { - name: "Composite", - className: "ScheduledEventsProfile", - }, - }, - userData: { - serializedName: "userData", - type: { - name: "String", - }, - }, - hardwareProfile: { - serializedName: "hardwareProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetHardwareProfile", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdateOSProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateOSProfile", - modelProperties: { - customData: { - serializedName: "customData", - type: { - name: "String", - }, - }, - windowsConfiguration: { - serializedName: "windowsConfiguration", - type: { - name: "Composite", - className: "WindowsConfiguration", - }, - }, - linuxConfiguration: { - serializedName: "linuxConfiguration", - type: { - name: "Composite", - className: "LinuxConfiguration", - }, - }, - secrets: { - serializedName: "secrets", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VaultSecretGroup", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdateStorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateStorageProfile", - modelProperties: { - imageReference: { - serializedName: "imageReference", - type: { - name: "Composite", - className: "ImageReference", - }, - }, - osDisk: { - serializedName: "osDisk", - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateOSDisk", - }, - }, - dataDisks: { - serializedName: "dataDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetDataDisk", - }, - }, - }, - }, - diskControllerType: { - serializedName: "diskControllerType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdateOSDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateOSDisk", - modelProperties: { - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - type: { - name: "Boolean", - }, - }, - diffDiskSettings: { - serializedName: "diffDiskSettings", - type: { - name: "Composite", - className: "DiffDiskSettings", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - image: { - serializedName: "image", - type: { - name: "Composite", - className: "VirtualHardDisk", - }, - }, - vhdContainers: { - serializedName: "vhdContainers", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "VirtualMachineScaleSetManagedDiskParameters", - }, - }, - deleteOption: { - serializedName: "deleteOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdateNetworkProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateNetworkProfile", - modelProperties: { - healthProbe: { - serializedName: "healthProbe", - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - networkInterfaceConfigurations: { - serializedName: "networkInterfaceConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateNetworkConfiguration", - }, - }, - }, - }, - networkApiVersion: { - serializedName: "networkApiVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdateNetworkConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateNetworkConfiguration", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - primary: { - serializedName: "properties.primary", - type: { - name: "Boolean", - }, - }, - enableAcceleratedNetworking: { - serializedName: "properties.enableAcceleratedNetworking", - type: { - name: "Boolean", - }, - }, - disableTcpStateTracking: { - serializedName: "properties.disableTcpStateTracking", - type: { - name: "Boolean", - }, - }, - enableFpga: { - serializedName: "properties.enableFpga", - type: { - name: "Boolean", - }, - }, - networkSecurityGroup: { - serializedName: "properties.networkSecurityGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - dnsSettings: { - serializedName: "properties.dnsSettings", - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkConfigurationDnsSettings", - }, - }, - ipConfigurations: { - serializedName: "properties.ipConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateIPConfiguration", - }, - }, - }, - }, - enableIPForwarding: { - serializedName: "properties.enableIPForwarding", - type: { - name: "Boolean", - }, - }, - deleteOption: { - serializedName: "properties.deleteOption", - type: { - name: "String", - }, - }, - auxiliaryMode: { - serializedName: "properties.auxiliaryMode", - type: { - name: "String", - }, - }, - auxiliarySku: { - serializedName: "properties.auxiliarySku", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdateIPConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateIPConfiguration", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - subnet: { - serializedName: "properties.subnet", - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - primary: { - serializedName: "properties.primary", - type: { - name: "Boolean", - }, - }, - publicIPAddressConfiguration: { - serializedName: "properties.publicIPAddressConfiguration", - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdatePublicIPAddressConfiguration", - }, - }, - privateIPAddressVersion: { - serializedName: "properties.privateIPAddressVersion", - type: { - name: "String", - }, - }, - applicationGatewayBackendAddressPools: { - serializedName: "properties.applicationGatewayBackendAddressPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - applicationSecurityGroups: { - serializedName: "properties.applicationSecurityGroups", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - loadBalancerBackendAddressPools: { - serializedName: "properties.loadBalancerBackendAddressPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - loadBalancerInboundNatPools: { - serializedName: "properties.loadBalancerInboundNatPools", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdatePublicIPAddressConfiguration: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdatePublicIPAddressConfiguration", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - idleTimeoutInMinutes: { - serializedName: "properties.idleTimeoutInMinutes", - type: { - name: "Number", - }, - }, - dnsSettings: { - serializedName: "properties.dnsSettings", - type: { - name: "Composite", - className: "VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings", - }, - }, - publicIPPrefix: { - serializedName: "properties.publicIPPrefix", - type: { - name: "Composite", - className: "SubResource", - }, - }, - deleteOption: { - serializedName: "properties.deleteOption", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const SecurityPostureReferenceUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SecurityPostureReferenceUpdate", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - excludeExtensions: { - serializedName: "excludeExtensions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - isOverridable: { - serializedName: "isOverridable", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMInstanceIDs: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMInstanceIDs", - modelProperties: { - instanceIds: { - serializedName: "instanceIds", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VMScaleSetConvertToSinglePlacementGroupInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMScaleSetConvertToSinglePlacementGroupInput", - modelProperties: { - activePlacementGroupId: { - serializedName: "activePlacementGroupId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMInstanceRequiredIDs: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMInstanceRequiredIDs", - modelProperties: { - instanceIds: { - serializedName: "instanceIds", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetExtensionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtension", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RecoveryWalkResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RecoveryWalkResponse", - modelProperties: { - walkPerformed: { - serializedName: "walkPerformed", - readOnly: true, - type: { - name: "Boolean", - }, - }, - nextPlatformUpdateDomain: { - serializedName: "nextPlatformUpdateDomain", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetInstanceView", - modelProperties: { - virtualMachine: { - serializedName: "virtualMachine", - type: { - name: "Composite", - className: "VirtualMachineScaleSetInstanceViewStatusesSummary", - }, - }, - extensions: { - serializedName: "extensions", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtensionsSummary", - }, - }, - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - orchestrationServices: { - serializedName: "orchestrationServices", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OrchestrationServiceSummary", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetInstanceViewStatusesSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetInstanceViewStatusesSummary", - modelProperties: { - statusesSummary: { - serializedName: "statusesSummary", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineStatusCodeCount", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineStatusCodeCount: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineStatusCodeCount", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - count: { - serializedName: "count", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMExtensionsSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtensionsSummary", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - statusesSummary: { - serializedName: "statusesSummary", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineStatusCodeCount", - }, - }, - }, - }, - }, - }, -}; - -export const OrchestrationServiceSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OrchestrationServiceSummary", - modelProperties: { - serviceName: { - serializedName: "serviceName", - readOnly: true, - type: { - name: "String", - }, - }, - serviceState: { - serializedName: "serviceState", - readOnly: true, - type: { - name: "String", - }, - }, - latestOperationStatus: { - serializedName: "latestOperationStatus", - readOnly: true, - type: { - name: "String", - }, - }, - lastStatusChangeTime: { - serializedName: "lastStatusChangeTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetListOSUpgradeHistory: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetListOSUpgradeHistory", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UpgradeOperationHistoricalStatusInfo", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpgradeOperationHistoricalStatusInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpgradeOperationHistoricalStatusInfo", - modelProperties: { - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "UpgradeOperationHistoricalStatusInfoProperties", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpgradeOperationHistoricalStatusInfoProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpgradeOperationHistoricalStatusInfoProperties", - modelProperties: { - runningStatus: { - serializedName: "runningStatus", - type: { - name: "Composite", - className: "UpgradeOperationHistoryStatus", - }, - }, - progress: { - serializedName: "progress", - type: { - name: "Composite", - className: "RollingUpgradeProgressInfo", - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ApiError", - }, - }, - startedBy: { - serializedName: "startedBy", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Unknown", "User", "Platform"], - }, - }, - targetImageReference: { - serializedName: "targetImageReference", - type: { - name: "Composite", - className: "ImageReference", - }, - }, - rollbackInfo: { - serializedName: "rollbackInfo", - type: { - name: "Composite", - className: "RollbackStatusInfo", - }, - }, - }, - }, -}; - -export const UpgradeOperationHistoryStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpgradeOperationHistoryStatus", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["RollingForward", "Cancelled", "Completed", "Faulted"], - }, - }, - startTime: { - serializedName: "startTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - endTime: { - serializedName: "endTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const RollingUpgradeProgressInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RollingUpgradeProgressInfo", - modelProperties: { - successfulInstanceCount: { - serializedName: "successfulInstanceCount", - readOnly: true, - type: { - name: "Number", - }, - }, - failedInstanceCount: { - serializedName: "failedInstanceCount", - readOnly: true, - type: { - name: "Number", - }, - }, - inProgressInstanceCount: { - serializedName: "inProgressInstanceCount", - readOnly: true, - type: { - name: "Number", - }, - }, - pendingInstanceCount: { - serializedName: "pendingInstanceCount", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const RollbackStatusInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RollbackStatusInfo", - modelProperties: { - successfullyRolledbackInstanceCount: { - serializedName: "successfullyRolledbackInstanceCount", - readOnly: true, - type: { - name: "Number", - }, - }, - failedRolledbackInstanceCount: { - serializedName: "failedRolledbackInstanceCount", - readOnly: true, - type: { - name: "Number", - }, - }, - rollbackError: { - serializedName: "rollbackError", - type: { - name: "Composite", - className: "ApiError", - }, - }, - }, - }, -}; - -export const VirtualMachineReimageParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineReimageParameters", - modelProperties: { - tempDisk: { - serializedName: "tempDisk", - type: { - name: "Boolean", - }, - }, - exactVersion: { - serializedName: "exactVersion", - type: { - name: "String", - }, - }, - osProfile: { - serializedName: "osProfile", - type: { - name: "Composite", - className: "OSProfileProvisioningData", - }, - }, - }, - }, -}; - -export const OSProfileProvisioningData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSProfileProvisioningData", - modelProperties: { - adminPassword: { - serializedName: "adminPassword", - type: { - name: "String", - }, - }, - customData: { - serializedName: "customData", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RollingUpgradeRunningStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RollingUpgradeRunningStatus", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["RollingForward", "Cancelled", "Completed", "Faulted"], - }, - }, - startTime: { - serializedName: "startTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - lastAction: { - serializedName: "lastAction", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Start", "Cancel"], - }, - }, - lastActionTime: { - serializedName: "lastActionTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const VMScaleSetScaleOutInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMScaleSetScaleOutInput", - modelProperties: { - capacity: { - serializedName: "capacity", - required: true, - type: { - name: "Number", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "VMScaleSetScaleOutInputProperties", - }, - }, - }, - }, -}; - -export const VMScaleSetScaleOutInputProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMScaleSetScaleOutInputProperties", - modelProperties: { - zone: { - serializedName: "zone", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OrchestrationServiceStateInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OrchestrationServiceStateInput", - modelProperties: { - serviceName: { - serializedName: "serviceName", - required: true, - type: { - name: "String", - }, - }, - action: { - serializedName: "action", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetListSkusResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetListSkusResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetSku", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetSku", - modelProperties: { - resourceType: { - serializedName: "resourceType", - readOnly: true, - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - capacity: { - serializedName: "capacity", - type: { - name: "Composite", - className: "VirtualMachineScaleSetSkuCapacity", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetSkuCapacity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetSkuCapacity", - modelProperties: { - minimum: { - serializedName: "minimum", - readOnly: true, - type: { - name: "Number", - }, - }, - maximum: { - serializedName: "maximum", - readOnly: true, - type: { - name: "Number", - }, - }, - defaultCapacity: { - serializedName: "defaultCapacity", - readOnly: true, - type: { - name: "Number", - }, - }, - scaleType: { - serializedName: "scaleType", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Automatic", "None"], - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVM", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMInstanceView", - modelProperties: { - platformUpdateDomain: { - serializedName: "platformUpdateDomain", - type: { - name: "Number", - }, - }, - platformFaultDomain: { - serializedName: "platformFaultDomain", - type: { - name: "Number", - }, - }, - rdpThumbPrint: { - serializedName: "rdpThumbPrint", - type: { - name: "String", - }, - }, - vmAgent: { - serializedName: "vmAgent", - type: { - name: "Composite", - className: "VirtualMachineAgentInstanceView", - }, - }, - maintenanceRedeployStatus: { - serializedName: "maintenanceRedeployStatus", - type: { - name: "Composite", - className: "MaintenanceRedeployStatus", - }, - }, - disks: { - serializedName: "disks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiskInstanceView", - }, - }, - }, - }, - extensions: { - serializedName: "extensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtensionInstanceView", - }, - }, - }, - }, - vmHealth: { - serializedName: "vmHealth", - type: { - name: "Composite", - className: "VirtualMachineHealthStatus", - }, - }, - bootDiagnostics: { - serializedName: "bootDiagnostics", - type: { - name: "Composite", - className: "BootDiagnosticsInstanceView", - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - assignedHost: { - serializedName: "assignedHost", - readOnly: true, - type: { - name: "String", - }, - }, - placementGroupId: { - serializedName: "placementGroupId", - type: { - name: "String", - }, - }, - computerName: { - serializedName: "computerName", - type: { - name: "String", - }, - }, - osName: { - serializedName: "osName", - type: { - name: "String", - }, - }, - osVersion: { - serializedName: "osVersion", - type: { - name: "String", - }, - }, - hyperVGeneration: { - serializedName: "hyperVGeneration", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMNetworkProfileConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMNetworkProfileConfiguration", - modelProperties: { - networkInterfaceConfigurations: { - serializedName: "networkInterfaceConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetNetworkConfiguration", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMProtectionPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMProtectionPolicy", - modelProperties: { - protectFromScaleIn: { - serializedName: "protectFromScaleIn", - type: { - name: "Boolean", - }, - }, - protectFromScaleSetActions: { - serializedName: "protectFromScaleSetActions", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const AttachDetachDataDisksRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AttachDetachDataDisksRequest", - modelProperties: { - dataDisksToAttach: { - constraints: { - MinItems: 1, - }, - serializedName: "dataDisksToAttach", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataDisksToAttach", - }, - }, - }, - }, - dataDisksToDetach: { - constraints: { - MinItems: 1, - }, - serializedName: "dataDisksToDetach", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataDisksToDetach", - }, - }, - }, - }, - }, - }, -}; - -export const DataDisksToAttach: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataDisksToAttach", - modelProperties: { - diskId: { - serializedName: "diskId", - required: true, - type: { - name: "String", - }, - }, - lun: { - serializedName: "lun", - type: { - name: "Number", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - deleteOption: { - serializedName: "deleteOption", - type: { - name: "String", - }, - }, - diskEncryptionSet: { - serializedName: "diskEncryptionSet", - type: { - name: "Composite", - className: "DiskEncryptionSetParameters", - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const DataDisksToDetach: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataDisksToDetach", - modelProperties: { - diskId: { - serializedName: "diskId", - required: true, - type: { - name: "String", - }, - }, - detachOption: { - serializedName: "detachOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMExtensionsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtensionsListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtension", - }, - }, - }, - }, - }, - }, -}; - -export const RetrieveBootDiagnosticsDataResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RetrieveBootDiagnosticsDataResult", - modelProperties: { - consoleScreenshotBlobUri: { - serializedName: "consoleScreenshotBlobUri", - readOnly: true, - type: { - name: "String", - }, - }, - serialConsoleLogBlobUri: { - serializedName: "serialConsoleLogBlobUri", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RunCommandInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandInput", - modelProperties: { - commandId: { - serializedName: "commandId", - required: true, - type: { - name: "String", - }, - }, - script: { - serializedName: "script", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - parameters: { - serializedName: "parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RunCommandInputParameter", - }, - }, - }, - }, - }, - }, -}; - -export const RunCommandInputParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandInputParameter", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RunCommandResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommandsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommandsListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineRunCommand", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommandScriptSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommandScriptSource", - modelProperties: { - script: { - serializedName: "script", - type: { - name: "String", - }, - }, - scriptUri: { - serializedName: "scriptUri", - type: { - name: "String", - }, - }, - commandId: { - serializedName: "commandId", - type: { - name: "String", - }, - }, - scriptUriManagedIdentity: { - serializedName: "scriptUriManagedIdentity", - type: { - name: "Composite", - className: "RunCommandManagedIdentity", - }, - }, - scriptShell: { - serializedName: "scriptShell", - type: { - name: "String", - }, - }, - galleryScriptReferenceId: { - serializedName: "galleryScriptReferenceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RunCommandManagedIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandManagedIdentity", - modelProperties: { - clientId: { - serializedName: "clientId", - type: { - name: "String", - }, - }, - objectId: { - serializedName: "objectId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommandInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommandInstanceView", - modelProperties: { - executionState: { - serializedName: "executionState", - type: { - name: "String", - }, - }, - executionMessage: { - serializedName: "executionMessage", - type: { - name: "String", - }, - }, - exitCode: { - serializedName: "exitCode", - type: { - name: "Number", - }, - }, - output: { - serializedName: "output", - type: { - name: "String", - }, - }, - error: { - serializedName: "error", - type: { - name: "String", - }, - }, - startTime: { - serializedName: "startTime", - type: { - name: "DateTime", - }, - }, - endTime: { - serializedName: "endTime", - type: { - name: "DateTime", - }, - }, - statuses: { - serializedName: "statuses", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineAssessPatchesResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineAssessPatchesResult", - modelProperties: { - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String", - }, - }, - assessmentActivityId: { - serializedName: "assessmentActivityId", - readOnly: true, - type: { - name: "String", - }, - }, - rebootPending: { - serializedName: "rebootPending", - readOnly: true, - type: { - name: "Boolean", - }, - }, - criticalAndSecurityPatchCount: { - serializedName: "criticalAndSecurityPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - otherPatchCount: { - serializedName: "otherPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - startDateTime: { - serializedName: "startDateTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - availablePatches: { - serializedName: "availablePatches", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineSoftwarePatchProperties", - }, - }, - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ApiError", - }, - }, - }, - }, -}; - -export const VirtualMachineSoftwarePatchProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineSoftwarePatchProperties", - modelProperties: { - patchId: { - serializedName: "patchId", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - readOnly: true, - type: { - name: "String", - }, - }, - kbId: { - serializedName: "kbId", - readOnly: true, - type: { - name: "String", - }, - }, - classifications: { - serializedName: "classifications", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - rebootBehavior: { - serializedName: "rebootBehavior", - readOnly: true, - type: { - name: "String", - }, - }, - activityId: { - serializedName: "activityId", - readOnly: true, - type: { - name: "String", - }, - }, - publishedDate: { - serializedName: "publishedDate", - readOnly: true, - type: { - name: "DateTime", - }, - }, - lastModifiedDateTime: { - serializedName: "lastModifiedDateTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - assessmentState: { - serializedName: "assessmentState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineCaptureParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineCaptureParameters", - modelProperties: { - vhdPrefix: { - serializedName: "vhdPrefix", - required: true, - type: { - name: "String", - }, - }, - destinationContainerName: { - serializedName: "destinationContainerName", - required: true, - type: { - name: "String", - }, - }, - overwriteVhds: { - serializedName: "overwriteVhds", - required: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionsListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtension", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineInstallPatchesParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstallPatchesParameters", - modelProperties: { - maximumDuration: { - serializedName: "maximumDuration", - type: { - name: "TimeSpan", - }, - }, - rebootSetting: { - serializedName: "rebootSetting", - required: true, - type: { - name: "String", - }, - }, - windowsParameters: { - serializedName: "windowsParameters", - type: { - name: "Composite", - className: "WindowsParameters", - }, - }, - linuxParameters: { - serializedName: "linuxParameters", - type: { - name: "Composite", - className: "LinuxParameters", - }, - }, - }, - }, -}; - -export const WindowsParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WindowsParameters", - modelProperties: { - classificationsToInclude: { - serializedName: "classificationsToInclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - kbNumbersToInclude: { - serializedName: "kbNumbersToInclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - kbNumbersToExclude: { - serializedName: "kbNumbersToExclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - excludeKbsRequiringReboot: { - serializedName: "excludeKbsRequiringReboot", - type: { - name: "Boolean", - }, - }, - maxPatchPublishDate: { - serializedName: "maxPatchPublishDate", - type: { - name: "DateTime", - }, - }, - patchNameMasksToInclude: { - serializedName: "patchNameMasksToInclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - patchNameMasksToExclude: { - serializedName: "patchNameMasksToExclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const LinuxParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LinuxParameters", - modelProperties: { - classificationsToInclude: { - serializedName: "classificationsToInclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - packageNameMasksToInclude: { - serializedName: "packageNameMasksToInclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - packageNameMasksToExclude: { - serializedName: "packageNameMasksToExclude", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - maintenanceRunId: { - serializedName: "maintenanceRunId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineInstallPatchesResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineInstallPatchesResult", - modelProperties: { - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String", - }, - }, - installationActivityId: { - serializedName: "installationActivityId", - readOnly: true, - type: { - name: "String", - }, - }, - rebootStatus: { - serializedName: "rebootStatus", - readOnly: true, - type: { - name: "String", - }, - }, - maintenanceWindowExceeded: { - serializedName: "maintenanceWindowExceeded", - readOnly: true, - type: { - name: "Boolean", - }, - }, - excludedPatchCount: { - serializedName: "excludedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - notSelectedPatchCount: { - serializedName: "notSelectedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - pendingPatchCount: { - serializedName: "pendingPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - installedPatchCount: { - serializedName: "installedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - failedPatchCount: { - serializedName: "failedPatchCount", - readOnly: true, - type: { - name: "Number", - }, - }, - patches: { - serializedName: "patches", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PatchInstallationDetail", - }, - }, - }, - }, - startDateTime: { - serializedName: "startDateTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ApiError", - }, - }, - }, - }, -}; - -export const PatchInstallationDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PatchInstallationDetail", - modelProperties: { - patchId: { - serializedName: "patchId", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - readOnly: true, - type: { - name: "String", - }, - }, - kbId: { - serializedName: "kbId", - readOnly: true, - type: { - name: "String", - }, - }, - classifications: { - serializedName: "classifications", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - installationState: { - serializedName: "installationState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const MigrateVMToVirtualMachineScaleSetInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MigrateVMToVirtualMachineScaleSetInput", - modelProperties: { - targetZone: { - serializedName: "targetZone", - type: { - name: "String", - }, - }, - targetFaultDomain: { - serializedName: "targetFaultDomain", - type: { - name: "Number", - }, - }, - targetVMSize: { - serializedName: "targetVMSize", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskAccessList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccessList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiskAccess", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - actionsRequired: { - serializedName: "actionsRequired", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskEncryptionSetList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSetList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiskEncryptionSet", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const KeyForDiskEncryptionSet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyForDiskEncryptionSet", - modelProperties: { - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SourceVault", - }, - }, - keyUrl: { - serializedName: "keyUrl", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SourceVault: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SourceVault", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const EncryptionSetIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionSetIdentity", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - }, - }, - }, - }, - }, - }, -}; - -export const DiskList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Disk", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskPurchasePlan: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskPurchasePlan", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - publisher: { - serializedName: "publisher", - required: true, - type: { - name: "String", - }, - }, - product: { - serializedName: "product", - required: true, - type: { - name: "String", - }, - }, - promotionCode: { - serializedName: "promotionCode", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SupportedCapabilities: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SupportedCapabilities", - modelProperties: { - diskControllerTypes: { - serializedName: "diskControllerTypes", - type: { - name: "String", - }, - }, - acceleratedNetwork: { - serializedName: "acceleratedNetwork", - type: { - name: "Boolean", - }, - }, - architecture: { - serializedName: "architecture", - type: { - name: "String", - }, - }, - supportedSecurityOption: { - serializedName: "supportedSecurityOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CreationData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CreationData", - modelProperties: { - createOption: { - serializedName: "createOption", - required: true, - type: { - name: "String", - }, - }, - storageAccountId: { - serializedName: "storageAccountId", - type: { - name: "String", - }, - }, - imageReference: { - serializedName: "imageReference", - type: { - name: "Composite", - className: "ImageDiskReference", - }, - }, - galleryImageReference: { - serializedName: "galleryImageReference", - type: { - name: "Composite", - className: "ImageDiskReference", - }, - }, - sourceUri: { - serializedName: "sourceUri", - type: { - name: "String", - }, - }, - sourceResourceId: { - serializedName: "sourceResourceId", - type: { - name: "String", - }, - }, - sourceUniqueId: { - serializedName: "sourceUniqueId", - readOnly: true, - type: { - name: "String", - }, - }, - uploadSizeBytes: { - serializedName: "uploadSizeBytes", - type: { - name: "Number", - }, - }, - logicalSectorSize: { - serializedName: "logicalSectorSize", - type: { - name: "Number", - }, - }, - securityDataUri: { - serializedName: "securityDataUri", - type: { - name: "String", - }, - }, - securityMetadataUri: { - serializedName: "securityMetadataUri", - type: { - name: "String", - }, - }, - performancePlus: { - serializedName: "performancePlus", - type: { - name: "Boolean", - }, - }, - elasticSanResourceId: { - serializedName: "elasticSanResourceId", - type: { - name: "String", - }, - }, - provisionedBandwidthCopySpeed: { - serializedName: "provisionedBandwidthCopySpeed", - type: { - name: "String", - }, - }, - instantAccessDurationMinutes: { - constraints: { - InclusiveMinimum: 1, - }, - serializedName: "instantAccessDurationMinutes", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ImageDiskReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageDiskReference", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - sharedGalleryImageId: { - serializedName: "sharedGalleryImageId", - type: { - name: "String", - }, - }, - communityGalleryImageId: { - serializedName: "communityGalleryImageId", - type: { - name: "String", - }, - }, - lun: { - serializedName: "lun", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const EncryptionSettingsCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionSettingsCollection", - modelProperties: { - enabled: { - serializedName: "enabled", - required: true, - type: { - name: "Boolean", - }, - }, - encryptionSettings: { - serializedName: "encryptionSettings", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EncryptionSettingsElement", - }, - }, - }, - }, - encryptionSettingsVersion: { - serializedName: "encryptionSettingsVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const EncryptionSettingsElement: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionSettingsElement", - modelProperties: { - diskEncryptionKey: { - serializedName: "diskEncryptionKey", - type: { - name: "Composite", - className: "KeyVaultAndSecretReference", - }, - }, - keyEncryptionKey: { - serializedName: "keyEncryptionKey", - type: { - name: "Composite", - className: "KeyVaultAndKeyReference", - }, - }, - }, - }, -}; - -export const KeyVaultAndSecretReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultAndSecretReference", - modelProperties: { - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SourceVault", - }, - }, - secretUrl: { - serializedName: "secretUrl", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const KeyVaultAndKeyReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultAndKeyReference", - modelProperties: { - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SourceVault", - }, - }, - keyUrl: { - serializedName: "keyUrl", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Encryption: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Encryption", - modelProperties: { - diskEncryptionSetId: { - serializedName: "diskEncryptionSetId", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ShareInfoElement: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ShareInfoElement", - modelProperties: { - vmUri: { - serializedName: "vmUri", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PropertyUpdatesInProgress: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PropertyUpdatesInProgress", - modelProperties: { - targetTier: { - serializedName: "targetTier", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskSecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskSecurityProfile", - modelProperties: { - securityType: { - serializedName: "securityType", - type: { - name: "String", - }, - }, - secureVMDiskEncryptionSetId: { - serializedName: "secureVMDiskEncryptionSetId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AvailabilityPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilityPolicy", - modelProperties: { - actionOnDiskDelay: { - serializedName: "actionOnDiskDelay", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskSku", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SnapshotList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Snapshot", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CopyCompletionError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CopyCompletionError", - modelProperties: { - errorCode: { - serializedName: "errorCode", - required: true, - type: { - name: "String", - }, - }, - errorMessage: { - serializedName: "errorMessage", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SnapshotSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotSku", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskAccessUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccessUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource", - }, - }, - }, - }, - }, - }, -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - groupId: { - serializedName: "properties.groupId", - readOnly: true, - type: { - name: "String", - }, - }, - requiredMembers: { - serializedName: "properties.requiredMembers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - requiredZoneNames: { - serializedName: "properties.requiredZoneNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const DiskEncryptionSetUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSetUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "EncryptionSetIdentity", - }, - }, - encryptionType: { - serializedName: "properties.encryptionType", - type: { - name: "String", - }, - }, - activeKey: { - serializedName: "properties.activeKey", - type: { - name: "Composite", - className: "KeyForDiskEncryptionSet", - }, - }, - rotationToLatestKeyVersionEnabled: { - serializedName: "properties.rotationToLatestKeyVersionEnabled", - type: { - name: "Boolean", - }, - }, - federatedClientId: { - serializedName: "properties.federatedClientId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceUriList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceUriList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "DiskSku", - }, - }, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - diskSizeGB: { - serializedName: "properties.diskSizeGB", - type: { - name: "Number", - }, - }, - encryptionSettingsCollection: { - serializedName: "properties.encryptionSettingsCollection", - type: { - name: "Composite", - className: "EncryptionSettingsCollection", - }, - }, - diskIopsReadWrite: { - serializedName: "properties.diskIOPSReadWrite", - type: { - name: "Number", - }, - }, - diskMBpsReadWrite: { - serializedName: "properties.diskMBpsReadWrite", - type: { - name: "Number", - }, - }, - diskIopsReadOnly: { - serializedName: "properties.diskIOPSReadOnly", - type: { - name: "Number", - }, - }, - diskMBpsReadOnly: { - serializedName: "properties.diskMBpsReadOnly", - type: { - name: "Number", - }, - }, - maxShares: { - serializedName: "properties.maxShares", - type: { - name: "Number", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "Encryption", - }, - }, - networkAccessPolicy: { - serializedName: "properties.networkAccessPolicy", - type: { - name: "String", - }, - }, - diskAccessId: { - serializedName: "properties.diskAccessId", - type: { - name: "String", - }, - }, - tier: { - serializedName: "properties.tier", - type: { - name: "String", - }, - }, - burstingEnabled: { - serializedName: "properties.burstingEnabled", - type: { - name: "Boolean", - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "DiskPurchasePlan", - }, - }, - supportedCapabilities: { - serializedName: "properties.supportedCapabilities", - type: { - name: "Composite", - className: "SupportedCapabilities", - }, - }, - propertyUpdatesInProgress: { - serializedName: "properties.propertyUpdatesInProgress", - type: { - name: "Composite", - className: "PropertyUpdatesInProgress", - }, - }, - supportsHibernation: { - serializedName: "properties.supportsHibernation", - type: { - name: "Boolean", - }, - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - dataAccessAuthMode: { - serializedName: "properties.dataAccessAuthMode", - type: { - name: "String", - }, - }, - optimizedForFrequentAttach: { - serializedName: "properties.optimizedForFrequentAttach", - type: { - name: "Boolean", - }, - }, - availabilityPolicy: { - serializedName: "properties.availabilityPolicy", - type: { - name: "Composite", - className: "AvailabilityPolicy", - }, - }, - }, - }, -}; - -export const GrantAccessData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GrantAccessData", - modelProperties: { - access: { - serializedName: "access", - required: true, - type: { - name: "String", - }, - }, - durationInSeconds: { - serializedName: "durationInSeconds", - required: true, - type: { - name: "Number", - }, - }, - getSecureVMGuestStateSAS: { - serializedName: "getSecureVMGuestStateSAS", - type: { - name: "Boolean", - }, - }, - fileFormat: { - serializedName: "fileFormat", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AccessUri: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessUri", - modelProperties: { - accessSAS: { - serializedName: "accessSAS", - readOnly: true, - type: { - name: "String", - }, - }, - securityDataAccessSAS: { - serializedName: "securityDataAccessSAS", - readOnly: true, - type: { - name: "String", - }, - }, - securityMetadataAccessSAS: { - serializedName: "securityMetadataAccessSAS", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskRestorePointList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskRestorePointList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DiskRestorePoint", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SnapshotUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "SnapshotSku", - }, - }, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - diskSizeGB: { - serializedName: "properties.diskSizeGB", - type: { - name: "Number", - }, - }, - encryptionSettingsCollection: { - serializedName: "properties.encryptionSettingsCollection", - type: { - name: "Composite", - className: "EncryptionSettingsCollection", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "Encryption", - }, - }, - networkAccessPolicy: { - serializedName: "properties.networkAccessPolicy", - type: { - name: "String", - }, - }, - diskAccessId: { - serializedName: "properties.diskAccessId", - type: { - name: "String", - }, - }, - supportsHibernation: { - serializedName: "properties.supportsHibernation", - type: { - name: "Boolean", - }, - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - dataAccessAuthMode: { - serializedName: "properties.dataAccessAuthMode", - type: { - name: "String", - }, - }, - supportedCapabilities: { - serializedName: "properties.supportedCapabilities", - type: { - name: "Composite", - className: "SupportedCapabilities", - }, - }, - snapshotAccessState: { - serializedName: "properties.snapshotAccessState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSkusResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkusResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSku", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSku", - modelProperties: { - resourceType: { - serializedName: "resourceType", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - readOnly: true, - type: { - name: "String", - }, - }, - size: { - serializedName: "size", - readOnly: true, - type: { - name: "String", - }, - }, - family: { - serializedName: "family", - readOnly: true, - type: { - name: "String", - }, - }, - kind: { - serializedName: "kind", - readOnly: true, - type: { - name: "String", - }, - }, - capacity: { - serializedName: "capacity", - type: { - name: "Composite", - className: "ResourceSkuCapacity", - }, - }, - locations: { - serializedName: "locations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - locationInfo: { - serializedName: "locationInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuLocationInfo", - }, - }, - }, - }, - apiVersions: { - serializedName: "apiVersions", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - costs: { - serializedName: "costs", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuCosts", - }, - }, - }, - }, - capabilities: { - serializedName: "capabilities", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuCapabilities", - }, - }, - }, - }, - restrictions: { - serializedName: "restrictions", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuRestrictions", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceSkuCapacity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuCapacity", - modelProperties: { - minimum: { - serializedName: "minimum", - readOnly: true, - type: { - name: "Number", - }, - }, - maximum: { - serializedName: "maximum", - readOnly: true, - type: { - name: "Number", - }, - }, - default: { - serializedName: "default", - readOnly: true, - type: { - name: "Number", - }, - }, - scaleType: { - serializedName: "scaleType", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Automatic", "Manual", "None"], - }, - }, - }, - }, -}; - -export const ResourceSkuLocationInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuLocationInfo", - modelProperties: { - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - zones: { - serializedName: "zones", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - zoneDetails: { - serializedName: "zoneDetails", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuZoneDetails", - }, - }, - }, - }, - extendedLocations: { - serializedName: "extendedLocations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSkuZoneDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuZoneDetails", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - capabilities: { - serializedName: "capabilities", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceSkuCapabilities", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceSkuCapabilities: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuCapabilities", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSkuCosts: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuCosts", - modelProperties: { - meterID: { - serializedName: "meterID", - readOnly: true, - type: { - name: "String", - }, - }, - quantity: { - serializedName: "quantity", - readOnly: true, - type: { - name: "Number", - }, - }, - extendedUnit: { - serializedName: "extendedUnit", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceSkuRestrictions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuRestrictions", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Location", "Zone"], - }, - }, - values: { - serializedName: "values", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - restrictionInfo: { - serializedName: "restrictionInfo", - type: { - name: "Composite", - className: "ResourceSkuRestrictionInfo", - }, - }, - reasonCode: { - serializedName: "reasonCode", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["QuotaId", "NotAvailableForSubscription"], - }, - }, - }, - }, -}; - -export const ResourceSkuRestrictionInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceSkuRestrictionInfo", - modelProperties: { - locations: { - serializedName: "locations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - zones: { - serializedName: "zones", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "any", - }, - }, - }, - }, -}; - -export const GalleryList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Gallery", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "ImageVersionSecurityProfile", - }, - }, - }, - }, -}; - -export const GalleryIdentifier: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryIdentifier", - modelProperties: { - uniqueName: { - serializedName: "uniqueName", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SharingProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharingProfile", - modelProperties: { - permissions: { - serializedName: "permissions", - type: { - name: "String", - }, - }, - groups: { - serializedName: "groups", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharingProfileGroup", - }, - }, - }, - }, - communityGalleryInfo: { - serializedName: "communityGalleryInfo", - type: { - name: "Composite", - className: "CommunityGalleryInfo", - }, - }, - }, - }, -}; - -export const SharingProfileGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharingProfileGroup", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - ids: { - serializedName: "ids", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const CommunityGalleryInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryInfo", - modelProperties: { - publisherUri: { - serializedName: "publisherUri", - type: { - name: "String", - }, - }, - publisherContact: { - serializedName: "publisherContact", - type: { - name: "String", - }, - }, - eula: { - serializedName: "eula", - type: { - name: "String", - }, - }, - publicNamePrefix: { - serializedName: "publicNamePrefix", - type: { - name: "String", - }, - }, - communityGalleryEnabled: { - serializedName: "communityGalleryEnabled", - readOnly: true, - type: { - name: "Boolean", - }, - }, - publicNames: { - serializedName: "publicNames", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const SoftDeletePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SoftDeletePolicy", - modelProperties: { - isSoftDeleteEnabled: { - serializedName: "isSoftDeleteEnabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const SharingStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharingStatus", - modelProperties: { - aggregatedState: { - serializedName: "aggregatedState", - readOnly: true, - type: { - name: "String", - }, - }, - summary: { - serializedName: "summary", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RegionalSharingStatus", - }, - }, - }, - }, - }, - }, -}; - -export const RegionalSharingStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RegionalSharingStatus", - modelProperties: { - region: { - serializedName: "region", - type: { - name: "String", - }, - }, - state: { - serializedName: "state", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { - name: "Composite", - className: "UserAssignedIdentitiesValue", - }, - }, - }, - }, - }, - }, -}; - -export const ImageVersionSecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageVersionSecurityProfile", - modelProperties: { - uefiSettings: { - serializedName: "uefiSettings", - type: { - name: "Composite", - className: "GalleryImageVersionUefiSettings", - }, - }, - }, - }, -}; - -export const GalleryImageVersionUefiSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionUefiSettings", - modelProperties: { - signatureTemplateNames: { - serializedName: "signatureTemplateNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - additionalSignatures: { - serializedName: "additionalSignatures", - type: { - name: "Composite", - className: "UefiKeySignatures", - }, - }, - }, - }, -}; - -export const UefiKeySignatures: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UefiKeySignatures", - modelProperties: { - pk: { - serializedName: "pk", - type: { - name: "Composite", - className: "UefiKey", - }, - }, - kek: { - serializedName: "kek", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UefiKey", - }, - }, - }, - }, - db: { - serializedName: "db", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UefiKey", - }, - }, - }, - }, - dbx: { - serializedName: "dbx", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UefiKey", - }, - }, - }, - }, - }, - }, -}; - -export const UefiKey: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UefiKey", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const CommunityGalleryMetadata: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryMetadata", - modelProperties: { - publisherUri: { - serializedName: "publisherUri", - type: { - name: "String", - }, - }, - publisherContact: { - serializedName: "publisherContact", - required: true, - type: { - name: "String", - }, - }, - eula: { - serializedName: "eula", - type: { - name: "String", - }, - }, - publicNames: { - serializedName: "publicNames", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - privacyStatementUri: { - serializedName: "privacyStatementUri", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PirCommunityGalleryResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PirCommunityGalleryResource", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - uniqueId: { - serializedName: "identifier.uniqueId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CommunityGalleryImageList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryImageList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CommunityGalleryImage", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CommunityGalleryImageIdentifier: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryImageIdentifier", - modelProperties: { - publisher: { - serializedName: "publisher", - type: { - name: "String", - }, - }, - offer: { - serializedName: "offer", - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RecommendedMachineConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RecommendedMachineConfiguration", - modelProperties: { - vCPUs: { - serializedName: "vCPUs", - type: { - name: "Composite", - className: "ResourceRange", - }, - }, - memory: { - serializedName: "memory", - type: { - name: "Composite", - className: "ResourceRange", - }, - }, - }, - }, -}; - -export const ResourceRange: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceRange", - modelProperties: { - min: { - serializedName: "min", - type: { - name: "Number", - }, - }, - max: { - serializedName: "max", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const Disallowed: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Disallowed", - modelProperties: { - diskTypes: { - serializedName: "diskTypes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const GalleryImageFeature: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageFeature", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - startsAtVersion: { - serializedName: "startsAtVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ImagePurchasePlan: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImagePurchasePlan", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "publisher", - type: { - name: "String", - }, - }, - product: { - serializedName: "product", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CommunityGalleryImageVersionList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryImageVersionList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CommunityGalleryImageVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SharedGalleryImageVersionStorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryImageVersionStorageProfile", - modelProperties: { - osDiskImage: { - serializedName: "osDiskImage", - type: { - name: "Composite", - className: "SharedGalleryOSDiskImage", - }, - }, - dataDiskImages: { - serializedName: "dataDiskImages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedGalleryDataDiskImage", - }, - }, - }, - }, - }, - }, -}; - -export const SharedGalleryDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryDiskImage", - modelProperties: { - diskSizeGB: { - serializedName: "diskSizeGB", - readOnly: true, - type: { - name: "Number", - }, - }, - hostCaching: { - serializedName: "hostCaching", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SharedGalleryList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedGallery", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PirResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PirResource", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SharedGalleryImageList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryImageList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedGalleryImage", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryImageIdentifier: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageIdentifier", - modelProperties: { - publisher: { - serializedName: "publisher", - required: true, - type: { - name: "String", - }, - }, - offer: { - serializedName: "offer", - required: true, - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SharedGalleryImageVersionList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryImageVersionList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharedGalleryImageVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpdateResourceDefinition: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpdateResourceDefinition", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const GalleryApplicationList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryApplication", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryApplicationCustomAction: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationCustomAction", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - script: { - serializedName: "script", - required: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - parameters: { - serializedName: "parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryApplicationCustomActionParameter", - }, - }, - }, - }, - }, - }, -}; - -export const GalleryApplicationCustomActionParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationCustomActionParameter", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - required: { - serializedName: "required", - type: { - name: "Boolean", - }, - }, - type: { - serializedName: "type", - type: { - name: "Enum", - allowedValues: ["String", "ConfigurationDataBlob", "LogOutputBlob"], - }, - }, - defaultValue: { - serializedName: "defaultValue", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryApplicationVersionList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersionList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryApplicationVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UserArtifactSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserArtifactSource", - modelProperties: { - mediaLink: { - serializedName: "mediaLink", - required: true, - type: { - name: "String", - }, - }, - defaultConfigurationLink: { - serializedName: "defaultConfigurationLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UserArtifactManage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserArtifactManage", - modelProperties: { - install: { - serializedName: "install", - required: true, - type: { - name: "String", - }, - }, - remove: { - serializedName: "remove", - required: true, - type: { - name: "String", - }, - }, - update: { - serializedName: "update", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UserArtifactSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserArtifactSettings", - modelProperties: { - packageFileName: { - serializedName: "packageFileName", - type: { - name: "String", - }, - }, - configFileName: { - serializedName: "configFileName", - type: { - name: "String", - }, - }, - scriptBehaviorAfterReboot: { - serializedName: "scriptBehaviorAfterReboot", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryArtifactPublishingProfileBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryArtifactPublishingProfileBase", - modelProperties: { - targetRegions: { - serializedName: "targetRegions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TargetRegion", - }, - }, - }, - }, - replicaCount: { - serializedName: "replicaCount", - type: { - name: "Number", - }, - }, - excludeFromLatest: { - serializedName: "excludeFromLatest", - type: { - name: "Boolean", - }, - }, - publishedDate: { - serializedName: "publishedDate", - readOnly: true, - type: { - name: "DateTime", - }, - }, - endOfLifeDate: { - serializedName: "endOfLifeDate", - type: { - name: "DateTime", - }, - }, - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - replicationMode: { - serializedName: "replicationMode", - type: { - name: "String", - }, - }, - targetExtendedLocations: { - serializedName: "targetExtendedLocations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryTargetExtendedLocation", - }, - }, - }, - }, - storageAccountStrategy: { - serializedName: "storageAccountStrategy", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const TargetRegion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TargetRegion", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - regionalReplicaCount: { - serializedName: "regionalReplicaCount", - type: { - name: "Number", - }, - }, - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - encryption: { - serializedName: "encryption", - type: { - name: "Composite", - className: "EncryptionImages", - }, - }, - excludeFromLatest: { - serializedName: "excludeFromLatest", - type: { - name: "Boolean", - }, - }, - additionalReplicaSets: { - serializedName: "additionalReplicaSets", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AdditionalReplicaSet", - }, - }, - }, - }, - }, - }, -}; - -export const EncryptionImages: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionImages", - modelProperties: { - osDiskImage: { - serializedName: "osDiskImage", - type: { - name: "Composite", - className: "OSDiskImageEncryption", - }, - }, - dataDiskImages: { - serializedName: "dataDiskImages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataDiskImageEncryption", - }, - }, - }, - }, - }, - }, -}; - -export const OSDiskImageSecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSDiskImageSecurityProfile", - modelProperties: { - confidentialVMEncryptionType: { - serializedName: "confidentialVMEncryptionType", - type: { - name: "String", - }, - }, - secureVMDiskEncryptionSetId: { - serializedName: "secureVMDiskEncryptionSetId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskImageEncryption: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskImageEncryption", - modelProperties: { - diskEncryptionSetId: { - serializedName: "diskEncryptionSetId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AdditionalReplicaSet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AdditionalReplicaSet", - modelProperties: { - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - regionalReplicaCount: { - serializedName: "regionalReplicaCount", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryTargetExtendedLocation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryTargetExtendedLocation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "GalleryExtendedLocation", - }, - }, - extendedLocationReplicaCount: { - serializedName: "extendedLocationReplicaCount", - type: { - name: "Number", - }, - }, - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - encryption: { - serializedName: "encryption", - type: { - name: "Composite", - className: "EncryptionImages", - }, - }, - }, - }, -}; - -export const GalleryExtendedLocation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryExtendedLocation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryArtifactSafetyProfileBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryArtifactSafetyProfileBase", - modelProperties: { - allowDeletionOfReplicatedLocations: { - serializedName: "allowDeletionOfReplicatedLocations", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ReplicationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ReplicationStatus", - modelProperties: { - aggregatedState: { - serializedName: "aggregatedState", - readOnly: true, - type: { - name: "String", - }, - }, - summary: { - serializedName: "summary", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RegionalReplicationStatus", - }, - }, - }, - }, - }, - }, -}; - -export const RegionalReplicationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RegionalReplicationStatus", - modelProperties: { - region: { - serializedName: "region", - readOnly: true, - type: { - name: "String", - }, - }, - state: { - serializedName: "state", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "String", - }, - }, - progress: { - serializedName: "progress", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryImageList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryImage", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryImageVersionList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryImageVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryImageVersionStorageProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionStorageProfile", - modelProperties: { - source: { - serializedName: "source", - type: { - name: "Composite", - className: "GalleryArtifactVersionFullSource", - }, - }, - osDiskImage: { - serializedName: "osDiskImage", - type: { - name: "Composite", - className: "GalleryOSDiskImage", - }, - }, - dataDiskImages: { - serializedName: "dataDiskImages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryDataDiskImage", - }, - }, - }, - }, - }, - }, -}; - -export const GalleryArtifactVersionSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryArtifactVersionSource", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryDiskImage", - modelProperties: { - sizeInGB: { - serializedName: "sizeInGB", - readOnly: true, - type: { - name: "Number", - }, - }, - hostCaching: { - serializedName: "hostCaching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - source: { - serializedName: "source", - type: { - name: "Composite", - className: "GalleryDiskImageSource", - }, - }, - }, - }, -}; - -export const PolicyViolation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PolicyViolation", - modelProperties: { - category: { - serializedName: "category", - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ValidationsProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ValidationsProfile", - modelProperties: { - validationEtag: { - serializedName: "validationEtag", - type: { - name: "String", - }, - }, - executedValidations: { - serializedName: "executedValidations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ExecutedValidation", - }, - }, - }, - }, - platformAttributes: { - serializedName: "platformAttributes", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PlatformAttribute", - }, - }, - }, - }, - }, - }, -}; - -export const ExecutedValidation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExecutedValidation", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - readOnly: true, - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - type: { - name: "String", - }, - }, - executionTime: { - serializedName: "executionTime", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const PlatformAttribute: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PlatformAttribute", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfile", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryResourceProfilePropertiesBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryResourceProfilePropertiesBase", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileVersionList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersionList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AccessControlRules: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessControlRules", - modelProperties: { - privileges: { - serializedName: "privileges", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessControlRulesPrivilege", - }, - }, - }, - }, - roles: { - serializedName: "roles", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessControlRulesRole", - }, - }, - }, - }, - identities: { - serializedName: "identities", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessControlRulesIdentity", - }, - }, - }, - }, - roleAssignments: { - serializedName: "roleAssignments", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessControlRulesRoleAssignment", - }, - }, - }, - }, - }, - }, -}; - -export const AccessControlRulesPrivilege: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessControlRulesPrivilege", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - path: { - serializedName: "path", - required: true, - type: { - name: "String", - }, - }, - queryParameters: { - serializedName: "queryParameters", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const AccessControlRulesRole: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessControlRulesRole", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - privileges: { - serializedName: "privileges", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const AccessControlRulesIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessControlRulesIdentity", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - userName: { - serializedName: "userName", - type: { - name: "String", - }, - }, - groupName: { - serializedName: "groupName", - type: { - name: "String", - }, - }, - exePath: { - serializedName: "exePath", - type: { - name: "String", - }, - }, - processName: { - serializedName: "processName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AccessControlRulesRoleAssignment: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessControlRulesRoleAssignment", - modelProperties: { - role: { - serializedName: "role", - required: true, - type: { - name: "String", - }, - }, - identities: { - serializedName: "identities", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const GalleryResourceProfileVersionPropertiesBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryResourceProfileVersionPropertiesBase", - modelProperties: { - targetLocations: { - serializedName: "targetLocations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TargetRegion", - }, - }, - }, - }, - excludeFromLatest: { - serializedName: "excludeFromLatest", - type: { - name: "Boolean", - }, - }, - publishedDate: { - serializedName: "publishedDate", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - }, - }, -}; - -export const GalleryScriptList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryScript", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryScriptProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptProperties", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - eula: { - serializedName: "eula", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "privacyStatementUri", - type: { - name: "String", - }, - }, - releaseNoteUri: { - serializedName: "releaseNoteUri", - type: { - name: "String", - }, - }, - endOfLifeDate: { - serializedName: "endOfLifeDate", - type: { - name: "DateTime", - }, - }, - supportedOSType: { - serializedName: "supportedOSType", - required: true, - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryScriptVersionList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryScriptVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryScriptVersionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionProperties", - modelProperties: { - publishingProfile: { - serializedName: "publishingProfile", - type: { - name: "Composite", - className: "GalleryScriptVersionPublishingProfile", - }, - }, - safetyProfile: { - serializedName: "safetyProfile", - type: { - name: "Composite", - className: "GalleryScriptVersionSafetyProfile", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - }, - }, -}; - -export const ScriptSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScriptSource", - modelProperties: { - scriptLink: { - serializedName: "scriptLink", - required: true, - type: { - name: "String", - }, - }, - parameters: { - serializedName: "parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryScriptParameter", - }, - }, - }, - }, - }, - }, -}; - -export const GenericGalleryParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GenericGalleryParameter", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - required: { - serializedName: "required", - type: { - name: "Boolean", - }, - }, - defaultValue: { - serializedName: "defaultValue", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SharingUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharingUpdate", - modelProperties: { - operationType: { - serializedName: "operationType", - required: true, - type: { - name: "String", - }, - }, - groups: { - serializedName: "groups", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SharingProfileGroup", - }, - }, - }, - }, - }, - }, -}; - -export const GallerySoftDeletedResourceList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GallerySoftDeletedResourceList", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GallerySoftDeletedResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RoleInstance: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleInstance", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "InstanceSku", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "RoleInstanceProperties", - }, - }, - }, - }, -}; - -export const InstanceSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InstanceSku", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RoleInstanceProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleInstanceProperties", - modelProperties: { - networkProfile: { - serializedName: "networkProfile", - type: { - name: "Composite", - className: "RoleInstanceNetworkProfile", - }, - }, - instanceView: { - serializedName: "instanceView", - type: { - name: "Composite", - className: "RoleInstanceView", - }, - }, - }, - }, -}; - -export const RoleInstanceNetworkProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleInstanceNetworkProfile", - modelProperties: { - networkInterfaces: { - serializedName: "networkInterfaces", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - }, - }, -}; - -export const RoleInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleInstanceView", - modelProperties: { - platformUpdateDomain: { - serializedName: "platformUpdateDomain", - readOnly: true, - type: { - name: "Number", - }, - }, - platformFaultDomain: { - serializedName: "platformFaultDomain", - readOnly: true, - type: { - name: "Number", - }, - }, - privateId: { - serializedName: "privateId", - readOnly: true, - type: { - name: "String", - }, - }, - statuses: { - serializedName: "statuses", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceInstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const ResourceInstanceViewStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceInstanceViewStatus", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - displayStatus: { - serializedName: "displayStatus", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - time: { - serializedName: "time", - readOnly: true, - type: { - name: "DateTime", - }, - }, - level: { - serializedName: "level", - type: { - name: "Enum", - allowedValues: ["Info", "Warning", "Error"], - }, - }, - }, - }, -}; - -export const RoleInstanceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleInstanceListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RoleInstance", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudServiceRole: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceRole", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "CloudServiceRoleSku", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "CloudServiceRoleProperties", - }, - }, - }, - }, -}; - -export const CloudServiceRoleSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceRoleSku", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - tier: { - serializedName: "tier", - type: { - name: "String", - }, - }, - capacity: { - serializedName: "capacity", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CloudServiceRoleProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceRoleProperties", - modelProperties: { - uniqueId: { - serializedName: "uniqueId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudServiceRoleListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceRoleListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudServiceRole", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudService: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudService", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "CloudServiceProperties", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const CloudServiceProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceProperties", - modelProperties: { - packageUrl: { - serializedName: "packageUrl", - type: { - name: "String", - }, - }, - configuration: { - serializedName: "configuration", - type: { - name: "String", - }, - }, - configurationUrl: { - serializedName: "configurationUrl", - type: { - name: "String", - }, - }, - startCloudService: { - serializedName: "startCloudService", - type: { - name: "Boolean", - }, - }, - allowModelOverride: { - serializedName: "allowModelOverride", - type: { - name: "Boolean", - }, - }, - upgradeMode: { - serializedName: "upgradeMode", - type: { - name: "String", - }, - }, - roleProfile: { - serializedName: "roleProfile", - type: { - name: "Composite", - className: "CloudServiceRoleProfile", - }, - }, - osProfile: { - serializedName: "osProfile", - type: { - name: "Composite", - className: "CloudServiceOsProfile", - }, - }, - networkProfile: { - serializedName: "networkProfile", - type: { - name: "Composite", - className: "CloudServiceNetworkProfile", - }, - }, - extensionProfile: { - serializedName: "extensionProfile", - type: { - name: "Composite", - className: "CloudServiceExtensionProfile", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - uniqueId: { - serializedName: "uniqueId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudServiceRoleProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceRoleProfile", - modelProperties: { - roles: { - serializedName: "roles", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudServiceRoleProfileProperties", - }, - }, - }, - }, - }, - }, -}; - -export const CloudServiceRoleProfileProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceRoleProfileProperties", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "CloudServiceRoleSku", - }, - }, - }, - }, -}; - -export const CloudServiceOsProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceOsProfile", - modelProperties: { - secrets: { - serializedName: "secrets", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudServiceVaultSecretGroup", - }, - }, - }, - }, - }, - }, -}; - -export const CloudServiceVaultSecretGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceVaultSecretGroup", - modelProperties: { - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SubResource", - }, - }, - vaultCertificates: { - serializedName: "vaultCertificates", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudServiceVaultCertificate", - }, - }, - }, - }, - }, - }, -}; - -export const CloudServiceVaultCertificate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceVaultCertificate", - modelProperties: { - certificateUrl: { - serializedName: "certificateUrl", - type: { - name: "String", - }, - }, - isBootstrapCertificate: { - serializedName: "isBootstrapCertificate", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const CloudServiceNetworkProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceNetworkProfile", - modelProperties: { - loadBalancerConfigurations: { - serializedName: "loadBalancerConfigurations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LoadBalancerConfiguration", - }, - }, - }, - }, - slotType: { - serializedName: "slotType", - type: { - name: "String", - }, - }, - swappableCloudService: { - serializedName: "swappableCloudService", - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, -}; - -export const LoadBalancerConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LoadBalancerConfiguration", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "LoadBalancerConfigurationProperties", - }, - }, - }, - }, -}; - -export const LoadBalancerConfigurationProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LoadBalancerConfigurationProperties", - modelProperties: { - frontendIpConfigurations: { - serializedName: "frontendIpConfigurations", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LoadBalancerFrontendIpConfiguration", - }, - }, - }, - }, - }, - }, -}; - -export const LoadBalancerFrontendIpConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LoadBalancerFrontendIpConfiguration", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "LoadBalancerFrontendIpConfigurationProperties", - }, - }, - }, - }, -}; - -export const LoadBalancerFrontendIpConfigurationProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LoadBalancerFrontendIpConfigurationProperties", - modelProperties: { - publicIPAddress: { - serializedName: "publicIPAddress", - type: { - name: "Composite", - className: "SubResource", - }, - }, - subnet: { - serializedName: "subnet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - privateIPAddress: { - serializedName: "privateIPAddress", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudServiceExtensionProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceExtensionProfile", - modelProperties: { - extensions: { - serializedName: "extensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Extension", - }, - }, - }, - }, - }, - }, -}; - -export const Extension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Extension", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "CloudServiceExtensionProperties", - }, - }, - }, - }, -}; - -export const CloudServiceExtensionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceExtensionProperties", - modelProperties: { - publisher: { - serializedName: "publisher", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "settings", - type: { - name: "any", - }, - }, - protectedSettings: { - serializedName: "protectedSettings", - type: { - name: "any", - }, - }, - protectedSettingsFromKeyVault: { - serializedName: "protectedSettingsFromKeyVault", - type: { - name: "Composite", - className: "CloudServiceVaultAndSecretReference", - }, - }, - forceUpdateTag: { - serializedName: "forceUpdateTag", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - rolesAppliedTo: { - serializedName: "rolesAppliedTo", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const CloudServiceVaultAndSecretReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceVaultAndSecretReference", - modelProperties: { - sourceVault: { - serializedName: "sourceVault", - type: { - name: "Composite", - className: "SubResource", - }, - }, - secretUrl: { - serializedName: "secretUrl", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CloudServiceUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceUpdate", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const CloudServiceInstanceView: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceInstanceView", - modelProperties: { - roleInstance: { - serializedName: "roleInstance", - type: { - name: "Composite", - className: "InstanceViewStatusesSummary", - }, - }, - sdkVersion: { - serializedName: "sdkVersion", - readOnly: true, - type: { - name: "String", - }, - }, - privateIds: { - serializedName: "privateIds", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - statuses: { - serializedName: "statuses", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceInstanceViewStatus", - }, - }, - }, - }, - }, - }, -}; - -export const InstanceViewStatusesSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InstanceViewStatusesSummary", - modelProperties: { - statusesSummary: { - serializedName: "statusesSummary", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StatusCodeCount", - }, - }, - }, - }, - }, - }, -}; - -export const StatusCodeCount: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StatusCodeCount", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - count: { - serializedName: "count", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CloudServiceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudServiceListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudService", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RoleInstances: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RoleInstances", - modelProperties: { - roleInstances: { - serializedName: "roleInstances", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const UpdateDomain: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpdateDomain", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpdateDomainListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpdateDomainListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UpdateDomain", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OSVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSVersion", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "OSVersionProperties", - }, - }, - }, - }, -}; - -export const OSVersionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSVersionProperties", - modelProperties: { - family: { - serializedName: "family", - readOnly: true, - type: { - name: "String", - }, - }, - familyLabel: { - serializedName: "familyLabel", - readOnly: true, - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - readOnly: true, - type: { - name: "String", - }, - }, - label: { - serializedName: "label", - readOnly: true, - type: { - name: "String", - }, - }, - isDefault: { - serializedName: "isDefault", - readOnly: true, - type: { - name: "Boolean", - }, - }, - isActive: { - serializedName: "isActive", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const OSVersionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSVersionListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OSVersion", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OSFamily: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSFamily", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "OSFamilyProperties", - }, - }, - }, - }, -}; - -export const OSFamilyProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSFamilyProperties", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - label: { - serializedName: "label", - readOnly: true, - type: { - name: "String", - }, - }, - versions: { - serializedName: "versions", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OSVersionPropertiesBase", - }, - }, - }, - }, - }, - }, -}; - -export const OSVersionPropertiesBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSVersionPropertiesBase", - modelProperties: { - version: { - serializedName: "version", - readOnly: true, - type: { - name: "String", - }, - }, - label: { - serializedName: "label", - readOnly: true, - type: { - name: "String", - }, - }, - isDefault: { - serializedName: "isDefault", - readOnly: true, - type: { - name: "Boolean", - }, - }, - isActive: { - serializedName: "isActive", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const OSFamilyListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSFamilyListResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OSFamily", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceWithOptionalLocation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceWithOptionalLocation", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const DiskEncryptionSetParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSetParameters", - modelProperties: { - ...SubResource.type.modelProperties, - }, - }, -}; - -export const VirtualMachineImageResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - modelProperties: { - ...SubResource.type.modelProperties, - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - }, - }, -}; - -export const ImageReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageReference", - modelProperties: { - ...SubResource.type.modelProperties, - publisher: { - serializedName: "publisher", - type: { - name: "String", - }, - }, - offer: { - serializedName: "offer", - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - type: { - name: "String", - }, - }, - exactVersion: { - serializedName: "exactVersion", - readOnly: true, - type: { - name: "String", - }, - }, - sharedGalleryImageId: { - serializedName: "sharedGalleryImageId", - type: { - name: "String", - }, - }, - communityGalleryImageId: { - serializedName: "communityGalleryImageId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ManagedDiskParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedDiskParameters", - modelProperties: { - ...SubResource.type.modelProperties, - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "String", - }, - }, - diskEncryptionSet: { - serializedName: "diskEncryptionSet", - type: { - name: "Composite", - className: "DiskEncryptionSetParameters", - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "VMDiskSecurityProfile", - }, - }, - }, - }, -}; - -export const NetworkInterfaceReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkInterfaceReference", - modelProperties: { - ...SubResource.type.modelProperties, - primary: { - serializedName: "properties.primary", - type: { - name: "Boolean", - }, - }, - deleteOption: { - serializedName: "properties.deleteOption", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SubResourceWithColocationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubResourceWithColocationStatus", - modelProperties: { - ...SubResource.type.modelProperties, - colocationStatus: { - serializedName: "colocationStatus", - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, -}; - -export const VirtualMachineCaptureResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineCaptureResult", - modelProperties: { - ...SubResource.type.modelProperties, - schema: { - serializedName: "$schema", - readOnly: true, - type: { - name: "String", - }, - }, - contentVersion: { - serializedName: "contentVersion", - readOnly: true, - type: { - name: "String", - }, - }, - parameters: { - serializedName: "parameters", - readOnly: true, - type: { - name: "any", - }, - }, - resources: { - serializedName: "resources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "any", - }, - }, - }, - }, - }, - }, -}; - -export const TrackedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties, - }, - }, -}; - -export const VirtualMachineScaleSetExtension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtension", - modelProperties: { - ...SubResourceReadOnly.type.modelProperties, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - forceUpdateTag: { - serializedName: "properties.forceUpdateTag", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "properties.publisher", - type: { - name: "String", - }, - }, - typePropertiesType: { - serializedName: "properties.type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "properties.typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "properties.autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "properties.enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "properties.settings", - type: { - name: "any", - }, - }, - protectedSettings: { - serializedName: "properties.protectedSettings", - type: { - name: "any", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - provisionAfterExtensions: { - serializedName: "properties.provisionAfterExtensions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - suppressFailures: { - serializedName: "properties.suppressFailures", - type: { - name: "Boolean", - }, - }, - protectedSettingsFromKeyVault: { - serializedName: "properties.protectedSettingsFromKeyVault", - type: { - name: "Composite", - className: "KeyVaultSecretReference", - }, - }, - }, - }, -}; - -export const DiskRestorePointAttributes: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskRestorePointAttributes", - modelProperties: { - ...SubResourceReadOnly.type.modelProperties, - encryption: { - serializedName: "encryption", - type: { - name: "Composite", - className: "RestorePointEncryption", - }, - }, - sourceDiskRestorePoint: { - serializedName: "sourceDiskRestorePoint", - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetExtensionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionUpdate", - modelProperties: { - ...SubResourceReadOnly.type.modelProperties, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - forceUpdateTag: { - serializedName: "properties.forceUpdateTag", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "properties.publisher", - type: { - name: "String", - }, - }, - typePropertiesType: { - serializedName: "properties.type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "properties.typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "properties.autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "properties.enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "properties.settings", - type: { - name: "any", - }, - }, - protectedSettings: { - serializedName: "properties.protectedSettings", - type: { - name: "any", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - provisionAfterExtensions: { - serializedName: "properties.provisionAfterExtensions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - suppressFailures: { - serializedName: "properties.suppressFailures", - type: { - name: "Boolean", - }, - }, - protectedSettingsFromKeyVault: { - serializedName: "properties.protectedSettingsFromKeyVault", - type: { - name: "Composite", - className: "KeyVaultSecretReference", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMExtension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtension", - modelProperties: { - ...SubResourceReadOnly.type.modelProperties, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - forceUpdateTag: { - serializedName: "properties.forceUpdateTag", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "properties.publisher", - type: { - name: "String", - }, - }, - typePropertiesType: { - serializedName: "properties.type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "properties.typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "properties.autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "properties.enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "properties.settings", - type: { - name: "any", - }, - }, - protectedSettings: { - serializedName: "properties.protectedSettings", - type: { - name: "any", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "VirtualMachineExtensionInstanceView", - }, - }, - suppressFailures: { - serializedName: "properties.suppressFailures", - type: { - name: "Boolean", - }, - }, - protectedSettingsFromKeyVault: { - serializedName: "properties.protectedSettingsFromKeyVault", - type: { - name: "Composite", - className: "KeyVaultSecretReference", - }, - }, - provisionAfterExtensions: { - serializedName: "properties.provisionAfterExtensions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMExtensionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtensionUpdate", - modelProperties: { - ...SubResourceReadOnly.type.modelProperties, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - forceUpdateTag: { - serializedName: "properties.forceUpdateTag", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "properties.publisher", - type: { - name: "String", - }, - }, - typePropertiesType: { - serializedName: "properties.type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "properties.typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "properties.autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "properties.enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "properties.settings", - type: { - name: "any", - }, - }, - protectedSettings: { - serializedName: "properties.protectedSettings", - type: { - name: "any", - }, - }, - suppressFailures: { - serializedName: "properties.suppressFailures", - type: { - name: "Boolean", - }, - }, - protectedSettingsFromKeyVault: { - serializedName: "properties.protectedSettingsFromKeyVault", - type: { - name: "Composite", - className: "KeyVaultSecretReference", - }, - }, - }, - }, -}; - -export const CapacityReservationInstanceViewWithName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationInstanceViewWithName", - modelProperties: { - ...CapacityReservationInstanceView.type.modelProperties, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DedicatedHostInstanceViewWithName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostInstanceViewWithName", - modelProperties: { - ...DedicatedHostInstanceView.type.modelProperties, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ImageOSDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageOSDisk", - modelProperties: { - ...ImageDisk.type.modelProperties, - osType: { - serializedName: "osType", - required: true, - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - osState: { - serializedName: "osState", - required: true, - type: { - name: "Enum", - allowedValues: ["Generalized", "Specialized"], - }, - }, - }, - }, -}; - -export const ImageDataDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageDataDisk", - modelProperties: { - ...ImageDisk.type.modelProperties, - lun: { - serializedName: "lun", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const RequestRateByIntervalInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RequestRateByIntervalInput", - modelProperties: { - ...LogAnalyticsInputBase.type.modelProperties, - intervalLength: { - serializedName: "intervalLength", - required: true, - type: { - name: "Enum", - allowedValues: ["ThreeMins", "FiveMins", "ThirtyMins", "SixtyMins"], - }, - }, - }, - }, -}; - -export const ThrottledRequestsInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ThrottledRequestsInput", - modelProperties: { - ...LogAnalyticsInputBase.type.modelProperties, - }, - }, -}; - -export const RunCommandDocument: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RunCommandDocument", - modelProperties: { - ...RunCommandDocumentBase.type.modelProperties, - script: { - serializedName: "script", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - parameters: { - serializedName: "parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RunCommandParameterDefinition", - }, - }, - }, - }, - }, - }, -}; - -export const AvailabilitySetUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - platformUpdateDomainCount: { - serializedName: "properties.platformUpdateDomainCount", - type: { - name: "Number", - }, - }, - platformFaultDomainCount: { - serializedName: "properties.platformFaultDomainCount", - type: { - name: "Number", - }, - }, - virtualMachines: { - serializedName: "properties.virtualMachines", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - proximityPlacementGroup: { - serializedName: "properties.proximityPlacementGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - statuses: { - serializedName: "properties.statuses", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - scheduledEventsPolicy: { - serializedName: "properties.scheduledEventsPolicy", - type: { - name: "Composite", - className: "ScheduledEventsPolicy", - }, - }, - virtualMachineScaleSetMigrationInfo: { - serializedName: "properties.virtualMachineScaleSetMigrationInfo", - type: { - name: "Composite", - className: "VirtualMachineScaleSetMigrationInfo", - }, - }, - }, - }, -}; - -export const CapacityReservationGroupUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationGroupUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - capacityReservations: { - serializedName: "properties.capacityReservations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - virtualMachinesAssociated: { - serializedName: "properties.virtualMachinesAssociated", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "CapacityReservationGroupInstanceView", - }, - }, - sharingProfile: { - serializedName: "properties.sharingProfile", - type: { - name: "Composite", - className: "ResourceSharingProfile", - }, - }, - reservationType: { - serializedName: "properties.reservationType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CapacityReservationUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - reservationId: { - serializedName: "properties.reservationId", - readOnly: true, - type: { - name: "String", - }, - }, - platformFaultDomainCount: { - serializedName: "properties.platformFaultDomainCount", - readOnly: true, - type: { - name: "Number", - }, - }, - virtualMachinesAssociated: { - serializedName: "properties.virtualMachinesAssociated", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - provisioningTime: { - serializedName: "properties.provisioningTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "CapacityReservationInstanceView", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - scheduleProfile: { - serializedName: "properties.scheduleProfile", - type: { - name: "Composite", - className: "ScheduleProfile", - }, - }, - }, - }, -}; - -export const DedicatedHostGroupUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostGroupUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - platformFaultDomainCount: { - constraints: { - InclusiveMinimum: 1, - }, - serializedName: "properties.platformFaultDomainCount", - type: { - name: "Number", - }, - }, - hosts: { - serializedName: "properties.hosts", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "DedicatedHostGroupInstanceView", - }, - }, - supportAutomaticPlacement: { - serializedName: "properties.supportAutomaticPlacement", - type: { - name: "Boolean", - }, - }, - additionalCapabilities: { - serializedName: "properties.additionalCapabilities", - type: { - name: "Composite", - className: "DedicatedHostGroupPropertiesAdditionalCapabilities", - }, - }, - }, - }, -}; - -export const DedicatedHostUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - platformFaultDomain: { - serializedName: "properties.platformFaultDomain", - type: { - name: "Number", - }, - }, - autoReplaceOnFailure: { - serializedName: "properties.autoReplaceOnFailure", - type: { - name: "Boolean", - }, - }, - hostId: { - serializedName: "properties.hostId", - readOnly: true, - type: { - name: "String", - }, - }, - virtualMachines: { - serializedName: "properties.virtualMachines", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - licenseType: { - serializedName: "properties.licenseType", - type: { - name: "Enum", - allowedValues: ["None", "Windows_Server_Hybrid", "Windows_Server_Perpetual"], - }, - }, - provisioningTime: { - serializedName: "properties.provisioningTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "DedicatedHostInstanceView", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const ImageUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - sourceVirtualMachine: { - serializedName: "properties.sourceVirtualMachine", - type: { - name: "Composite", - className: "SubResource", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "ImageStorageProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProximityPlacementGroupUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProximityPlacementGroupUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - }, - }, -}; - -export const RestorePointCollectionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointCollectionUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - source: { - serializedName: "properties.source", - type: { - name: "Composite", - className: "RestorePointCollectionSourceProperties", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - restorePointCollectionId: { - serializedName: "properties.restorePointCollectionId", - readOnly: true, - type: { - name: "String", - }, - }, - restorePoints: { - serializedName: "properties.restorePoints", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorePoint", - }, - }, - }, - }, - instantAccess: { - serializedName: "properties.instantAccess", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const SshPublicKeyUpdateResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SshPublicKeyUpdateResource", - modelProperties: { - ...UpdateResource.type.modelProperties, - publicKey: { - serializedName: "properties.publicKey", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - plan: { - serializedName: "plan", - type: { - name: "Composite", - className: "Plan", - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "VirtualMachineScaleSetIdentity", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - upgradePolicy: { - serializedName: "properties.upgradePolicy", - type: { - name: "Composite", - className: "UpgradePolicy", - }, - }, - automaticRepairsPolicy: { - serializedName: "properties.automaticRepairsPolicy", - type: { - name: "Composite", - className: "AutomaticRepairsPolicy", - }, - }, - virtualMachineProfile: { - serializedName: "properties.virtualMachineProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetUpdateVMProfile", - }, - }, - overprovision: { - serializedName: "properties.overprovision", - type: { - name: "Boolean", - }, - }, - doNotRunExtensionsOnOverprovisionedVMs: { - serializedName: "properties.doNotRunExtensionsOnOverprovisionedVMs", - type: { - name: "Boolean", - }, - }, - singlePlacementGroup: { - serializedName: "properties.singlePlacementGroup", - type: { - name: "Boolean", - }, - }, - additionalCapabilities: { - serializedName: "properties.additionalCapabilities", - type: { - name: "Composite", - className: "AdditionalCapabilities", - }, - }, - scaleInPolicy: { - serializedName: "properties.scaleInPolicy", - type: { - name: "Composite", - className: "ScaleInPolicy", - }, - }, - proximityPlacementGroup: { - serializedName: "properties.proximityPlacementGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - priorityMixPolicy: { - serializedName: "properties.priorityMixPolicy", - type: { - name: "Composite", - className: "PriorityMixPolicy", - }, - }, - spotRestorePolicy: { - serializedName: "properties.spotRestorePolicy", - type: { - name: "Composite", - className: "SpotRestorePolicy", - }, - }, - resiliencyPolicy: { - serializedName: "properties.resiliencyPolicy", - type: { - name: "Composite", - className: "ResiliencyPolicy", - }, - }, - zonalPlatformFaultDomainAlignMode: { - serializedName: "properties.zonalPlatformFaultDomainAlignMode", - type: { - name: "String", - }, - }, - skuProfile: { - serializedName: "properties.skuProfile", - type: { - name: "Composite", - className: "SkuProfile", - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommandUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommandUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - source: { - serializedName: "properties.source", - type: { - name: "Composite", - className: "VirtualMachineRunCommandScriptSource", - }, - }, - parameters: { - serializedName: "properties.parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RunCommandInputParameter", - }, - }, - }, - }, - protectedParameters: { - serializedName: "properties.protectedParameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RunCommandInputParameter", - }, - }, - }, - }, - asyncExecution: { - serializedName: "properties.asyncExecution", - type: { - name: "Boolean", - }, - }, - runAsUser: { - serializedName: "properties.runAsUser", - type: { - name: "String", - }, - }, - runAsPassword: { - serializedName: "properties.runAsPassword", - type: { - name: "String", - }, - }, - timeoutInSeconds: { - serializedName: "properties.timeoutInSeconds", - type: { - name: "Number", - }, - }, - outputBlobUri: { - serializedName: "properties.outputBlobUri", - type: { - name: "String", - }, - }, - errorBlobUri: { - serializedName: "properties.errorBlobUri", - type: { - name: "String", - }, - }, - outputBlobManagedIdentity: { - serializedName: "properties.outputBlobManagedIdentity", - type: { - name: "Composite", - className: "RunCommandManagedIdentity", - }, - }, - errorBlobManagedIdentity: { - serializedName: "properties.errorBlobManagedIdentity", - type: { - name: "Composite", - className: "RunCommandManagedIdentity", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "VirtualMachineRunCommandInstanceView", - }, - }, - treatFailureAsDeploymentFailure: { - serializedName: "properties.treatFailureAsDeploymentFailure", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VirtualMachineUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - plan: { - serializedName: "plan", - type: { - name: "Composite", - className: "Plan", - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "VirtualMachineIdentity", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - hardwareProfile: { - serializedName: "properties.hardwareProfile", - type: { - name: "Composite", - className: "HardwareProfile", - }, - }, - scheduledEventsPolicy: { - serializedName: "properties.scheduledEventsPolicy", - type: { - name: "Composite", - className: "ScheduledEventsPolicy", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "StorageProfile", - }, - }, - additionalCapabilities: { - serializedName: "properties.additionalCapabilities", - type: { - name: "Composite", - className: "AdditionalCapabilities", - }, - }, - osProfile: { - serializedName: "properties.osProfile", - type: { - name: "Composite", - className: "OSProfile", - }, - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "SecurityProfile", - }, - }, - diagnosticsProfile: { - serializedName: "properties.diagnosticsProfile", - type: { - name: "Composite", - className: "DiagnosticsProfile", - }, - }, - availabilitySet: { - serializedName: "properties.availabilitySet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - virtualMachineScaleSet: { - serializedName: "properties.virtualMachineScaleSet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - proximityPlacementGroup: { - serializedName: "properties.proximityPlacementGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - priority: { - serializedName: "properties.priority", - type: { - name: "String", - }, - }, - evictionPolicy: { - serializedName: "properties.evictionPolicy", - type: { - name: "String", - }, - }, - billingProfile: { - serializedName: "properties.billingProfile", - type: { - name: "Composite", - className: "BillingProfile", - }, - }, - host: { - serializedName: "properties.host", - type: { - name: "Composite", - className: "SubResource", - }, - }, - hostGroup: { - serializedName: "properties.hostGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "VirtualMachineInstanceView", - }, - }, - licenseType: { - serializedName: "properties.licenseType", - type: { - name: "String", - }, - }, - vmId: { - serializedName: "properties.vmId", - readOnly: true, - type: { - name: "String", - }, - }, - extensionsTimeBudget: { - serializedName: "properties.extensionsTimeBudget", - type: { - name: "String", - }, - }, - platformFaultDomain: { - serializedName: "properties.platformFaultDomain", - type: { - name: "Number", - }, - }, - scheduledEventsProfile: { - serializedName: "properties.scheduledEventsProfile", - type: { - name: "Composite", - className: "ScheduledEventsProfile", - }, - }, - userData: { - serializedName: "properties.userData", - type: { - name: "String", - }, - }, - capacityReservation: { - serializedName: "properties.capacityReservation", - type: { - name: "Composite", - className: "CapacityReservationProfile", - }, - }, - applicationProfile: { - serializedName: "properties.applicationProfile", - type: { - name: "Composite", - className: "ApplicationProfile", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionUpdate", - modelProperties: { - ...UpdateResource.type.modelProperties, - forceUpdateTag: { - serializedName: "properties.forceUpdateTag", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "properties.publisher", - type: { - name: "String", - }, - }, - type: { - serializedName: "properties.type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "properties.typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "properties.autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "properties.enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "properties.settings", - type: { - name: "any", - }, - }, - protectedSettings: { - serializedName: "properties.protectedSettings", - type: { - name: "any", - }, - }, - suppressFailures: { - serializedName: "properties.suppressFailures", - type: { - name: "Boolean", - }, - }, - protectedSettingsFromKeyVault: { - serializedName: "properties.protectedSettingsFromKeyVault", - type: { - name: "Composite", - className: "KeyVaultSecretReference", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMReimageParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMReimageParameters", - modelProperties: { - ...VirtualMachineReimageParameters.type.modelProperties, - forceUpdateOSDiskForEphemeral: { - serializedName: "forceUpdateOSDiskForEphemeral", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const CommunityGallery: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGallery", - modelProperties: { - ...PirCommunityGalleryResource.type.modelProperties, - disclaimer: { - serializedName: "properties.disclaimer", - type: { - name: "String", - }, - }, - artifactTags: { - serializedName: "properties.artifactTags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - communityMetadata: { - serializedName: "properties.communityMetadata", - type: { - name: "Composite", - className: "CommunityGalleryMetadata", - }, - }, - }, - }, -}; - -export const CommunityGalleryImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryImage", - modelProperties: { - ...PirCommunityGalleryResource.type.modelProperties, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - osState: { - serializedName: "properties.osState", - type: { - name: "Enum", - allowedValues: ["Generalized", "Specialized"], - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - identifier: { - serializedName: "properties.identifier", - type: { - name: "Composite", - className: "CommunityGalleryImageIdentifier", - }, - }, - recommended: { - serializedName: "properties.recommended", - type: { - name: "Composite", - className: "RecommendedMachineConfiguration", - }, - }, - disallowed: { - serializedName: "properties.disallowed", - type: { - name: "Composite", - className: "Disallowed", - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - features: { - serializedName: "properties.features", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryImageFeature", - }, - }, - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "ImagePurchasePlan", - }, - }, - architecture: { - serializedName: "properties.architecture", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "properties.privacyStatementUri", - type: { - name: "String", - }, - }, - eula: { - serializedName: "properties.eula", - type: { - name: "String", - }, - }, - disclaimer: { - serializedName: "properties.disclaimer", - type: { - name: "String", - }, - }, - artifactTags: { - serializedName: "properties.artifactTags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const CommunityGalleryImageVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryImageVersion", - modelProperties: { - ...PirCommunityGalleryResource.type.modelProperties, - publishedDate: { - serializedName: "properties.publishedDate", - type: { - name: "DateTime", - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - excludeFromLatest: { - serializedName: "properties.excludeFromLatest", - type: { - name: "Boolean", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "SharedGalleryImageVersionStorageProfile", - }, - }, - disclaimer: { - serializedName: "properties.disclaimer", - type: { - name: "String", - }, - }, - artifactTags: { - serializedName: "properties.artifactTags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const SharedGalleryOSDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryOSDiskImage", - modelProperties: { - ...SharedGalleryDiskImage.type.modelProperties, - }, - }, -}; - -export const SharedGalleryDataDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryDataDiskImage", - modelProperties: { - ...SharedGalleryDiskImage.type.modelProperties, - lun: { - serializedName: "lun", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const PirSharedGalleryResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PirSharedGalleryResource", - modelProperties: { - ...PirResource.type.modelProperties, - uniqueId: { - serializedName: "identifier.uniqueId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "GalleryIdentity", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - identifier: { - serializedName: "properties.identifier", - type: { - name: "Composite", - className: "GalleryIdentifier", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - sharingProfile: { - serializedName: "properties.sharingProfile", - type: { - name: "Composite", - className: "SharingProfile", - }, - }, - softDeletePolicy: { - serializedName: "properties.softDeletePolicy", - type: { - name: "Composite", - className: "SoftDeletePolicy", - }, - }, - sharingStatus: { - serializedName: "properties.sharingStatus", - type: { - name: "Composite", - className: "SharingStatus", - }, - }, - }, - }, -}; - -export const GalleryApplicationUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - eula: { - serializedName: "properties.eula", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "properties.privacyStatementUri", - type: { - name: "String", - }, - }, - releaseNoteUri: { - serializedName: "properties.releaseNoteUri", - type: { - name: "String", - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - supportedOSType: { - serializedName: "properties.supportedOSType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - customActions: { - serializedName: "properties.customActions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryApplicationCustomAction", - }, - }, - }, - }, - }, - }, -}; - -export const GalleryApplicationVersionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersionUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - publishingProfile: { - serializedName: "properties.publishingProfile", - type: { - name: "Composite", - className: "GalleryApplicationVersionPublishingProfile", - }, - }, - safetyProfile: { - serializedName: "properties.safetyProfile", - type: { - name: "Composite", - className: "GalleryApplicationVersionSafetyProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "properties.replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - }, - }, -}; - -export const GalleryImageUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - eula: { - serializedName: "properties.eula", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "properties.privacyStatementUri", - type: { - name: "String", - }, - }, - releaseNoteUri: { - serializedName: "properties.releaseNoteUri", - type: { - name: "String", - }, - }, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - osState: { - serializedName: "properties.osState", - type: { - name: "Enum", - allowedValues: ["Generalized", "Specialized"], - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - identifier: { - serializedName: "properties.identifier", - type: { - name: "Composite", - className: "GalleryImageIdentifier", - }, - }, - recommended: { - serializedName: "properties.recommended", - type: { - name: "Composite", - className: "RecommendedMachineConfiguration", - }, - }, - disallowed: { - serializedName: "properties.disallowed", - type: { - name: "Composite", - className: "Disallowed", - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "ImagePurchasePlan", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - features: { - serializedName: "properties.features", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryImageFeature", - }, - }, - }, - }, - architecture: { - serializedName: "properties.architecture", - type: { - name: "String", - }, - }, - allowUpdateImage: { - serializedName: "properties.allowUpdateImage", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const GalleryImageVersionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - publishingProfile: { - serializedName: "properties.publishingProfile", - type: { - name: "Composite", - className: "GalleryImageVersionPublishingProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "GalleryImageVersionStorageProfile", - }, - }, - safetyProfile: { - serializedName: "properties.safetyProfile", - type: { - name: "Composite", - className: "GalleryImageVersionSafetyProfile", - }, - }, - replicationStatus: { - serializedName: "properties.replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "ImageVersionSecurityProfile", - }, - }, - restore: { - serializedName: "properties.restore", - type: { - name: "Boolean", - }, - }, - validationsProfile: { - serializedName: "properties.validationsProfile", - type: { - name: "Composite", - className: "ValidationsProfile", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileProperties", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileVersionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersionUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - targetLocations: { - serializedName: "properties.targetLocations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TargetRegion", - }, - }, - }, - }, - excludeFromLatest: { - serializedName: "properties.excludeFromLatest", - type: { - name: "Boolean", - }, - }, - publishedDate: { - serializedName: "properties.publishedDate", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "properties.replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - mode: { - serializedName: "properties.mode", - type: { - name: "String", - }, - }, - defaultAccess: { - serializedName: "properties.defaultAccess", - type: { - name: "String", - }, - }, - rules: { - serializedName: "properties.rules", - type: { - name: "Composite", - className: "AccessControlRules", - }, - }, - }, - }, -}; - -export const GalleryScriptUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - eula: { - serializedName: "properties.eula", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "properties.privacyStatementUri", - type: { - name: "String", - }, - }, - releaseNoteUri: { - serializedName: "properties.releaseNoteUri", - type: { - name: "String", - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - supportedOSType: { - serializedName: "properties.supportedOSType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryScriptVersionUpdate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionUpdate", - modelProperties: { - ...UpdateResourceDefinition.type.modelProperties, - publishingProfile: { - serializedName: "properties.publishingProfile", - type: { - name: "Composite", - className: "GalleryScriptVersionPublishingProfile", - }, - }, - safetyProfile: { - serializedName: "properties.safetyProfile", - type: { - name: "Composite", - className: "GalleryScriptVersionSafetyProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "properties.replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - }, - }, -}; - -export const GalleryApplicationVersionPublishingProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersionPublishingProfile", - modelProperties: { - ...GalleryArtifactPublishingProfileBase.type.modelProperties, - source: { - serializedName: "source", - type: { - name: "Composite", - className: "UserArtifactSource", - }, - }, - manageActions: { - serializedName: "manageActions", - type: { - name: "Composite", - className: "UserArtifactManage", - }, - }, - settings: { - serializedName: "settings", - type: { - name: "Composite", - className: "UserArtifactSettings", - }, - }, - advancedSettings: { - serializedName: "advancedSettings", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - enableHealthCheck: { - serializedName: "enableHealthCheck", - type: { - name: "Boolean", - }, - }, - customActions: { - serializedName: "customActions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryApplicationCustomAction", - }, - }, - }, - }, - }, - }, -}; - -export const GalleryImageVersionPublishingProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionPublishingProfile", - modelProperties: { - ...GalleryArtifactPublishingProfileBase.type.modelProperties, - }, - }, -}; - -export const GalleryScriptVersionPublishingProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionPublishingProfile", - modelProperties: { - ...GalleryArtifactPublishingProfileBase.type.modelProperties, - source: { - serializedName: "source", - type: { - name: "Composite", - className: "ScriptSource", - }, - }, - }, - }, -}; - -export const OSDiskImageEncryption: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSDiskImageEncryption", - modelProperties: { - ...DiskImageEncryption.type.modelProperties, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "OSDiskImageSecurityProfile", - }, - }, - }, - }, -}; - -export const DataDiskImageEncryption: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataDiskImageEncryption", - modelProperties: { - ...DiskImageEncryption.type.modelProperties, - lun: { - serializedName: "lun", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryApplicationVersionSafetyProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersionSafetyProfile", - modelProperties: { - ...GalleryArtifactSafetyProfileBase.type.modelProperties, - }, - }, -}; - -export const GalleryImageVersionSafetyProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionSafetyProfile", - modelProperties: { - ...GalleryArtifactSafetyProfileBase.type.modelProperties, - reportedForPolicyViolation: { - serializedName: "reportedForPolicyViolation", - readOnly: true, - type: { - name: "Boolean", - }, - }, - policyViolations: { - serializedName: "policyViolations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PolicyViolation", - }, - }, - }, - }, - blockDeletionBeforeEndOfLife: { - serializedName: "blockDeletionBeforeEndOfLife", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const GalleryScriptVersionSafetyProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionSafetyProfile", - modelProperties: { - ...GalleryArtifactSafetyProfileBase.type.modelProperties, - }, - }, -}; - -export const GalleryArtifactVersionFullSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryArtifactVersionFullSource", - modelProperties: { - ...GalleryArtifactVersionSource.type.modelProperties, - communityGalleryImageId: { - serializedName: "communityGalleryImageId", - type: { - name: "String", - }, - }, - virtualMachineId: { - serializedName: "virtualMachineId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryDiskImageSource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryDiskImageSource", - modelProperties: { - ...GalleryArtifactVersionSource.type.modelProperties, - uri: { - serializedName: "uri", - type: { - name: "String", - }, - }, - storageAccountId: { - serializedName: "storageAccountId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryOSDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryOSDiskImage", - modelProperties: { - ...GalleryDiskImage.type.modelProperties, - }, - }, -}; - -export const GalleryDataDiskImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryDataDiskImage", - modelProperties: { - ...GalleryDiskImage.type.modelProperties, - lun: { - serializedName: "lun", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileProperties", - modelProperties: { - ...GalleryResourceProfilePropertiesBase.type.modelProperties, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - osType: { - serializedName: "osType", - required: true, - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - applicableHostEndpoint: { - serializedName: "applicableHostEndpoint", - required: true, - type: { - name: "Enum", - allowedValues: ["WireServer", "IMDS"], - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileVersionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersionProperties", - modelProperties: { - ...GalleryResourceProfileVersionPropertiesBase.type.modelProperties, - mode: { - serializedName: "mode", - required: true, - type: { - name: "String", - }, - }, - defaultAccess: { - serializedName: "defaultAccess", - required: true, - type: { - name: "String", - }, - }, - rules: { - serializedName: "rules", - type: { - name: "Composite", - className: "AccessControlRules", - }, - }, - }, - }, -}; - -export const GalleryScriptParameter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptParameter", - modelProperties: { - ...GenericGalleryParameter.type.modelProperties, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - minValue: { - serializedName: "minValue", - type: { - name: "String", - }, - }, - maxValue: { - serializedName: "maxValue", - type: { - name: "String", - }, - }, - enumValues: { - serializedName: "enumValues", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachineImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineImage", - modelProperties: { - ...VirtualMachineImageResource.type.modelProperties, - plan: { - serializedName: "properties.plan", - type: { - name: "Composite", - className: "PurchasePlan", - }, - }, - osDiskImage: { - serializedName: "properties.osDiskImage", - type: { - name: "Composite", - className: "OSDiskImage", - }, - }, - dataDiskImages: { - serializedName: "properties.dataDiskImages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataDiskImage", - }, - }, - }, - }, - automaticOSUpgradeProperties: { - serializedName: "properties.automaticOSUpgradeProperties", - type: { - name: "Composite", - className: "AutomaticOSUpgradeProperties", - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - disallowed: { - serializedName: "properties.disallowed", - type: { - name: "Composite", - className: "DisallowedConfiguration", - }, - }, - features: { - serializedName: "properties.features", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageFeature", - }, - }, - }, - }, - architecture: { - serializedName: "properties.architecture", - type: { - name: "String", - }, - }, - imageDeprecationStatus: { - serializedName: "properties.imageDeprecationStatus", - type: { - name: "Composite", - className: "ImageDeprecationStatus", - }, - }, - }, - }, -}; - -export const AvailabilitySet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySet", - modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - platformUpdateDomainCount: { - serializedName: "properties.platformUpdateDomainCount", - type: { - name: "Number", - }, - }, - platformFaultDomainCount: { - serializedName: "properties.platformFaultDomainCount", - type: { - name: "Number", - }, - }, - virtualMachines: { - serializedName: "properties.virtualMachines", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResource", - }, - }, - }, - }, - proximityPlacementGroup: { - serializedName: "properties.proximityPlacementGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - statuses: { - serializedName: "properties.statuses", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - }, - }, - scheduledEventsPolicy: { - serializedName: "properties.scheduledEventsPolicy", - type: { - name: "Composite", - className: "ScheduledEventsPolicy", - }, - }, - virtualMachineScaleSetMigrationInfo: { - serializedName: "properties.virtualMachineScaleSetMigrationInfo", - type: { - name: "Composite", - className: "VirtualMachineScaleSetMigrationInfo", - }, - }, - }, - }, -}; - -export const CapacityReservationGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationGroup", - modelProperties: { - ...TrackedResource.type.modelProperties, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - capacityReservations: { - serializedName: "properties.capacityReservations", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - virtualMachinesAssociated: { - serializedName: "properties.virtualMachinesAssociated", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "CapacityReservationGroupInstanceView", - }, - }, - sharingProfile: { - serializedName: "properties.sharingProfile", - type: { - name: "Composite", - className: "ResourceSharingProfile", - }, - }, - reservationType: { - serializedName: "properties.reservationType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DedicatedHostGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostGroup", - modelProperties: { - ...TrackedResource.type.modelProperties, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - platformFaultDomainCount: { - constraints: { - InclusiveMinimum: 1, - }, - serializedName: "properties.platformFaultDomainCount", - type: { - name: "Number", - }, - }, - hosts: { - serializedName: "properties.hosts", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "DedicatedHostGroupInstanceView", - }, - }, - supportAutomaticPlacement: { - serializedName: "properties.supportAutomaticPlacement", - type: { - name: "Boolean", - }, - }, - additionalCapabilities: { - serializedName: "properties.additionalCapabilities", - type: { - name: "Composite", - className: "DedicatedHostGroupPropertiesAdditionalCapabilities", - }, - }, - }, - }, -}; - -export const Image: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Image", - modelProperties: { - ...TrackedResource.type.modelProperties, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - sourceVirtualMachine: { - serializedName: "properties.sourceVirtualMachine", - type: { - name: "Composite", - className: "SubResource", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "ImageStorageProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionImage", - modelProperties: { - ...TrackedResource.type.modelProperties, - operatingSystem: { - serializedName: "properties.operatingSystem", - type: { - name: "String", - }, - }, - computeRole: { - serializedName: "properties.computeRole", - type: { - name: "String", - }, - }, - handlerSchema: { - serializedName: "properties.handlerSchema", - type: { - name: "String", - }, - }, - vmScaleSetEnabled: { - serializedName: "properties.vmScaleSetEnabled", - type: { - name: "Boolean", - }, - }, - supportsMultipleExtensions: { - serializedName: "properties.supportsMultipleExtensions", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSet", - modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - plan: { - serializedName: "plan", - type: { - name: "Composite", - className: "Plan", - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "VirtualMachineScaleSetIdentity", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - placement: { - serializedName: "placement", - type: { - name: "Composite", - className: "Placement", - }, - }, - upgradePolicy: { - serializedName: "properties.upgradePolicy", - type: { - name: "Composite", - className: "UpgradePolicy", - }, - }, - scheduledEventsPolicy: { - serializedName: "properties.scheduledEventsPolicy", - type: { - name: "Composite", - className: "ScheduledEventsPolicy", - }, - }, - automaticRepairsPolicy: { - serializedName: "properties.automaticRepairsPolicy", - type: { - name: "Composite", - className: "AutomaticRepairsPolicy", - }, - }, - virtualMachineProfile: { - serializedName: "properties.virtualMachineProfile", - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - overprovision: { - serializedName: "properties.overprovision", - type: { - name: "Boolean", - }, - }, - doNotRunExtensionsOnOverprovisionedVMs: { - serializedName: "properties.doNotRunExtensionsOnOverprovisionedVMs", - type: { - name: "Boolean", - }, - }, - uniqueId: { - serializedName: "properties.uniqueId", - readOnly: true, - type: { - name: "String", - }, - }, - singlePlacementGroup: { - serializedName: "properties.singlePlacementGroup", - type: { - name: "Boolean", - }, - }, - zoneBalance: { - serializedName: "properties.zoneBalance", - type: { - name: "Boolean", - }, - }, - platformFaultDomainCount: { - serializedName: "properties.platformFaultDomainCount", - type: { - name: "Number", - }, - }, - proximityPlacementGroup: { - serializedName: "properties.proximityPlacementGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - hostGroup: { - serializedName: "properties.hostGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - additionalCapabilities: { - serializedName: "properties.additionalCapabilities", - type: { - name: "Composite", - className: "AdditionalCapabilities", - }, - }, - scaleInPolicy: { - serializedName: "properties.scaleInPolicy", - type: { - name: "Composite", - className: "ScaleInPolicy", - }, - }, - orchestrationMode: { - serializedName: "properties.orchestrationMode", - type: { - name: "String", - }, - }, - spotRestorePolicy: { - serializedName: "properties.spotRestorePolicy", - type: { - name: "Composite", - className: "SpotRestorePolicy", - }, - }, - priorityMixPolicy: { - serializedName: "properties.priorityMixPolicy", - type: { - name: "Composite", - className: "PriorityMixPolicy", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - constrainedMaximumCapacity: { - serializedName: "properties.constrainedMaximumCapacity", - type: { - name: "Boolean", - }, - }, - resiliencyPolicy: { - serializedName: "properties.resiliencyPolicy", - type: { - name: "Composite", - className: "ResiliencyPolicy", - }, - }, - zonalPlatformFaultDomainAlignMode: { - serializedName: "properties.zonalPlatformFaultDomainAlignMode", - type: { - name: "String", - }, - }, - skuProfile: { - serializedName: "properties.skuProfile", - type: { - name: "Composite", - className: "SkuProfile", - }, - }, - highSpeedInterconnectPlacement: { - serializedName: "properties.highSpeedInterconnectPlacement", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const VirtualMachineExtension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtension", - modelProperties: { - ...TrackedResource.type.modelProperties, - forceUpdateTag: { - serializedName: "properties.forceUpdateTag", - type: { - name: "String", - }, - }, - publisher: { - serializedName: "properties.publisher", - type: { - name: "String", - }, - }, - typePropertiesType: { - serializedName: "properties.type", - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "properties.typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "properties.autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "properties.enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "properties.settings", - type: { - name: "any", - }, - }, - protectedSettings: { - serializedName: "properties.protectedSettings", - type: { - name: "any", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "VirtualMachineExtensionInstanceView", - }, - }, - suppressFailures: { - serializedName: "properties.suppressFailures", - type: { - name: "Boolean", - }, - }, - protectedSettingsFromKeyVault: { - serializedName: "properties.protectedSettingsFromKeyVault", - type: { - name: "Composite", - className: "KeyVaultSecretReference", - }, - }, - provisionAfterExtensions: { - serializedName: "properties.provisionAfterExtensions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const VirtualMachine: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachine", - modelProperties: { - ...TrackedResource.type.modelProperties, - plan: { - serializedName: "plan", - type: { - name: "Composite", - className: "Plan", - }, - }, - resources: { - serializedName: "resources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtension", - }, - }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "VirtualMachineIdentity", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - managedBy: { - serializedName: "managedBy", - readOnly: true, - type: { - name: "String", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - placement: { - serializedName: "placement", - type: { - name: "Composite", - className: "Placement", - }, - }, - hardwareProfile: { - serializedName: "properties.hardwareProfile", - type: { - name: "Composite", - className: "HardwareProfile", - }, - }, - scheduledEventsPolicy: { - serializedName: "properties.scheduledEventsPolicy", - type: { - name: "Composite", - className: "ScheduledEventsPolicy", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "StorageProfile", - }, - }, - additionalCapabilities: { - serializedName: "properties.additionalCapabilities", - type: { - name: "Composite", - className: "AdditionalCapabilities", - }, - }, - osProfile: { - serializedName: "properties.osProfile", - type: { - name: "Composite", - className: "OSProfile", - }, - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "SecurityProfile", - }, - }, - diagnosticsProfile: { - serializedName: "properties.diagnosticsProfile", - type: { - name: "Composite", - className: "DiagnosticsProfile", - }, - }, - availabilitySet: { - serializedName: "properties.availabilitySet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - virtualMachineScaleSet: { - serializedName: "properties.virtualMachineScaleSet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - proximityPlacementGroup: { - serializedName: "properties.proximityPlacementGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - priority: { - serializedName: "properties.priority", - type: { - name: "String", - }, - }, - evictionPolicy: { - serializedName: "properties.evictionPolicy", - type: { - name: "String", - }, - }, - billingProfile: { - serializedName: "properties.billingProfile", - type: { - name: "Composite", - className: "BillingProfile", - }, - }, - host: { - serializedName: "properties.host", - type: { - name: "Composite", - className: "SubResource", - }, - }, - hostGroup: { - serializedName: "properties.hostGroup", - type: { - name: "Composite", - className: "SubResource", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "VirtualMachineInstanceView", - }, - }, - licenseType: { - serializedName: "properties.licenseType", - type: { - name: "String", - }, - }, - vmId: { - serializedName: "properties.vmId", - readOnly: true, - type: { - name: "String", - }, - }, - extensionsTimeBudget: { - serializedName: "properties.extensionsTimeBudget", - type: { - name: "String", - }, - }, - platformFaultDomain: { - serializedName: "properties.platformFaultDomain", - type: { - name: "Number", - }, - }, - scheduledEventsProfile: { - serializedName: "properties.scheduledEventsProfile", - type: { - name: "Composite", - className: "ScheduledEventsProfile", - }, - }, - userData: { - serializedName: "properties.userData", - type: { - name: "String", - }, - }, - capacityReservation: { - serializedName: "properties.capacityReservation", - type: { - name: "Composite", - className: "CapacityReservationProfile", - }, - }, - applicationProfile: { - serializedName: "properties.applicationProfile", - type: { - name: "Composite", - className: "ApplicationProfile", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const ProximityPlacementGroup: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProximityPlacementGroup", - modelProperties: { - ...TrackedResource.type.modelProperties, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - proximityPlacementGroupType: { - serializedName: "properties.proximityPlacementGroupType", - type: { - name: "String", - }, - }, - virtualMachines: { - serializedName: "properties.virtualMachines", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceWithColocationStatus", - }, - }, - }, - }, - virtualMachineScaleSets: { - serializedName: "properties.virtualMachineScaleSets", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceWithColocationStatus", - }, - }, - }, - }, - availabilitySets: { - serializedName: "properties.availabilitySets", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceWithColocationStatus", - }, - }, - }, - }, - colocationStatus: { - serializedName: "properties.colocationStatus", - type: { - name: "Composite", - className: "InstanceViewStatus", - }, - }, - intent: { - serializedName: "properties.intent", - type: { - name: "Composite", - className: "ProximityPlacementGroupPropertiesIntent", - }, - }, - }, - }, -}; - -export const RestorePointCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointCollection", - modelProperties: { - ...TrackedResource.type.modelProperties, - source: { - serializedName: "properties.source", - type: { - name: "Composite", - className: "RestorePointCollectionSourceProperties", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - restorePointCollectionId: { - serializedName: "properties.restorePointCollectionId", - readOnly: true, - type: { - name: "String", - }, - }, - restorePoints: { - serializedName: "properties.restorePoints", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorePoint", - }, - }, - }, - }, - instantAccess: { - serializedName: "properties.instantAccess", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const SshPublicKeyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SshPublicKeyResource", - modelProperties: { - ...TrackedResource.type.modelProperties, - publicKey: { - serializedName: "properties.publicKey", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CapacityReservation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservation", - modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - reservationId: { - serializedName: "properties.reservationId", - readOnly: true, - type: { - name: "String", - }, - }, - platformFaultDomainCount: { - serializedName: "properties.platformFaultDomainCount", - readOnly: true, - type: { - name: "Number", - }, - }, - virtualMachinesAssociated: { - serializedName: "properties.virtualMachinesAssociated", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - provisioningTime: { - serializedName: "properties.provisioningTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "CapacityReservationInstanceView", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - scheduleProfile: { - serializedName: "properties.scheduleProfile", - type: { - name: "Composite", - className: "ScheduleProfile", - }, - }, - }, - }, -}; - -export const DedicatedHost: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHost", - modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - platformFaultDomain: { - serializedName: "properties.platformFaultDomain", - type: { - name: "Number", - }, - }, - autoReplaceOnFailure: { - serializedName: "properties.autoReplaceOnFailure", - type: { - name: "Boolean", - }, - }, - hostId: { - serializedName: "properties.hostId", - readOnly: true, - type: { - name: "String", - }, - }, - virtualMachines: { - serializedName: "properties.virtualMachines", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubResourceReadOnly", - }, - }, - }, - }, - licenseType: { - serializedName: "properties.licenseType", - type: { - name: "Enum", - allowedValues: ["None", "Windows_Server_Hybrid", "Windows_Server_Perpetual"], - }, - }, - provisioningTime: { - serializedName: "properties.provisioningTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "DedicatedHostInstanceView", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const RollingUpgradeStatusInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RollingUpgradeStatusInfo", - modelProperties: { - ...TrackedResource.type.modelProperties, - policy: { - serializedName: "properties.policy", - type: { - name: "Composite", - className: "RollingUpgradePolicy", - }, - }, - runningStatus: { - serializedName: "properties.runningStatus", - type: { - name: "Composite", - className: "RollingUpgradeRunningStatus", - }, - }, - progress: { - serializedName: "properties.progress", - type: { - name: "Composite", - className: "RollingUpgradeProgressInfo", - }, - }, - error: { - serializedName: "properties.error", - type: { - name: "Composite", - className: "ApiError", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVM: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVM", - modelProperties: { - ...TrackedResource.type.modelProperties, - instanceId: { - serializedName: "instanceId", - readOnly: true, - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - plan: { - serializedName: "plan", - type: { - name: "Composite", - className: "Plan", - }, - }, - resources: { - serializedName: "resources", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtension", - }, - }, - }, - }, - zones: { - serializedName: "zones", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "VirtualMachineIdentity", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - latestModelApplied: { - serializedName: "properties.latestModelApplied", - readOnly: true, - type: { - name: "Boolean", - }, - }, - vmId: { - serializedName: "properties.vmId", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMInstanceView", - }, - }, - hardwareProfile: { - serializedName: "properties.hardwareProfile", - type: { - name: "Composite", - className: "HardwareProfile", - }, - }, - resilientVMDeletionStatus: { - serializedName: "properties.resilientVMDeletionStatus", - type: { - name: "String", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "StorageProfile", - }, - }, - additionalCapabilities: { - serializedName: "properties.additionalCapabilities", - type: { - name: "Composite", - className: "AdditionalCapabilities", - }, - }, - osProfile: { - serializedName: "properties.osProfile", - type: { - name: "Composite", - className: "OSProfile", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "SecurityProfile", - }, - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - networkProfileConfiguration: { - serializedName: "properties.networkProfileConfiguration", - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMNetworkProfileConfiguration", - }, - }, - diagnosticsProfile: { - serializedName: "properties.diagnosticsProfile", - type: { - name: "Composite", - className: "DiagnosticsProfile", - }, - }, - availabilitySet: { - serializedName: "properties.availabilitySet", - type: { - name: "Composite", - className: "SubResource", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - licenseType: { - serializedName: "properties.licenseType", - type: { - name: "String", - }, - }, - modelDefinitionApplied: { - serializedName: "properties.modelDefinitionApplied", - readOnly: true, - type: { - name: "String", - }, - }, - protectionPolicy: { - serializedName: "properties.protectionPolicy", - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMProtectionPolicy", - }, - }, - userData: { - serializedName: "properties.userData", - type: { - name: "String", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommand: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommand", - modelProperties: { - ...TrackedResource.type.modelProperties, - source: { - serializedName: "properties.source", - type: { - name: "Composite", - className: "VirtualMachineRunCommandScriptSource", - }, - }, - parameters: { - serializedName: "properties.parameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RunCommandInputParameter", - }, - }, - }, - }, - protectedParameters: { - serializedName: "properties.protectedParameters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RunCommandInputParameter", - }, - }, - }, - }, - asyncExecution: { - serializedName: "properties.asyncExecution", - type: { - name: "Boolean", - }, - }, - runAsUser: { - serializedName: "properties.runAsUser", - type: { - name: "String", - }, - }, - runAsPassword: { - serializedName: "properties.runAsPassword", - type: { - name: "String", - }, - }, - timeoutInSeconds: { - serializedName: "properties.timeoutInSeconds", - type: { - name: "Number", - }, - }, - outputBlobUri: { - serializedName: "properties.outputBlobUri", - type: { - name: "String", - }, - }, - errorBlobUri: { - serializedName: "properties.errorBlobUri", - type: { - name: "String", - }, - }, - outputBlobManagedIdentity: { - serializedName: "properties.outputBlobManagedIdentity", - type: { - name: "Composite", - className: "RunCommandManagedIdentity", - }, - }, - errorBlobManagedIdentity: { - serializedName: "properties.errorBlobManagedIdentity", - type: { - name: "Composite", - className: "RunCommandManagedIdentity", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "VirtualMachineRunCommandInstanceView", - }, - }, - treatFailureAsDeploymentFailure: { - serializedName: "properties.treatFailureAsDeploymentFailure", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const DiskAccess: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccess", - modelProperties: { - ...TrackedResource.type.modelProperties, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - privateEndpointConnections: { - serializedName: "properties.privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const DiskEncryptionSet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSet", - modelProperties: { - ...TrackedResource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "EncryptionSetIdentity", - }, - }, - encryptionType: { - serializedName: "properties.encryptionType", - type: { - name: "String", - }, - }, - activeKey: { - serializedName: "properties.activeKey", - type: { - name: "Composite", - className: "KeyForDiskEncryptionSet", - }, - }, - previousKeys: { - serializedName: "properties.previousKeys", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "KeyForDiskEncryptionSet", - }, - }, - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - rotationToLatestKeyVersionEnabled: { - serializedName: "properties.rotationToLatestKeyVersionEnabled", - type: { - name: "Boolean", - }, - }, - lastKeyRotationTimestamp: { - serializedName: "properties.lastKeyRotationTimestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - autoKeyRotationError: { - serializedName: "properties.autoKeyRotationError", - type: { - name: "Composite", - className: "ApiError", - }, - }, - federatedClientId: { - serializedName: "properties.federatedClientId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Disk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Disk", - modelProperties: { - ...TrackedResource.type.modelProperties, - managedBy: { - serializedName: "managedBy", - readOnly: true, - type: { - name: "String", - }, - }, - managedByExtended: { - serializedName: "managedByExtended", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "DiskSku", - }, - }, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "DiskPurchasePlan", - }, - }, - supportedCapabilities: { - serializedName: "properties.supportedCapabilities", - type: { - name: "Composite", - className: "SupportedCapabilities", - }, - }, - creationData: { - serializedName: "properties.creationData", - type: { - name: "Composite", - className: "CreationData", - }, - }, - diskSizeGB: { - serializedName: "properties.diskSizeGB", - type: { - name: "Number", - }, - }, - diskSizeBytes: { - serializedName: "properties.diskSizeBytes", - readOnly: true, - type: { - name: "Number", - }, - }, - uniqueId: { - serializedName: "properties.uniqueId", - readOnly: true, - type: { - name: "String", - }, - }, - encryptionSettingsCollection: { - serializedName: "properties.encryptionSettingsCollection", - type: { - name: "Composite", - className: "EncryptionSettingsCollection", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - diskIopsReadWrite: { - serializedName: "properties.diskIOPSReadWrite", - type: { - name: "Number", - }, - }, - diskMBpsReadWrite: { - serializedName: "properties.diskMBpsReadWrite", - type: { - name: "Number", - }, - }, - diskIopsReadOnly: { - serializedName: "properties.diskIOPSReadOnly", - type: { - name: "Number", - }, - }, - diskMBpsReadOnly: { - serializedName: "properties.diskMBpsReadOnly", - type: { - name: "Number", - }, - }, - diskState: { - serializedName: "properties.diskState", - readOnly: true, - type: { - name: "String", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "Encryption", - }, - }, - maxShares: { - serializedName: "properties.maxShares", - type: { - name: "Number", - }, - }, - shareInfo: { - serializedName: "properties.shareInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ShareInfoElement", - }, - }, - }, - }, - networkAccessPolicy: { - serializedName: "properties.networkAccessPolicy", - type: { - name: "String", - }, - }, - diskAccessId: { - serializedName: "properties.diskAccessId", - type: { - name: "String", - }, - }, - burstingEnabledTime: { - serializedName: "properties.burstingEnabledTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - tier: { - serializedName: "properties.tier", - type: { - name: "String", - }, - }, - burstingEnabled: { - serializedName: "properties.burstingEnabled", - type: { - name: "Boolean", - }, - }, - propertyUpdatesInProgress: { - serializedName: "properties.propertyUpdatesInProgress", - type: { - name: "Composite", - className: "PropertyUpdatesInProgress", - }, - }, - supportsHibernation: { - serializedName: "properties.supportsHibernation", - type: { - name: "Boolean", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "DiskSecurityProfile", - }, - }, - completionPercent: { - serializedName: "properties.completionPercent", - type: { - name: "Number", - }, - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - dataAccessAuthMode: { - serializedName: "properties.dataAccessAuthMode", - type: { - name: "String", - }, - }, - optimizedForFrequentAttach: { - serializedName: "properties.optimizedForFrequentAttach", - type: { - name: "Boolean", - }, - }, - lastOwnershipUpdateTime: { - serializedName: "properties.LastOwnershipUpdateTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - availabilityPolicy: { - serializedName: "properties.availabilityPolicy", - type: { - name: "Composite", - className: "AvailabilityPolicy", - }, - }, - }, - }, -}; - -export const Snapshot: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Snapshot", - modelProperties: { - ...TrackedResource.type.modelProperties, - managedBy: { - serializedName: "managedBy", - readOnly: true, - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "SnapshotSku", - }, - }, - extendedLocation: { - serializedName: "extendedLocation", - type: { - name: "Composite", - className: "ExtendedLocation", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "DiskPurchasePlan", - }, - }, - supportedCapabilities: { - serializedName: "properties.supportedCapabilities", - type: { - name: "Composite", - className: "SupportedCapabilities", - }, - }, - creationData: { - serializedName: "properties.creationData", - type: { - name: "Composite", - className: "CreationData", - }, - }, - diskSizeGB: { - serializedName: "properties.diskSizeGB", - type: { - name: "Number", - }, - }, - diskSizeBytes: { - serializedName: "properties.diskSizeBytes", - readOnly: true, - type: { - name: "Number", - }, - }, - diskState: { - serializedName: "properties.diskState", - readOnly: true, - type: { - name: "String", - }, - }, - uniqueId: { - serializedName: "properties.uniqueId", - readOnly: true, - type: { - name: "String", - }, - }, - encryptionSettingsCollection: { - serializedName: "properties.encryptionSettingsCollection", - type: { - name: "Composite", - className: "EncryptionSettingsCollection", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - incremental: { - serializedName: "properties.incremental", - type: { - name: "Boolean", - }, - }, - incrementalSnapshotFamilyId: { - serializedName: "properties.incrementalSnapshotFamilyId", - readOnly: true, - type: { - name: "String", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "Encryption", - }, - }, - networkAccessPolicy: { - serializedName: "properties.networkAccessPolicy", - type: { - name: "String", - }, - }, - diskAccessId: { - serializedName: "properties.diskAccessId", - type: { - name: "String", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "DiskSecurityProfile", - }, - }, - supportsHibernation: { - serializedName: "properties.supportsHibernation", - type: { - name: "Boolean", - }, - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - completionPercent: { - serializedName: "properties.completionPercent", - type: { - name: "Number", - }, - }, - copyCompletionError: { - serializedName: "properties.copyCompletionError", - type: { - name: "Composite", - className: "CopyCompletionError", - }, - }, - dataAccessAuthMode: { - serializedName: "properties.dataAccessAuthMode", - type: { - name: "String", - }, - }, - snapshotAccessState: { - serializedName: "properties.snapshotAccessState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Gallery: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Gallery", - modelProperties: { - ...TrackedResource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "GalleryIdentity", - }, - }, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - identifier: { - serializedName: "properties.identifier", - type: { - name: "Composite", - className: "GalleryIdentifier", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - sharingProfile: { - serializedName: "properties.sharingProfile", - type: { - name: "Composite", - className: "SharingProfile", - }, - }, - softDeletePolicy: { - serializedName: "properties.softDeletePolicy", - type: { - name: "Composite", - className: "SoftDeletePolicy", - }, - }, - sharingStatus: { - serializedName: "properties.sharingStatus", - type: { - name: "Composite", - className: "SharingStatus", - }, - }, - }, - }, -}; - -export const GalleryApplication: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplication", - modelProperties: { - ...TrackedResource.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - eula: { - serializedName: "properties.eula", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "properties.privacyStatementUri", - type: { - name: "String", - }, - }, - releaseNoteUri: { - serializedName: "properties.releaseNoteUri", - type: { - name: "String", - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - supportedOSType: { - serializedName: "properties.supportedOSType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - customActions: { - serializedName: "properties.customActions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryApplicationCustomAction", - }, - }, - }, - }, - }, - }, -}; - -export const GalleryApplicationVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersion", - modelProperties: { - ...TrackedResource.type.modelProperties, - publishingProfile: { - serializedName: "properties.publishingProfile", - type: { - name: "Composite", - className: "GalleryApplicationVersionPublishingProfile", - }, - }, - safetyProfile: { - serializedName: "properties.safetyProfile", - type: { - name: "Composite", - className: "GalleryApplicationVersionSafetyProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "properties.replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - }, - }, -}; - -export const GalleryImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImage", - modelProperties: { - ...TrackedResource.type.modelProperties, - description: { - serializedName: "properties.description", - type: { - name: "String", - }, - }, - eula: { - serializedName: "properties.eula", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "properties.privacyStatementUri", - type: { - name: "String", - }, - }, - releaseNoteUri: { - serializedName: "properties.releaseNoteUri", - type: { - name: "String", - }, - }, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - osState: { - serializedName: "properties.osState", - type: { - name: "Enum", - allowedValues: ["Generalized", "Specialized"], - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - identifier: { - serializedName: "properties.identifier", - type: { - name: "Composite", - className: "GalleryImageIdentifier", - }, - }, - recommended: { - serializedName: "properties.recommended", - type: { - name: "Composite", - className: "RecommendedMachineConfiguration", - }, - }, - disallowed: { - serializedName: "properties.disallowed", - type: { - name: "Composite", - className: "Disallowed", - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "ImagePurchasePlan", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - features: { - serializedName: "properties.features", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryImageFeature", - }, - }, - }, - }, - architecture: { - serializedName: "properties.architecture", - type: { - name: "String", - }, - }, - allowUpdateImage: { - serializedName: "properties.allowUpdateImage", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const GalleryImageVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersion", - modelProperties: { - ...TrackedResource.type.modelProperties, - publishingProfile: { - serializedName: "properties.publishingProfile", - type: { - name: "Composite", - className: "GalleryImageVersionPublishingProfile", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "GalleryImageVersionStorageProfile", - }, - }, - safetyProfile: { - serializedName: "properties.safetyProfile", - type: { - name: "Composite", - className: "GalleryImageVersionSafetyProfile", - }, - }, - replicationStatus: { - serializedName: "properties.replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "ImageVersionSecurityProfile", - }, - }, - restore: { - serializedName: "properties.restore", - type: { - name: "Boolean", - }, - }, - validationsProfile: { - serializedName: "properties.validationsProfile", - type: { - name: "Composite", - className: "ValidationsProfile", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfile", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileProperties", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersion", - modelProperties: { - ...TrackedResource.type.modelProperties, - targetLocations: { - serializedName: "properties.targetLocations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TargetRegion", - }, - }, - }, - }, - excludeFromLatest: { - serializedName: "properties.excludeFromLatest", - type: { - name: "Boolean", - }, - }, - publishedDate: { - serializedName: "properties.publishedDate", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - replicationStatus: { - serializedName: "properties.replicationStatus", - type: { - name: "Composite", - className: "ReplicationStatus", - }, - }, - mode: { - serializedName: "properties.mode", - type: { - name: "String", - }, - }, - defaultAccess: { - serializedName: "properties.defaultAccess", - type: { - name: "String", - }, - }, - rules: { - serializedName: "properties.rules", - type: { - name: "Composite", - className: "AccessControlRules", - }, - }, - }, - }, -}; - -export const GalleryScript: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScript", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "GalleryScriptProperties", - }, - }, - }, - }, -}; - -export const GalleryScriptVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersion", - modelProperties: { - ...TrackedResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "GalleryScriptVersionProperties", - }, - }, - }, - }, -}; - -export const GallerySoftDeletedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GallerySoftDeletedResource", - modelProperties: { - ...TrackedResource.type.modelProperties, - resourceArmId: { - serializedName: "properties.resourceArmId", - type: { - name: "String", - }, - }, - softDeletedArtifactType: { - serializedName: "properties.softDeletedArtifactType", - type: { - name: "String", - }, - }, - softDeletedTime: { - serializedName: "properties.softDeletedTime", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RestorePoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePoint", - modelProperties: { - ...ProxyResource.type.modelProperties, - excludeDisks: { - serializedName: "properties.excludeDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - }, - }, - sourceMetadata: { - serializedName: "properties.sourceMetadata", - type: { - name: "Composite", - className: "RestorePointSourceMetadata", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - consistencyMode: { - serializedName: "properties.consistencyMode", - type: { - name: "String", - }, - }, - timeCreated: { - serializedName: "properties.timeCreated", - type: { - name: "DateTime", - }, - }, - sourceRestorePoint: { - serializedName: "properties.sourceRestorePoint", - type: { - name: "Composite", - className: "ApiEntityReference", - }, - }, - instanceView: { - serializedName: "properties.instanceView", - type: { - name: "Composite", - className: "RestorePointInstanceView", - }, - }, - instantAccessDurationMinutes: { - serializedName: "properties.instantAccessDurationMinutes", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...ProxyResource.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint", - }, - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DiskRestorePoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskRestorePoint", - modelProperties: { - ...ProxyResource.type.modelProperties, - timeCreated: { - serializedName: "properties.timeCreated", - readOnly: true, - type: { - name: "DateTime", - }, - }, - sourceResourceId: { - serializedName: "properties.sourceResourceId", - readOnly: true, - type: { - name: "String", - }, - }, - osType: { - serializedName: "properties.osType", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "DiskPurchasePlan", - }, - }, - supportedCapabilities: { - serializedName: "properties.supportedCapabilities", - type: { - name: "Composite", - className: "SupportedCapabilities", - }, - }, - familyId: { - serializedName: "properties.familyId", - readOnly: true, - type: { - name: "String", - }, - }, - sourceUniqueId: { - serializedName: "properties.sourceUniqueId", - readOnly: true, - type: { - name: "String", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "Encryption", - }, - }, - supportsHibernation: { - serializedName: "properties.supportsHibernation", - type: { - name: "Boolean", - }, - }, - networkAccessPolicy: { - serializedName: "properties.networkAccessPolicy", - type: { - name: "String", - }, - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - diskAccessId: { - serializedName: "properties.diskAccessId", - type: { - name: "String", - }, - }, - completionPercent: { - serializedName: "properties.completionPercent", - type: { - name: "Number", - }, - }, - replicationState: { - serializedName: "properties.replicationState", - readOnly: true, - type: { - name: "String", - }, - }, - sourceResourceLocation: { - serializedName: "properties.sourceResourceLocation", - readOnly: true, - type: { - name: "String", - }, - }, - securityProfile: { - serializedName: "properties.securityProfile", - type: { - name: "Composite", - className: "DiskSecurityProfile", - }, - }, - logicalSectorSize: { - serializedName: "properties.logicalSectorSize", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetReimageParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetReimageParameters", - modelProperties: { - ...VirtualMachineScaleSetVMReimageParameters.type.modelProperties, - instanceIds: { - serializedName: "instanceIds", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const SharedGallery: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGallery", - modelProperties: { - ...PirSharedGalleryResource.type.modelProperties, - artifactTags: { - serializedName: "properties.artifactTags", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const SharedGalleryImage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryImage", - modelProperties: { - ...PirSharedGalleryResource.type.modelProperties, - osType: { - serializedName: "properties.osType", - type: { - name: "Enum", - allowedValues: ["Windows", "Linux"], - }, - }, - osState: { - serializedName: "properties.osState", - type: { - name: "Enum", - allowedValues: ["Generalized", "Specialized"], - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - identifier: { - serializedName: "properties.identifier", - type: { - name: "Composite", - className: "GalleryImageIdentifier", - }, - }, - recommended: { - serializedName: "properties.recommended", - type: { - name: "Composite", - className: "RecommendedMachineConfiguration", - }, - }, - disallowed: { - serializedName: "properties.disallowed", - type: { - name: "Composite", - className: "Disallowed", - }, - }, - hyperVGeneration: { - serializedName: "properties.hyperVGeneration", - type: { - name: "String", - }, - }, - features: { - serializedName: "properties.features", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GalleryImageFeature", - }, - }, - }, - }, - purchasePlan: { - serializedName: "properties.purchasePlan", - type: { - name: "Composite", - className: "ImagePurchasePlan", - }, - }, - architecture: { - serializedName: "properties.architecture", - type: { - name: "String", - }, - }, - privacyStatementUri: { - serializedName: "properties.privacyStatementUri", - type: { - name: "String", - }, - }, - eula: { - serializedName: "properties.eula", - type: { - name: "String", - }, - }, - artifactTags: { - serializedName: "properties.artifactTags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const SharedGalleryImageVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SharedGalleryImageVersion", - modelProperties: { - ...PirSharedGalleryResource.type.modelProperties, - publishedDate: { - serializedName: "properties.publishedDate", - type: { - name: "DateTime", - }, - }, - endOfLifeDate: { - serializedName: "properties.endOfLifeDate", - type: { - name: "DateTime", - }, - }, - excludeFromLatest: { - serializedName: "properties.excludeFromLatest", - type: { - name: "Boolean", - }, - }, - storageProfile: { - serializedName: "properties.storageProfile", - type: { - name: "Composite", - className: "SharedGalleryImageVersionStorageProfile", - }, - }, - artifactTags: { - serializedName: "properties.artifactTags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const AvailabilitySetsConvertToVirtualMachineScaleSetHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AvailabilitySetsConvertToVirtualMachineScaleSetHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ImagesCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImagesCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ImagesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImagesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const ImagesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImagesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const LogAnalyticsExportRequestRateByIntervalHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogAnalyticsExportRequestRateByIntervalHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const LogAnalyticsExportThrottledRequestsHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LogAnalyticsExportThrottledRequestsHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommandsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommandsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommandsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommandsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineRunCommandsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineRunCommandsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsApproveRollingUpgradeHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsApproveRollingUpgradeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsDeallocateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsDeallocateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsDeleteInstancesHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsDeleteInstancesHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsUpdateInstancesHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsUpdateInstancesHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsPerformMaintenanceHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsPerformMaintenanceHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsPowerOffHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsPowerOffHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsReapplyHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsReapplyHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsRedeployHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsRedeployHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsReimageHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsReimageHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsReimageAllHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsReimageAllHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsRestartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsRestartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsScaleOutHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsScaleOutHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetsSetOrchestrationServiceStateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsSetOrchestrationServiceStateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineScaleSetsStartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetsStartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesAssessPatchesHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesAssessPatchesHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesAttachDetachDataDisksHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesAttachDetachDataDisksHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesCaptureHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesCaptureHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesConvertToManagedDisksHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesConvertToManagedDisksHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesDeallocateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesDeallocateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesInstallPatchesHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesInstallPatchesHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesMigrateToVMScaleSetHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesMigrateToVMScaleSetHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesPerformMaintenanceHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesPerformMaintenanceHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesPowerOffHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesPowerOffHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesReapplyHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesReapplyHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesRedeployHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesRedeployHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesReimageHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesReimageHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesRestartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesRestartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesRunCommandHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesRunCommandHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachinesStartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachinesStartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const RestorePointCollectionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointCollectionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CapacityReservationsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CapacityReservationsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CapacityReservationsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CapacityReservationsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DedicatedHostsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DedicatedHostsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DedicatedHostsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DedicatedHostsRedeployHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostsRedeployHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DedicatedHostsRestartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DedicatedHostsRestartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const RestorePointsCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointsCreateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const RestorePointsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorePointsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineScaleSetRollingUpgradesStartOSUpgradeHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineScaleSetRollingUpgradesStartOSUpgradeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineScaleSetRollingUpgradesCancelHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetRollingUpgradesCancelHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetExtensionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetExtensionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetExtensionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsAttachDetachDataDisksHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsDeallocateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsDeallocateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsPerformMaintenanceHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsPerformMaintenanceHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsPowerOffHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsPowerOffHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsRedeployHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsRedeployHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsReimageHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsReimageHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsReimageAllHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsReimageAllHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsRestartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsRestartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsRunCommandHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsRunCommandHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMsStartHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMsStartHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtensionsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMExtensionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtensionsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMExtensionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMExtensionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMRunCommandsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const VirtualMachineScaleSetVMRunCommandsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMRunCommandsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineScaleSetVMRunCommandsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineScaleSetVMRunCommandsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const VirtualMachineExtensionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineExtensionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskAccessesCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccessesCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskAccessesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccessesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskAccessesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccessesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskAccessesUpdateAPrivateEndpointConnectionHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccessesUpdateAPrivateEndpointConnectionHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskAccessesDeleteAPrivateEndpointConnectionHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskAccessesDeleteAPrivateEndpointConnectionHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskEncryptionSetsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSetsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskEncryptionSetsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSetsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskEncryptionSetsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionSetsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DisksCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DisksCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DisksUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DisksUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DisksDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DisksDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DisksGrantAccessHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DisksGrantAccessHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DisksRevokeAccessHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DisksRevokeAccessHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SnapshotsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SnapshotsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SnapshotsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SnapshotsGrantAccessHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotsGrantAccessHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SnapshotsRevokeAccessHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SnapshotsRevokeAccessHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskRestorePointGrantAccessHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskRestorePointGrantAccessHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const DiskRestorePointRevokeAccessHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskRestorePointRevokeAccessHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleriesCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleriesCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleriesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleriesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleriesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleriesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryApplicationsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryApplicationsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryApplicationsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryApplicationVersionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersionsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryApplicationVersionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersionsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryApplicationVersionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryApplicationVersionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryImagesCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImagesCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryImagesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImagesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryImagesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImagesDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryImageVersionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryImageVersionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryImageVersionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryImageVersionsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfilesCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfilesCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfilesUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfilesUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfilesDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfilesDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersionsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const GalleryInVMAccessControlProfileVersionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersionsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryInVMAccessControlProfileVersionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryInVMAccessControlProfileVersionsDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GalleryScriptsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptsCreateOrUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryScriptsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptsUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryScriptsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptsDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryScriptVersionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionsCreateOrUpdateHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryScriptVersionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionsUpdateHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GalleryScriptVersionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GalleryScriptVersionsDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const GallerySharingProfileUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GallerySharingProfileUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; diff --git a/sdk/compute/arm-compute/src/models/models.ts b/sdk/compute/arm-compute/src/models/models.ts new file mode 100644 index 000000000000..0ad53a70df95 --- /dev/null +++ b/sdk/compute/arm-compute/src/models/models.ts @@ -0,0 +1,300 @@ +// 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; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(_item: Resource): any { + return {}; +} + +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 error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** The 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 {}; +} + +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 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"]), + }; +} diff --git a/sdk/compute/arm-compute/src/models/parameters.ts b/sdk/compute/arm-compute/src/models/parameters.ts deleted file mode 100644 index f5b746369902..000000000000 --- a/sdk/compute/arm-compute/src/models/parameters.ts +++ /dev/null @@ -1,1584 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { - OperationParameter, - OperationURLParameter, - OperationQueryParameter, -} from "@azure/core-client"; -import { - AvailabilitySet as AvailabilitySetMapper, - AvailabilitySetUpdate as AvailabilitySetUpdateMapper, - ConvertToVirtualMachineScaleSetInput as ConvertToVirtualMachineScaleSetInputMapper, - MigrateToVirtualMachineScaleSetInput as MigrateToVirtualMachineScaleSetInputMapper, - CapacityReservationGroup as CapacityReservationGroupMapper, - CapacityReservationGroupUpdate as CapacityReservationGroupUpdateMapper, - DedicatedHostGroup as DedicatedHostGroupMapper, - DedicatedHostGroupUpdate as DedicatedHostGroupUpdateMapper, - Image as ImageMapper, - ImageUpdate as ImageUpdateMapper, - RequestRateByIntervalInput as RequestRateByIntervalInputMapper, - ThrottledRequestsInput as ThrottledRequestsInputMapper, - VirtualMachineRunCommand as VirtualMachineRunCommandMapper, - VirtualMachineRunCommandUpdate as VirtualMachineRunCommandUpdateMapper, - VirtualMachineScaleSet as VirtualMachineScaleSetMapper, - VirtualMachineScaleSetUpdate as VirtualMachineScaleSetUpdateMapper, - VirtualMachineScaleSetVMInstanceIDs as VirtualMachineScaleSetVMInstanceIDsMapper, - VMScaleSetConvertToSinglePlacementGroupInput as VMScaleSetConvertToSinglePlacementGroupInputMapper, - VirtualMachineScaleSetVMInstanceRequiredIDs as VirtualMachineScaleSetVMInstanceRequiredIDsMapper, - VirtualMachineScaleSetReimageParameters as VirtualMachineScaleSetReimageParametersMapper, - VMScaleSetScaleOutInput as VMScaleSetScaleOutInputMapper, - OrchestrationServiceStateInput as OrchestrationServiceStateInputMapper, - VirtualMachine as VirtualMachineMapper, - VirtualMachineUpdate as VirtualMachineUpdateMapper, - AttachDetachDataDisksRequest as AttachDetachDataDisksRequestMapper, - VirtualMachineCaptureParameters as VirtualMachineCaptureParametersMapper, - VirtualMachineInstallPatchesParameters as VirtualMachineInstallPatchesParametersMapper, - MigrateVMToVirtualMachineScaleSetInput as MigrateVMToVirtualMachineScaleSetInputMapper, - VirtualMachineReimageParameters as VirtualMachineReimageParametersMapper, - RunCommandInput as RunCommandInputMapper, - ProximityPlacementGroup as ProximityPlacementGroupMapper, - ProximityPlacementGroupUpdate as ProximityPlacementGroupUpdateMapper, - RestorePointCollection as RestorePointCollectionMapper, - RestorePointCollectionUpdate as RestorePointCollectionUpdateMapper, - SshPublicKeyResource as SshPublicKeyResourceMapper, - SshPublicKeyUpdateResource as SshPublicKeyUpdateResourceMapper, - SshGenerateKeyPairInputParameters as SshGenerateKeyPairInputParametersMapper, - CapacityReservation as CapacityReservationMapper, - CapacityReservationUpdate as CapacityReservationUpdateMapper, - DedicatedHost as DedicatedHostMapper, - DedicatedHostUpdate as DedicatedHostUpdateMapper, - RestorePoint as RestorePointMapper, - VirtualMachineScaleSetExtension as VirtualMachineScaleSetExtensionMapper, - VirtualMachineScaleSetExtensionUpdate as VirtualMachineScaleSetExtensionUpdateMapper, - VirtualMachineScaleSetVM as VirtualMachineScaleSetVMMapper, - VirtualMachineScaleSetVMReimageParameters as VirtualMachineScaleSetVMReimageParametersMapper, - VirtualMachineScaleSetVMExtension as VirtualMachineScaleSetVMExtensionMapper, - VirtualMachineScaleSetVMExtensionUpdate as VirtualMachineScaleSetVMExtensionUpdateMapper, - VirtualMachineExtension as VirtualMachineExtensionMapper, - VirtualMachineExtensionUpdate as VirtualMachineExtensionUpdateMapper, - DiskAccess as DiskAccessMapper, - DiskAccessUpdate as DiskAccessUpdateMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper, - DiskEncryptionSet as DiskEncryptionSetMapper, - DiskEncryptionSetUpdate as DiskEncryptionSetUpdateMapper, - Disk as DiskMapper, - DiskUpdate as DiskUpdateMapper, - GrantAccessData as GrantAccessDataMapper, - Snapshot as SnapshotMapper, - SnapshotUpdate as SnapshotUpdateMapper, - Gallery as GalleryMapper, - GalleryUpdate as GalleryUpdateMapper, - GalleryApplication as GalleryApplicationMapper, - GalleryApplicationUpdate as GalleryApplicationUpdateMapper, - GalleryApplicationVersion as GalleryApplicationVersionMapper, - GalleryApplicationVersionUpdate as GalleryApplicationVersionUpdateMapper, - GalleryImage as GalleryImageMapper, - GalleryImageUpdate as GalleryImageUpdateMapper, - GalleryImageVersion as GalleryImageVersionMapper, - GalleryImageVersionUpdate as GalleryImageVersionUpdateMapper, - GalleryInVMAccessControlProfile as GalleryInVMAccessControlProfileMapper, - GalleryInVMAccessControlProfileUpdate as GalleryInVMAccessControlProfileUpdateMapper, - GalleryInVMAccessControlProfileVersion as GalleryInVMAccessControlProfileVersionMapper, - GalleryInVMAccessControlProfileVersionUpdate as GalleryInVMAccessControlProfileVersionUpdateMapper, - GalleryScript as GalleryScriptMapper, - GalleryScriptUpdate as GalleryScriptUpdateMapper, - GalleryScriptVersion as GalleryScriptVersionMapper, - GalleryScriptVersionUpdate as GalleryScriptVersionUpdateMapper, - SharingUpdate as SharingUpdateMapper, - CloudService as CloudServiceMapper, - CloudServiceUpdate as CloudServiceUpdateMapper, - RoleInstances as RoleInstancesMapper, - UpdateDomain as UpdateDomainMapper, -} from "../models/mappers.js"; - -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String", - }, - }, -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2025-04-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1, - }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const availabilitySetName: OperationURLParameter = { - parameterPath: "availabilitySetName", - mapper: { - serializedName: "availabilitySetName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: AvailabilitySetMapper, -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: AvailabilitySetUpdateMapper, -}; - -export const parameters2: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: ConvertToVirtualMachineScaleSetInputMapper, -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: MigrateToVirtualMachineScaleSetInputMapper, -}; - -export const expand1: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const resourceIdsOnly: OperationQueryParameter = { - parameterPath: ["options", "resourceIdsOnly"], - mapper: { - serializedName: "resourceIdsOnly", - type: { - name: "String", - }, - }, -}; - -export const capacityReservationGroupName: OperationURLParameter = { - parameterPath: "capacityReservationGroupName", - mapper: { - serializedName: "capacityReservationGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand2: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: CapacityReservationGroupMapper, -}; - -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: CapacityReservationGroupUpdateMapper, -}; - -export const hostGroupName: OperationURLParameter = { - parameterPath: "hostGroupName", - mapper: { - serializedName: "hostGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand3: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "Enum", - allowedValues: ["instanceView", "userData", "resiliencyView"], - }, - }, -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: DedicatedHostGroupMapper, -}; - -export const parameters7: OperationParameter = { - parameterPath: "parameters", - mapper: DedicatedHostGroupUpdateMapper, -}; - -export const imageName: OperationURLParameter = { - parameterPath: "imageName", - mapper: { - serializedName: "imageName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters8: OperationParameter = { - parameterPath: "parameters", - mapper: ImageMapper, -}; - -export const parameters9: OperationParameter = { - parameterPath: "parameters", - mapper: ImageUpdateMapper, -}; - -export const location: OperationURLParameter = { - parameterPath: "location", - mapper: { - constraints: { - MinLength: 1, - }, - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, -}; - -export const edgeZone: OperationURLParameter = { - parameterPath: "edgeZone", - mapper: { - serializedName: "edgeZone", - required: true, - type: { - name: "String", - }, - }, -}; - -export const publisherName: OperationURLParameter = { - parameterPath: "publisherName", - mapper: { - serializedName: "publisherName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const offer: OperationURLParameter = { - parameterPath: "offer", - mapper: { - serializedName: "offer", - required: true, - type: { - name: "String", - }, - }, -}; - -export const skus: OperationURLParameter = { - parameterPath: "skus", - mapper: { - serializedName: "skus", - required: true, - type: { - name: "String", - }, - }, -}; - -export const top: OperationQueryParameter = { - parameterPath: ["options", "top"], - mapper: { - serializedName: "$top", - type: { - name: "Number", - }, - }, -}; - -export const orderby: OperationQueryParameter = { - parameterPath: ["options", "orderby"], - mapper: { - serializedName: "$orderby", - type: { - name: "String", - }, - }, -}; - -export const version: OperationURLParameter = { - parameterPath: "version", - mapper: { - serializedName: "version", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand4: OperationQueryParameter = { - parameterPath: "expand", - mapper: { - serializedName: "$expand", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters10: OperationParameter = { - parameterPath: "parameters", - mapper: RequestRateByIntervalInputMapper, -}; - -export const parameters11: OperationParameter = { - parameterPath: "parameters", - mapper: ThrottledRequestsInputMapper, -}; - -export const typeParam: OperationURLParameter = { - parameterPath: "typeParam", - mapper: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String", - }, - }, -}; - -export const commandId: OperationURLParameter = { - parameterPath: "commandId", - mapper: { - serializedName: "commandId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const vmName: OperationURLParameter = { - parameterPath: "vmName", - mapper: { - serializedName: "vmName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const runCommandName: OperationURLParameter = { - parameterPath: "runCommandName", - mapper: { - serializedName: "runCommandName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const runCommand: OperationParameter = { - parameterPath: "runCommand", - mapper: VirtualMachineRunCommandMapper, -}; - -export const runCommand1: OperationParameter = { - parameterPath: "runCommand", - mapper: VirtualMachineRunCommandUpdateMapper, -}; - -export const vmScaleSetName: OperationURLParameter = { - parameterPath: "vmScaleSetName", - mapper: { - serializedName: "vmScaleSetName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand5: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const parameters12: OperationParameter = { - parameterPath: "parameters", - mapper: VirtualMachineScaleSetMapper, -}; - -export const ifMatch: OperationParameter = { - parameterPath: ["options", "ifMatch"], - mapper: { - serializedName: "If-Match", - type: { - name: "String", - }, - }, -}; - -export const ifNoneMatch: OperationParameter = { - parameterPath: ["options", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - type: { - name: "String", - }, - }, -}; - -export const parameters13: OperationParameter = { - parameterPath: "parameters", - mapper: VirtualMachineScaleSetUpdateMapper, -}; - -export const forceDeletion: OperationQueryParameter = { - parameterPath: ["options", "forceDeletion"], - mapper: { - serializedName: "forceDeletion", - type: { - name: "Boolean", - }, - }, -}; - -export const vmInstanceIDs: OperationParameter = { - parameterPath: ["options", "vmInstanceIDs"], - mapper: VirtualMachineScaleSetVMInstanceIDsMapper, -}; - -export const parameters14: OperationParameter = { - parameterPath: "parameters", - mapper: VMScaleSetConvertToSinglePlacementGroupInputMapper, -}; - -export const hibernate: OperationQueryParameter = { - parameterPath: ["options", "hibernate"], - mapper: { - serializedName: "hibernate", - type: { - name: "Boolean", - }, - }, -}; - -export const vmInstanceIDs1: OperationParameter = { - parameterPath: "vmInstanceIDs", - mapper: VirtualMachineScaleSetVMInstanceRequiredIDsMapper, -}; - -export const platformUpdateDomain: OperationQueryParameter = { - parameterPath: "platformUpdateDomain", - mapper: { - serializedName: "platformUpdateDomain", - required: true, - type: { - name: "Number", - }, - }, -}; - -export const zone: OperationQueryParameter = { - parameterPath: ["options", "zone"], - mapper: { - serializedName: "zone", - type: { - name: "String", - }, - }, -}; - -export const placementGroupId: OperationQueryParameter = { - parameterPath: ["options", "placementGroupId"], - mapper: { - serializedName: "placementGroupId", - type: { - name: "String", - }, - }, -}; - -export const skipShutdown: OperationQueryParameter = { - parameterPath: ["options", "skipShutdown"], - mapper: { - serializedName: "skipShutdown", - type: { - name: "Boolean", - }, - }, -}; - -export const vmScaleSetReimageInput: OperationParameter = { - parameterPath: ["options", "vmScaleSetReimageInput"], - mapper: VirtualMachineScaleSetReimageParametersMapper, -}; - -export const parameters15: OperationParameter = { - parameterPath: "parameters", - mapper: VMScaleSetScaleOutInputMapper, -}; - -export const parameters16: OperationParameter = { - parameterPath: "parameters", - mapper: OrchestrationServiceStateInputMapper, -}; - -export const statusOnly: OperationQueryParameter = { - parameterPath: ["options", "statusOnly"], - mapper: { - serializedName: "statusOnly", - type: { - name: "String", - }, - }, -}; - -export const expand6: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const expand7: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const parameters17: OperationParameter = { - parameterPath: "parameters", - mapper: VirtualMachineMapper, -}; - -export const parameters18: OperationParameter = { - parameterPath: "parameters", - mapper: VirtualMachineUpdateMapper, -}; - -export const parameters19: OperationParameter = { - parameterPath: "parameters", - mapper: AttachDetachDataDisksRequestMapper, -}; - -export const parameters20: OperationParameter = { - parameterPath: "parameters", - mapper: VirtualMachineCaptureParametersMapper, -}; - -export const installPatchesInput: OperationParameter = { - parameterPath: "installPatchesInput", - mapper: VirtualMachineInstallPatchesParametersMapper, -}; - -export const parameters21: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: MigrateVMToVirtualMachineScaleSetInputMapper, -}; - -export const parameters22: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: VirtualMachineReimageParametersMapper, -}; - -export const sasUriExpirationTimeInMinutes: OperationQueryParameter = { - parameterPath: ["options", "sasUriExpirationTimeInMinutes"], - mapper: { - serializedName: "sasUriExpirationTimeInMinutes", - type: { - name: "Number", - }, - }, -}; - -export const parameters23: OperationParameter = { - parameterPath: "parameters", - mapper: RunCommandInputMapper, -}; - -export const proximityPlacementGroupName: OperationURLParameter = { - parameterPath: "proximityPlacementGroupName", - mapper: { - serializedName: "proximityPlacementGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const includeColocationStatus: OperationQueryParameter = { - parameterPath: ["options", "includeColocationStatus"], - mapper: { - serializedName: "includeColocationStatus", - type: { - name: "String", - }, - }, -}; - -export const parameters24: OperationParameter = { - parameterPath: "parameters", - mapper: ProximityPlacementGroupMapper, -}; - -export const parameters25: OperationParameter = { - parameterPath: "parameters", - mapper: ProximityPlacementGroupUpdateMapper, -}; - -export const restorePointCollectionName: OperationURLParameter = { - parameterPath: "restorePointCollectionName", - mapper: { - serializedName: "restorePointCollectionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand8: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const parameters26: OperationParameter = { - parameterPath: "parameters", - mapper: RestorePointCollectionMapper, -}; - -export const parameters27: OperationParameter = { - parameterPath: "parameters", - mapper: RestorePointCollectionUpdateMapper, -}; - -export const sshPublicKeyName: OperationURLParameter = { - parameterPath: "sshPublicKeyName", - mapper: { - serializedName: "sshPublicKeyName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters28: OperationParameter = { - parameterPath: "parameters", - mapper: SshPublicKeyResourceMapper, -}; - -export const parameters29: OperationParameter = { - parameterPath: "parameters", - mapper: SshPublicKeyUpdateResourceMapper, -}; - -export const parameters30: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: SshGenerateKeyPairInputParametersMapper, -}; - -export const capacityReservationName: OperationURLParameter = { - parameterPath: "capacityReservationName", - mapper: { - serializedName: "capacityReservationName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand9: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const parameters31: OperationParameter = { - parameterPath: "parameters", - mapper: CapacityReservationMapper, -}; - -export const parameters32: OperationParameter = { - parameterPath: "parameters", - mapper: CapacityReservationUpdateMapper, -}; - -export const hostName: OperationURLParameter = { - parameterPath: "hostName", - mapper: { - serializedName: "hostName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters33: OperationParameter = { - parameterPath: "parameters", - mapper: DedicatedHostMapper, -}; - -export const parameters34: OperationParameter = { - parameterPath: "parameters", - mapper: DedicatedHostUpdateMapper, -}; - -export const restorePointName: OperationURLParameter = { - parameterPath: "restorePointName", - mapper: { - serializedName: "restorePointName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const expand10: OperationQueryParameter = { - parameterPath: ["options", "expand"], - mapper: { - serializedName: "$expand", - type: { - name: "String", - }, - }, -}; - -export const parameters35: OperationParameter = { - parameterPath: "parameters", - mapper: RestorePointMapper, -}; - -export const vmssExtensionName: OperationURLParameter = { - parameterPath: "vmssExtensionName", - mapper: { - serializedName: "vmssExtensionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const extensionParameters: OperationParameter = { - parameterPath: "extensionParameters", - mapper: VirtualMachineScaleSetExtensionMapper, -}; - -export const extensionParameters1: OperationParameter = { - parameterPath: "extensionParameters", - mapper: VirtualMachineScaleSetExtensionUpdateMapper, -}; - -export const virtualMachineScaleSetName: OperationURLParameter = { - parameterPath: "virtualMachineScaleSetName", - mapper: { - serializedName: "virtualMachineScaleSetName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const select: OperationQueryParameter = { - parameterPath: ["options", "select"], - mapper: { - serializedName: "$select", - type: { - name: "String", - }, - }, -}; - -export const instanceId: OperationURLParameter = { - parameterPath: "instanceId", - mapper: { - serializedName: "instanceId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters36: OperationParameter = { - parameterPath: "parameters", - mapper: VirtualMachineScaleSetVMMapper, -}; - -export const vmScaleSetVMReimageInput: OperationParameter = { - parameterPath: ["options", "vmScaleSetVMReimageInput"], - mapper: VirtualMachineScaleSetVMReimageParametersMapper, -}; - -export const vmExtensionName: OperationURLParameter = { - parameterPath: "vmExtensionName", - mapper: { - serializedName: "vmExtensionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const extensionParameters2: OperationParameter = { - parameterPath: "extensionParameters", - mapper: VirtualMachineScaleSetVMExtensionMapper, -}; - -export const extensionParameters3: OperationParameter = { - parameterPath: "extensionParameters", - mapper: VirtualMachineScaleSetVMExtensionUpdateMapper, -}; - -export const extensionParameters4: OperationParameter = { - parameterPath: "extensionParameters", - mapper: VirtualMachineExtensionMapper, -}; - -export const extensionParameters5: OperationParameter = { - parameterPath: "extensionParameters", - mapper: VirtualMachineExtensionUpdateMapper, -}; - -export const apiVersion1: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2025-01-02", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const diskAccessName: OperationURLParameter = { - parameterPath: "diskAccessName", - mapper: { - serializedName: "diskAccessName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const diskAccess: OperationParameter = { - parameterPath: "diskAccess", - mapper: DiskAccessMapper, -}; - -export const diskAccess1: OperationParameter = { - parameterPath: "diskAccess", - mapper: DiskAccessUpdateMapper, -}; - -export const privateEndpointConnectionName: OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", - mapper: { - serializedName: "privateEndpointConnectionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const privateEndpointConnection: OperationParameter = { - parameterPath: "privateEndpointConnection", - mapper: PrivateEndpointConnectionMapper, -}; - -export const diskEncryptionSetName: OperationURLParameter = { - parameterPath: "diskEncryptionSetName", - mapper: { - serializedName: "diskEncryptionSetName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const diskEncryptionSet: OperationParameter = { - parameterPath: "diskEncryptionSet", - mapper: DiskEncryptionSetMapper, -}; - -export const diskEncryptionSet1: OperationParameter = { - parameterPath: "diskEncryptionSet", - mapper: DiskEncryptionSetUpdateMapper, -}; - -export const diskName: OperationURLParameter = { - parameterPath: "diskName", - mapper: { - serializedName: "diskName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const disk: OperationParameter = { - parameterPath: "disk", - mapper: DiskMapper, -}; - -export const disk1: OperationParameter = { - parameterPath: "disk", - mapper: DiskUpdateMapper, -}; - -export const grantAccessData: OperationParameter = { - parameterPath: "grantAccessData", - mapper: GrantAccessDataMapper, -}; - -export const snapshotName: OperationURLParameter = { - parameterPath: "snapshotName", - mapper: { - serializedName: "snapshotName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const snapshot: OperationParameter = { - parameterPath: "snapshot", - mapper: SnapshotMapper, -}; - -export const snapshot1: OperationParameter = { - parameterPath: "snapshot", - mapper: SnapshotUpdateMapper, -}; - -export const vmRestorePointName: OperationURLParameter = { - parameterPath: "vmRestorePointName", - mapper: { - serializedName: "vmRestorePointName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const diskRestorePointName: OperationURLParameter = { - parameterPath: "diskRestorePointName", - mapper: { - serializedName: "diskRestorePointName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion2: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2021-07-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const includeExtendedLocations: OperationQueryParameter = { - parameterPath: ["options", "includeExtendedLocations"], - mapper: { - serializedName: "includeExtendedLocations", - type: { - name: "String", - }, - }, -}; - -export const apiVersion3: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2025-03-03", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const galleryName: OperationURLParameter = { - parameterPath: "galleryName", - mapper: { - constraints: { - Pattern: new RegExp("^[^_\\W][\\w-._]{0,79}(? -/** Class containing AvailabilitySets operations. */ -export class AvailabilitySetsImpl implements AvailabilitySets { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class AvailabilitySets class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all availability sets in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AvailabilitySetsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all availability sets in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - options?: AvailabilitySetsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - options?: AvailabilitySetsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AvailabilitySetsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - options?: AvailabilitySetsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an - * existing availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - public listAvailableSizes( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsListAvailableSizesOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAvailableSizesPagingAll(resourceGroupName, availabilitySetName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAvailableSizesPagingPage( - resourceGroupName, - availabilitySetName, - options, - settings, - ); - }, - }; - } - - private async *listAvailableSizesPagingPage( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsListAvailableSizesOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AvailabilitySetsListAvailableSizesResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAvailableSizes(resourceGroupName, availabilitySetName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAvailableSizesNext( - resourceGroupName, - availabilitySetName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAvailableSizesPagingAll( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsListAvailableSizesOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAvailableSizesPagingPage( - resourceGroupName, - availabilitySetName, - options, - )) { - yield* page; - } - } - - /** - * Lists all availability sets in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); - } - - /** - * Lists all availability sets in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - options?: AvailabilitySetsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ resourceGroupName, options }, listOperationSpec); - } - - /** - * Retrieves information about an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, options }, - getOperationSpec, - ); - } - - /** - * Create or update an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - availabilitySetName: string, - parameters: AvailabilitySet, - options?: AvailabilitySetsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Update an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - availabilitySetName: string, - parameters: AvailabilitySetUpdate, - options?: AvailabilitySetsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Delete an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, options }, - deleteOperationSpec, - ); - } - - /** - * Cancel the migration operation on an Availability Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - cancelMigrationToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, options }, - cancelMigrationToVirtualMachineScaleSetOperationSpec, - ); - } - - /** - * Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the - * Availability Set. This does not trigger a downtime on the Virtual Machines. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - async beginConvertToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsConvertToVirtualMachineScaleSetResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, availabilitySetName, options }, - spec: convertToVirtualMachineScaleSetOperationSpec, - }); - const poller = await createHttpPoller< - AvailabilitySetsConvertToVirtualMachineScaleSetResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the - * Availability Set. This does not trigger a downtime on the Virtual Machines. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - async beginConvertToVirtualMachineScaleSetAndWait( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, - ): Promise { - const poller = await this.beginConvertToVirtualMachineScaleSet( - resourceGroupName, - availabilitySetName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine - * Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a - * downtime on the Virtual Machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the migrate operation on the availability set. - * @param options The options parameters. - */ - startMigrationToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - parameters: MigrateToVirtualMachineScaleSetInput, - options?: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, parameters, options }, - startMigrationToVirtualMachineScaleSetOperationSpec, - ); - } - - /** - * Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual - * Machine Scale Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the migrate operation on the availability set. - * @param options The options parameters. - */ - validateMigrationToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - parameters: MigrateToVirtualMachineScaleSetInput, - options?: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, parameters, options }, - validateMigrationToVirtualMachineScaleSetOperationSpec, - ); - } - - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an - * existing availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - private _listAvailableSizes( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsListAvailableSizesOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, options }, - listAvailableSizesOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: AvailabilitySetsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - nextLink: string, - options?: AvailabilitySetsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listNextOperationSpec, - ); - } - - /** - * ListAvailableSizesNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param nextLink The nextLink from the previous successful call to the ListAvailableSizes method. - * @param options The options parameters. - */ - private _listAvailableSizesNext( - resourceGroupName: string, - availabilitySetName: string, - nextLink: string, - options?: AvailabilitySetsListAvailableSizesNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, availabilitySetName, nextLink, options }, - listAvailableSizesNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelMigrationToVirtualMachineScaleSetOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/cancelMigrationToVirtualMachineScaleSet", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const convertToVirtualMachineScaleSetOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/convertToVirtualMachineScaleSet", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.AvailabilitySetsConvertToVirtualMachineScaleSetHeaders, - }, - 201: { - headersMapper: Mappers.AvailabilitySetsConvertToVirtualMachineScaleSetHeaders, - }, - 202: { - headersMapper: Mappers.AvailabilitySetsConvertToVirtualMachineScaleSetHeaders, - }, - 204: { - headersMapper: Mappers.AvailabilitySetsConvertToVirtualMachineScaleSetHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const startMigrationToVirtualMachineScaleSetOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/startMigrationToVirtualMachineScaleSet", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const validateMigrationToVirtualMachineScaleSetOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/validateMigrationToVirtualMachineScaleSet", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listAvailableSizesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilitySetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAvailableSizesNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.availabilitySetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts b/sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts deleted file mode 100644 index 424840ed2e7e..000000000000 --- a/sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts +++ /dev/null @@ -1,457 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CapacityReservationGroups } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - CapacityReservationGroup, - CapacityReservationGroupsListBySubscriptionNextOptionalParams, - CapacityReservationGroupsListBySubscriptionOptionalParams, - CapacityReservationGroupsListBySubscriptionResponse, - CapacityReservationGroupsListByResourceGroupNextOptionalParams, - CapacityReservationGroupsListByResourceGroupOptionalParams, - CapacityReservationGroupsListByResourceGroupResponse, - CapacityReservationGroupsGetOptionalParams, - CapacityReservationGroupsGetResponse, - CapacityReservationGroupsCreateOrUpdateOptionalParams, - CapacityReservationGroupsCreateOrUpdateResponse, - CapacityReservationGroupUpdate, - CapacityReservationGroupsUpdateOptionalParams, - CapacityReservationGroupsUpdateResponse, - CapacityReservationGroupsDeleteOptionalParams, - CapacityReservationGroupsListBySubscriptionNextResponse, - CapacityReservationGroupsListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CapacityReservationGroups operations. */ -export class CapacityReservationGroupsImpl implements CapacityReservationGroups { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CapacityReservationGroups class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the - * response to get the next page of capacity reservation groups. - * @param options The options parameters. - */ - public listBySubscription( - options?: CapacityReservationGroupsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: CapacityReservationGroupsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CapacityReservationGroupsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: CapacityReservationGroupsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink - * property in the response to get the next page of capacity reservation groups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: CapacityReservationGroupsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: CapacityReservationGroupsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CapacityReservationGroupsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: CapacityReservationGroupsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the - * response to get the next page of capacity reservation groups. - * @param options The options parameters. - */ - private _listBySubscription( - options?: CapacityReservationGroupsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); - } - - /** - * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink - * property in the response to get the next page of capacity reservation groups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: CapacityReservationGroupsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * The operation that retrieves information about a capacity reservation group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationGroupsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, capacityReservationGroupName, options }, - getOperationSpec, - ); - } - - /** - * The operation to create or update a capacity reservation group. When updating a capacity reservation - * group, only tags and sharing profile may be modified. Please refer to - * https://aka.ms/CapacityReservation for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param parameters Parameters supplied to the Create capacity reservation Group. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - capacityReservationGroupName: string, - parameters: CapacityReservationGroup, - options?: CapacityReservationGroupsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, capacityReservationGroupName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * The operation to update a capacity reservation group. When updating a capacity reservation group, - * only tags and sharing profile may be modified. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param parameters Parameters supplied to the Update capacity reservation Group operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - capacityReservationGroupName: string, - parameters: CapacityReservationGroupUpdate, - options?: CapacityReservationGroupsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, capacityReservationGroupName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * The operation to delete a capacity reservation group. This operation is allowed only if all the - * associated resources are disassociated from the reservation group and all capacity reservations - * under the reservation group have also been deleted. Please refer to - * https://aka.ms/CapacityReservation for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationGroupsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, capacityReservationGroupName, options }, - deleteOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: CapacityReservationGroupsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: CapacityReservationGroupsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand1, Parameters.resourceIdsOnly], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand1], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand2], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationGroup, - }, - 201: { - bodyMapper: Mappers.CapacityReservationGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/capacityReservations.ts b/sdk/compute/arm-compute/src/operations/capacityReservations.ts deleted file mode 100644 index 04ac4169b1ba..000000000000 --- a/sdk/compute/arm-compute/src/operations/capacityReservations.ts +++ /dev/null @@ -1,659 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CapacityReservations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - CapacityReservation, - CapacityReservationsListByCapacityReservationGroupNextOptionalParams, - CapacityReservationsListByCapacityReservationGroupOptionalParams, - CapacityReservationsListByCapacityReservationGroupResponse, - CapacityReservationsGetOptionalParams, - CapacityReservationsGetResponse, - CapacityReservationsCreateOrUpdateOptionalParams, - CapacityReservationsCreateOrUpdateResponse, - CapacityReservationUpdate, - CapacityReservationsUpdateOptionalParams, - CapacityReservationsUpdateResponse, - CapacityReservationsDeleteOptionalParams, - CapacityReservationsListByCapacityReservationGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CapacityReservations operations. */ -export class CapacityReservationsImpl implements CapacityReservations { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CapacityReservations class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink - * property in the response to get the next page of capacity reservations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param options The options parameters. - */ - public listByCapacityReservationGroup( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByCapacityReservationGroupPagingAll( - resourceGroupName, - capacityReservationGroupName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByCapacityReservationGroupPagingPage( - resourceGroupName, - capacityReservationGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByCapacityReservationGroupPagingPage( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CapacityReservationsListByCapacityReservationGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByCapacityReservationGroupNext( - resourceGroupName, - capacityReservationGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByCapacityReservationGroupPagingAll( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByCapacityReservationGroupPagingPage( - resourceGroupName, - capacityReservationGroupName, - options, - )) { - yield* page; - } - } - - /** - * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink - * property in the response to get the next page of capacity reservations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param options The options parameters. - */ - private _listByCapacityReservationGroup( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, capacityReservationGroupName, options }, - listByCapacityReservationGroupOperationSpec, - ); - } - - /** - * The operation that retrieves information about the capacity reservation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - options?: CapacityReservationsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - }, - getOperationSpec, - ); - } - - /** - * The operation to create or update a capacity reservation. Please note some properties can be set - * only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for - * more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Create capacity reservation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservation, - options?: CapacityReservationsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CapacityReservationsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - CapacityReservationsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update a capacity reservation. Please note some properties can be set - * only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for - * more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Create capacity reservation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservation, - options?: CapacityReservationsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to update a capacity reservation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Update capacity reservation operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservationUpdate, - options?: CapacityReservationsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CapacityReservationsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - CapacityReservationsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update a capacity reservation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Update capacity reservation operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservationUpdate, - options?: CapacityReservationsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to delete a capacity reservation. This operation is allowed only when all the - * associated resources are disassociated from the capacity reservation. Please refer to - * https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be - * deleted after it has been successfully allocated until the schedule end time. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - options?: CapacityReservationsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete a capacity reservation. This operation is allowed only when all the - * associated resources are disassociated from the capacity reservation. Please refer to - * https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be - * deleted after it has been successfully allocated until the schedule end time. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - options?: CapacityReservationsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - capacityReservationGroupName, - capacityReservationName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByCapacityReservationGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param nextLink The nextLink from the previous successful call to the ListByCapacityReservationGroup - * method. - * @param options The options parameters. - */ - private _listByCapacityReservationGroupNext( - resourceGroupName: string, - capacityReservationGroupName: string, - nextLink: string, - options?: CapacityReservationsListByCapacityReservationGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, capacityReservationGroupName, nextLink, options }, - listByCapacityReservationGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByCapacityReservationGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand9], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - Parameters.capacityReservationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservation, - }, - 201: { - bodyMapper: Mappers.CapacityReservation, - }, - 202: { - bodyMapper: Mappers.CapacityReservation, - }, - 204: { - bodyMapper: Mappers.CapacityReservation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters31, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - Parameters.capacityReservationName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservation, - }, - 201: { - bodyMapper: Mappers.CapacityReservation, - }, - 202: { - bodyMapper: Mappers.CapacityReservation, - }, - 204: { - bodyMapper: Mappers.CapacityReservation, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters32, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - Parameters.capacityReservationName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - Parameters.capacityReservationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByCapacityReservationGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CapacityReservationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.capacityReservationGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts b/sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts deleted file mode 100644 index 0f20f13ac11f..000000000000 --- a/sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CloudServiceOperatingSystems } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - OSVersion, - CloudServiceOperatingSystemsListOSVersionsNextOptionalParams, - CloudServiceOperatingSystemsListOSVersionsOptionalParams, - CloudServiceOperatingSystemsListOSVersionsResponse, - OSFamily, - CloudServiceOperatingSystemsListOSFamiliesNextOptionalParams, - CloudServiceOperatingSystemsListOSFamiliesOptionalParams, - CloudServiceOperatingSystemsListOSFamiliesResponse, - CloudServiceOperatingSystemsGetOSVersionOptionalParams, - CloudServiceOperatingSystemsGetOSVersionResponse, - CloudServiceOperatingSystemsGetOSFamilyOptionalParams, - CloudServiceOperatingSystemsGetOSFamilyResponse, - CloudServiceOperatingSystemsListOSVersionsNextResponse, - CloudServiceOperatingSystemsListOSFamiliesNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CloudServiceOperatingSystems operations. */ -export class CloudServiceOperatingSystemsImpl implements CloudServiceOperatingSystems { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CloudServiceOperatingSystems class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of all guest operating system versions available to be specified in the XML service - * configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next - * page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * @param location Name of the location that the OS versions pertain to. - * @param options The options parameters. - */ - public listOSVersions( - location: string, - options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listOSVersionsPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listOSVersionsPagingPage(location, options, settings); - }, - }; - } - - private async *listOSVersionsPagingPage( - location: string, - options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudServiceOperatingSystemsListOSVersionsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listOSVersions(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listOSVersionsNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listOSVersionsPagingAll( - location: string, - options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listOSVersionsPagingPage(location, options)) { - yield* page; - } - } - - /** - * Gets a list of all guest operating system families available to be specified in the XML service - * configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next - * page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * @param location Name of the location that the OS families pertain to. - * @param options The options parameters. - */ - public listOSFamilies( - location: string, - options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listOSFamiliesPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listOSFamiliesPagingPage(location, options, settings); - }, - }; - } - - private async *listOSFamiliesPagingPage( - location: string, - options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudServiceOperatingSystemsListOSFamiliesResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listOSFamilies(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listOSFamiliesNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listOSFamiliesPagingAll( - location: string, - options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listOSFamiliesPagingPage(location, options)) { - yield* page; - } - } - - /** - * Gets properties of a guest operating system version that can be specified in the XML service - * configuration (.cscfg) for a cloud service. - * @param location Name of the location that the OS version pertains to. - * @param osVersionName Name of the OS version. - * @param options The options parameters. - */ - getOSVersion( - location: string, - osVersionName: string, - options?: CloudServiceOperatingSystemsGetOSVersionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, osVersionName, options }, - getOSVersionOperationSpec, - ); - } - - /** - * Gets a list of all guest operating system versions available to be specified in the XML service - * configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next - * page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * @param location Name of the location that the OS versions pertain to. - * @param options The options parameters. - */ - private _listOSVersions( - location: string, - options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listOSVersionsOperationSpec); - } - - /** - * Gets properties of a guest operating system family that can be specified in the XML service - * configuration (.cscfg) for a cloud service. - * @param location Name of the location that the OS family pertains to. - * @param osFamilyName Name of the OS family. - * @param options The options parameters. - */ - getOSFamily( - location: string, - osFamilyName: string, - options?: CloudServiceOperatingSystemsGetOSFamilyOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, osFamilyName, options }, - getOSFamilyOperationSpec, - ); - } - - /** - * Gets a list of all guest operating system families available to be specified in the XML service - * configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next - * page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * @param location Name of the location that the OS families pertain to. - * @param options The options parameters. - */ - private _listOSFamilies( - location: string, - options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listOSFamiliesOperationSpec); - } - - /** - * ListOSVersionsNext - * @param location Name of the location that the OS versions pertain to. - * @param nextLink The nextLink from the previous successful call to the ListOSVersions method. - * @param options The options parameters. - */ - private _listOSVersionsNext( - location: string, - nextLink: string, - options?: CloudServiceOperatingSystemsListOSVersionsNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, nextLink, options }, - listOSVersionsNextOperationSpec, - ); - } - - /** - * ListOSFamiliesNext - * @param location Name of the location that the OS families pertain to. - * @param nextLink The nextLink from the previous successful call to the ListOSFamilies method. - * @param options The options parameters. - */ - private _listOSFamiliesNext( - location: string, - nextLink: string, - options?: CloudServiceOperatingSystemsListOSFamiliesNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, nextLink, options }, - listOSFamiliesNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOSVersionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OSVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location1, - Parameters.osVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOSVersionsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OSVersionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location1], - headerParameters: [Parameters.accept], - serializer, -}; -const getOSFamilyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OSFamily, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location1, - Parameters.osFamilyName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOSFamiliesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OSFamilyListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location1], - headerParameters: [Parameters.accept], - serializer, -}; -const listOSVersionsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OSVersionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOSFamiliesNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OSFamilyListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location1, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts b/sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts deleted file mode 100644 index ace9da026f39..000000000000 --- a/sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts +++ /dev/null @@ -1,761 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CloudServiceRoleInstances } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - RoleInstance, - CloudServiceRoleInstancesListNextOptionalParams, - CloudServiceRoleInstancesListOptionalParams, - CloudServiceRoleInstancesListResponse, - CloudServiceRoleInstancesDeleteOptionalParams, - CloudServiceRoleInstancesGetOptionalParams, - CloudServiceRoleInstancesGetResponse, - CloudServiceRoleInstancesGetInstanceViewOptionalParams, - CloudServiceRoleInstancesGetInstanceViewResponse, - CloudServiceRoleInstancesRestartOptionalParams, - CloudServiceRoleInstancesReimageOptionalParams, - CloudServiceRoleInstancesRebuildOptionalParams, - CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams, - CloudServiceRoleInstancesGetRemoteDesktopFileResponse, - CloudServiceRoleInstancesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CloudServiceRoleInstances operations. */ -export class CloudServiceRoleInstancesImpl implements CloudServiceRoleInstances { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CloudServiceRoleInstances class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get - * the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, cloudServiceName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, cloudServiceName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudServiceRoleInstancesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, cloudServiceName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - cloudServiceName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, cloudServiceName, options)) { - yield* page; - } - } - - /** - * Deletes a role instance from a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginDelete( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { roleInstanceName, resourceGroupName, cloudServiceName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a role instance from a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginDeleteAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - roleInstanceName, - resourceGroupName, - cloudServiceName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a role instance from a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - get( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { roleInstanceName, resourceGroupName, cloudServiceName, options }, - getOperationSpec, - ); - } - - /** - * Retrieves information about the run-time state of a role instance in a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - getInstanceView( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesGetInstanceViewOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { roleInstanceName, resourceGroupName, cloudServiceName, options }, - getInstanceViewOperationSpec, - ); - } - - /** - * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get - * the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, options }, - listOperationSpec, - ); - } - - /** - * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud - * service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRestart( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRestartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { roleInstanceName, resourceGroupName, cloudServiceName, options }, - spec: restartOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud - * service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRestartAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRestartOptionalParams, - ): Promise { - const poller = await this.beginRestart( - roleInstanceName, - resourceGroupName, - cloudServiceName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginReimage( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesReimageOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { roleInstanceName, resourceGroupName, cloudServiceName, options }, - spec: reimageOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginReimageAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesReimageOptionalParams, - ): Promise { - const poller = await this.beginReimage( - roleInstanceName, - resourceGroupName, - cloudServiceName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles and initializes the storage resources that are used by them. If you do not - * want to initialize storage resources, you can use Reimage Role Instance. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRebuild( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRebuildOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { roleInstanceName, resourceGroupName, cloudServiceName, options }, - spec: rebuildOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles and initializes the storage resources that are used by them. If you do not - * want to initialize storage resources, you can use Reimage Role Instance. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRebuildAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRebuildOptionalParams, - ): Promise { - const poller = await this.beginRebuild( - roleInstanceName, - resourceGroupName, - cloudServiceName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a remote desktop file for a role instance in a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - getRemoteDesktopFile( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { roleInstanceName, resourceGroupName, cloudServiceName, options }, - getRemoteDesktopFileOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - cloudServiceName: string, - nextLink: string, - options?: CloudServiceRoleInstancesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.roleInstanceName, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleInstance, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.expand3, Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.roleInstanceName, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getInstanceViewOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleInstanceView, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.roleInstanceName, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleInstanceListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.expand3, Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const restartOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.roleInstanceName, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const reimageOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.roleInstanceName, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const rebuildOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.roleInstanceName, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getRemoteDesktopFileOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse", - }, - }, - default: {}, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.roleInstanceName, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept1], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RoleInstanceListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts b/sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts deleted file mode 100644 index 095a14120bc8..000000000000 --- a/sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CloudServiceRoles } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - CloudServiceRole, - CloudServiceRolesListNextOptionalParams, - CloudServiceRolesListOptionalParams, - CloudServiceRolesListResponse, - CloudServiceRolesGetOptionalParams, - CloudServiceRolesGetResponse, - CloudServiceRolesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CloudServiceRoles operations. */ -export class CloudServiceRolesImpl implements CloudServiceRoles { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CloudServiceRoles class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next - * page of roles. Do this till nextLink is null to fetch all the roles. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRolesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, cloudServiceName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, cloudServiceName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRolesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudServiceRolesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, cloudServiceName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - cloudServiceName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRolesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, cloudServiceName, options)) { - yield* page; - } - } - - /** - * Gets a role from a cloud service. - * @param roleName Name of the role. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - get( - roleName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRolesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { roleName, resourceGroupName, cloudServiceName, options }, - getOperationSpec, - ); - } - - /** - * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next - * page of roles. Do this till nextLink is null to fetch all the roles. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRolesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, options }, - listOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - cloudServiceName: string, - nextLink: string, - options?: CloudServiceRolesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceRole, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - Parameters.roleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceRoleListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceRoleListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/cloudServices.ts b/sdk/compute/arm-compute/src/operations/cloudServices.ts deleted file mode 100644 index 8fc6897decc0..000000000000 --- a/sdk/compute/arm-compute/src/operations/cloudServices.ts +++ /dev/null @@ -1,1304 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CloudServices } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - CloudService, - CloudServicesListAllNextOptionalParams, - CloudServicesListAllOptionalParams, - CloudServicesListAllResponse, - CloudServicesListNextOptionalParams, - CloudServicesListOptionalParams, - CloudServicesListResponse, - CloudServicesCreateOrUpdateOptionalParams, - CloudServicesCreateOrUpdateResponse, - CloudServicesUpdateOptionalParams, - CloudServicesUpdateResponse, - CloudServicesDeleteOptionalParams, - CloudServicesGetOptionalParams, - CloudServicesGetResponse, - CloudServicesGetInstanceViewOptionalParams, - CloudServicesGetInstanceViewResponse, - CloudServicesStartOptionalParams, - CloudServicesPowerOffOptionalParams, - CloudServicesRestartOptionalParams, - CloudServicesReimageOptionalParams, - CloudServicesRebuildOptionalParams, - CloudServicesDeleteInstancesOptionalParams, - CloudServicesListAllNextResponse, - CloudServicesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CloudServices operations. */ -export class CloudServicesImpl implements CloudServices { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CloudServices class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of all cloud services in the subscription, regardless of the associated resource group. - * Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink - * is null to fetch all the Cloud Services. - * @param options The options parameters. - */ - public listAll( - options?: CloudServicesListAllOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAllPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAllPagingPage(options, settings); - }, - }; - } - - private async *listAllPagingPage( - options?: CloudServicesListAllOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudServicesListAllResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAll(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAllNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAllPagingAll( - options?: CloudServicesListAllOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAllPagingPage(options)) { - yield* page; - } - } - - /** - * Gets a list of all cloud services under a resource group. Use nextLink property in the response to - * get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * @param resourceGroupName Name of the resource group. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - options?: CloudServicesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - options?: CloudServicesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudServicesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - options?: CloudServicesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Create or update a cloud service. Please note some properties can be set only during cloud service - * creation. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CloudServicesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - CloudServicesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a cloud service. Please note some properties can be set only during cloud service - * creation. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Update a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateOptionalParams, - ): Promise< - SimplePollerLike, CloudServicesUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - CloudServicesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Update a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Deletes a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Display information about a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, options }, - getOperationSpec, - ); - } - - /** - * Gets the status of a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - getInstanceView( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesGetInstanceViewOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, options }, - getInstanceViewOperationSpec, - ); - } - - /** - * Gets a list of all cloud services in the subscription, regardless of the associated resource group. - * Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink - * is null to fetch all the Cloud Services. - * @param options The options parameters. - */ - private _listAll( - options?: CloudServicesListAllOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listAllOperationSpec); - } - - /** - * Gets a list of all cloud services under a resource group. Use nextLink property in the response to - * get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * @param resourceGroupName Name of the resource group. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - options?: CloudServicesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ resourceGroupName, options }, listOperationSpec); - } - - /** - * Starts the cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginStart( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesStartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: startOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Starts the cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginStartAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesStartOptionalParams, - ): Promise { - const poller = await this.beginStart(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Power off the cloud service. Note that resources are still attached and you are getting charged for - * the resources. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginPowerOff( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesPowerOffOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: powerOffOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Power off the cloud service. Note that resources are still attached and you are getting charged for - * the resources. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginPowerOffAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesPowerOffOptionalParams, - ): Promise { - const poller = await this.beginPowerOff(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Restarts one or more role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRestart( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRestartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: restartOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Restarts one or more role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRestartAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRestartOptionalParams, - ): Promise { - const poller = await this.beginRestart(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker - * roles. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginReimage( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesReimageOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: reimageOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker - * roles. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginReimageAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesReimageOptionalParams, - ): Promise { - const poller = await this.beginReimage(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and - * initializes the storage resources that are used by them. If you do not want to initialize storage - * resources, you can use Reimage Role Instances. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRebuild( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRebuildOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: rebuildOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and - * initializes the storage resources that are used by them. If you do not want to initialize storage - * resources, you can use Reimage Role Instances. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginRebuildAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRebuildOptionalParams, - ): Promise { - const poller = await this.beginRebuild(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * Deletes role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginDeleteInstances( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteInstancesOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, options }, - spec: deleteInstancesOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - async beginDeleteInstancesAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteInstancesOptionalParams, - ): Promise { - const poller = await this.beginDeleteInstances(resourceGroupName, cloudServiceName, options); - return poller.pollUntilDone(); - } - - /** - * ListAllNext - * @param nextLink The nextLink from the previous successful call to the ListAll method. - * @param options The options parameters. - */ - private _listAllNext( - nextLink: string, - options?: CloudServicesListAllNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listAllNextOperationSpec); - } - - /** - * ListNext - * @param resourceGroupName Name of the resource group. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - nextLink: string, - options?: CloudServicesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.CloudService, - }, - 201: { - bodyMapper: Mappers.CloudService, - }, - 202: { - bodyMapper: Mappers.CloudService, - }, - 204: { - bodyMapper: Mappers.CloudService, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters37, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.CloudService, - }, - 201: { - bodyMapper: Mappers.CloudService, - }, - 202: { - bodyMapper: Mappers.CloudService, - }, - 204: { - bodyMapper: Mappers.CloudService, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters38, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudService, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getInstanceViewOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceInstanceView, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAllOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName1], - headerParameters: [Parameters.accept], - serializer, -}; -const startOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const powerOffOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const restartOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters39, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const reimageOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters39, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const rebuildOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters39, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteInstancesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters39, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listAllNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CloudServiceListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts b/sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts deleted file mode 100644 index 934fbb5408e0..000000000000 --- a/sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CloudServicesUpdateDomain } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - UpdateDomain, - CloudServicesUpdateDomainListUpdateDomainsNextOptionalParams, - CloudServicesUpdateDomainListUpdateDomainsOptionalParams, - CloudServicesUpdateDomainListUpdateDomainsResponse, - CloudServicesUpdateDomainWalkUpdateDomainOptionalParams, - CloudServicesUpdateDomainGetUpdateDomainOptionalParams, - CloudServicesUpdateDomainGetUpdateDomainResponse, - CloudServicesUpdateDomainListUpdateDomainsNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CloudServicesUpdateDomain operations. */ -export class CloudServicesUpdateDomainImpl implements CloudServicesUpdateDomain { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CloudServicesUpdateDomain class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of all update domains in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - public listUpdateDomains( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listUpdateDomainsPagingAll(resourceGroupName, cloudServiceName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listUpdateDomainsPagingPage( - resourceGroupName, - cloudServiceName, - options, - settings, - ); - }, - }; - } - - private async *listUpdateDomainsPagingPage( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CloudServicesUpdateDomainListUpdateDomainsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listUpdateDomains(resourceGroupName, cloudServiceName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listUpdateDomainsNext( - resourceGroupName, - cloudServiceName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listUpdateDomainsPagingAll( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listUpdateDomainsPagingPage( - resourceGroupName, - cloudServiceName, - options, - )) { - yield* page; - } - } - - /** - * Updates the role instances in the specified update domain. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are - * identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of - * 1, and so on. - * @param options The options parameters. - */ - async beginWalkUpdateDomain( - resourceGroupName: string, - cloudServiceName: string, - updateDomain: number, - options?: CloudServicesUpdateDomainWalkUpdateDomainOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cloudServiceName, updateDomain, options }, - spec: walkUpdateDomainOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Updates the role instances in the specified update domain. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are - * identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of - * 1, and so on. - * @param options The options parameters. - */ - async beginWalkUpdateDomainAndWait( - resourceGroupName: string, - cloudServiceName: string, - updateDomain: number, - options?: CloudServicesUpdateDomainWalkUpdateDomainOptionalParams, - ): Promise { - const poller = await this.beginWalkUpdateDomain( - resourceGroupName, - cloudServiceName, - updateDomain, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the specified update domain of a cloud service. Use nextLink property in the response to get - * the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are - * identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of - * 1, and so on. - * @param options The options parameters. - */ - getUpdateDomain( - resourceGroupName: string, - cloudServiceName: string, - updateDomain: number, - options?: CloudServicesUpdateDomainGetUpdateDomainOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, updateDomain, options }, - getUpdateDomainOperationSpec, - ); - } - - /** - * Gets a list of all update domains in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - private _listUpdateDomains( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, options }, - listUpdateDomainsOperationSpec, - ); - } - - /** - * ListUpdateDomainsNext - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param nextLink The nextLink from the previous successful call to the ListUpdateDomains method. - * @param options The options parameters. - */ - private _listUpdateDomainsNext( - resourceGroupName: string, - cloudServiceName: string, - nextLink: string, - options?: CloudServicesUpdateDomainListUpdateDomainsNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cloudServiceName, nextLink, options }, - listUpdateDomainsNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const walkUpdateDomainOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", - httpMethod: "PUT", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters40, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - Parameters.updateDomain, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getUpdateDomainOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.UpdateDomain, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - Parameters.updateDomain, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listUpdateDomainsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.UpdateDomainListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listUpdateDomainsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.UpdateDomainListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName1, - Parameters.cloudServiceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/communityGalleries.ts b/sdk/compute/arm-compute/src/operations/communityGalleries.ts deleted file mode 100644 index ef5c2ff07bc7..000000000000 --- a/sdk/compute/arm-compute/src/operations/communityGalleries.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { CommunityGalleries } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - CommunityGalleriesGetOptionalParams, - CommunityGalleriesGetResponse, -} from "../models/index.js"; - -/** Class containing CommunityGalleries operations. */ -export class CommunityGalleriesImpl implements CommunityGalleries { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CommunityGalleries class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Get a community gallery by gallery public name. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param options The options parameters. - */ - get( - location: string, - publicGalleryName: string, - options?: CommunityGalleriesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publicGalleryName, options }, - getOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CommunityGallery, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publicGalleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts deleted file mode 100644 index bd18b905cee6..000000000000 --- a/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CommunityGalleryImageVersions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - CommunityGalleryImageVersion, - CommunityGalleryImageVersionsListNextOptionalParams, - CommunityGalleryImageVersionsListOptionalParams, - CommunityGalleryImageVersionsListResponse, - CommunityGalleryImageVersionsGetOptionalParams, - CommunityGalleryImageVersionsGetResponse, - CommunityGalleryImageVersionsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CommunityGalleryImageVersions operations. */ -export class CommunityGalleryImageVersionsImpl implements CommunityGalleryImageVersions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CommunityGalleryImageVersions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List community gallery image versions inside an image. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param options The options parameters. - */ - public list( - location: string, - publicGalleryName: string, - galleryImageName: string, - options?: CommunityGalleryImageVersionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, publicGalleryName, galleryImageName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - location, - publicGalleryName, - galleryImageName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - location: string, - publicGalleryName: string, - galleryImageName: string, - options?: CommunityGalleryImageVersionsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CommunityGalleryImageVersionsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, publicGalleryName, galleryImageName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - location, - publicGalleryName, - galleryImageName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - publicGalleryName: string, - galleryImageName: string, - options?: CommunityGalleryImageVersionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - location, - publicGalleryName, - galleryImageName, - options, - )) { - yield* page; - } - } - - /** - * List community gallery image versions inside an image. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param options The options parameters. - */ - private _list( - location: string, - publicGalleryName: string, - galleryImageName: string, - options?: CommunityGalleryImageVersionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publicGalleryName, galleryImageName, options }, - listOperationSpec, - ); - } - - /** - * Get a community gallery image version. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param galleryImageVersionName The name of the community gallery image version. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within - * the range of a 32-bit integer. Format: .. - * @param options The options parameters. - */ - get( - location: string, - publicGalleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: CommunityGalleryImageVersionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - location, - publicGalleryName, - galleryImageName, - galleryImageVersionName, - options, - }, - getOperationSpec, - ); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - publicGalleryName: string, - galleryImageName: string, - nextLink: string, - options?: CommunityGalleryImageVersionsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publicGalleryName, galleryImageName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CommunityGalleryImageVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publicGalleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CommunityGalleryImageVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publicGalleryName, - Parameters.galleryImageName, - Parameters.galleryImageVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CommunityGalleryImageVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - Parameters.publicGalleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts b/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts deleted file mode 100644 index ab01e16f6205..000000000000 --- a/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { CommunityGalleryImages } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - CommunityGalleryImage, - CommunityGalleryImagesListNextOptionalParams, - CommunityGalleryImagesListOptionalParams, - CommunityGalleryImagesListResponse, - CommunityGalleryImagesGetOptionalParams, - CommunityGalleryImagesGetResponse, - CommunityGalleryImagesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CommunityGalleryImages operations. */ -export class CommunityGalleryImagesImpl implements CommunityGalleryImages { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class CommunityGalleryImages class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List community gallery images inside a gallery. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param options The options parameters. - */ - public list( - location: string, - publicGalleryName: string, - options?: CommunityGalleryImagesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, publicGalleryName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(location, publicGalleryName, options, settings); - }, - }; - } - - private async *listPagingPage( - location: string, - publicGalleryName: string, - options?: CommunityGalleryImagesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CommunityGalleryImagesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, publicGalleryName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(location, publicGalleryName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - publicGalleryName: string, - options?: CommunityGalleryImagesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(location, publicGalleryName, options)) { - yield* page; - } - } - - /** - * List community gallery images inside a gallery. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param options The options parameters. - */ - private _list( - location: string, - publicGalleryName: string, - options?: CommunityGalleryImagesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publicGalleryName, options }, - listOperationSpec, - ); - } - - /** - * Get a community gallery image. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param options The options parameters. - */ - get( - location: string, - publicGalleryName: string, - galleryImageName: string, - options?: CommunityGalleryImagesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publicGalleryName, galleryImageName, options }, - getOperationSpec, - ); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - publicGalleryName: string, - nextLink: string, - options?: CommunityGalleryImagesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publicGalleryName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CommunityGalleryImageList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publicGalleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CommunityGalleryImage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publicGalleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CommunityGalleryImageList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - Parameters.publicGalleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts b/sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts deleted file mode 100644 index e3eba115c271..000000000000 --- a/sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { DedicatedHostGroups } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - DedicatedHostGroup, - DedicatedHostGroupsListBySubscriptionNextOptionalParams, - DedicatedHostGroupsListBySubscriptionOptionalParams, - DedicatedHostGroupsListBySubscriptionResponse, - DedicatedHostGroupsListByResourceGroupNextOptionalParams, - DedicatedHostGroupsListByResourceGroupOptionalParams, - DedicatedHostGroupsListByResourceGroupResponse, - DedicatedHostGroupsGetOptionalParams, - DedicatedHostGroupsGetResponse, - DedicatedHostGroupsCreateOrUpdateOptionalParams, - DedicatedHostGroupsCreateOrUpdateResponse, - DedicatedHostGroupUpdate, - DedicatedHostGroupsUpdateOptionalParams, - DedicatedHostGroupsUpdateResponse, - DedicatedHostGroupsDeleteOptionalParams, - DedicatedHostGroupsListBySubscriptionNextResponse, - DedicatedHostGroupsListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DedicatedHostGroups operations. */ -export class DedicatedHostGroupsImpl implements DedicatedHostGroups { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class DedicatedHostGroups class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - * response to get the next page of dedicated host groups. - * @param options The options parameters. - */ - public listBySubscription( - options?: DedicatedHostGroupsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: DedicatedHostGroupsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DedicatedHostGroupsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: DedicatedHostGroupsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in - * the response to get the next page of dedicated host groups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: DedicatedHostGroupsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: DedicatedHostGroupsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DedicatedHostGroupsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: DedicatedHostGroupsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - * response to get the next page of dedicated host groups. - * @param options The options parameters. - */ - private _listBySubscription( - options?: DedicatedHostGroupsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); - } - - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in - * the response to get the next page of dedicated host groups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: DedicatedHostGroupsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Retrieves information about a dedicated host group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostGroupsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups - * please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - hostGroupName: string, - parameters: DedicatedHostGroup, - options?: DedicatedHostGroupsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Update an dedicated host group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - hostGroupName: string, - parameters: DedicatedHostGroupUpdate, - options?: DedicatedHostGroupsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Delete a dedicated host group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostGroupsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, options }, - deleteOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: DedicatedHostGroupsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DedicatedHostGroupsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostGroup, - }, - 201: { - bodyMapper: Mappers.DedicatedHostGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/dedicatedHosts.ts b/sdk/compute/arm-compute/src/operations/dedicatedHosts.ts deleted file mode 100644 index 283fcbeb804f..000000000000 --- a/sdk/compute/arm-compute/src/operations/dedicatedHosts.ts +++ /dev/null @@ -1,1037 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { DedicatedHosts } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - DedicatedHost, - DedicatedHostsListByHostGroupNextOptionalParams, - DedicatedHostsListByHostGroupOptionalParams, - DedicatedHostsListByHostGroupResponse, - DedicatedHostsListAvailableSizesNextOptionalParams, - DedicatedHostsListAvailableSizesOptionalParams, - DedicatedHostsListAvailableSizesResponse, - DedicatedHostsGetOptionalParams, - DedicatedHostsGetResponse, - DedicatedHostsCreateOrUpdateOptionalParams, - DedicatedHostsCreateOrUpdateResponse, - DedicatedHostUpdate, - DedicatedHostsUpdateOptionalParams, - DedicatedHostsUpdateResponse, - DedicatedHostsDeleteOptionalParams, - DedicatedHostsRedeployOptionalParams, - DedicatedHostsRedeployResponse, - DedicatedHostsRestartOptionalParams, - DedicatedHostsRestartResponse, - DedicatedHostsListByHostGroupNextResponse, - DedicatedHostsListAvailableSizesNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DedicatedHosts operations. */ -export class DedicatedHostsImpl implements DedicatedHosts { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class DedicatedHosts class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in - * the response to get the next page of dedicated hosts. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param options The options parameters. - */ - public listByHostGroup( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostsListByHostGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByHostGroupPagingAll(resourceGroupName, hostGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByHostGroupPagingPage(resourceGroupName, hostGroupName, options, settings); - }, - }; - } - - private async *listByHostGroupPagingPage( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostsListByHostGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DedicatedHostsListByHostGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByHostGroup(resourceGroupName, hostGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByHostGroupNext( - resourceGroupName, - hostGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByHostGroupPagingAll( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostsListByHostGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByHostGroupPagingPage( - resourceGroupName, - hostGroupName, - options, - )) { - yield* page; - } - } - - /** - * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: - * The dedicated host sizes provided can be used to only scale up the existing dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - public listAvailableSizes( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsListAvailableSizesOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAvailableSizesPagingAll( - resourceGroupName, - hostGroupName, - hostName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAvailableSizesPagingPage( - resourceGroupName, - hostGroupName, - hostName, - options, - settings, - ); - }, - }; - } - - private async *listAvailableSizesPagingPage( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsListAvailableSizesOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DedicatedHostsListAvailableSizesResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAvailableSizes(resourceGroupName, hostGroupName, hostName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAvailableSizesNext( - resourceGroupName, - hostGroupName, - hostName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAvailableSizesPagingAll( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsListAvailableSizesOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAvailableSizesPagingPage( - resourceGroupName, - hostGroupName, - hostName, - options, - )) { - yield* page; - } - } - - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in - * the response to get the next page of dedicated hosts. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param options The options parameters. - */ - private _listByHostGroup( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostsListByHostGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, options }, - listByHostGroupOperationSpec, - ); - } - - /** - * Retrieves information about a dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, hostName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHost, - options?: DedicatedHostsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DedicatedHostsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, hostGroupName, hostName, parameters, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - DedicatedHostsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHost, - options?: DedicatedHostsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - hostGroupName, - hostName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHostUpdate, - options?: DedicatedHostsUpdateOptionalParams, - ): Promise< - SimplePollerLike, DedicatedHostsUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, hostGroupName, hostName, parameters, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - DedicatedHostsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHostUpdate, - options?: DedicatedHostsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - hostGroupName, - hostName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, hostGroupName, hostName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, hostGroupName, hostName, options); - return poller.pollUntilDone(); - } - - /** - * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: - * The dedicated host sizes provided can be used to only scale up the existing dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - private _listAvailableSizes( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsListAvailableSizesOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, hostName, options }, - listAvailableSizesOperationSpec, - ); - } - - /** - * Redeploy the dedicated host. The operation will complete successfully once the dedicated host has - * migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host - * after the redeploy check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - async beginRedeploy( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRedeployOptionalParams, - ): Promise< - SimplePollerLike, DedicatedHostsRedeployResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, hostGroupName, hostName, options }, - spec: redeployOperationSpec, - }); - const poller = await createHttpPoller< - DedicatedHostsRedeployResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Redeploy the dedicated host. The operation will complete successfully once the dedicated host has - * migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host - * after the redeploy check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - async beginRedeployAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRedeployOptionalParams, - ): Promise { - const poller = await this.beginRedeploy(resourceGroupName, hostGroupName, hostName, options); - return poller.pollUntilDone(); - } - - /** - * Restart the dedicated host. The operation will complete successfully once the dedicated host has - * restarted and is running. To determine the health of VMs deployed on the dedicated host after the - * restart check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - async beginRestart( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRestartOptionalParams, - ): Promise< - SimplePollerLike, DedicatedHostsRestartResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, hostGroupName, hostName, options }, - spec: restartOperationSpec, - }); - const poller = await createHttpPoller< - DedicatedHostsRestartResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Restart the dedicated host. The operation will complete successfully once the dedicated host has - * restarted and is running. To determine the health of VMs deployed on the dedicated host after the - * restart check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - async beginRestartAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRestartOptionalParams, - ): Promise { - const poller = await this.beginRestart(resourceGroupName, hostGroupName, hostName, options); - return poller.pollUntilDone(); - } - - /** - * ListByHostGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param nextLink The nextLink from the previous successful call to the ListByHostGroup method. - * @param options The options parameters. - */ - private _listByHostGroupNext( - resourceGroupName: string, - hostGroupName: string, - nextLink: string, - options?: DedicatedHostsListByHostGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, nextLink, options }, - listByHostGroupNextOperationSpec, - ); - } - - /** - * ListAvailableSizesNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param nextLink The nextLink from the previous successful call to the ListAvailableSizes method. - * @param options The options parameters. - */ - private _listAvailableSizesNext( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - nextLink: string, - options?: DedicatedHostsListAvailableSizesNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, hostGroupName, hostName, nextLink, options }, - listAvailableSizesNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByHostGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHost, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHost, - }, - 201: { - bodyMapper: Mappers.DedicatedHost, - }, - 202: { - bodyMapper: Mappers.DedicatedHost, - }, - 204: { - bodyMapper: Mappers.DedicatedHost, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters33, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHost, - headersMapper: Mappers.DedicatedHostsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.DedicatedHost, - headersMapper: Mappers.DedicatedHostsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.DedicatedHost, - headersMapper: Mappers.DedicatedHostsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.DedicatedHost, - headersMapper: Mappers.DedicatedHostsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters34, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAvailableSizesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/hostSizes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const redeployOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/redeploy", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.DedicatedHostsRedeployHeaders, - }, - 201: { - headersMapper: Mappers.DedicatedHostsRedeployHeaders, - }, - 202: { - headersMapper: Mappers.DedicatedHostsRedeployHeaders, - }, - 204: { - headersMapper: Mappers.DedicatedHostsRedeployHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const restartOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.DedicatedHostsRestartHeaders, - }, - 201: { - headersMapper: Mappers.DedicatedHostsRestartHeaders, - }, - 202: { - headersMapper: Mappers.DedicatedHostsRestartHeaders, - }, - 204: { - headersMapper: Mappers.DedicatedHostsRestartHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByHostGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAvailableSizesNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DedicatedHostSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.hostGroupName, - Parameters.hostName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/diskAccesses.ts b/sdk/compute/arm-compute/src/operations/diskAccesses.ts deleted file mode 100644 index 0ca01b77af6f..000000000000 --- a/sdk/compute/arm-compute/src/operations/diskAccesses.ts +++ /dev/null @@ -1,1209 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { DiskAccesses } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - DiskAccess, - DiskAccessesListNextOptionalParams, - DiskAccessesListOptionalParams, - DiskAccessesListResponse, - DiskAccessesListByResourceGroupNextOptionalParams, - DiskAccessesListByResourceGroupOptionalParams, - DiskAccessesListByResourceGroupResponse, - PrivateEndpointConnection, - DiskAccessesListPrivateEndpointConnectionsNextOptionalParams, - DiskAccessesListPrivateEndpointConnectionsOptionalParams, - DiskAccessesListPrivateEndpointConnectionsResponse, - DiskAccessesGetOptionalParams, - DiskAccessesGetResponse, - DiskAccessesCreateOrUpdateOptionalParams, - DiskAccessesCreateOrUpdateResponse, - DiskAccessUpdate, - DiskAccessesUpdateOptionalParams, - DiskAccessesUpdateResponse, - DiskAccessesDeleteOptionalParams, - DiskAccessesGetAPrivateEndpointConnectionOptionalParams, - DiskAccessesGetAPrivateEndpointConnectionResponse, - DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, - DiskAccessesUpdateAPrivateEndpointConnectionResponse, - DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, - DiskAccessesGetPrivateLinkResourcesOptionalParams, - DiskAccessesGetPrivateLinkResourcesResponse, - DiskAccessesListNextResponse, - DiskAccessesListByResourceGroupNextResponse, - DiskAccessesListPrivateEndpointConnectionsNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DiskAccesses operations. */ -export class DiskAccessesImpl implements DiskAccesses { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class DiskAccesses class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all the disk access resources under a subscription. - * @param options The options parameters. - */ - public list(options?: DiskAccessesListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: DiskAccessesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiskAccessesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: DiskAccessesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all the disk access resources under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: DiskAccessesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: DiskAccessesListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiskAccessesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: DiskAccessesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * List information about private endpoint connections under a disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - public listPrivateEndpointConnections( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPrivateEndpointConnectionsPagingAll( - resourceGroupName, - diskAccessName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPrivateEndpointConnectionsPagingPage( - resourceGroupName, - diskAccessName, - options, - settings, - ); - }, - }; - } - - private async *listPrivateEndpointConnectionsPagingPage( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiskAccessesListPrivateEndpointConnectionsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listPrivateEndpointConnections( - resourceGroupName, - diskAccessName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listPrivateEndpointConnectionsNext( - resourceGroupName, - diskAccessName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPrivateEndpointConnectionsPagingAll( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPrivateEndpointConnectionsPagingPage( - resourceGroupName, - diskAccessName, - options, - )) { - yield* page; - } - } - - /** - * Lists all the disk access resources under a subscription. - * @param options The options parameters. - */ - private _list(options?: DiskAccessesListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Lists all the disk access resources under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: DiskAccessesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Gets information about a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskAccessName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates a disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Put disk access operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccess, - options?: DiskAccessesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskAccessesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskAccessName, diskAccess, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - DiskAccessesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Put disk access operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccess, - options?: DiskAccessesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - diskAccessName, - diskAccess, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates (patches) a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Patch disk access operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccessUpdate, - options?: DiskAccessesUpdateOptionalParams, - ): Promise< - SimplePollerLike, DiskAccessesUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskAccessName, diskAccess, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - DiskAccessesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Updates (patches) a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Patch disk access operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccessUpdate, - options?: DiskAccessesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, diskAccessName, diskAccess, options); - return poller.pollUntilDone(); - } - - /** - * Deletes a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskAccessName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, diskAccessName, options); - return poller.pollUntilDone(); - } - - /** - * List information about private endpoint connections under a disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - private _listPrivateEndpointConnections( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskAccessName, options }, - listPrivateEndpointConnectionsOperationSpec, - ); - } - - /** - * Gets information about a private endpoint connection under a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - getAPrivateEndpointConnection( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - options, - }, - getAPrivateEndpointConnectionOperationSpec, - ); - } - - /** - * Approve or reject a private endpoint connection under disk access resource, this can't be used to - * create a new private endpoint connection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put - * private endpoint connection operation. - * @param options The options parameters. - */ - async beginUpdateAPrivateEndpointConnection( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - privateEndpointConnection: PrivateEndpointConnection, - options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskAccessesUpdateAPrivateEndpointConnectionResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - privateEndpointConnection, - options, - }, - spec: updateAPrivateEndpointConnectionOperationSpec, - }); - const poller = await createHttpPoller< - DiskAccessesUpdateAPrivateEndpointConnectionResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Approve or reject a private endpoint connection under disk access resource, this can't be used to - * create a new private endpoint connection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put - * private endpoint connection operation. - * @param options The options parameters. - */ - async beginUpdateAPrivateEndpointConnectionAndWait( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - privateEndpointConnection: PrivateEndpointConnection, - options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, - ): Promise { - const poller = await this.beginUpdateAPrivateEndpointConnection( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - privateEndpointConnection, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes a private endpoint connection under a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - async beginDeleteAPrivateEndpointConnection( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - options, - }, - spec: deleteAPrivateEndpointConnectionOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a private endpoint connection under a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - async beginDeleteAPrivateEndpointConnectionAndWait( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, - ): Promise { - const poller = await this.beginDeleteAPrivateEndpointConnection( - resourceGroupName, - diskAccessName, - privateEndpointConnectionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the private link resources possible under disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - getPrivateLinkResources( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesGetPrivateLinkResourcesOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskAccessName, options }, - getPrivateLinkResourcesOperationSpec, - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: DiskAccessesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DiskAccessesListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListPrivateEndpointConnectionsNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param nextLink The nextLink from the previous successful call to the ListPrivateEndpointConnections - * method. - * @param options The options parameters. - */ - private _listPrivateEndpointConnectionsNext( - resourceGroupName: string, - diskAccessName: string, - nextLink: string, - options?: DiskAccessesListPrivateEndpointConnectionsNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskAccessName, nextLink, options }, - listPrivateEndpointConnectionsNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskAccessList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskAccessList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskAccess, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DiskAccess, - }, - 201: { - bodyMapper: Mappers.DiskAccess, - }, - 202: { - bodyMapper: Mappers.DiskAccess, - }, - 204: { - bodyMapper: Mappers.DiskAccess, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.diskAccess, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.DiskAccess, - }, - 201: { - bodyMapper: Mappers.DiskAccess, - }, - 202: { - bodyMapper: Mappers.DiskAccess, - }, - 204: { - bodyMapper: Mappers.DiskAccess, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.diskAccess1, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listPrivateEndpointConnectionsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 201: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 202: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 204: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.privateEndpointConnection, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getPrivateLinkResourcesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privatelinkresources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskAccessList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskAccessList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listPrivateEndpointConnectionsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskAccessName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts b/sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts deleted file mode 100644 index fe9a2fbae22e..000000000000 --- a/sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts +++ /dev/null @@ -1,875 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { DiskEncryptionSets } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - DiskEncryptionSet, - DiskEncryptionSetsListNextOptionalParams, - DiskEncryptionSetsListOptionalParams, - DiskEncryptionSetsListResponse, - DiskEncryptionSetsListByResourceGroupNextOptionalParams, - DiskEncryptionSetsListByResourceGroupOptionalParams, - DiskEncryptionSetsListByResourceGroupResponse, - DiskEncryptionSetsListAssociatedResourcesNextOptionalParams, - DiskEncryptionSetsListAssociatedResourcesOptionalParams, - DiskEncryptionSetsListAssociatedResourcesResponse, - DiskEncryptionSetsGetOptionalParams, - DiskEncryptionSetsGetResponse, - DiskEncryptionSetsCreateOrUpdateOptionalParams, - DiskEncryptionSetsCreateOrUpdateResponse, - DiskEncryptionSetUpdate, - DiskEncryptionSetsUpdateOptionalParams, - DiskEncryptionSetsUpdateResponse, - DiskEncryptionSetsDeleteOptionalParams, - DiskEncryptionSetsListNextResponse, - DiskEncryptionSetsListByResourceGroupNextResponse, - DiskEncryptionSetsListAssociatedResourcesNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DiskEncryptionSets operations. */ -export class DiskEncryptionSetsImpl implements DiskEncryptionSets { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class DiskEncryptionSets class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all the disk encryption sets under a subscription. - * @param options The options parameters. - */ - public list( - options?: DiskEncryptionSetsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: DiskEncryptionSetsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiskEncryptionSetsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: DiskEncryptionSetsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all the disk encryption sets under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: DiskEncryptionSetsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: DiskEncryptionSetsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiskEncryptionSetsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: DiskEncryptionSetsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all resources that are encrypted with this disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - public listAssociatedResources( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAssociatedResourcesPagingAll( - resourceGroupName, - diskEncryptionSetName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAssociatedResourcesPagingPage( - resourceGroupName, - diskEncryptionSetName, - options, - settings, - ); - }, - }; - } - - private async *listAssociatedResourcesPagingPage( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiskEncryptionSetsListAssociatedResourcesResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAssociatedResources( - resourceGroupName, - diskEncryptionSetName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAssociatedResourcesNext( - resourceGroupName, - diskEncryptionSetName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAssociatedResourcesPagingAll( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAssociatedResourcesPagingPage( - resourceGroupName, - diskEncryptionSetName, - options, - )) { - yield* page; - } - } - - /** - * Lists all the disk encryption sets under a subscription. - * @param options The options parameters. - */ - private _list( - options?: DiskEncryptionSetsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Lists all the disk encryption sets under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: DiskEncryptionSetsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Gets information about a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskEncryptionSetName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates a disk encryption set - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption - * set operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSet, - options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskEncryptionSetsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - DiskEncryptionSetsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a disk encryption set - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption - * set operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSet, - options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates (patches) a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk - * encryption set operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSetUpdate, - options?: DiskEncryptionSetsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskEncryptionSetsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - DiskEncryptionSetsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Updates (patches) a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk - * encryption set operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSetUpdate, - options?: DiskEncryptionSetsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - diskEncryptionSetName, - diskEncryptionSet, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskEncryptionSetName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, diskEncryptionSetName, options); - return poller.pollUntilDone(); - } - - /** - * Lists all resources that are encrypted with this disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - private _listAssociatedResources( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskEncryptionSetName, options }, - listAssociatedResourcesOperationSpec, - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: DiskEncryptionSetsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DiskEncryptionSetsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListAssociatedResourcesNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param nextLink The nextLink from the previous successful call to the ListAssociatedResources - * method. - * @param options The options parameters. - */ - private _listAssociatedResourcesNext( - resourceGroupName: string, - diskEncryptionSetName: string, - nextLink: string, - options?: DiskEncryptionSetsListAssociatedResourcesNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskEncryptionSetName, nextLink, options }, - listAssociatedResourcesNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskEncryptionSetList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskEncryptionSetList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskEncryptionSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - 201: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - 202: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - 204: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.diskEncryptionSet, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskEncryptionSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - 201: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - 202: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - 204: { - bodyMapper: Mappers.DiskEncryptionSet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.diskEncryptionSet1, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskEncryptionSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskEncryptionSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAssociatedResourcesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceUriList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskEncryptionSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskEncryptionSetList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskEncryptionSetList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAssociatedResourcesNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceUriList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskEncryptionSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts b/sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts deleted file mode 100644 index 6c556de8efed..000000000000 --- a/sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts +++ /dev/null @@ -1,558 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { DiskRestorePointOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - DiskRestorePoint, - DiskRestorePointListByRestorePointNextOptionalParams, - DiskRestorePointListByRestorePointOptionalParams, - DiskRestorePointListByRestorePointResponse, - DiskRestorePointGetOptionalParams, - DiskRestorePointGetResponse, - GrantAccessData, - DiskRestorePointGrantAccessOptionalParams, - DiskRestorePointGrantAccessResponse, - DiskRestorePointRevokeAccessOptionalParams, - DiskRestorePointListByRestorePointNextResponse, -} from "../models/index.js"; - -/// -/** Class containing DiskRestorePointOperations operations. */ -export class DiskRestorePointOperationsImpl implements DiskRestorePointOperations { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class DiskRestorePointOperations class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists diskRestorePoints under a vmRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param options The options parameters. - */ - public listByRestorePoint( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - options?: DiskRestorePointListByRestorePointOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByRestorePointPagingAll( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByRestorePointPagingPage( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - options, - settings, - ); - }, - }; - } - - private async *listByRestorePointPagingPage( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - options?: DiskRestorePointListByRestorePointOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DiskRestorePointListByRestorePointResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByRestorePoint( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByRestorePointNext( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByRestorePointPagingAll( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - options?: DiskRestorePointListByRestorePointOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByRestorePointPagingPage( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - options, - )) { - yield* page; - } - } - - /** - * Lists diskRestorePoints under a vmRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param options The options parameters. - */ - private _listByRestorePoint( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - options?: DiskRestorePointListByRestorePointOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - options, - }, - listByRestorePointOperationSpec, - ); - } - - /** - * Get disk restorePoint resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param options The options parameters. - */ - get( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - options?: DiskRestorePointGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - options, - }, - getOperationSpec, - ); - } - - /** - * Grants access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - async beginGrantAccess( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - grantAccessData: GrantAccessData, - options?: DiskRestorePointGrantAccessOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskRestorePointGrantAccessResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - grantAccessData, - options, - }, - spec: grantAccessOperationSpec, - }); - const poller = await createHttpPoller< - DiskRestorePointGrantAccessResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Grants access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - async beginGrantAccessAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - grantAccessData: GrantAccessData, - options?: DiskRestorePointGrantAccessOptionalParams, - ): Promise { - const poller = await this.beginGrantAccess( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - grantAccessData, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Revokes access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param options The options parameters. - */ - async beginRevokeAccess( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - options?: DiskRestorePointRevokeAccessOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - options, - }, - spec: revokeAccessOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Revokes access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param options The options parameters. - */ - async beginRevokeAccessAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - options?: DiskRestorePointRevokeAccessOptionalParams, - ): Promise { - const poller = await this.beginRevokeAccess( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - diskRestorePointName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByRestorePointNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param nextLink The nextLink from the previous successful call to the ListByRestorePoint method. - * @param options The options parameters. - */ - private _listByRestorePointNext( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - nextLink: string, - options?: DiskRestorePointListByRestorePointNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - nextLink, - options, - }, - listByRestorePointNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByRestorePointOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskRestorePointList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.vmRestorePointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskRestorePoint, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.vmRestorePointName, - Parameters.diskRestorePointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const grantAccessOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.AccessUri, - }, - 201: { - bodyMapper: Mappers.AccessUri, - }, - 202: { - bodyMapper: Mappers.AccessUri, - }, - 204: { - bodyMapper: Mappers.AccessUri, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.grantAccessData, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.vmRestorePointName, - Parameters.diskRestorePointName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const revokeAccessOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.vmRestorePointName, - Parameters.diskRestorePointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByRestorePointNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskRestorePointList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.vmRestorePointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/disks.ts b/sdk/compute/arm-compute/src/operations/disks.ts deleted file mode 100644 index c3fb2da20b4c..000000000000 --- a/sdk/compute/arm-compute/src/operations/disks.ts +++ /dev/null @@ -1,896 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Disks } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - Disk, - DisksListNextOptionalParams, - DisksListOptionalParams, - DisksListResponse, - DisksListByResourceGroupNextOptionalParams, - DisksListByResourceGroupOptionalParams, - DisksListByResourceGroupResponse, - DisksGetOptionalParams, - DisksGetResponse, - DisksCreateOrUpdateOptionalParams, - DisksCreateOrUpdateResponse, - DiskUpdate, - DisksUpdateOptionalParams, - DisksUpdateResponse, - DisksDeleteOptionalParams, - GrantAccessData, - DisksGrantAccessOptionalParams, - DisksGrantAccessResponse, - DisksRevokeAccessOptionalParams, - DisksListNextResponse, - DisksListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Disks operations. */ -export class DisksImpl implements Disks { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class Disks class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all the disks under a subscription. - * @param options The options parameters. - */ - public list(options?: DisksListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: DisksListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DisksListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll(options?: DisksListOptionalParams): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all the disks under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: DisksListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: DisksListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: DisksListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: DisksListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all the disks under a subscription. - * @param options The options parameters. - */ - private _list(options?: DisksListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Lists all the disks under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: DisksListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Gets information about a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - diskName: string, - options?: DisksGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, diskName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - diskName: string, - disk: Disk, - options?: DisksCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike, DisksCreateOrUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskName, disk, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - DisksCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - diskName: string, - disk: Disk, - options?: DisksCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate(resourceGroupName, diskName, disk, options); - return poller.pollUntilDone(); - } - - /** - * Updates (patches) a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - diskName: string, - disk: DiskUpdate, - options?: DisksUpdateOptionalParams, - ): Promise, DisksUpdateResponse>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskName, disk, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller>( - lro, - { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }, - ); - await poller.poll(); - return poller; - } - - /** - * Updates (patches) a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - diskName: string, - disk: DiskUpdate, - options?: DisksUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, diskName, disk, options); - return poller.pollUntilDone(); - } - - /** - * Deletes a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - diskName: string, - options?: DisksDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - diskName: string, - options?: DisksDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, diskName, options); - return poller.pollUntilDone(); - } - - /** - * Grants access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - async beginGrantAccess( - resourceGroupName: string, - diskName: string, - grantAccessData: GrantAccessData, - options?: DisksGrantAccessOptionalParams, - ): Promise, DisksGrantAccessResponse>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskName, grantAccessData, options }, - spec: grantAccessOperationSpec, - }); - const poller = await createHttpPoller< - DisksGrantAccessResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Grants access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - async beginGrantAccessAndWait( - resourceGroupName: string, - diskName: string, - grantAccessData: GrantAccessData, - options?: DisksGrantAccessOptionalParams, - ): Promise { - const poller = await this.beginGrantAccess( - resourceGroupName, - diskName, - grantAccessData, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Revokes access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - async beginRevokeAccess( - resourceGroupName: string, - diskName: string, - options?: DisksRevokeAccessOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, diskName, options }, - spec: revokeAccessOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Revokes access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - async beginRevokeAccessAndWait( - resourceGroupName: string, - diskName: string, - options?: DisksRevokeAccessOptionalParams, - ): Promise { - const poller = await this.beginRevokeAccess(resourceGroupName, diskName, options); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: DisksListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: DisksListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Disk, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Disk, - }, - 201: { - bodyMapper: Mappers.Disk, - }, - 202: { - bodyMapper: Mappers.Disk, - }, - 204: { - bodyMapper: Mappers.Disk, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.disk, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Disk, - }, - 201: { - bodyMapper: Mappers.Disk, - }, - 202: { - bodyMapper: Mappers.Disk, - }, - 204: { - bodyMapper: Mappers.Disk, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.disk1, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const grantAccessOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.AccessUri, - }, - 201: { - bodyMapper: Mappers.AccessUri, - }, - 202: { - bodyMapper: Mappers.AccessUri, - }, - 204: { - bodyMapper: Mappers.AccessUri, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.grantAccessData, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const revokeAccessOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.diskName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiskList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleries.ts b/sdk/compute/arm-compute/src/operations/galleries.ts deleted file mode 100644 index 80af5bd57f76..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleries.ts +++ /dev/null @@ -1,659 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Galleries } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - Gallery, - GalleriesListNextOptionalParams, - GalleriesListOptionalParams, - GalleriesListResponse, - GalleriesListByResourceGroupNextOptionalParams, - GalleriesListByResourceGroupOptionalParams, - GalleriesListByResourceGroupResponse, - GalleriesGetOptionalParams, - GalleriesGetResponse, - GalleriesCreateOrUpdateOptionalParams, - GalleriesCreateOrUpdateResponse, - GalleryUpdate, - GalleriesUpdateOptionalParams, - GalleriesUpdateResponse, - GalleriesDeleteOptionalParams, - GalleriesListNextResponse, - GalleriesListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Galleries operations. */ -export class GalleriesImpl implements Galleries { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class Galleries class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List galleries under a subscription. - * @param options The options parameters. - */ - public list(options?: GalleriesListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: GalleriesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleriesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: GalleriesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List galleries under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: GalleriesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: GalleriesListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleriesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: GalleriesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * List galleries under a subscription. - * @param options The options parameters. - */ - private _list(options?: GalleriesListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * List galleries under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: GalleriesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Retrieves information about a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - options?: GalleriesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - gallery: Gallery, - options?: GalleriesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleriesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, galleryName, gallery, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleriesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - gallery: Gallery, - options?: GalleriesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options); - return poller.pollUntilDone(); - } - - /** - * Update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - gallery: GalleryUpdate, - options?: GalleriesUpdateOptionalParams, - ): Promise, GalleriesUpdateResponse>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, galleryName, gallery, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleriesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - gallery: GalleryUpdate, - options?: GalleriesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, galleryName, gallery, options); - return poller.pollUntilDone(); - } - - /** - * Delete a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - options?: GalleriesDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, galleryName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - options?: GalleriesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, galleryName, options); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: GalleriesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: GalleriesListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Gallery, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3, Parameters.select1, Parameters.expand11], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Gallery, - }, - 201: { - bodyMapper: Mappers.Gallery, - }, - 202: { - bodyMapper: Mappers.Gallery, - }, - 204: { - bodyMapper: Mappers.Gallery, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.gallery, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Gallery, - headersMapper: Mappers.GalleriesUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.Gallery, - headersMapper: Mappers.GalleriesUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.Gallery, - headersMapper: Mappers.GalleriesUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.Gallery, - headersMapper: Mappers.GalleriesUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.gallery1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts b/sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts deleted file mode 100644 index dd3ae9ba485b..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts +++ /dev/null @@ -1,701 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryApplicationVersions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryApplicationVersion, - GalleryApplicationVersionsListByGalleryApplicationNextOptionalParams, - GalleryApplicationVersionsListByGalleryApplicationOptionalParams, - GalleryApplicationVersionsListByGalleryApplicationResponse, - GalleryApplicationVersionsGetOptionalParams, - GalleryApplicationVersionsGetResponse, - GalleryApplicationVersionsCreateOrUpdateOptionalParams, - GalleryApplicationVersionsCreateOrUpdateResponse, - GalleryApplicationVersionUpdate, - GalleryApplicationVersionsUpdateOptionalParams, - GalleryApplicationVersionsUpdateResponse, - GalleryApplicationVersionsDeleteOptionalParams, - GalleryApplicationVersionsListByGalleryApplicationNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryApplicationVersions operations. */ -export class GalleryApplicationVersionsImpl implements GalleryApplicationVersions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryApplicationVersions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - public listByGalleryApplication( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryApplicationPagingAll( - resourceGroupName, - galleryName, - galleryApplicationName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryApplicationPagingPage( - resourceGroupName, - galleryName, - galleryApplicationName, - options, - settings, - ); - }, - }; - } - - private async *listByGalleryApplicationPagingPage( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryApplicationVersionsListByGalleryApplicationResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGalleryApplication( - resourceGroupName, - galleryName, - galleryApplicationName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryApplicationNext( - resourceGroupName, - galleryName, - galleryApplicationName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryApplicationPagingAll( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryApplicationPagingPage( - resourceGroupName, - galleryName, - galleryApplicationName, - options, - )) { - yield* page; - } - } - - /** - * List gallery Application Versions in a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - private _listByGalleryApplication( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryApplicationName, options }, - listByGalleryApplicationOperationSpec, - ); - } - - /** - * Retrieves information about a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - options?: GalleryApplicationVersionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - options, - }, - getOperationSpec, - ); - } - - /** - * Create or update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application - * Version operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersion, - options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationVersionsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryApplicationVersionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application - * Version operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersion, - options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version - * operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersionUpdate, - options?: GalleryApplicationVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationVersionsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryApplicationVersionsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version - * operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersionUpdate, - options?: GalleryApplicationVersionsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - options?: GalleryApplicationVersionsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - options?: GalleryApplicationVersionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryApplicationNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param nextLink The nextLink from the previous successful call to the ListByGalleryApplication - * method. - * @param options The options parameters. - */ - private _listByGalleryApplicationNext( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - nextLink: string, - options?: GalleryApplicationVersionsListByGalleryApplicationNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - galleryName, - galleryApplicationName, - nextLink, - options, - }, - listByGalleryApplicationNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryApplicationOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplicationVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplicationVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3, Parameters.expand12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - Parameters.galleryApplicationVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplicationVersion, - }, - 201: { - bodyMapper: Mappers.GalleryApplicationVersion, - }, - 202: { - bodyMapper: Mappers.GalleryApplicationVersion, - }, - 204: { - bodyMapper: Mappers.GalleryApplicationVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryApplicationVersion, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - Parameters.galleryApplicationVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplicationVersion, - headersMapper: Mappers.GalleryApplicationVersionsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.GalleryApplicationVersion, - headersMapper: Mappers.GalleryApplicationVersionsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.GalleryApplicationVersion, - headersMapper: Mappers.GalleryApplicationVersionsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.GalleryApplicationVersion, - headersMapper: Mappers.GalleryApplicationVersionsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryApplicationVersion1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - Parameters.galleryApplicationVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - Parameters.galleryApplicationVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryApplicationNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplicationVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryApplications.ts b/sdk/compute/arm-compute/src/operations/galleryApplications.ts deleted file mode 100644 index 7b1afd8ba7ef..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryApplications.ts +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryApplications } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryApplication, - GalleryApplicationsListByGalleryNextOptionalParams, - GalleryApplicationsListByGalleryOptionalParams, - GalleryApplicationsListByGalleryResponse, - GalleryApplicationsGetOptionalParams, - GalleryApplicationsGetResponse, - GalleryApplicationsCreateOrUpdateOptionalParams, - GalleryApplicationsCreateOrUpdateResponse, - GalleryApplicationUpdate, - GalleryApplicationsUpdateOptionalParams, - GalleryApplicationsUpdateResponse, - GalleryApplicationsDeleteOptionalParams, - GalleryApplicationsListByGalleryNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryApplications operations. */ -export class GalleryApplicationsImpl implements GalleryApplications { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryApplications class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery Application Definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - public listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryApplicationsListByGalleryOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryPagingAll(resourceGroupName, galleryName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryPagingPage(resourceGroupName, galleryName, options, settings); - }, - }; - } - - private async *listByGalleryPagingPage( - resourceGroupName: string, - galleryName: string, - options?: GalleryApplicationsListByGalleryOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryApplicationsListByGalleryResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGallery(resourceGroupName, galleryName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryNext( - resourceGroupName, - galleryName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryPagingAll( - resourceGroupName: string, - galleryName: string, - options?: GalleryApplicationsListByGalleryOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryPagingPage( - resourceGroupName, - galleryName, - options, - )) { - yield* page; - } - } - - /** - * List gallery Application Definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - private _listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryApplicationsListByGalleryOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, options }, - listByGalleryOperationSpec, - ); - } - - /** - * Retrieves information about a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryApplicationName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplication, - options?: GalleryApplicationsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryApplicationsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplication, - options?: GalleryApplicationsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplicationUpdate, - options?: GalleryApplicationsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryApplicationsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplicationUpdate, - options?: GalleryApplicationsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplication, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery Application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, galleryName, galleryApplicationName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery Application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - galleryApplicationName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param nextLink The nextLink from the previous successful call to the ListByGallery method. - * @param options The options parameters. - */ - private _listByGalleryNext( - resourceGroupName: string, - galleryName: string, - nextLink: string, - options?: GalleryApplicationsListByGalleryNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, nextLink, options }, - listByGalleryNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplicationList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplication, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplication, - }, - 201: { - bodyMapper: Mappers.GalleryApplication, - }, - 202: { - bodyMapper: Mappers.GalleryApplication, - }, - 204: { - bodyMapper: Mappers.GalleryApplication, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryApplication, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplication, - headersMapper: Mappers.GalleryApplicationsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.GalleryApplication, - headersMapper: Mappers.GalleryApplicationsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.GalleryApplication, - headersMapper: Mappers.GalleryApplicationsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.GalleryApplication, - headersMapper: Mappers.GalleryApplicationsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryApplication1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryApplicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryApplicationList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts deleted file mode 100644 index 19ec59986d9a..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts +++ /dev/null @@ -1,692 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryImageVersions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryImageVersion, - GalleryImageVersionsListByGalleryImageNextOptionalParams, - GalleryImageVersionsListByGalleryImageOptionalParams, - GalleryImageVersionsListByGalleryImageResponse, - GalleryImageVersionsGetOptionalParams, - GalleryImageVersionsGetResponse, - GalleryImageVersionsCreateOrUpdateOptionalParams, - GalleryImageVersionsCreateOrUpdateResponse, - GalleryImageVersionUpdate, - GalleryImageVersionsUpdateOptionalParams, - GalleryImageVersionsUpdateResponse, - GalleryImageVersionsDeleteOptionalParams, - GalleryImageVersionsListByGalleryImageNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryImageVersions operations. */ -export class GalleryImageVersionsImpl implements GalleryImageVersions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryImageVersions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery image versions in a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - public listByGalleryImage( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImageVersionsListByGalleryImageOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryImagePagingAll( - resourceGroupName, - galleryName, - galleryImageName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryImagePagingPage( - resourceGroupName, - galleryName, - galleryImageName, - options, - settings, - ); - }, - }; - } - - private async *listByGalleryImagePagingPage( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImageVersionsListByGalleryImageOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryImageVersionsListByGalleryImageResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGalleryImage( - resourceGroupName, - galleryName, - galleryImageName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryImageNext( - resourceGroupName, - galleryName, - galleryImageName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryImagePagingAll( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImageVersionsListByGalleryImageOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryImagePagingPage( - resourceGroupName, - galleryName, - galleryImageName, - options, - )) { - yield* page; - } - } - - /** - * List gallery image versions in a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - private _listByGalleryImage( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImageVersionsListByGalleryImageOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryImageName, options }, - listByGalleryImageOperationSpec, - ); - } - - /** - * Retrieves information about a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: GalleryImageVersionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - }, - getOperationSpec, - ); - } - - /** - * Create or update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the create or update gallery image version - * operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersion, - options?: GalleryImageVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryImageVersionsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryImageVersionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the create or update gallery image version - * operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersion, - options?: GalleryImageVersionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the update gallery image version operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersionUpdate, - options?: GalleryImageVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryImageVersionsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryImageVersionsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the update gallery image version operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersionUpdate, - options?: GalleryImageVersionsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - galleryImageVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: GalleryImageVersionsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: GalleryImageVersionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryImageNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param nextLink The nextLink from the previous successful call to the ListByGalleryImage method. - * @param options The options parameters. - */ - private _listByGalleryImageNext( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - nextLink: string, - options?: GalleryImageVersionsListByGalleryImageNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryImageName, nextLink, options }, - listByGalleryImageNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryImageOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryImageVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryImageVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3, Parameters.expand12], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - Parameters.galleryImageVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryImageVersion, - }, - 201: { - bodyMapper: Mappers.GalleryImageVersion, - }, - 202: { - bodyMapper: Mappers.GalleryImageVersion, - }, - 204: { - bodyMapper: Mappers.GalleryImageVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryImageVersion, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - Parameters.galleryImageVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryImageVersion, - headersMapper: Mappers.GalleryImageVersionsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.GalleryImageVersion, - headersMapper: Mappers.GalleryImageVersionsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.GalleryImageVersion, - headersMapper: Mappers.GalleryImageVersionsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.GalleryImageVersion, - headersMapper: Mappers.GalleryImageVersionsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryImageVersion1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - Parameters.galleryImageVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - Parameters.galleryImageVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryImageNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryImageVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryImages.ts b/sdk/compute/arm-compute/src/operations/galleryImages.ts deleted file mode 100644 index 4c96d76ee9b5..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryImages.ts +++ /dev/null @@ -1,624 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryImages } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryImage, - GalleryImagesListByGalleryNextOptionalParams, - GalleryImagesListByGalleryOptionalParams, - GalleryImagesListByGalleryResponse, - GalleryImagesGetOptionalParams, - GalleryImagesGetResponse, - GalleryImagesCreateOrUpdateOptionalParams, - GalleryImagesCreateOrUpdateResponse, - GalleryImageUpdate, - GalleryImagesUpdateOptionalParams, - GalleryImagesUpdateResponse, - GalleryImagesDeleteOptionalParams, - GalleryImagesListByGalleryNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryImages operations. */ -export class GalleryImagesImpl implements GalleryImages { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryImages class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery image definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - public listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryImagesListByGalleryOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryPagingAll(resourceGroupName, galleryName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryPagingPage(resourceGroupName, galleryName, options, settings); - }, - }; - } - - private async *listByGalleryPagingPage( - resourceGroupName: string, - galleryName: string, - options?: GalleryImagesListByGalleryOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryImagesListByGalleryResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGallery(resourceGroupName, galleryName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryNext( - resourceGroupName, - galleryName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryPagingAll( - resourceGroupName: string, - galleryName: string, - options?: GalleryImagesListByGalleryOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryPagingPage( - resourceGroupName, - galleryName, - options, - )) { - yield* page; - } - } - - /** - * List gallery image definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - private _listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryImagesListByGalleryOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, options }, - listByGalleryOperationSpec, - ); - } - - /** - * Retrieves information about a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImagesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryImageName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImage, - options?: GalleryImagesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryImagesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryImagesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImage, - options?: GalleryImagesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImageUpdate, - options?: GalleryImagesUpdateOptionalParams, - ): Promise< - SimplePollerLike, GalleryImagesUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryImagesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImageUpdate, - options?: GalleryImagesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - galleryImageName, - galleryImage, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImagesDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, galleryName, galleryImageName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImagesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - galleryImageName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param nextLink The nextLink from the previous successful call to the ListByGallery method. - * @param options The options parameters. - */ - private _listByGalleryNext( - resourceGroupName: string, - galleryName: string, - nextLink: string, - options?: GalleryImagesListByGalleryNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, nextLink, options }, - listByGalleryNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryImageList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryImage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryImage, - }, - 201: { - bodyMapper: Mappers.GalleryImage, - }, - 202: { - bodyMapper: Mappers.GalleryImage, - }, - 204: { - bodyMapper: Mappers.GalleryImage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryImage, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryImage, - headersMapper: Mappers.GalleryImagesUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.GalleryImage, - headersMapper: Mappers.GalleryImagesUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.GalleryImage, - headersMapper: Mappers.GalleryImagesUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.GalleryImage, - headersMapper: Mappers.GalleryImagesUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryImage1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryImageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryImageList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts b/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts deleted file mode 100644 index f18882b5357c..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts +++ /dev/null @@ -1,735 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryInVMAccessControlProfileVersions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryInVMAccessControlProfileVersion, - GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams, - GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, - GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse, - GalleryInVMAccessControlProfileVersionsGetOptionalParams, - GalleryInVMAccessControlProfileVersionsGetResponse, - GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, - GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse, - GalleryInVMAccessControlProfileVersionUpdate, - GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, - GalleryInVMAccessControlProfileVersionsUpdateResponse, - GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, - GalleryInVMAccessControlProfileVersionsDeleteResponse, - GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryInVMAccessControlProfileVersions operations. */ -export class GalleryInVMAccessControlProfileVersionsImpl implements GalleryInVMAccessControlProfileVersions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryInVMAccessControlProfileVersions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - public listByGalleryInVMAccessControlProfile( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryInVMAccessControlProfilePagingAll( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryInVMAccessControlProfilePagingPage( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - options, - settings, - ); - }, - }; - } - - private async *listByGalleryInVMAccessControlProfilePagingPage( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGalleryInVMAccessControlProfile( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryInVMAccessControlProfileNext( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryInVMAccessControlProfilePagingAll( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryInVMAccessControlProfilePagingPage( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - options, - )) { - yield* page; - } - } - - /** - * List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - private _listByGalleryInVMAccessControlProfile( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, inVMAccessControlProfileName, options }, - listByGalleryInVMAccessControlProfileOperationSpec, - ); - } - - /** - * Retrieves information about a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - options, - }, - getOperationSpec, - ); - } - - /** - * Create or update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, - options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, - options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, - options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfileVersionsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryInVMAccessControlProfileVersionsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, - options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - galleryInVMAccessControlProfileVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfileVersionsDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - GalleryInVMAccessControlProfileVersionsDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - inVMAccessControlProfileVersionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryInVMAccessControlProfileNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param nextLink The nextLink from the previous successful call to the - * ListByGalleryInVMAccessControlProfile method. - * @param options The options parameters. - */ - private _listByGalleryInVMAccessControlProfileNext( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - nextLink: string, - options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - nextLink, - options, - }, - listByGalleryInVMAccessControlProfileNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryInVMAccessControlProfileOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - Parameters.inVMAccessControlProfileVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - }, - 201: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - }, - 202: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - }, - 204: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryInVMAccessControlProfileVersion, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - Parameters.inVMAccessControlProfileVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryInVMAccessControlProfileVersion1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - Parameters.inVMAccessControlProfileVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, - }, - 201: { - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, - }, - 202: { - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, - }, - 204: { - headersMapper: Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - Parameters.inVMAccessControlProfileVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryInVMAccessControlProfileNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts b/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts deleted file mode 100644 index 06d323552dfb..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts +++ /dev/null @@ -1,660 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryInVMAccessControlProfiles } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryInVMAccessControlProfile, - GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams, - GalleryInVMAccessControlProfilesListByGalleryOptionalParams, - GalleryInVMAccessControlProfilesListByGalleryResponse, - GalleryInVMAccessControlProfilesGetOptionalParams, - GalleryInVMAccessControlProfilesGetResponse, - GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, - GalleryInVMAccessControlProfilesCreateOrUpdateResponse, - GalleryInVMAccessControlProfileUpdate, - GalleryInVMAccessControlProfilesUpdateOptionalParams, - GalleryInVMAccessControlProfilesUpdateResponse, - GalleryInVMAccessControlProfilesDeleteOptionalParams, - GalleryInVMAccessControlProfilesDeleteResponse, - GalleryInVMAccessControlProfilesListByGalleryNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryInVMAccessControlProfiles operations. */ -export class GalleryInVMAccessControlProfilesImpl implements GalleryInVMAccessControlProfiles { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryInVMAccessControlProfiles class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery inVMAccessControlProfiles in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - public listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryPagingAll(resourceGroupName, galleryName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryPagingPage(resourceGroupName, galleryName, options, settings); - }, - }; - } - - private async *listByGalleryPagingPage( - resourceGroupName: string, - galleryName: string, - options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryInVMAccessControlProfilesListByGalleryResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGallery(resourceGroupName, galleryName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryNext( - resourceGroupName, - galleryName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryPagingAll( - resourceGroupName: string, - galleryName: string, - options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryPagingPage( - resourceGroupName, - galleryName, - options, - )) { - yield* page; - } - } - - /** - * List gallery inVMAccessControlProfiles in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - private _listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, options }, - listByGalleryOperationSpec, - ); - } - - /** - * Retrieves information about a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfilesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, inVMAccessControlProfileName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, - options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfilesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryInVMAccessControlProfilesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, - options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, - options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfilesUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryInVMAccessControlProfilesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, - options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - galleryInVMAccessControlProfile, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfilesDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - GalleryInVMAccessControlProfilesDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - inVMAccessControlProfileName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param nextLink The nextLink from the previous successful call to the ListByGallery method. - * @param options The options parameters. - */ - private _listByGalleryNext( - resourceGroupName: string, - galleryName: string, - nextLink: string, - options?: GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, nextLink, options }, - listByGalleryNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - }, - 201: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - }, - 202: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - }, - 204: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryInVMAccessControlProfile, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - headersMapper: Mappers.GalleryInVMAccessControlProfilesUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - headersMapper: Mappers.GalleryInVMAccessControlProfilesUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - headersMapper: Mappers.GalleryInVMAccessControlProfilesUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.GalleryInVMAccessControlProfile, - headersMapper: Mappers.GalleryInVMAccessControlProfilesUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryInVMAccessControlProfile1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, - }, - 201: { - headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, - }, - 202: { - headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, - }, - 204: { - headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.inVMAccessControlProfileName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryInVMAccessControlProfileList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryScriptVersions.ts b/sdk/compute/arm-compute/src/operations/galleryScriptVersions.ts deleted file mode 100644 index 14c27bbd36c3..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryScriptVersions.ts +++ /dev/null @@ -1,705 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryScriptVersions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryScriptVersion, - GalleryScriptVersionsListByGalleryScriptNextOptionalParams, - GalleryScriptVersionsListByGalleryScriptOptionalParams, - GalleryScriptVersionsListByGalleryScriptResponse, - GalleryScriptVersionsGetOptionalParams, - GalleryScriptVersionsGetResponse, - GalleryScriptVersionsCreateOrUpdateOptionalParams, - GalleryScriptVersionsCreateOrUpdateResponse, - GalleryScriptVersionUpdate, - GalleryScriptVersionsUpdateOptionalParams, - GalleryScriptVersionsUpdateResponse, - GalleryScriptVersionsDeleteOptionalParams, - GalleryScriptVersionsDeleteResponse, - GalleryScriptVersionsListByGalleryScriptNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryScriptVersions operations. */ -export class GalleryScriptVersionsImpl implements GalleryScriptVersions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryScriptVersions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery Script Versions in a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - public listByGalleryScript( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptVersionsListByGalleryScriptOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryScriptPagingAll( - resourceGroupName, - galleryName, - galleryScriptName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryScriptPagingPage( - resourceGroupName, - galleryName, - galleryScriptName, - options, - settings, - ); - }, - }; - } - - private async *listByGalleryScriptPagingPage( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptVersionsListByGalleryScriptOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryScriptVersionsListByGalleryScriptResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGalleryScript( - resourceGroupName, - galleryName, - galleryScriptName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryScriptNext( - resourceGroupName, - galleryName, - galleryScriptName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryScriptPagingAll( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptVersionsListByGalleryScriptOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryScriptPagingPage( - resourceGroupName, - galleryName, - galleryScriptName, - options, - )) { - yield* page; - } - } - - /** - * List gallery Script Versions in a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - private _listByGalleryScript( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptVersionsListByGalleryScriptOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryScriptName, options }, - listByGalleryScriptOperationSpec, - ); - } - - /** - * Custom ArmResourceRead operation template with CloudError as Error - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - options?: GalleryScriptVersionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - options, - }, - getOperationSpec, - ); - } - - /** - * Create or update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version - * operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersion, - options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptVersionsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryScriptVersionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version - * operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersion, - options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersionUpdate, - options?: GalleryScriptVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptVersionsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryScriptVersionsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersionUpdate, - options?: GalleryScriptVersionsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - galleryScriptVersion, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - options?: GalleryScriptVersionsDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptVersionsDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - GalleryScriptVersionsDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - options?: GalleryScriptVersionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScriptVersionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryScriptNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param nextLink The nextLink from the previous successful call to the ListByGalleryScript method. - * @param options The options parameters. - */ - private _listByGalleryScriptNext( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - nextLink: string, - options?: GalleryScriptVersionsListByGalleryScriptNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryScriptName, nextLink, options }, - listByGalleryScriptNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryScriptOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryScriptVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - Parameters.galleryScriptVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - 201: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - 202: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - 204: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryScriptVersion, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - Parameters.galleryScriptVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - 201: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - 202: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - 204: { - bodyMapper: Mappers.GalleryScriptVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryScriptVersion1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - Parameters.galleryScriptVersionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.GalleryScriptVersionsDeleteHeaders, - }, - 201: { - headersMapper: Mappers.GalleryScriptVersionsDeleteHeaders, - }, - 202: { - headersMapper: Mappers.GalleryScriptVersionsDeleteHeaders, - }, - 204: { - headersMapper: Mappers.GalleryScriptVersionsDeleteHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - Parameters.galleryScriptVersionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryScriptNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryScriptVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/galleryScripts.ts b/sdk/compute/arm-compute/src/operations/galleryScripts.ts deleted file mode 100644 index 862e17586ace..000000000000 --- a/sdk/compute/arm-compute/src/operations/galleryScripts.ts +++ /dev/null @@ -1,636 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { GalleryScripts } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - GalleryScript, - GalleryScriptsListByGalleryNextOptionalParams, - GalleryScriptsListByGalleryOptionalParams, - GalleryScriptsListByGalleryResponse, - GalleryScriptsGetOptionalParams, - GalleryScriptsGetResponse, - GalleryScriptsCreateOrUpdateOptionalParams, - GalleryScriptsCreateOrUpdateResponse, - GalleryScriptUpdate, - GalleryScriptsUpdateOptionalParams, - GalleryScriptsUpdateResponse, - GalleryScriptsDeleteOptionalParams, - GalleryScriptsDeleteResponse, - GalleryScriptsListByGalleryNextResponse, -} from "../models/index.js"; - -/// -/** Class containing GalleryScripts operations. */ -export class GalleryScriptsImpl implements GalleryScripts { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GalleryScripts class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List gallery Script Definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - public listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryScriptsListByGalleryOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByGalleryPagingAll(resourceGroupName, galleryName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByGalleryPagingPage(resourceGroupName, galleryName, options, settings); - }, - }; - } - - private async *listByGalleryPagingPage( - resourceGroupName: string, - galleryName: string, - options?: GalleryScriptsListByGalleryOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GalleryScriptsListByGalleryResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByGallery(resourceGroupName, galleryName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByGalleryNext( - resourceGroupName, - galleryName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByGalleryPagingAll( - resourceGroupName: string, - galleryName: string, - options?: GalleryScriptsListByGalleryOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByGalleryPagingPage( - resourceGroupName, - galleryName, - options, - )) { - yield* page; - } - } - - /** - * List gallery Script Definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - private _listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryScriptsListByGalleryOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, options }, - listByGalleryOperationSpec, - ); - } - - /** - * Retrieves information about a gallery script definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, galleryScriptName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse - * of common scripts - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the create or update gallery Script operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScript, - options?: GalleryScriptsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryScriptsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse - * of common scripts - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the create or update gallery Script operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScript, - options?: GalleryScriptsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the update gallery Script operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScriptUpdate, - options?: GalleryScriptsUpdateOptionalParams, - ): Promise< - SimplePollerLike, GalleryScriptsUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GalleryScriptsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the update gallery Script operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScriptUpdate, - options?: GalleryScriptsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - galleryName, - galleryScriptName, - galleryScript, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Delete a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptsDeleteOptionalParams, - ): Promise< - SimplePollerLike, GalleryScriptsDeleteResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, galleryName, galleryScriptName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - GalleryScriptsDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Delete a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - galleryName, - galleryScriptName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByGalleryNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param nextLink The nextLink from the previous successful call to the ListByGallery method. - * @param options The options parameters. - */ - private _listByGalleryNext( - resourceGroupName: string, - galleryName: string, - nextLink: string, - options?: GalleryScriptsListByGalleryNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, nextLink, options }, - listByGalleryNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByGalleryOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryScriptList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryScript, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GalleryScript, - }, - 201: { - bodyMapper: Mappers.GalleryScript, - }, - 202: { - bodyMapper: Mappers.GalleryScript, - }, - 204: { - bodyMapper: Mappers.GalleryScript, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryScript, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GalleryScript, - }, - 201: { - bodyMapper: Mappers.GalleryScript, - }, - 202: { - bodyMapper: Mappers.GalleryScript, - }, - 204: { - bodyMapper: Mappers.GalleryScript, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.galleryScript1, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.GalleryScriptsDeleteHeaders, - }, - 201: { - headersMapper: Mappers.GalleryScriptsDeleteHeaders, - }, - 202: { - headersMapper: Mappers.GalleryScriptsDeleteHeaders, - }, - 204: { - headersMapper: Mappers.GalleryScriptsDeleteHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.galleryScriptName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByGalleryNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GalleryScriptList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/gallerySharingProfile.ts b/sdk/compute/arm-compute/src/operations/gallerySharingProfile.ts deleted file mode 100644 index ca14fd48d4cc..000000000000 --- a/sdk/compute/arm-compute/src/operations/gallerySharingProfile.ts +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { GallerySharingProfile } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - SharingUpdate, - GallerySharingProfileUpdateOptionalParams, - GallerySharingProfileUpdateResponse, -} from "../models/index.js"; - -/** Class containing GallerySharingProfile operations. */ -export class GallerySharingProfileImpl implements GallerySharingProfile { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class GallerySharingProfile class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Update sharing profile of a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param sharingUpdate Parameters supplied to the update gallery sharing profile. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - galleryName: string, - sharingUpdate: SharingUpdate, - options?: GallerySharingProfileUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GallerySharingProfileUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, galleryName, sharingUpdate, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GallerySharingProfileUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update sharing profile of a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param sharingUpdate Parameters supplied to the update gallery sharing profile. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - sharingUpdate: SharingUpdate, - options?: GallerySharingProfileUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, galleryName, sharingUpdate, options); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SharingUpdate, - }, - 201: { - bodyMapper: Mappers.SharingUpdate, - }, - 202: { - bodyMapper: Mappers.SharingUpdate, - }, - 204: { - bodyMapper: Mappers.SharingUpdate, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.sharingUpdate, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/images.ts b/sdk/compute/arm-compute/src/operations/images.ts deleted file mode 100644 index ff7682f33dce..000000000000 --- a/sdk/compute/arm-compute/src/operations/images.ts +++ /dev/null @@ -1,659 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Images } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - Image, - ImagesListNextOptionalParams, - ImagesListOptionalParams, - ImagesListResponse, - ImagesListByResourceGroupNextOptionalParams, - ImagesListByResourceGroupOptionalParams, - ImagesListByResourceGroupResponse, - ImagesGetOptionalParams, - ImagesGetResponse, - ImagesCreateOrUpdateOptionalParams, - ImagesCreateOrUpdateResponse, - ImageUpdate, - ImagesUpdateOptionalParams, - ImagesUpdateResponse, - ImagesDeleteOptionalParams, - ImagesListNextResponse, - ImagesListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Images operations. */ -export class ImagesImpl implements Images { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class Images class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next - * page of Images. Do this till nextLink is null to fetch all the Images. - * @param options The options parameters. - */ - public list(options?: ImagesListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: ImagesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ImagesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll(options?: ImagesListOptionalParams): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Gets the list of images under a resource group. Use nextLink property in the response to get the - * next page of Images. Do this till nextLink is null to fetch all the Images. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: ImagesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: ImagesListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ImagesListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: ImagesListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next - * page of Images. Do this till nextLink is null to fetch all the Images. - * @param options The options parameters. - */ - private _list(options?: ImagesListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Gets the list of images under a resource group. Use nextLink property in the response to get the - * next page of Images. Do this till nextLink is null to fetch all the Images. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: ImagesListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Gets an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - imageName: string, - options?: ImagesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, imageName, options }, - getOperationSpec, - ); - } - - /** - * Create or update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - imageName: string, - parameters: Image, - options?: ImagesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike, ImagesCreateOrUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, imageName, parameters, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - ImagesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - imageName: string, - parameters: Image, - options?: ImagesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - imageName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - imageName: string, - parameters: ImageUpdate, - options?: ImagesUpdateOptionalParams, - ): Promise, ImagesUpdateResponse>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, imageName, parameters, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - ImagesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - imageName: string, - parameters: ImageUpdate, - options?: ImagesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, imageName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * Deletes an Image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - imageName: string, - options?: ImagesDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, imageName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes an Image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - imageName: string, - options?: ImagesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, imageName, options); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: ImagesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: ImagesListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ImageListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ImageListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Image, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.imageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Image, - }, - 201: { - bodyMapper: Mappers.Image, - }, - 202: { - bodyMapper: Mappers.Image, - }, - 204: { - bodyMapper: Mappers.Image, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.imageName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Image, - }, - 201: { - bodyMapper: Mappers.Image, - }, - 202: { - bodyMapper: Mappers.Image, - }, - 204: { - bodyMapper: Mappers.Image, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.imageName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.imageName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ImageListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ImageListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/index.ts b/sdk/compute/arm-compute/src/operations/index.ts deleted file mode 100644 index f91f8bc2c7cf..000000000000 --- a/sdk/compute/arm-compute/src/operations/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -export * from "./operations.js"; -export * from "./availabilitySets.js"; -export * from "./capacityReservationGroups.js"; -export * from "./dedicatedHostGroups.js"; -export * from "./images.js"; -export * from "./virtualMachineImagesEdgeZone.js"; -export * from "./virtualMachineImages.js"; -export * from "./logAnalytics.js"; -export * from "./virtualMachineExtensionImages.js"; -export * from "./virtualMachineRunCommands.js"; -export * from "./usageOperations.js"; -export * from "./virtualMachineScaleSets.js"; -export * from "./virtualMachines.js"; -export * from "./virtualMachineSizes.js"; -export * from "./proximityPlacementGroups.js"; -export * from "./restorePointCollections.js"; -export * from "./sshPublicKeys.js"; -export * from "./capacityReservations.js"; -export * from "./dedicatedHosts.js"; -export * from "./restorePoints.js"; -export * from "./virtualMachineScaleSetRollingUpgrades.js"; -export * from "./virtualMachineScaleSetExtensions.js"; -export * from "./virtualMachineScaleSetVMs.js"; -export * from "./virtualMachineScaleSetVMExtensions.js"; -export * from "./virtualMachineScaleSetVMRunCommands.js"; -export * from "./virtualMachineExtensions.js"; -export * from "./diskAccesses.js"; -export * from "./diskEncryptionSets.js"; -export * from "./disks.js"; -export * from "./snapshots.js"; -export * from "./diskRestorePointOperations.js"; -export * from "./resourceSkus.js"; -export * from "./galleries.js"; -export * from "./communityGalleries.js"; -export * from "./communityGalleryImages.js"; -export * from "./communityGalleryImageVersions.js"; -export * from "./sharedGalleries.js"; -export * from "./sharedGalleryImages.js"; -export * from "./sharedGalleryImageVersions.js"; -export * from "./galleryApplications.js"; -export * from "./galleryApplicationVersions.js"; -export * from "./galleryImages.js"; -export * from "./galleryImageVersions.js"; -export * from "./galleryInVMAccessControlProfiles.js"; -export * from "./galleryInVMAccessControlProfileVersions.js"; -export * from "./galleryScripts.js"; -export * from "./galleryScriptVersions.js"; -export * from "./gallerySharingProfile.js"; -export * from "./softDeletedResource.js"; -export * from "./cloudServiceRoleInstances.js"; -export * from "./cloudServiceRoles.js"; -export * from "./cloudServices.js"; -export * from "./cloudServicesUpdateDomain.js"; -export * from "./cloudServiceOperatingSystems.js"; diff --git a/sdk/compute/arm-compute/src/operations/logAnalytics.ts b/sdk/compute/arm-compute/src/operations/logAnalytics.ts deleted file mode 100644 index 7cdc485da436..000000000000 --- a/sdk/compute/arm-compute/src/operations/logAnalytics.ts +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { LogAnalytics } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - RequestRateByIntervalInput, - LogAnalyticsExportRequestRateByIntervalOptionalParams, - LogAnalyticsExportRequestRateByIntervalResponse, - ThrottledRequestsInput, - LogAnalyticsExportThrottledRequestsOptionalParams, - LogAnalyticsExportThrottledRequestsResponse, -} from "../models/index.js"; - -/** Class containing LogAnalytics operations. */ -export class LogAnalyticsImpl implements LogAnalytics { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class LogAnalytics class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show - * throttling activities. - * @param location The name of Azure region. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param options The options parameters. - */ - async beginExportRequestRateByInterval( - location: string, - parameters: RequestRateByIntervalInput, - options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - LogAnalyticsExportRequestRateByIntervalResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { location, parameters, options }, - spec: exportRequestRateByIntervalOperationSpec, - }); - const poller = await createHttpPoller< - LogAnalyticsExportRequestRateByIntervalResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show - * throttling activities. - * @param location The name of Azure region. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param options The options parameters. - */ - async beginExportRequestRateByIntervalAndWait( - location: string, - parameters: RequestRateByIntervalInput, - options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, - ): Promise { - const poller = await this.beginExportRequestRateByInterval(location, parameters, options); - return poller.pollUntilDone(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * @param location The name of Azure region. - * @param parameters The request body - * @param options The options parameters. - */ - async beginExportThrottledRequests( - location: string, - parameters: ThrottledRequestsInput, - options?: LogAnalyticsExportThrottledRequestsOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - LogAnalyticsExportThrottledRequestsResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { location, parameters, options }, - spec: exportThrottledRequestsOperationSpec, - }); - const poller = await createHttpPoller< - LogAnalyticsExportThrottledRequestsResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * @param location The name of Azure region. - * @param parameters The request body - * @param options The options parameters. - */ - async beginExportThrottledRequestsAndWait( - location: string, - parameters: ThrottledRequestsInput, - options?: LogAnalyticsExportThrottledRequestsOptionalParams, - ): Promise { - const poller = await this.beginExportThrottledRequests(location, parameters, options); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const exportRequestRateByIntervalOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - 201: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - 202: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - 204: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters10, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const exportThrottledRequestsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - 201: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - 202: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - 204: { - bodyMapper: Mappers.LogAnalyticsOperationResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters11, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/operations.ts b/sdk/compute/arm-compute/src/operations/operations.ts deleted file mode 100644 index 905995950d5d..000000000000 --- a/sdk/compute/arm-compute/src/operations/operations.ts +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Operations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List the operations for the provider - * @param options The options parameters. - */ - public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List the operations for the provider - * @param options The options parameters. - */ - private _list(options?: OperationsListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Compute/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts b/sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts deleted file mode 100644 index 8fc57b736854..000000000000 --- a/sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { ProximityPlacementGroups } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - ProximityPlacementGroup, - ProximityPlacementGroupsListBySubscriptionNextOptionalParams, - ProximityPlacementGroupsListBySubscriptionOptionalParams, - ProximityPlacementGroupsListBySubscriptionResponse, - ProximityPlacementGroupsListByResourceGroupNextOptionalParams, - ProximityPlacementGroupsListByResourceGroupOptionalParams, - ProximityPlacementGroupsListByResourceGroupResponse, - ProximityPlacementGroupsGetOptionalParams, - ProximityPlacementGroupsGetResponse, - ProximityPlacementGroupsCreateOrUpdateOptionalParams, - ProximityPlacementGroupsCreateOrUpdateResponse, - ProximityPlacementGroupUpdate, - ProximityPlacementGroupsUpdateOptionalParams, - ProximityPlacementGroupsUpdateResponse, - ProximityPlacementGroupsDeleteOptionalParams, - ProximityPlacementGroupsListBySubscriptionNextResponse, - ProximityPlacementGroupsListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ProximityPlacementGroups operations. */ -export class ProximityPlacementGroupsImpl implements ProximityPlacementGroups { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class ProximityPlacementGroups class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all proximity placement groups in a subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: ProximityPlacementGroupsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: ProximityPlacementGroupsListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ProximityPlacementGroupsListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: ProximityPlacementGroupsListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all proximity placement groups in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ProximityPlacementGroupsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all proximity placement groups in a subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: ProximityPlacementGroupsListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); - } - - /** - * Lists all proximity placement groups in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Retrieves information about a proximity placement group . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - proximityPlacementGroupName: string, - options?: ProximityPlacementGroupsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, proximityPlacementGroupName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a proximity placement group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - proximityPlacementGroupName: string, - parameters: ProximityPlacementGroup, - options?: ProximityPlacementGroupsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, proximityPlacementGroupName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Update a proximity placement group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - proximityPlacementGroupName: string, - parameters: ProximityPlacementGroupUpdate, - options?: ProximityPlacementGroupsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, proximityPlacementGroupName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Delete a proximity placement group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - proximityPlacementGroupName: string, - options?: ProximityPlacementGroupsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, proximityPlacementGroupName, options }, - deleteOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: ProximityPlacementGroupsListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: ProximityPlacementGroupsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ProximityPlacementGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ProximityPlacementGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ProximityPlacementGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.includeColocationStatus], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.proximityPlacementGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ProximityPlacementGroup, - }, - 201: { - bodyMapper: Mappers.ProximityPlacementGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters24, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.proximityPlacementGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.ProximityPlacementGroup, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters25, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.proximityPlacementGroupName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", - httpMethod: "DELETE", - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.proximityPlacementGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ProximityPlacementGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ProximityPlacementGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/resourceSkus.ts b/sdk/compute/arm-compute/src/operations/resourceSkus.ts deleted file mode 100644 index 4d2c1c00bbbe..000000000000 --- a/sdk/compute/arm-compute/src/operations/resourceSkus.ts +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { ResourceSkus } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - ResourceSku, - ResourceSkusListNextOptionalParams, - ResourceSkusListOptionalParams, - ResourceSkusListResponse, - ResourceSkusListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ResourceSkus operations. */ -export class ResourceSkusImpl implements ResourceSkus { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class ResourceSkus class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * @param options The options parameters. - */ - public list(options?: ResourceSkusListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: ResourceSkusListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ResourceSkusListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: ResourceSkusListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * @param options The options parameters. - */ - private _list(options?: ResourceSkusListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: ResourceSkusListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceSkusResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.filter, Parameters.apiVersion2, Parameters.includeExtendedLocations], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceSkusResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/restorePointCollections.ts b/sdk/compute/arm-compute/src/operations/restorePointCollections.ts deleted file mode 100644 index 075882d6995a..000000000000 --- a/sdk/compute/arm-compute/src/operations/restorePointCollections.ts +++ /dev/null @@ -1,514 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { RestorePointCollections } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - RestorePointCollection, - RestorePointCollectionsListAllNextOptionalParams, - RestorePointCollectionsListAllOptionalParams, - RestorePointCollectionsListAllResponse, - RestorePointCollectionsListNextOptionalParams, - RestorePointCollectionsListOptionalParams, - RestorePointCollectionsListResponse, - RestorePointCollectionsGetOptionalParams, - RestorePointCollectionsGetResponse, - RestorePointCollectionsCreateOrUpdateOptionalParams, - RestorePointCollectionsCreateOrUpdateResponse, - RestorePointCollectionUpdate, - RestorePointCollectionsUpdateOptionalParams, - RestorePointCollectionsUpdateResponse, - RestorePointCollectionsDeleteOptionalParams, - RestorePointCollectionsListAllNextResponse, - RestorePointCollectionsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing RestorePointCollections operations. */ -export class RestorePointCollectionsImpl implements RestorePointCollections { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class RestorePointCollections class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets the list of restore point collections in the subscription. Use nextLink property in the - * response to get the next page of restore point collections. Do this till nextLink is not null to - * fetch all the restore point collections. - * @param options The options parameters. - */ - public listAll( - options?: RestorePointCollectionsListAllOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAllPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAllPagingPage(options, settings); - }, - }; - } - - private async *listAllPagingPage( - options?: RestorePointCollectionsListAllOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: RestorePointCollectionsListAllResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAll(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAllNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAllPagingAll( - options?: RestorePointCollectionsListAllOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAllPagingPage(options)) { - yield* page; - } - } - - /** - * Gets the list of restore point collections in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - options?: RestorePointCollectionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - options?: RestorePointCollectionsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: RestorePointCollectionsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - options?: RestorePointCollectionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Gets the list of restore point collections in the subscription. Use nextLink property in the - * response to get the next page of restore point collections. Do this till nextLink is not null to - * fetch all the restore point collections. - * @param options The options parameters. - */ - private _listAll( - options?: RestorePointCollectionsListAllOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listAllOperationSpec); - } - - /** - * Gets the list of restore point collections in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - options?: RestorePointCollectionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ resourceGroupName, options }, listOperationSpec); - } - - /** - * The operation to get the restore point collection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - restorePointCollectionName: string, - options?: RestorePointCollectionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, restorePointCollectionName, options }, - getOperationSpec, - ); - } - - /** - * The operation to create or update the restore point collection. Please refer to - * https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags - * may be modified. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param parameters Parameters supplied to the Create or Update restore point collection operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - restorePointCollectionName: string, - parameters: RestorePointCollection, - options?: RestorePointCollectionsCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, restorePointCollectionName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * The operation to update the restore point collection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param parameters Parameters supplied to the Update restore point collection operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - restorePointCollectionName: string, - parameters: RestorePointCollectionUpdate, - options?: RestorePointCollectionsUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, restorePointCollectionName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * The operation to delete the restore point collection. This operation will also delete all the - * contained restore points. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - restorePointCollectionName: string, - options?: RestorePointCollectionsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, restorePointCollectionName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete the restore point collection. This operation will also delete all the - * contained restore points. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - options?: RestorePointCollectionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, restorePointCollectionName, options); - return poller.pollUntilDone(); - } - - /** - * ListAllNext - * @param nextLink The nextLink from the previous successful call to the ListAll method. - * @param options The options parameters. - */ - private _listAllNext( - nextLink: string, - options?: RestorePointCollectionsListAllNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listAllNextOperationSpec); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - nextLink: string, - options?: RestorePointCollectionsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listAllOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RestorePointCollectionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RestorePointCollectionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RestorePointCollection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand8], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RestorePointCollection, - }, - 201: { - bodyMapper: Mappers.RestorePointCollection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters26, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.RestorePointCollection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters27, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAllNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RestorePointCollectionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RestorePointCollectionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/restorePoints.ts b/sdk/compute/arm-compute/src/operations/restorePoints.ts deleted file mode 100644 index 51c5590105c0..000000000000 --- a/sdk/compute/arm-compute/src/operations/restorePoints.ts +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { RestorePoints } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - RestorePointsGetOptionalParams, - RestorePointsGetResponse, - RestorePoint, - RestorePointsCreateOptionalParams, - RestorePointsCreateResponse, - RestorePointsDeleteOptionalParams, -} from "../models/index.js"; - -/** Class containing RestorePoints operations. */ -export class RestorePointsImpl implements RestorePoints { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class RestorePoints class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * The operation to get the restore point. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - options?: RestorePointsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - restorePointCollectionName, - restorePointName, - options, - }, - getOperationSpec, - ); - } - - /** - * The operation to create the restore point. Updating properties of an existing restore point is not - * allowed - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param parameters Parameters supplied to the Create restore point operation. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - parameters: RestorePoint, - options?: RestorePointsCreateOptionalParams, - ): Promise< - SimplePollerLike, RestorePointsCreateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - options, - }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - RestorePointsCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create the restore point. Updating properties of an existing restore point is not - * allowed - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param parameters Parameters supplied to the Create restore point operation. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - parameters: RestorePoint, - options?: RestorePointsCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - restorePointCollectionName, - restorePointName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to delete the restore point. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - options?: RestorePointsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - restorePointCollectionName, - restorePointName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete the restore point. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - options?: RestorePointsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - restorePointCollectionName, - restorePointName, - options, - ); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RestorePoint, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand10], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.restorePointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RestorePoint, - headersMapper: Mappers.RestorePointsCreateHeaders, - }, - 201: { - bodyMapper: Mappers.RestorePoint, - headersMapper: Mappers.RestorePointsCreateHeaders, - }, - 202: { - bodyMapper: Mappers.RestorePoint, - headersMapper: Mappers.RestorePointsCreateHeaders, - }, - 204: { - bodyMapper: Mappers.RestorePoint, - headersMapper: Mappers.RestorePointsCreateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters35, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.restorePointName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.restorePointCollectionName, - Parameters.restorePointName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleries.ts b/sdk/compute/arm-compute/src/operations/sharedGalleries.ts deleted file mode 100644 index f43b5953b73e..000000000000 --- a/sdk/compute/arm-compute/src/operations/sharedGalleries.ts +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { SharedGalleries } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - SharedGallery, - SharedGalleriesListNextOptionalParams, - SharedGalleriesListOptionalParams, - SharedGalleriesListResponse, - SharedGalleriesGetOptionalParams, - SharedGalleriesGetResponse, - SharedGalleriesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing SharedGalleries operations. */ -export class SharedGalleriesImpl implements SharedGalleries { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class SharedGalleries class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List shared galleries by subscription id or tenant id. - * @param location The name of Azure region. - * @param options The options parameters. - */ - public list( - location: string, - options?: SharedGalleriesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(location, options, settings); - }, - }; - } - - private async *listPagingPage( - location: string, - options?: SharedGalleriesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SharedGalleriesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - options?: SharedGalleriesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(location, options)) { - yield* page; - } - } - - /** - * List shared galleries by subscription id or tenant id. - * @param location The name of Azure region. - * @param options The options parameters. - */ - private _list( - location: string, - options?: SharedGalleriesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listOperationSpec); - } - - /** - * Get a shared gallery by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param options The options parameters. - */ - get( - location: string, - galleryUniqueName: string, - options?: SharedGalleriesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, galleryUniqueName, options }, - getOperationSpec, - ); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - nextLink: string, - options?: SharedGalleriesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, nextLink, options }, listNextOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGallery, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.galleryUniqueName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts deleted file mode 100644 index 75670ffe4128..000000000000 --- a/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { SharedGalleryImageVersions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - SharedGalleryImageVersion, - SharedGalleryImageVersionsListNextOptionalParams, - SharedGalleryImageVersionsListOptionalParams, - SharedGalleryImageVersionsListResponse, - SharedGalleryImageVersionsGetOptionalParams, - SharedGalleryImageVersionsGetResponse, - SharedGalleryImageVersionsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing SharedGalleryImageVersions operations. */ -export class SharedGalleryImageVersionsImpl implements SharedGalleryImageVersions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class SharedGalleryImageVersions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List shared gallery image versions by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param options The options parameters. - */ - public list( - location: string, - galleryUniqueName: string, - galleryImageName: string, - options?: SharedGalleryImageVersionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, galleryUniqueName, galleryImageName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - location, - galleryUniqueName, - galleryImageName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - location: string, - galleryUniqueName: string, - galleryImageName: string, - options?: SharedGalleryImageVersionsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SharedGalleryImageVersionsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, galleryUniqueName, galleryImageName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - location, - galleryUniqueName, - galleryImageName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - galleryUniqueName: string, - galleryImageName: string, - options?: SharedGalleryImageVersionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - location, - galleryUniqueName, - galleryImageName, - options, - )) { - yield* page; - } - } - - /** - * List shared gallery image versions by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param options The options parameters. - */ - private _list( - location: string, - galleryUniqueName: string, - galleryImageName: string, - options?: SharedGalleryImageVersionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, galleryUniqueName, galleryImageName, options }, - listOperationSpec, - ); - } - - /** - * Get a shared gallery image version by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within - * the range of a 32-bit integer. Format: .. - * @param options The options parameters. - */ - get( - location: string, - galleryUniqueName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: SharedGalleryImageVersionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - location, - galleryUniqueName, - galleryImageName, - galleryImageVersionName, - options, - }, - getOperationSpec, - ); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - galleryUniqueName: string, - galleryImageName: string, - nextLink: string, - options?: SharedGalleryImageVersionsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, galleryUniqueName, galleryImageName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryImageVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.galleryImageName, - Parameters.galleryUniqueName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryImageVersion, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.galleryImageName, - Parameters.galleryImageVersionName, - Parameters.galleryUniqueName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryImageVersionList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - Parameters.galleryImageName, - Parameters.galleryUniqueName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts b/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts deleted file mode 100644 index 8fb3a5e291ea..000000000000 --- a/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { SharedGalleryImages } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - SharedGalleryImage, - SharedGalleryImagesListNextOptionalParams, - SharedGalleryImagesListOptionalParams, - SharedGalleryImagesListResponse, - SharedGalleryImagesGetOptionalParams, - SharedGalleryImagesGetResponse, - SharedGalleryImagesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing SharedGalleryImages operations. */ -export class SharedGalleryImagesImpl implements SharedGalleryImages { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class SharedGalleryImages class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List shared gallery images by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param options The options parameters. - */ - public list( - location: string, - galleryUniqueName: string, - options?: SharedGalleryImagesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, galleryUniqueName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(location, galleryUniqueName, options, settings); - }, - }; - } - - private async *listPagingPage( - location: string, - galleryUniqueName: string, - options?: SharedGalleryImagesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SharedGalleryImagesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, galleryUniqueName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(location, galleryUniqueName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - galleryUniqueName: string, - options?: SharedGalleryImagesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(location, galleryUniqueName, options)) { - yield* page; - } - } - - /** - * List shared gallery images by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param options The options parameters. - */ - private _list( - location: string, - galleryUniqueName: string, - options?: SharedGalleryImagesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, galleryUniqueName, options }, - listOperationSpec, - ); - } - - /** - * Get a shared gallery image by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param options The options parameters. - */ - get( - location: string, - galleryUniqueName: string, - galleryImageName: string, - options?: SharedGalleryImagesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, galleryUniqueName, galleryImageName, options }, - getOperationSpec, - ); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - galleryUniqueName: string, - nextLink: string, - options?: SharedGalleryImagesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, galleryUniqueName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryImageList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.galleryUniqueName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryImage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.galleryImageName, - Parameters.galleryUniqueName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SharedGalleryImageList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - Parameters.galleryUniqueName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/snapshots.ts b/sdk/compute/arm-compute/src/operations/snapshots.ts deleted file mode 100644 index 48c6b80bd693..000000000000 --- a/sdk/compute/arm-compute/src/operations/snapshots.ts +++ /dev/null @@ -1,908 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { Snapshots } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - Snapshot, - SnapshotsListNextOptionalParams, - SnapshotsListOptionalParams, - SnapshotsListResponse, - SnapshotsListByResourceGroupNextOptionalParams, - SnapshotsListByResourceGroupOptionalParams, - SnapshotsListByResourceGroupResponse, - SnapshotsGetOptionalParams, - SnapshotsGetResponse, - SnapshotsCreateOrUpdateOptionalParams, - SnapshotsCreateOrUpdateResponse, - SnapshotUpdate, - SnapshotsUpdateOptionalParams, - SnapshotsUpdateResponse, - SnapshotsDeleteOptionalParams, - GrantAccessData, - SnapshotsGrantAccessOptionalParams, - SnapshotsGrantAccessResponse, - SnapshotsRevokeAccessOptionalParams, - SnapshotsListNextResponse, - SnapshotsListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Snapshots operations. */ -export class SnapshotsImpl implements Snapshots { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class Snapshots class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists snapshots under a subscription. - * @param options The options parameters. - */ - public list(options?: SnapshotsListOptionalParams): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: SnapshotsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SnapshotsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: SnapshotsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists snapshots under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: SnapshotsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: SnapshotsListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SnapshotsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: SnapshotsListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists snapshots under a subscription. - * @param options The options parameters. - */ - private _list(options?: SnapshotsListOptionalParams): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Lists snapshots under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: SnapshotsListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Gets information about a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, snapshotName, options }, - getOperationSpec, - ); - } - - /** - * Creates or updates a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - snapshotName: string, - snapshot: Snapshot, - options?: SnapshotsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - SnapshotsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, snapshotName, snapshot, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - SnapshotsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - snapshotName: string, - snapshot: Snapshot, - options?: SnapshotsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - snapshotName, - snapshot, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates (patches) a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - snapshotName: string, - snapshot: SnapshotUpdate, - options?: SnapshotsUpdateOptionalParams, - ): Promise, SnapshotsUpdateResponse>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, snapshotName, snapshot, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - SnapshotsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Updates (patches) a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - snapshotName: string, - snapshot: SnapshotUpdate, - options?: SnapshotsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, snapshotName, snapshot, options); - return poller.pollUntilDone(); - } - - /** - * Deletes a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, snapshotName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, snapshotName, options); - return poller.pollUntilDone(); - } - - /** - * Grants access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param options The options parameters. - */ - async beginGrantAccess( - resourceGroupName: string, - snapshotName: string, - grantAccessData: GrantAccessData, - options?: SnapshotsGrantAccessOptionalParams, - ): Promise< - SimplePollerLike, SnapshotsGrantAccessResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, snapshotName, grantAccessData, options }, - spec: grantAccessOperationSpec, - }); - const poller = await createHttpPoller< - SnapshotsGrantAccessResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Grants access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param options The options parameters. - */ - async beginGrantAccessAndWait( - resourceGroupName: string, - snapshotName: string, - grantAccessData: GrantAccessData, - options?: SnapshotsGrantAccessOptionalParams, - ): Promise { - const poller = await this.beginGrantAccess( - resourceGroupName, - snapshotName, - grantAccessData, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Revokes access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - async beginRevokeAccess( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsRevokeAccessOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, snapshotName, options }, - spec: revokeAccessOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Revokes access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - async beginRevokeAccessAndWait( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsRevokeAccessOptionalParams, - ): Promise { - const poller = await this.beginRevokeAccess(resourceGroupName, snapshotName, options); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: SnapshotsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: SnapshotsListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Snapshot, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Snapshot, - }, - 201: { - bodyMapper: Mappers.Snapshot, - }, - 202: { - bodyMapper: Mappers.Snapshot, - }, - 204: { - bodyMapper: Mappers.Snapshot, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.snapshot, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Snapshot, - }, - 201: { - bodyMapper: Mappers.Snapshot, - }, - 202: { - bodyMapper: Mappers.Snapshot, - }, - 204: { - bodyMapper: Mappers.Snapshot, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.snapshot1, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const grantAccessOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.AccessUri, - }, - 201: { - bodyMapper: Mappers.AccessUri, - }, - 202: { - bodyMapper: Mappers.AccessUri, - }, - 204: { - bodyMapper: Mappers.AccessUri, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.grantAccessData, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const revokeAccessOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion1], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.snapshotName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SnapshotList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/softDeletedResource.ts b/sdk/compute/arm-compute/src/operations/softDeletedResource.ts deleted file mode 100644 index 512dc273774c..000000000000 --- a/sdk/compute/arm-compute/src/operations/softDeletedResource.ts +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { SoftDeletedResource } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - GallerySoftDeletedResource, - SoftDeletedResourceListByArtifactNameNextOptionalParams, - SoftDeletedResourceListByArtifactNameOptionalParams, - SoftDeletedResourceListByArtifactNameResponse, - SoftDeletedResourceListByArtifactNameNextResponse, -} from "../models/index.js"; - -/// -/** Class containing SoftDeletedResource operations. */ -export class SoftDeletedResourceImpl implements SoftDeletedResource { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class SoftDeletedResource class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image - * version of an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param artifactType The type of the artifact to be listed, such as gallery image version. - * @param artifactName The artifact name to be listed. If artifact type is Images, then the artifact - * name should be the gallery image name. - * @param options The options parameters. - */ - public listByArtifactName( - resourceGroupName: string, - galleryName: string, - artifactType: string, - artifactName: string, - options?: SoftDeletedResourceListByArtifactNameOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByArtifactNamePagingAll( - resourceGroupName, - galleryName, - artifactType, - artifactName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByArtifactNamePagingPage( - resourceGroupName, - galleryName, - artifactType, - artifactName, - options, - settings, - ); - }, - }; - } - - private async *listByArtifactNamePagingPage( - resourceGroupName: string, - galleryName: string, - artifactType: string, - artifactName: string, - options?: SoftDeletedResourceListByArtifactNameOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SoftDeletedResourceListByArtifactNameResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByArtifactName( - resourceGroupName, - galleryName, - artifactType, - artifactName, - options, - ); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByArtifactNameNext( - resourceGroupName, - galleryName, - artifactType, - artifactName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByArtifactNamePagingAll( - resourceGroupName: string, - galleryName: string, - artifactType: string, - artifactName: string, - options?: SoftDeletedResourceListByArtifactNameOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByArtifactNamePagingPage( - resourceGroupName, - galleryName, - artifactType, - artifactName, - options, - )) { - yield* page; - } - } - - /** - * List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image - * version of an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param artifactType The type of the artifact to be listed, such as gallery image version. - * @param artifactName The artifact name to be listed. If artifact type is Images, then the artifact - * name should be the gallery image name. - * @param options The options parameters. - */ - private _listByArtifactName( - resourceGroupName: string, - galleryName: string, - artifactType: string, - artifactName: string, - options?: SoftDeletedResourceListByArtifactNameOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, galleryName, artifactType, artifactName, options }, - listByArtifactNameOperationSpec, - ); - } - - /** - * ListByArtifactNameNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param artifactType The type of the artifact to be listed, such as gallery image version. - * @param artifactName The artifact name to be listed. If artifact type is Images, then the artifact - * name should be the gallery image name. - * @param nextLink The nextLink from the previous successful call to the ListByArtifactName method. - * @param options The options parameters. - */ - private _listByArtifactNameNext( - resourceGroupName: string, - galleryName: string, - artifactType: string, - artifactName: string, - nextLink: string, - options?: SoftDeletedResourceListByArtifactNameNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - galleryName, - artifactType, - artifactName, - nextLink, - options, - }, - listByArtifactNameNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByArtifactNameOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/softdeletedartifacttypes/{artifactType}/artifacts/{artifactName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GallerySoftDeletedResourceList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.artifactType, - Parameters.artifactName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByArtifactNameNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GallerySoftDeletedResourceList, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.galleryName, - Parameters.artifactType, - Parameters.artifactName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/sshPublicKeys.ts b/sdk/compute/arm-compute/src/operations/sshPublicKeys.ts deleted file mode 100644 index daa17c802f14..000000000000 --- a/sdk/compute/arm-compute/src/operations/sshPublicKeys.ts +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { SshPublicKeys } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - SshPublicKeyResource, - SshPublicKeysListBySubscriptionNextOptionalParams, - SshPublicKeysListBySubscriptionOptionalParams, - SshPublicKeysListBySubscriptionResponse, - SshPublicKeysListByResourceGroupNextOptionalParams, - SshPublicKeysListByResourceGroupOptionalParams, - SshPublicKeysListByResourceGroupResponse, - SshPublicKeysGetOptionalParams, - SshPublicKeysGetResponse, - SshPublicKeysCreateOptionalParams, - SshPublicKeysCreateResponse, - SshPublicKeyUpdateResource, - SshPublicKeysUpdateOptionalParams, - SshPublicKeysUpdateResponse, - SshPublicKeysDeleteOptionalParams, - SshPublicKeysGenerateKeyPairOptionalParams, - SshPublicKeysGenerateKeyPairResponse, - SshPublicKeysListBySubscriptionNextResponse, - SshPublicKeysListByResourceGroupNextResponse, -} from "../models/index.js"; - -/// -/** Class containing SshPublicKeys operations. */ -export class SshPublicKeysImpl implements SshPublicKeys { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class SshPublicKeys class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to - * get the next page of SSH public keys. - * @param options The options parameters. - */ - public listBySubscription( - options?: SshPublicKeysListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: SshPublicKeysListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SshPublicKeysListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: SshPublicKeysListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the - * response to get the next page of SSH public keys. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: SshPublicKeysListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: SshPublicKeysListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: SshPublicKeysListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: SshPublicKeysListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to - * get the next page of SSH public keys. - * @param options The options parameters. - */ - private _listBySubscription( - options?: SshPublicKeysListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec); - } - - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the - * response to get the next page of SSH public keys. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: SshPublicKeysListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Retrieves information about an SSH public key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - sshPublicKeyName: string, - options?: SshPublicKeysGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, sshPublicKeyName, options }, - getOperationSpec, - ); - } - - /** - * Creates a new SSH public key resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - sshPublicKeyName: string, - parameters: SshPublicKeyResource, - options?: SshPublicKeysCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, sshPublicKeyName, parameters, options }, - createOperationSpec, - ); - } - - /** - * Updates a new SSH public key resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - sshPublicKeyName: string, - parameters: SshPublicKeyUpdateResource, - options?: SshPublicKeysUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, sshPublicKeyName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Delete an SSH public key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - sshPublicKeyName: string, - options?: SshPublicKeysDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, sshPublicKeyName, options }, - deleteOperationSpec, - ); - } - - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the - * public key. The length of the key will be 3072 bits. This operation can only be performed once per - * SSH public key resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param options The options parameters. - */ - generateKeyPair( - resourceGroupName: string, - sshPublicKeyName: string, - options?: SshPublicKeysGenerateKeyPairOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, sshPublicKeyName, options }, - generateKeyPairOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: SshPublicKeysListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: SshPublicKeysListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeysGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeysGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeyResource, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.sshPublicKeyName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeyResource, - }, - 201: { - bodyMapper: Mappers.SshPublicKeyResource, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters28, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.sshPublicKeyName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeyResource, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters29, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.sshPublicKeyName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.sshPublicKeyName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const generateKeyPairOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeyGenerateKeyPairResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters30, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.sshPublicKeyName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeysGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SshPublicKeysGroupListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/usageOperations.ts b/sdk/compute/arm-compute/src/operations/usageOperations.ts deleted file mode 100644 index ebf46fe1b948..000000000000 --- a/sdk/compute/arm-compute/src/operations/usageOperations.ts +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { UsageOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - Usage, - UsageListNextOptionalParams, - UsageListOptionalParams, - UsageListResponse, - UsageListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing UsageOperations operations. */ -export class UsageOperationsImpl implements UsageOperations { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class UsageOperations class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the - * limits for compute resources under the subscription. - * @param location The name of Azure region. - * @param options The options parameters. - */ - public list( - location: string, - options?: UsageListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(location, options, settings); - }, - }; - } - - private async *listPagingPage( - location: string, - options?: UsageListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: UsageListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - options?: UsageListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(location, options)) { - yield* page; - } - } - - /** - * Gets, for the specified location, the current compute resource usage information as well as the - * limits for compute resources under the subscription. - * @param location The name of Azure region. - * @param options The options parameters. - */ - private _list(location: string, options?: UsageListOptionalParams): Promise { - return this.client.sendOperationRequest({ location, options }, listOperationSpec); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - nextLink: string, - options?: UsageListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, nextLink, options }, listNextOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListUsagesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListUsagesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts b/sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts deleted file mode 100644 index d560bfe99982..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { VirtualMachineExtensionImages } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - VirtualMachineExtensionImagesListTypesOptionalParams, - VirtualMachineExtensionImagesListTypesResponse, - VirtualMachineExtensionImagesListVersionsOptionalParams, - VirtualMachineExtensionImagesListVersionsResponse, - VirtualMachineExtensionImagesGetOptionalParams, - VirtualMachineExtensionImagesGetResponse, -} from "../models/index.js"; - -/** Class containing VirtualMachineExtensionImages operations. */ -export class VirtualMachineExtensionImagesImpl implements VirtualMachineExtensionImages { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineExtensionImages class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of virtual machine extension image types. - * @param location The name of Azure region. - * @param publisherName - * @param options The options parameters. - */ - listTypes( - location: string, - publisherName: string, - options?: VirtualMachineExtensionImagesListTypesOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, options }, - listTypesOperationSpec, - ); - } - - /** - * Gets a list of virtual machine extension image versions. - * @param location The name of Azure region. - * @param publisherName - * @param typeParam - * @param options The options parameters. - */ - listVersions( - location: string, - publisherName: string, - typeParam: string, - options?: VirtualMachineExtensionImagesListVersionsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, typeParam, options }, - listVersionsOperationSpec, - ); - } - - /** - * Gets a virtual machine extension image. - * @param location The name of Azure region. - * @param publisherName - * @param typeParam - * @param version - * @param options The options parameters. - */ - get( - location: string, - publisherName: string, - typeParam: string, - version: string, - options?: VirtualMachineExtensionImagesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, typeParam, version, options }, - getOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listTypesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtensionImage", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listVersionsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineExtensionImage", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.orderby, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - Parameters.typeParam, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineExtensionImage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - Parameters.version, - Parameters.typeParam, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineExtensions.ts b/sdk/compute/arm-compute/src/operations/virtualMachineExtensions.ts deleted file mode 100644 index 05c5199dc96b..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineExtensions.ts +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { VirtualMachineExtensions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachineExtensionsListOptionalParams, - VirtualMachineExtensionsListResponse, - VirtualMachineExtensionsGetOptionalParams, - VirtualMachineExtensionsGetResponse, - VirtualMachineExtension, - VirtualMachineExtensionsCreateOrUpdateOptionalParams, - VirtualMachineExtensionsCreateOrUpdateResponse, - VirtualMachineExtensionUpdate, - VirtualMachineExtensionsUpdateOptionalParams, - VirtualMachineExtensionsUpdateResponse, - VirtualMachineExtensionsDeleteOptionalParams, -} from "../models/index.js"; - -/** Class containing VirtualMachineExtensions operations. */ -export class VirtualMachineExtensionsImpl implements VirtualMachineExtensions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineExtensions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * The operation to get all extensions of a Virtual Machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - vmName: string, - options?: VirtualMachineExtensionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - listOperationSpec, - ); - } - - /** - * The operation to get the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - options?: VirtualMachineExtensionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, vmExtensionName, options }, - getOperationSpec, - ); - } - - /** - * The operation to create or update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtension, - options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineExtensionsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineExtensionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtension, - options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtensionUpdate, - options?: VirtualMachineExtensionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineExtensionsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineExtensionsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtensionUpdate, - options?: VirtualMachineExtensionsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - vmName, - vmExtensionName, - extensionParameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - options?: VirtualMachineExtensionsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, vmExtensionName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - options?: VirtualMachineExtensionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, vmName, vmExtensionName, options); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineExtensionsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineExtension, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineExtension, - }, - 201: { - bodyMapper: Mappers.VirtualMachineExtension, - }, - 202: { - bodyMapper: Mappers.VirtualMachineExtension, - }, - 204: { - bodyMapper: Mappers.VirtualMachineExtension, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.extensionParameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineExtension, - headersMapper: Mappers.VirtualMachineExtensionsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.VirtualMachineExtension, - headersMapper: Mappers.VirtualMachineExtensionsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.VirtualMachineExtension, - headersMapper: Mappers.VirtualMachineExtensionsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.VirtualMachineExtension, - headersMapper: Mappers.VirtualMachineExtensionsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.extensionParameters5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineImages.ts b/sdk/compute/arm-compute/src/operations/virtualMachineImages.ts deleted file mode 100644 index 544e70714819..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineImages.ts +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { VirtualMachineImages } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - VirtualMachineImagesListByEdgeZoneOptionalParams, - VirtualMachineImagesListByEdgeZoneResponse, - VirtualMachineImagesListPublishersOptionalParams, - VirtualMachineImagesListPublishersResponse, - VirtualMachineImagesListOffersOptionalParams, - VirtualMachineImagesListOffersResponse, - VirtualMachineImagesListSkusOptionalParams, - VirtualMachineImagesListSkusResponse, - VirtualMachineImagesListOptionalParams, - VirtualMachineImagesListResponse, - VirtualMachineImagesGetOptionalParams, - VirtualMachineImagesGetResponse, - VirtualMachineImagesListWithPropertiesOptionalParams, - VirtualMachineImagesListWithPropertiesResponse, -} from "../models/index.js"; - -/** Class containing VirtualMachineImages operations. */ -export class VirtualMachineImagesImpl implements VirtualMachineImages { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineImages class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of all virtual machine image versions for the specified edge zone - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param options The options parameters. - */ - listByEdgeZone( - location: string, - edgeZone: string, - options?: VirtualMachineImagesListByEdgeZoneOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, edgeZone, options }, - listByEdgeZoneOperationSpec, - ); - } - - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - listPublishers( - location: string, - options?: VirtualMachineImagesListPublishersOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listPublishersOperationSpec); - } - - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param options The options parameters. - */ - listOffers( - location: string, - publisherName: string, - options?: VirtualMachineImagesListOffersOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, options }, - listOffersOperationSpec, - ); - } - - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param options The options parameters. - */ - listSkus( - location: string, - publisherName: string, - offer: string, - options?: VirtualMachineImagesListSkusOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, offer, options }, - listSkusOperationSpec, - ); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and - * SKU. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param options The options parameters. - */ - list( - location: string, - publisherName: string, - offer: string, - skus: string, - options?: VirtualMachineImagesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, offer, skus, options }, - listOperationSpec, - ); - } - - /** - * Gets a virtual machine image. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @param options The options parameters. - */ - get( - location: string, - publisherName: string, - offer: string, - skus: string, - version: string, - options?: VirtualMachineImagesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, offer, skus, version, options }, - getOperationSpec, - ); - } - - /** - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param options The options parameters. - */ - listWithProperties( - location: string, - publisherName: string, - offer: string, - skus: string, - expand: string, - options?: VirtualMachineImagesListWithPropertiesOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, publisherName, offer, skus, expand, options }, - listWithPropertiesOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByEdgeZoneOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VmImagesInEdgeZoneListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.edgeZone, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listPublishersOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept], - serializer, -}; -const listOffersOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listSkusOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - Parameters.offer, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top, Parameters.orderby], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - Parameters.offer, - Parameters.skus, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineImage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - Parameters.offer, - Parameters.skus, - Parameters.version, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listWithPropertiesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { name: "Composite", className: "VirtualMachineImage" }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.top, Parameters.orderby, Parameters.expand4], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.publisherName, - Parameters.offer, - Parameters.skus, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineImagesEdgeZone.ts b/sdk/compute/arm-compute/src/operations/virtualMachineImagesEdgeZone.ts deleted file mode 100644 index df8b75fdcba3..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineImagesEdgeZone.ts +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { VirtualMachineImagesEdgeZone } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - VirtualMachineImagesEdgeZoneListPublishersOptionalParams, - VirtualMachineImagesEdgeZoneListPublishersResponse, - VirtualMachineImagesEdgeZoneListOffersOptionalParams, - VirtualMachineImagesEdgeZoneListOffersResponse, - VirtualMachineImagesEdgeZoneListSkusOptionalParams, - VirtualMachineImagesEdgeZoneListSkusResponse, - VirtualMachineImagesEdgeZoneListOptionalParams, - VirtualMachineImagesEdgeZoneListResponse, - VirtualMachineImagesEdgeZoneGetOptionalParams, - VirtualMachineImagesEdgeZoneGetResponse, -} from "../models/index.js"; - -/** Class containing VirtualMachineImagesEdgeZone operations. */ -export class VirtualMachineImagesEdgeZoneImpl implements VirtualMachineImagesEdgeZone { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineImagesEdgeZone class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param options The options parameters. - */ - listPublishers( - location: string, - edgeZone: string, - options?: VirtualMachineImagesEdgeZoneListPublishersOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, edgeZone, options }, - listPublishersOperationSpec, - ); - } - - /** - * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param options The options parameters. - */ - listOffers( - location: string, - edgeZone: string, - publisherName: string, - options?: VirtualMachineImagesEdgeZoneListOffersOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, edgeZone, publisherName, options }, - listOffersOperationSpec, - ); - } - - /** - * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and - * offer. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param options The options parameters. - */ - listSkus( - location: string, - edgeZone: string, - publisherName: string, - offer: string, - options?: VirtualMachineImagesEdgeZoneListSkusOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, edgeZone, publisherName, offer, options }, - listSkusOperationSpec, - ); - } - - /** - * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, - * offer, and SKU. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param options The options parameters. - */ - list( - location: string, - edgeZone: string, - publisherName: string, - offer: string, - skus: string, - options?: VirtualMachineImagesEdgeZoneListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, edgeZone, publisherName, offer, skus, options }, - listOperationSpec, - ); - } - - /** - * Gets a virtual machine image in an edge zone. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @param options The options parameters. - */ - get( - location: string, - edgeZone: string, - publisherName: string, - offer: string, - skus: string, - version: string, - options?: VirtualMachineImagesEdgeZoneGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, edgeZone, publisherName, offer, skus, version, options }, - getOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listPublishersOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.edgeZone, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOffersOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.edgeZone, - Parameters.publisherName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listSkusOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.edgeZone, - Parameters.publisherName, - Parameters.offer, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineImageResource", - }, - }, - }, - }, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.top, Parameters.orderby], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.edgeZone, - Parameters.publisherName, - Parameters.offer, - Parameters.skus, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineImage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.edgeZone, - Parameters.publisherName, - Parameters.offer, - Parameters.skus, - Parameters.version, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts b/sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts deleted file mode 100644 index 0b5333feec95..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts +++ /dev/null @@ -1,774 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VirtualMachineRunCommands } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - RunCommandDocumentBase, - VirtualMachineRunCommandsListNextOptionalParams, - VirtualMachineRunCommandsListOptionalParams, - VirtualMachineRunCommandsListResponse, - VirtualMachineRunCommand, - VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams, - VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - VirtualMachineRunCommandsListByVirtualMachineResponse, - VirtualMachineRunCommandsGetOptionalParams, - VirtualMachineRunCommandsGetResponse, - VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, - VirtualMachineRunCommandsGetByVirtualMachineResponse, - VirtualMachineRunCommandsCreateOrUpdateOptionalParams, - VirtualMachineRunCommandsCreateOrUpdateResponse, - VirtualMachineRunCommandUpdate, - VirtualMachineRunCommandsUpdateOptionalParams, - VirtualMachineRunCommandsUpdateResponse, - VirtualMachineRunCommandsDeleteOptionalParams, - VirtualMachineRunCommandsListNextResponse, - VirtualMachineRunCommandsListByVirtualMachineNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VirtualMachineRunCommands operations. */ -export class VirtualMachineRunCommandsImpl implements VirtualMachineRunCommands { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineRunCommands class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Lists all available run commands for a subscription in a location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - public list( - location: string, - options?: VirtualMachineRunCommandsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(location, options, settings); - }, - }; - } - - private async *listPagingPage( - location: string, - options?: VirtualMachineRunCommandsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineRunCommandsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - options?: VirtualMachineRunCommandsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(location, options)) { - yield* page; - } - } - - /** - * The operation to get all run commands of a Virtual Machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param options The options parameters. - */ - public listByVirtualMachine( - resourceGroupName: string, - vmName: string, - options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByVirtualMachinePagingAll(resourceGroupName, vmName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByVirtualMachinePagingPage(resourceGroupName, vmName, options, settings); - }, - }; - } - - private async *listByVirtualMachinePagingPage( - resourceGroupName: string, - vmName: string, - options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineRunCommandsListByVirtualMachineResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByVirtualMachine(resourceGroupName, vmName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByVirtualMachineNext( - resourceGroupName, - vmName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByVirtualMachinePagingAll( - resourceGroupName: string, - vmName: string, - options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByVirtualMachinePagingPage( - resourceGroupName, - vmName, - options, - )) { - yield* page; - } - } - - /** - * Lists all available run commands for a subscription in a location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - private _list( - location: string, - options?: VirtualMachineRunCommandsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listOperationSpec); - } - - /** - * Gets specific run command for a subscription in a location. - * @param location The name of Azure region. - * @param commandId Specifies a commandId of predefined built-in script. Command IDs available for - * Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at - * https://aka.ms/RunCommandManagedWindows#available-commands. - * @param options The options parameters. - */ - get( - location: string, - commandId: string, - options?: VirtualMachineRunCommandsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, commandId, options }, getOperationSpec); - } - - /** - * The operation to get all run commands of a Virtual Machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param options The options parameters. - */ - private _listByVirtualMachine( - resourceGroupName: string, - vmName: string, - options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - listByVirtualMachineOperationSpec, - ); - } - - /** - * The operation to get the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - getByVirtualMachine( - resourceGroupName: string, - vmName: string, - runCommandName: string, - options?: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, runCommandName, options }, - getByVirtualMachineOperationSpec, - ); - } - - /** - * The operation to create or update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineRunCommandsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, runCommandName, runCommand, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineRunCommandsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - vmName, - runCommandName, - runCommand, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineRunCommandsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineRunCommandsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, runCommandName, runCommand, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineRunCommandsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineRunCommandsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - vmName, - runCommandName, - runCommand, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to delete the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmName: string, - runCommandName: string, - options?: VirtualMachineRunCommandsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, runCommandName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmName: string, - runCommandName: string, - options?: VirtualMachineRunCommandsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, vmName, runCommandName, options); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - nextLink: string, - options?: VirtualMachineRunCommandsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, nextLink, options }, listNextOperationSpec); - } - - /** - * ListByVirtualMachineNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param nextLink The nextLink from the previous successful call to the ListByVirtualMachine method. - * @param options The options parameters. - */ - private _listByVirtualMachineNext( - resourceGroupName: string, - vmName: string, - nextLink: string, - options?: VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, nextLink, options }, - listByVirtualMachineNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RunCommandListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RunCommandDocument, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.commandId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVirtualMachineOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommandsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getByVirtualMachineOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.runCommandName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - 201: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - 202: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - 204: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.runCommand, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.runCommandName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineRunCommandsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineRunCommandsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineRunCommandsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineRunCommandsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.runCommand1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.runCommandName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - Parameters.runCommandName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RunCommandListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByVirtualMachineNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommandsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts deleted file mode 100644 index 40a522d54914..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VirtualMachineScaleSetExtensions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachineScaleSetExtension, - VirtualMachineScaleSetExtensionsListNextOptionalParams, - VirtualMachineScaleSetExtensionsListOptionalParams, - VirtualMachineScaleSetExtensionsListResponse, - VirtualMachineScaleSetExtensionsGetOptionalParams, - VirtualMachineScaleSetExtensionsGetResponse, - VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetExtensionsCreateOrUpdateResponse, - VirtualMachineScaleSetExtensionUpdate, - VirtualMachineScaleSetExtensionsUpdateOptionalParams, - VirtualMachineScaleSetExtensionsUpdateResponse, - VirtualMachineScaleSetExtensionsDeleteOptionalParams, - VirtualMachineScaleSetExtensionsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VirtualMachineScaleSetExtensions operations. */ -export class VirtualMachineScaleSetExtensionsImpl implements VirtualMachineScaleSetExtensions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineScaleSetExtensions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of all extensions in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetExtensionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, vmScaleSetName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, vmScaleSetName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetExtensionsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetExtensionsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, vmScaleSetName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceGroupName, vmScaleSetName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetExtensionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, vmScaleSetName, options)) { - yield* page; - } - } - - /** - * Gets a list of all extensions in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetExtensionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, options }, - listOperationSpec, - ); - } - - /** - * The operation to get the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - options?: VirtualMachineScaleSetExtensionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, vmssExtensionName, options }, - getOperationSpec, - ); - } - - /** - * The operation to create or update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtension, - options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetExtensionsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetExtensionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtension, - options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtensionUpdate, - options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetExtensionsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetExtensionsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtensionUpdate, - options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - extensionParameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, vmssExtensionName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - vmScaleSetName: string, - nextLink: string, - options?: VirtualMachineScaleSetExtensionsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetExtensionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.vmssExtensionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - 201: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - 202: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - 204: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.extensionParameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.vmssExtensionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - 201: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - 202: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - 204: { - bodyMapper: Mappers.VirtualMachineScaleSetExtension, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.extensionParameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.vmssExtensionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.vmssExtensionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetExtensionListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetRollingUpgrades.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetRollingUpgrades.ts deleted file mode 100644 index 3285c95d0d8d..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetRollingUpgrades.ts +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { VirtualMachineScaleSetRollingUpgrades } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, - VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, - VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, - VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, - VirtualMachineScaleSetRollingUpgradesGetLatestResponse, -} from "../models/index.js"; - -/** Class containing VirtualMachineScaleSetRollingUpgrades operations. */ -export class VirtualMachineScaleSetRollingUpgradesImpl implements VirtualMachineScaleSetRollingUpgrades { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineScaleSetRollingUpgrades class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the - * latest available extension version. Instances which are already running the latest extension - * versions are not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginStartExtensionUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: startExtensionUpgradeOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the - * latest available extension version. Instances which are already running the latest extension - * versions are not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginStartExtensionUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, - ): Promise { - const poller = await this.beginStartExtensionUpgrade( - resourceGroupName, - vmScaleSetName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available - * Platform Image OS version. Instances which are already running the latest available OS version are - * not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginStartOSUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: startOSUpgradeOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available - * Platform Image OS version. Instances which are already running the latest available OS version are - * not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginStartOSUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, - ): Promise { - const poller = await this.beginStartOSUpgrade(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginCancel( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: cancelOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginCancelAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, - ): Promise { - const poller = await this.beginCancel(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - getLatest( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, options }, - getLatestOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const startExtensionUpgradeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const startOSUpgradeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getLatestOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RollingUpgradeStatusInfo, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMExtensions.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMExtensions.ts deleted file mode 100644 index df4d0dd21105..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMExtensions.ts +++ /dev/null @@ -1,549 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { VirtualMachineScaleSetVMExtensions } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachineScaleSetVMExtensionsListOptionalParams, - VirtualMachineScaleSetVMExtensionsListResponse, - VirtualMachineScaleSetVMExtensionsGetOptionalParams, - VirtualMachineScaleSetVMExtensionsGetResponse, - VirtualMachineScaleSetVMExtension, - VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse, - VirtualMachineScaleSetVMExtensionUpdate, - VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, - VirtualMachineScaleSetVMExtensionsUpdateResponse, - VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, -} from "../models/index.js"; - -/** Class containing VirtualMachineScaleSetVMExtensions operations. */ -export class VirtualMachineScaleSetVMExtensionsImpl implements VirtualMachineScaleSetVMExtensions { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineScaleSetVMExtensions class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMExtensionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, instanceId, options }, - listOperationSpec, - ); - } - - /** - * The operation to get the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - options?: VirtualMachineScaleSetVMExtensionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - options, - }, - getOperationSpec, - ); - } - - /** - * The operation to create or update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtension, - options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtension, - options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, - options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMExtensionsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMExtensionsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, - options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - extensionParameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to delete the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - options, - ); - return poller.pollUntilDone(); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtensionsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - }, - 201: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - }, - 202: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - }, - 204: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.extensionParameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - headersMapper: Mappers.VirtualMachineScaleSetVMExtensionsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - headersMapper: Mappers.VirtualMachineScaleSetVMExtensionsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - headersMapper: Mappers.VirtualMachineScaleSetVMExtensionsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.VirtualMachineScaleSetVMExtension, - headersMapper: Mappers.VirtualMachineScaleSetVMExtensionsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.extensionParameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - Parameters.vmExtensionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts deleted file mode 100644 index 7a6a75d617d7..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts +++ /dev/null @@ -1,680 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VirtualMachineScaleSetVMRunCommands } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachineRunCommand, - VirtualMachineScaleSetVMRunCommandsListNextOptionalParams, - VirtualMachineScaleSetVMRunCommandsListOptionalParams, - VirtualMachineScaleSetVMRunCommandsListResponse, - VirtualMachineScaleSetVMRunCommandsGetOptionalParams, - VirtualMachineScaleSetVMRunCommandsGetResponse, - VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse, - VirtualMachineRunCommandUpdate, - VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, - VirtualMachineScaleSetVMRunCommandsUpdateResponse, - VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, - VirtualMachineScaleSetVMRunCommandsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VirtualMachineScaleSetVMRunCommands operations. */ -export class VirtualMachineScaleSetVMRunCommandsImpl implements VirtualMachineScaleSetVMRunCommands { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineScaleSetVMRunCommands class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, vmScaleSetName, instanceId, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetVMRunCommandsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, vmScaleSetName, instanceId, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - vmScaleSetName, - instanceId, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - )) { - yield* page; - } - } - - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, instanceId, options }, - listOperationSpec, - ); - } - - /** - * The operation to get the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - options?: VirtualMachineScaleSetVMRunCommandsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - options, - }, - getOperationSpec, - ); - } - - /** - * The operation to create or update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Resource create parameters. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMRunCommandsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMRunCommandsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Resource create parameters. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - runCommand, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to delete the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - vmScaleSetName, - instanceId, - runCommandName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - nextLink: string, - options?: VirtualMachineScaleSetVMRunCommandsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, instanceId, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommandsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.runCommandName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - 201: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - 202: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - 204: { - bodyMapper: Mappers.VirtualMachineRunCommand, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.runCommand, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.runCommandName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineScaleSetVMRunCommandsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineScaleSetVMRunCommandsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineScaleSetVMRunCommandsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.VirtualMachineRunCommand, - headersMapper: Mappers.VirtualMachineScaleSetVMRunCommandsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.runCommand1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.runCommandName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.runCommandName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineRunCommandsListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts deleted file mode 100644 index 0dbaba2bfaf2..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts +++ /dev/null @@ -1,1893 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VirtualMachineScaleSetVMs } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachineScaleSetVM, - VirtualMachineScaleSetVMsListNextOptionalParams, - VirtualMachineScaleSetVMsListOptionalParams, - VirtualMachineScaleSetVMsListResponse, - VirtualMachineScaleSetVMsGetOptionalParams, - VirtualMachineScaleSetVMsGetResponse, - VirtualMachineScaleSetVMsUpdateOptionalParams, - VirtualMachineScaleSetVMsUpdateResponse, - VirtualMachineScaleSetVMsDeleteOptionalParams, - VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, - VirtualMachineScaleSetVMsApproveRollingUpgradeResponse, - AttachDetachDataDisksRequest, - VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, - VirtualMachineScaleSetVMsAttachDetachDataDisksResponse, - VirtualMachineScaleSetVMsDeallocateOptionalParams, - VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, - VirtualMachineScaleSetVMsGetInstanceViewResponse, - VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, - VirtualMachineScaleSetVMsPowerOffOptionalParams, - VirtualMachineScaleSetVMsRedeployOptionalParams, - VirtualMachineScaleSetVMsReimageOptionalParams, - VirtualMachineScaleSetVMsReimageAllOptionalParams, - VirtualMachineScaleSetVMsRestartOptionalParams, - VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, - VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataResponse, - RunCommandInput, - VirtualMachineScaleSetVMsRunCommandOptionalParams, - VirtualMachineScaleSetVMsRunCommandResponse, - VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, - VirtualMachineScaleSetVMsStartOptionalParams, - VirtualMachineScaleSetVMsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VirtualMachineScaleSetVMs operations. */ -export class VirtualMachineScaleSetVMsImpl implements VirtualMachineScaleSetVMs { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineScaleSetVMs class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineScaleSetName The name of the VirtualMachineScaleSet - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - virtualMachineScaleSetName: string, - options?: VirtualMachineScaleSetVMsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, virtualMachineScaleSetName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - virtualMachineScaleSetName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - virtualMachineScaleSetName: string, - options?: VirtualMachineScaleSetVMsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetVMsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, virtualMachineScaleSetName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - virtualMachineScaleSetName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - virtualMachineScaleSetName: string, - options?: VirtualMachineScaleSetVMsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - virtualMachineScaleSetName, - options, - )) { - yield* page; - } - } - - /** - * Gets a list of all virtual machines in a VM scale sets. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineScaleSetName The name of the VirtualMachineScaleSet - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - virtualMachineScaleSetName: string, - options?: VirtualMachineScaleSetVMsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, virtualMachineScaleSetName, options }, - listOperationSpec, - ); - } - - /** - * Gets a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, instanceId, options }, - getOperationSpec, - ); - } - - /** - * Updates a virtual machine of a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: VirtualMachineScaleSetVM, - options?: VirtualMachineScaleSetVMsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Updates a virtual machine of a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: VirtualMachineScaleSetVM, - options?: VirtualMachineScaleSetVMsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, vmScaleSetName, instanceId, options); - return poller.pollUntilDone(); - } - - /** - * Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginApproveRollingUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsApproveRollingUpgradeResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: approveRollingUpgradeOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMsApproveRollingUpgradeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginApproveRollingUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, - ): Promise { - const poller = await this.beginApproveRollingUpgrade( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Attach and detach data disks to/from a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on a Virtual - * Machine Scale Sets VM. - * @param options The options parameters. - */ - async beginAttachDetachDataDisks( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsAttachDetachDataDisksResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - options, - }, - spec: attachDetachDataDisksOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMsAttachDetachDataDisksResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Attach and detach data disks to/from a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on a Virtual - * Machine Scale Sets VM. - * @param options The options parameters. - */ - async beginAttachDetachDataDisksAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, - ): Promise { - const poller = await this.beginAttachDetachDataDisks( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - * releases the compute resources it uses. You are not billed for the compute resources of this virtual - * machine once it is deallocated. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginDeallocate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: deallocateOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - * releases the compute resources it uses. You are not billed for the compute resources of this virtual - * machine once it is deallocated. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginDeallocateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, - ): Promise { - const poller = await this.beginDeallocate( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the status of a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - getInstanceView( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, instanceId, options }, - getInstanceViewOperationSpec, - ); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginPerformMaintenance( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: performMaintenanceOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginPerformMaintenanceAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, - ): Promise { - const poller = await this.beginPerformMaintenance( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid - * charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginPowerOff( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: powerOffOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid - * charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginPowerOffAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, - ): Promise { - const poller = await this.beginPowerOff(resourceGroupName, vmScaleSetName, instanceId, options); - return poller.pollUntilDone(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers - * it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginRedeploy( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRedeployOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: redeployOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers - * it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginRedeployAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRedeployOptionalParams, - ): Promise { - const poller = await this.beginRedeploy(resourceGroupName, vmScaleSetName, instanceId, options); - return poller.pollUntilDone(); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginReimage( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: reimageOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginReimageAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageOptionalParams, - ): Promise { - const poller = await this.beginReimage(resourceGroupName, vmScaleSetName, instanceId, options); - return poller.pollUntilDone(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginReimageAll( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: reimageAllOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginReimageAllAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, - ): Promise { - const poller = await this.beginReimageAll( - resourceGroupName, - vmScaleSetName, - instanceId, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginRestart( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRestartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: restartOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Restarts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginRestartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRestartOptionalParams, - ): Promise { - const poller = await this.beginRestart(resourceGroupName, vmScaleSetName, instanceId, options); - return poller.pollUntilDone(); - } - - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - retrieveBootDiagnosticsData( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, instanceId, options }, - retrieveBootDiagnosticsDataOperationSpec, - ); - } - - /** - * Run command on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - async beginRunCommand( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: RunCommandInput, - options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsRunCommandResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - options, - }, - spec: runCommandOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetVMsRunCommandResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Run command on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - async beginRunCommandAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: RunCommandInput, - options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, - ): Promise { - const poller = await this.beginRunCommand( - resourceGroupName, - vmScaleSetName, - instanceId, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - simulateEviction( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, instanceId, options }, - simulateEvictionOperationSpec, - ); - } - - /** - * Starts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginStart( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsStartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, instanceId, options }, - spec: startOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Starts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - async beginStartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsStartOptionalParams, - ): Promise { - const poller = await this.beginStart(resourceGroupName, vmScaleSetName, instanceId, options); - return poller.pollUntilDone(); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineScaleSetName The name of the VirtualMachineScaleSet - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - virtualMachineScaleSetName: string, - nextLink: string, - options?: VirtualMachineScaleSetVMsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, virtualMachineScaleSetName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVMListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand, Parameters.filter, Parameters.select], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.virtualMachineScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVM, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVM, - }, - 201: { - bodyMapper: Mappers.VirtualMachineScaleSetVM, - }, - 202: { - bodyMapper: Mappers.VirtualMachineScaleSetVM, - }, - 204: { - bodyMapper: Mappers.VirtualMachineScaleSetVM, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters36, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch, - Parameters.ifNoneMatch, - ], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.forceDeletion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const approveRollingUpgradeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/approveRollingUpgrade", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineScaleSetVMsApproveRollingUpgradeHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const attachDetachDataDisksOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/attachDetachDataDisks", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.StorageProfile, - }, - 201: { - bodyMapper: Mappers.StorageProfile, - }, - 202: { - bodyMapper: Mappers.StorageProfile, - }, - 204: { - bodyMapper: Mappers.StorageProfile, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters19, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deallocateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getInstanceViewOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVMInstanceView, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const performMaintenanceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/performMaintenance", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const powerOffOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/powerOff", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.skipShutdown], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const redeployOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/redeploy", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const reimageOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmScaleSetVMReimageInput, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const reimageAllOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const restartOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/restart", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const retrieveBootDiagnosticsDataOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/retrieveBootDiagnosticsData", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RetrieveBootDiagnosticsDataResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.sasUriExpirationTimeInMinutes], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const runCommandOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommand", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RunCommandResult, - }, - 201: { - bodyMapper: Mappers.RunCommandResult, - }, - 202: { - bodyMapper: Mappers.RunCommandResult, - }, - 204: { - bodyMapper: Mappers.RunCommandResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters23, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const simulateEvictionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const startOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/start", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - Parameters.instanceId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetVMListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.virtualMachineScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts deleted file mode 100644 index f74e94160a5d..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts +++ /dev/null @@ -1,2755 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VirtualMachineScaleSets } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachineScaleSet, - VirtualMachineScaleSetsListByLocationNextOptionalParams, - VirtualMachineScaleSetsListByLocationOptionalParams, - VirtualMachineScaleSetsListByLocationResponse, - VirtualMachineScaleSetsListAllNextOptionalParams, - VirtualMachineScaleSetsListAllOptionalParams, - VirtualMachineScaleSetsListAllResponse, - VirtualMachineScaleSetsListNextOptionalParams, - VirtualMachineScaleSetsListOptionalParams, - VirtualMachineScaleSetsListResponse, - UpgradeOperationHistoricalStatusInfo, - VirtualMachineScaleSetsGetOSUpgradeHistoryNextOptionalParams, - VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - VirtualMachineScaleSetsGetOSUpgradeHistoryResponse, - VirtualMachineScaleSetSku, - VirtualMachineScaleSetsListSkusNextOptionalParams, - VirtualMachineScaleSetsListSkusOptionalParams, - VirtualMachineScaleSetsListSkusResponse, - VirtualMachineScaleSetsGetOptionalParams, - VirtualMachineScaleSetsGetResponse, - VirtualMachineScaleSetsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetsCreateOrUpdateResponse, - VirtualMachineScaleSetUpdate, - VirtualMachineScaleSetsUpdateOptionalParams, - VirtualMachineScaleSetsUpdateResponse, - VirtualMachineScaleSetsDeleteOptionalParams, - VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, - VirtualMachineScaleSetsApproveRollingUpgradeResponse, - VMScaleSetConvertToSinglePlacementGroupInput, - VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, - VirtualMachineScaleSetsDeallocateOptionalParams, - VirtualMachineScaleSetVMInstanceRequiredIDs, - VirtualMachineScaleSetsDeleteInstancesOptionalParams, - VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, - VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, - VirtualMachineScaleSetsGetInstanceViewOptionalParams, - VirtualMachineScaleSetsGetInstanceViewResponse, - VirtualMachineScaleSetsUpdateInstancesOptionalParams, - VirtualMachineScaleSetsPerformMaintenanceOptionalParams, - VirtualMachineScaleSetsPowerOffOptionalParams, - VirtualMachineScaleSetsReapplyOptionalParams, - VirtualMachineScaleSetsRedeployOptionalParams, - VirtualMachineScaleSetsReimageOptionalParams, - VirtualMachineScaleSetsReimageAllOptionalParams, - VirtualMachineScaleSetsRestartOptionalParams, - VMScaleSetScaleOutInput, - VirtualMachineScaleSetsScaleOutOptionalParams, - OrchestrationServiceStateInput, - VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, - VirtualMachineScaleSetsStartOptionalParams, - VirtualMachineScaleSetsListByLocationNextResponse, - VirtualMachineScaleSetsListAllNextResponse, - VirtualMachineScaleSetsListNextResponse, - VirtualMachineScaleSetsGetOSUpgradeHistoryNextResponse, - VirtualMachineScaleSetsListSkusNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VirtualMachineScaleSets operations. */ -export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineScaleSets class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets all the VM scale sets under the specified subscription for the specified location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - public listByLocation( - location: string, - options?: VirtualMachineScaleSetsListByLocationOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByLocationPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByLocationPagingPage(location, options, settings); - }, - }; - } - - private async *listByLocationPagingPage( - location: string, - options?: VirtualMachineScaleSetsListByLocationOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetsListByLocationResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByLocation(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByLocationNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByLocationPagingAll( - location: string, - options?: VirtualMachineScaleSetsListByLocationOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByLocationPagingPage(location, options)) { - yield* page; - } - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - * Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink - * is null to fetch all the VM Scale Sets. - * @param options The options parameters. - */ - public listAll( - options?: VirtualMachineScaleSetsListAllOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAllPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAllPagingPage(options, settings); - }, - }; - } - - private async *listAllPagingPage( - options?: VirtualMachineScaleSetsListAllOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetsListAllResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAll(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAllNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAllPagingAll( - options?: VirtualMachineScaleSetsListAllOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAllPagingPage(options)) { - yield* page; - } - } - - /** - * Gets a list of all VM scale sets under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - options?: VirtualMachineScaleSetsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - options?: VirtualMachineScaleSetsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - options?: VirtualMachineScaleSetsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - public listOSUpgradeHistory( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.getOSUpgradeHistoryPagingAll(resourceGroupName, vmScaleSetName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.getOSUpgradeHistoryPagingPage( - resourceGroupName, - vmScaleSetName, - options, - settings, - ); - }, - }; - } - - private async *getOSUpgradeHistoryPagingPage( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetsGetOSUpgradeHistoryResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._getOSUpgradeHistory(resourceGroupName, vmScaleSetName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._getOSUpgradeHistoryNext( - resourceGroupName, - vmScaleSetName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *getOSUpgradeHistoryPagingAll( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.getOSUpgradeHistoryPagingPage( - resourceGroupName, - vmScaleSetName, - options, - )) { - yield* page; - } - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances - * allowed for each SKU. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - public listSkus( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsListSkusOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listSkusPagingAll(resourceGroupName, vmScaleSetName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listSkusPagingPage(resourceGroupName, vmScaleSetName, options, settings); - }, - }; - } - - private async *listSkusPagingPage( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsListSkusOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineScaleSetsListSkusResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listSkus(resourceGroupName, vmScaleSetName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listSkusNext( - resourceGroupName, - vmScaleSetName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listSkusPagingAll( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsListSkusOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listSkusPagingPage(resourceGroupName, vmScaleSetName, options)) { - yield* page; - } - } - - /** - * Gets all the VM scale sets under the specified subscription for the specified location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - private _listByLocation( - location: string, - options?: VirtualMachineScaleSetsListByLocationOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listByLocationOperationSpec); - } - - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - * Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink - * is null to fetch all the VM Scale Sets. - * @param options The options parameters. - */ - private _listAll( - options?: VirtualMachineScaleSetsListAllOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listAllOperationSpec); - } - - /** - * Gets a list of all VM scale sets under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - options?: VirtualMachineScaleSetsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ resourceGroupName, options }, listOperationSpec); - } - - /** - * Display information about a virtual machine scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, options }, - getOperationSpec, - ); - } - - /** - * Create or update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSet, - options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, parameters, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Create or update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSet, - options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - vmScaleSetName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSetUpdate, - options?: VirtualMachineScaleSetsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetsUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, parameters, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSetUpdate, - options?: VirtualMachineScaleSetsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, vmScaleSetName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * Deletes a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginApproveRollingUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetsApproveRollingUpgradeResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: approveRollingUpgradeOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachineScaleSetsApproveRollingUpgradeResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginApproveRollingUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, - ): Promise { - const poller = await this.beginApproveRollingUpgrade( - resourceGroupName, - vmScaleSetName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @param options The options parameters. - */ - convertToSinglePlacementGroup( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VMScaleSetConvertToSinglePlacementGroupInput, - options?: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, parameters, options }, - convertToSinglePlacementGroupOperationSpec, - ); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - * releases the compute resources. You are not billed for the compute resources that this virtual - * machine scale set deallocates. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginDeallocate( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeallocateOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: deallocateOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - * releases the compute resources. You are not billed for the compute resources that this virtual - * machine scale set deallocates. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginDeallocateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeallocateOptionalParams, - ): Promise { - const poller = await this.beginDeallocate(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Deletes virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - async beginDeleteInstances( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, vmInstanceIDs, options }, - spec: deleteInstancesOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - async beginDeleteInstancesAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, - ): Promise { - const poller = await this.beginDeleteInstances( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine - * scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested - * @param options The options parameters. - */ - forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName: string, - vmScaleSetName: string, - platformUpdateDomain: number, - options?: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, platformUpdateDomain, options }, - forceRecoveryServiceFabricPlatformUpdateDomainWalkOperationSpec, - ); - } - - /** - * Gets the status of a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - getInstanceView( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetInstanceViewOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, options }, - getInstanceViewOperationSpec, - ); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - async beginUpdateInstances( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, vmInstanceIDs, options }, - spec: updateInstancesOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - async beginUpdateInstancesAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, - ): Promise { - const poller = await this.beginUpdateInstances( - resourceGroupName, - vmScaleSetName, - vmInstanceIDs, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets list of OS upgrades on a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - private _getOSUpgradeHistory( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, options }, - getOSUpgradeHistoryOperationSpec, - ); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which - * are not eligible for perform maintenance will be failed. Please refer to best practices for more - * details: - * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginPerformMaintenance( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: performMaintenanceOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which - * are not eligible for perform maintenance will be failed. Please refer to best practices for more - * details: - * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginPerformMaintenanceAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, - ): Promise { - const poller = await this.beginPerformMaintenance(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - * attached and you are getting charged for the resources. Instead, use deallocate to release resources - * and avoid charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginPowerOff( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPowerOffOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: powerOffOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - * attached and you are getting charged for the resources. Instead, use deallocate to release resources - * and avoid charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginPowerOffAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPowerOffOptionalParams, - ): Promise { - const poller = await this.beginPowerOff(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginReapply( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReapplyOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: reapplyOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginReapplyAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReapplyOptionalParams, - ): Promise { - const poller = await this.beginReapply(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and - * powers them back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginRedeploy( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRedeployOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: redeployOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and - * powers them back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginRedeployAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRedeployOptionalParams, - ): Promise { - const poller = await this.beginRedeploy(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't - * have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is - * reset to initial state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginReimage( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: reimageOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't - * have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is - * reset to initial state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginReimageAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageOptionalParams, - ): Promise { - const poller = await this.beginReimage(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginReimageAll( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageAllOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: reimageAllOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginReimageAllAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageAllOptionalParams, - ): Promise { - const poller = await this.beginReimageAll(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginRestart( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRestartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: restartOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginRestartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRestartOptionalParams, - ): Promise { - const poller = await this.beginRestart(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * Scales out one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for ScaleOut API. - * @param options The options parameters. - */ - async beginScaleOut( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VMScaleSetScaleOutInput, - options?: VirtualMachineScaleSetsScaleOutOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, parameters, options }, - spec: scaleOutOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Scales out one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for ScaleOut API. - * @param options The options parameters. - */ - async beginScaleOutAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VMScaleSetScaleOutInput, - options?: VirtualMachineScaleSetsScaleOutOptionalParams, - ): Promise { - const poller = await this.beginScaleOut(resourceGroupName, vmScaleSetName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * Changes ServiceState property for a given service - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param options The options parameters. - */ - async beginSetOrchestrationServiceState( - resourceGroupName: string, - vmScaleSetName: string, - parameters: OrchestrationServiceStateInput, - options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, parameters, options }, - spec: setOrchestrationServiceStateOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Changes ServiceState property for a given service - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param options The options parameters. - */ - async beginSetOrchestrationServiceStateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: OrchestrationServiceStateInput, - options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, - ): Promise { - const poller = await this.beginSetOrchestrationServiceState( - resourceGroupName, - vmScaleSetName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances - * allowed for each SKU. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - private _listSkus( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsListSkusOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, options }, - listSkusOperationSpec, - ); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginStart( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsStartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmScaleSetName, options }, - spec: startOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Starts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - async beginStartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsStartOptionalParams, - ): Promise { - const poller = await this.beginStart(resourceGroupName, vmScaleSetName, options); - return poller.pollUntilDone(); - } - - /** - * ListByLocationNext - * @param location The name of Azure region. - * @param nextLink The nextLink from the previous successful call to the ListByLocation method. - * @param options The options parameters. - */ - private _listByLocationNext( - location: string, - nextLink: string, - options?: VirtualMachineScaleSetsListByLocationNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, nextLink, options }, - listByLocationNextOperationSpec, - ); - } - - /** - * ListAllNext - * @param nextLink The nextLink from the previous successful call to the ListAll method. - * @param options The options parameters. - */ - private _listAllNext( - nextLink: string, - options?: VirtualMachineScaleSetsListAllNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listAllNextOperationSpec); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - nextLink: string, - options?: VirtualMachineScaleSetsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listNextOperationSpec, - ); - } - - /** - * GetOSUpgradeHistoryNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param nextLink The nextLink from the previous successful call to the GetOSUpgradeHistory method. - * @param options The options parameters. - */ - private _getOSUpgradeHistoryNext( - resourceGroupName: string, - vmScaleSetName: string, - nextLink: string, - options?: VirtualMachineScaleSetsGetOSUpgradeHistoryNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, nextLink, options }, - getOSUpgradeHistoryNextOperationSpec, - ); - } - - /** - * ListSkusNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param nextLink The nextLink from the previous successful call to the ListSkus method. - * @param options The options parameters. - */ - private _listSkusNext( - resourceGroupName: string, - vmScaleSetName: string, - nextLink: string, - options?: VirtualMachineScaleSetsListSkusNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmScaleSetName, nextLink, options }, - listSkusNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByLocationOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept], - serializer, -}; -const listAllOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListWithLinkResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand5], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSet, - }, - 201: { - bodyMapper: Mappers.VirtualMachineScaleSet, - }, - 202: { - bodyMapper: Mappers.VirtualMachineScaleSet, - }, - 204: { - bodyMapper: Mappers.VirtualMachineScaleSet, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters12, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch, - Parameters.ifNoneMatch, - ], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSet, - headersMapper: Mappers.VirtualMachineScaleSetsUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.VirtualMachineScaleSet, - headersMapper: Mappers.VirtualMachineScaleSetsUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.VirtualMachineScaleSet, - headersMapper: Mappers.VirtualMachineScaleSetsUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.VirtualMachineScaleSet, - headersMapper: Mappers.VirtualMachineScaleSetsUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters13, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch, - Parameters.ifNoneMatch, - ], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.forceDeletion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const approveRollingUpgradeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/approveRollingUpgrade", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachineScaleSetsApproveRollingUpgradeHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachineScaleSetsApproveRollingUpgradeHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachineScaleSetsApproveRollingUpgradeHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachineScaleSetsApproveRollingUpgradeHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const convertToSinglePlacementGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", - httpMethod: "POST", - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters14, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deallocateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion, Parameters.hibernate], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteInstancesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs1, - queryParameters: [Parameters.apiVersion, Parameters.forceDeletion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const forceRecoveryServiceFabricPlatformUpdateDomainWalkOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RecoveryWalkResponse, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.platformUpdateDomain, - Parameters.zone, - Parameters.placementGroupId, - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getInstanceViewOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetInstanceView, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateInstancesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getOSUpgradeHistoryOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListOSUpgradeHistory, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const performMaintenanceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const powerOffOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion, Parameters.skipShutdown], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const reapplyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const redeployOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const reimageOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmScaleSetReimageInput, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const reimageAllOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const restartOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const scaleOutOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/scaleOut", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters15, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const setOrchestrationServiceStateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters16, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listSkusOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListSkusResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const startOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.vmInstanceIDs, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listByLocationNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAllNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListWithLinkResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOSUpgradeHistoryNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListOSUpgradeHistory, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listSkusNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineScaleSetListSkusResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmScaleSetName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts b/sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts deleted file mode 100644 index 80674064bfcc..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VirtualMachineSizes } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { - VirtualMachineSize, - VirtualMachineSizesListNextOptionalParams, - VirtualMachineSizesListOptionalParams, - VirtualMachineSizesListResponse, - VirtualMachineSizesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VirtualMachineSizes operations. */ -export class VirtualMachineSizesImpl implements VirtualMachineSizes { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachineSizes class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * @param location The name of Azure region. - * @param options The options parameters. - */ - public list( - location: string, - options?: VirtualMachineSizesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(location, options, settings); - }, - }; - } - - private async *listPagingPage( - location: string, - options?: VirtualMachineSizesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachineSizesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - location: string, - options?: VirtualMachineSizesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(location, options)) { - yield* page; - } - } - - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * @param location The name of Azure region. - * @param options The options parameters. - */ - private _list( - location: string, - options?: VirtualMachineSizesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listOperationSpec); - } - - /** - * ListNext - * @param location The name of Azure region. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - location: string, - nextLink: string, - options?: VirtualMachineSizesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, nextLink, options }, listNextOperationSpec); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operations/virtualMachines.ts b/sdk/compute/arm-compute/src/operations/virtualMachines.ts deleted file mode 100644 index 06c069929d46..000000000000 --- a/sdk/compute/arm-compute/src/operations/virtualMachines.ts +++ /dev/null @@ -1,2784 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import type { VirtualMachines } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import type { ComputeManagementClient } from "../computeManagementClient.js"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import type { - VirtualMachine, - VirtualMachinesListByLocationNextOptionalParams, - VirtualMachinesListByLocationOptionalParams, - VirtualMachinesListByLocationResponse, - VirtualMachinesListAllNextOptionalParams, - VirtualMachinesListAllOptionalParams, - VirtualMachinesListAllResponse, - VirtualMachinesListNextOptionalParams, - VirtualMachinesListOptionalParams, - VirtualMachinesListResponse, - VirtualMachineSize, - VirtualMachinesListAvailableSizesNextOptionalParams, - VirtualMachinesListAvailableSizesOptionalParams, - VirtualMachinesListAvailableSizesResponse, - VirtualMachinesGetOptionalParams, - VirtualMachinesGetResponse, - VirtualMachinesCreateOrUpdateOptionalParams, - VirtualMachinesCreateOrUpdateResponse, - VirtualMachineUpdate, - VirtualMachinesUpdateOptionalParams, - VirtualMachinesUpdateResponse, - VirtualMachinesDeleteOptionalParams, - VirtualMachinesAssessPatchesOptionalParams, - VirtualMachinesAssessPatchesResponse, - AttachDetachDataDisksRequest, - VirtualMachinesAttachDetachDataDisksOptionalParams, - VirtualMachinesAttachDetachDataDisksResponse, - VirtualMachineCaptureParameters, - VirtualMachinesCaptureOptionalParams, - VirtualMachinesCaptureResponse, - VirtualMachinesConvertToManagedDisksOptionalParams, - VirtualMachinesDeallocateOptionalParams, - VirtualMachinesGeneralizeOptionalParams, - VirtualMachineInstallPatchesParameters, - VirtualMachinesInstallPatchesOptionalParams, - VirtualMachinesInstallPatchesResponse, - VirtualMachinesInstanceViewOptionalParams, - VirtualMachinesInstanceViewResponse, - VirtualMachinesMigrateToVMScaleSetOptionalParams, - VirtualMachinesMigrateToVMScaleSetResponse, - VirtualMachinesPerformMaintenanceOptionalParams, - VirtualMachinesPowerOffOptionalParams, - VirtualMachinesReapplyOptionalParams, - VirtualMachinesRedeployOptionalParams, - VirtualMachinesReimageOptionalParams, - VirtualMachinesRestartOptionalParams, - VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, - VirtualMachinesRetrieveBootDiagnosticsDataResponse, - RunCommandInput, - VirtualMachinesRunCommandOptionalParams, - VirtualMachinesRunCommandResponse, - VirtualMachinesSimulateEvictionOptionalParams, - VirtualMachinesStartOptionalParams, - VirtualMachinesListByLocationNextResponse, - VirtualMachinesListAllNextResponse, - VirtualMachinesListNextResponse, - VirtualMachinesListAvailableSizesNextResponse, -} from "../models/index.js"; - -/// -/** Class containing VirtualMachines operations. */ -export class VirtualMachinesImpl implements VirtualMachines { - private readonly client: ComputeManagementClient; - - /** - * Initialize a new instance of the class VirtualMachines class. - * @param client Reference to the service client - */ - constructor(client: ComputeManagementClient) { - this.client = client; - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - public listByLocation( - location: string, - options?: VirtualMachinesListByLocationOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByLocationPagingAll(location, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByLocationPagingPage(location, options, settings); - }, - }; - } - - private async *listByLocationPagingPage( - location: string, - options?: VirtualMachinesListByLocationOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachinesListByLocationResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByLocation(location, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByLocationNext(location, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByLocationPagingAll( - location: string, - options?: VirtualMachinesListByLocationOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByLocationPagingPage(location, options)) { - yield* page; - } - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the - * response to get the next page of virtual machines. - * @param options The options parameters. - */ - public listAll( - options?: VirtualMachinesListAllOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAllPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAllPagingPage(options, settings); - }, - }; - } - - private async *listAllPagingPage( - options?: VirtualMachinesListAllOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachinesListAllResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAll(options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAllNext(continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAllPagingAll( - options?: VirtualMachinesListAllOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAllPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the - * response to get the next page of virtual machines. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - options?: VirtualMachinesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - options?: VirtualMachinesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachinesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(resourceGroupName, continuationToken, options); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - options?: VirtualMachinesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceGroupName, options)) { - yield* page; - } - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - public listAvailableSizes( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesListAvailableSizesOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listAvailableSizesPagingAll(resourceGroupName, vmName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listAvailableSizesPagingPage(resourceGroupName, vmName, options, settings); - }, - }; - } - - private async *listAvailableSizesPagingPage( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesListAvailableSizesOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: VirtualMachinesListAvailableSizesResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listAvailableSizes(resourceGroupName, vmName, options); - const page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listAvailableSizesNext( - resourceGroupName, - vmName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - const page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listAvailableSizesPagingAll( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesListAvailableSizesOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listAvailableSizesPagingPage( - resourceGroupName, - vmName, - options, - )) { - yield* page; - } - } - - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - private _listByLocation( - location: string, - options?: VirtualMachinesListByLocationOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ location, options }, listByLocationOperationSpec); - } - - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the - * response to get the next page of virtual machines. - * @param options The options parameters. - */ - private _listAll( - options?: VirtualMachinesListAllOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listAllOperationSpec); - } - - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the - * response to get the next page of virtual machines. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - options?: VirtualMachinesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ resourceGroupName, options }, listOperationSpec); - } - - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - getOperationSpec, - ); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only - * during virtual machine creation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachine, - options?: VirtualMachinesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, parameters, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only - * during virtual machine creation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachine, - options?: VirtualMachinesCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate(resourceGroupName, vmName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * The operation to update a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineUpdate, - options?: VirtualMachinesUpdateOptionalParams, - ): Promise< - SimplePollerLike, VirtualMachinesUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, parameters, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to update a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineUpdate, - options?: VirtualMachinesUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate(resourceGroupName, vmName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * The operation to delete a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to delete a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * Assess patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginAssessPatches( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesAssessPatchesOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesAssessPatchesResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: assessPatchesOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesAssessPatchesResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Assess patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginAssessPatchesAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesAssessPatchesOptionalParams, - ): Promise { - const poller = await this.beginAssessPatches(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * Attach and detach data disks to/from the virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on the virtual - * machine. - * @param options The options parameters. - */ - async beginAttachDetachDataDisks( - resourceGroupName: string, - vmName: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachinesAttachDetachDataDisksOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesAttachDetachDataDisksResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, parameters, options }, - spec: attachDetachDataDisksOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesAttachDetachDataDisksResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Attach and detach data disks to/from the virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on the virtual - * machine. - * @param options The options parameters. - */ - async beginAttachDetachDataDisksAndWait( - resourceGroupName: string, - vmName: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachinesAttachDetachDataDisksOptionalParams, - ): Promise { - const poller = await this.beginAttachDetachDataDisks( - resourceGroupName, - vmName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to - * create similar VMs. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param options The options parameters. - */ - async beginCapture( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineCaptureParameters, - options?: VirtualMachinesCaptureOptionalParams, - ): Promise< - SimplePollerLike, VirtualMachinesCaptureResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, parameters, options }, - spec: captureOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesCaptureResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to - * create similar VMs. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param options The options parameters. - */ - async beginCaptureAndWait( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineCaptureParameters, - options?: VirtualMachinesCaptureOptionalParams, - ): Promise { - const poller = await this.beginCapture(resourceGroupName, vmName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be - * stop-deallocated before invoking this operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginConvertToManagedDisks( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesConvertToManagedDisksOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: convertToManagedDisksOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be - * stop-deallocated before invoking this operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginConvertToManagedDisksAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesConvertToManagedDisksOptionalParams, - ): Promise { - const poller = await this.beginConvertToManagedDisks(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the - * compute resources that this virtual machine uses. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginDeallocate( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeallocateOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: deallocateOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the - * compute resources that this virtual machine uses. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginDeallocateAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeallocateOptionalParams, - ): Promise { - const poller = await this.beginDeallocate(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual - * machine before performing this operation. For Windows, please refer to [Create a managed image of a - * generalized VM in - * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, - * please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - generalize( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesGeneralizeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - generalizeOperationSpec, - ); - } - - /** - * Installs patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API - * @param options The options parameters. - */ - async beginInstallPatches( - resourceGroupName: string, - vmName: string, - installPatchesInput: VirtualMachineInstallPatchesParameters, - options?: VirtualMachinesInstallPatchesOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesInstallPatchesResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, installPatchesInput, options }, - spec: installPatchesOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesInstallPatchesResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Installs patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API - * @param options The options parameters. - */ - async beginInstallPatchesAndWait( - resourceGroupName: string, - vmName: string, - installPatchesInput: VirtualMachineInstallPatchesParameters, - options?: VirtualMachinesInstallPatchesOptionalParams, - ): Promise { - const poller = await this.beginInstallPatches( - resourceGroupName, - vmName, - installPatchesInput, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Retrieves information about the run-time state of a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - instanceView( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesInstanceViewOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - instanceViewOperationSpec, - ); - } - - /** - * Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginMigrateToVMScaleSet( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesMigrateToVMScaleSetResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: migrateToVMScaleSetOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesMigrateToVMScaleSetResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginMigrateToVMScaleSetAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, - ): Promise { - const poller = await this.beginMigrateToVMScaleSet(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginPerformMaintenance( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPerformMaintenanceOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: performMaintenanceOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to perform maintenance on a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginPerformMaintenanceAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPerformMaintenanceOptionalParams, - ): Promise { - const poller = await this.beginPerformMaintenance(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the - * same provisioned resources. You are still charged for this virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginPowerOff( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPowerOffOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: powerOffOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the - * same provisioned resources. You are still charged for this virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginPowerOffAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPowerOffOptionalParams, - ): Promise { - const poller = await this.beginPowerOff(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * The operation to reapply a virtual machine's state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginReapply( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReapplyOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: reapplyOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to reapply a virtual machine's state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginReapplyAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReapplyOptionalParams, - ): Promise { - const poller = await this.beginReapply(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginRedeploy( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRedeployOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: redeployOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginRedeployAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRedeployOptionalParams, - ): Promise { - const poller = await this.beginRedeploy(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for - * virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: - * The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is - * detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk - * will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before - * performing the reimage. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginReimage( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReimageOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: reimageOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for - * virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: - * The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is - * detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk - * will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before - * performing the reimage. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginReimageAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReimageOptionalParams, - ): Promise { - const poller = await this.beginReimage(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * The operation to restart a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginRestart( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRestartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: restartOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to restart a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginRestartAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRestartOptionalParams, - ): Promise { - const poller = await this.beginRestart(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - retrieveBootDiagnosticsData( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - retrieveBootDiagnosticsDataOperationSpec, - ); - } - - /** - * Run command on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - async beginRunCommand( - resourceGroupName: string, - vmName: string, - parameters: RunCommandInput, - options?: VirtualMachinesRunCommandOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesRunCommandResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, parameters, options }, - spec: runCommandOperationSpec, - }); - const poller = await createHttpPoller< - VirtualMachinesRunCommandResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Run command on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - async beginRunCommandAndWait( - resourceGroupName: string, - vmName: string, - parameters: RunCommandInput, - options?: VirtualMachinesRunCommandOptionalParams, - ): Promise { - const poller = await this.beginRunCommand(resourceGroupName, vmName, parameters, options); - return poller.pollUntilDone(); - } - - /** - * The operation to simulate the eviction of spot virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - simulateEviction( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesSimulateEvictionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - simulateEvictionOperationSpec, - ); - } - - /** - * The operation to start a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginStart( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesStartOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, vmName, options }, - spec: startOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * The operation to start a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - async beginStartAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesStartOptionalParams, - ): Promise { - const poller = await this.beginStart(resourceGroupName, vmName, options); - return poller.pollUntilDone(); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - private _listAvailableSizes( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesListAvailableSizesOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, options }, - listAvailableSizesOperationSpec, - ); - } - - /** - * ListByLocationNext - * @param location The name of Azure region. - * @param nextLink The nextLink from the previous successful call to the ListByLocation method. - * @param options The options parameters. - */ - private _listByLocationNext( - location: string, - nextLink: string, - options?: VirtualMachinesListByLocationNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, nextLink, options }, - listByLocationNextOperationSpec, - ); - } - - /** - * ListAllNext - * @param nextLink The nextLink from the previous successful call to the ListAll method. - * @param options The options parameters. - */ - private _listAllNext( - nextLink: string, - options?: VirtualMachinesListAllNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listAllNextOperationSpec); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - nextLink: string, - options?: VirtualMachinesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listNextOperationSpec, - ); - } - - /** - * ListAvailableSizesNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param nextLink The nextLink from the previous successful call to the ListAvailableSizes method. - * @param options The options parameters. - */ - private _listAvailableSizesNext( - resourceGroupName: string, - vmName: string, - nextLink: string, - options?: VirtualMachinesListAvailableSizesNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, vmName, nextLink, options }, - listAvailableSizesNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByLocationOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location], - headerParameters: [Parameters.accept], - serializer, -}; -const listAllOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.statusOnly, - Parameters.expand6, - ], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.expand7], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachine, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.expand3], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachine, - }, - 201: { - bodyMapper: Mappers.VirtualMachine, - }, - 202: { - bodyMapper: Mappers.VirtualMachine, - }, - 204: { - bodyMapper: Mappers.VirtualMachine, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters17, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch, - Parameters.ifNoneMatch, - ], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachine, - headersMapper: Mappers.VirtualMachinesUpdateHeaders, - }, - 201: { - bodyMapper: Mappers.VirtualMachine, - headersMapper: Mappers.VirtualMachinesUpdateHeaders, - }, - 202: { - bodyMapper: Mappers.VirtualMachine, - headersMapper: Mappers.VirtualMachinesUpdateHeaders, - }, - 204: { - bodyMapper: Mappers.VirtualMachine, - headersMapper: Mappers.VirtualMachinesUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters18, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch, - Parameters.ifNoneMatch, - ], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.forceDeletion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const assessPatchesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineAssessPatchesResult, - }, - 201: { - bodyMapper: Mappers.VirtualMachineAssessPatchesResult, - }, - 202: { - bodyMapper: Mappers.VirtualMachineAssessPatchesResult, - }, - 204: { - bodyMapper: Mappers.VirtualMachineAssessPatchesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const attachDetachDataDisksOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/attachDetachDataDisks", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.StorageProfile, - }, - 201: { - bodyMapper: Mappers.StorageProfile, - }, - 202: { - bodyMapper: Mappers.StorageProfile, - }, - 204: { - bodyMapper: Mappers.StorageProfile, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters19, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const captureOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineCaptureResult, - }, - 201: { - bodyMapper: Mappers.VirtualMachineCaptureResult, - }, - 202: { - bodyMapper: Mappers.VirtualMachineCaptureResult, - }, - 204: { - bodyMapper: Mappers.VirtualMachineCaptureResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters20, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const convertToManagedDisksOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deallocateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.hibernate], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const generalizeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize", - httpMethod: "POST", - responses: { - 200: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const installPatchesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineInstallPatchesResult, - }, - 201: { - bodyMapper: Mappers.VirtualMachineInstallPatchesResult, - }, - 202: { - bodyMapper: Mappers.VirtualMachineInstallPatchesResult, - }, - 204: { - bodyMapper: Mappers.VirtualMachineInstallPatchesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.installPatchesInput, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const instanceViewOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineInstanceView, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const migrateToVMScaleSetOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/migrateToVirtualMachineScaleSet", - httpMethod: "POST", - responses: { - 200: { - headersMapper: Mappers.VirtualMachinesMigrateToVMScaleSetHeaders, - }, - 201: { - headersMapper: Mappers.VirtualMachinesMigrateToVMScaleSetHeaders, - }, - 202: { - headersMapper: Mappers.VirtualMachinesMigrateToVMScaleSetHeaders, - }, - 204: { - headersMapper: Mappers.VirtualMachinesMigrateToVMScaleSetHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters21, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const performMaintenanceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const powerOffOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.skipShutdown], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const reapplyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const redeployOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const reimageOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters22, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const restartOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const retrieveBootDiagnosticsDataOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RetrieveBootDiagnosticsDataResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.sasUriExpirationTimeInMinutes], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const runCommandOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RunCommandResult, - }, - 201: { - bodyMapper: Mappers.RunCommandResult, - }, - 202: { - bodyMapper: Mappers.RunCommandResult, - }, - 204: { - bodyMapper: Mappers.RunCommandResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters23, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const simulateEvictionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const startOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAvailableSizesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByLocationNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAllNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listAvailableSizesNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.VirtualMachineSizeListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.vmName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/availabilitySets.ts b/sdk/compute/arm-compute/src/operationsInterfaces/availabilitySets.ts deleted file mode 100644 index 3b232fcf6d43..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/availabilitySets.ts +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - AvailabilitySet, - AvailabilitySetsListBySubscriptionOptionalParams, - AvailabilitySetsListOptionalParams, - VirtualMachineSize, - AvailabilitySetsListAvailableSizesOptionalParams, - AvailabilitySetsGetOptionalParams, - AvailabilitySetsGetResponse, - AvailabilitySetsCreateOrUpdateOptionalParams, - AvailabilitySetsCreateOrUpdateResponse, - AvailabilitySetUpdate, - AvailabilitySetsUpdateOptionalParams, - AvailabilitySetsUpdateResponse, - AvailabilitySetsDeleteOptionalParams, - AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, - AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, - AvailabilitySetsConvertToVirtualMachineScaleSetResponse, - MigrateToVirtualMachineScaleSetInput, - AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, - AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a AvailabilitySets. */ -export interface AvailabilitySets { - /** - * Lists all availability sets in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: AvailabilitySetsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all availability sets in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - options?: AvailabilitySetsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all available virtual machine sizes that can be used to create a new virtual machine in an - * existing availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - listAvailableSizes( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsListAvailableSizesOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsGetOptionalParams, - ): Promise; - /** - * Create or update an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Create Availability Set operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - availabilitySetName: string, - parameters: AvailabilitySet, - options?: AvailabilitySetsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the Update Availability Set operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - availabilitySetName: string, - parameters: AvailabilitySetUpdate, - options?: AvailabilitySetsUpdateOptionalParams, - ): Promise; - /** - * Delete an availability set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsDeleteOptionalParams, - ): Promise; - /** - * Cancel the migration operation on an Availability Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - cancelMigrationToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsCancelMigrationToVirtualMachineScaleSetOptionalParams, - ): Promise; - /** - * Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the - * Availability Set. This does not trigger a downtime on the Virtual Machines. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - beginConvertToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AvailabilitySetsConvertToVirtualMachineScaleSetResponse - > - >; - /** - * Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the - * Availability Set. This does not trigger a downtime on the Virtual Machines. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param options The options parameters. - */ - beginConvertToVirtualMachineScaleSetAndWait( - resourceGroupName: string, - availabilitySetName: string, - options?: AvailabilitySetsConvertToVirtualMachineScaleSetOptionalParams, - ): Promise; - /** - * Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine - * Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a - * downtime on the Virtual Machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the migrate operation on the availability set. - * @param options The options parameters. - */ - startMigrationToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - parameters: MigrateToVirtualMachineScaleSetInput, - options?: AvailabilitySetsStartMigrationToVirtualMachineScaleSetOptionalParams, - ): Promise; - /** - * Validates that the Virtual Machines in the Availability Set can be migrated to the provided Virtual - * Machine Scale Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param availabilitySetName The name of the availability set. - * @param parameters Parameters supplied to the migrate operation on the availability set. - * @param options The options parameters. - */ - validateMigrationToVirtualMachineScaleSet( - resourceGroupName: string, - availabilitySetName: string, - parameters: MigrateToVirtualMachineScaleSetInput, - options?: AvailabilitySetsValidateMigrationToVirtualMachineScaleSetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/capacityReservationGroups.ts b/sdk/compute/arm-compute/src/operationsInterfaces/capacityReservationGroups.ts deleted file mode 100644 index 0d123ffd499d..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/capacityReservationGroups.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - CapacityReservationGroup, - CapacityReservationGroupsListBySubscriptionOptionalParams, - CapacityReservationGroupsListByResourceGroupOptionalParams, - CapacityReservationGroupsGetOptionalParams, - CapacityReservationGroupsGetResponse, - CapacityReservationGroupsCreateOrUpdateOptionalParams, - CapacityReservationGroupsCreateOrUpdateResponse, - CapacityReservationGroupUpdate, - CapacityReservationGroupsUpdateOptionalParams, - CapacityReservationGroupsUpdateResponse, - CapacityReservationGroupsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a CapacityReservationGroups. */ -export interface CapacityReservationGroups { - /** - * Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the - * response to get the next page of capacity reservation groups. - * @param options The options parameters. - */ - listBySubscription( - options?: CapacityReservationGroupsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all of the capacity reservation groups in the specified resource group. Use the nextLink - * property in the response to get the next page of capacity reservation groups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: CapacityReservationGroupsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * The operation that retrieves information about a capacity reservation group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationGroupsGetOptionalParams, - ): Promise; - /** - * The operation to create or update a capacity reservation group. When updating a capacity reservation - * group, only tags and sharing profile may be modified. Please refer to - * https://aka.ms/CapacityReservation for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param parameters Parameters supplied to the Create capacity reservation Group. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - capacityReservationGroupName: string, - parameters: CapacityReservationGroup, - options?: CapacityReservationGroupsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update a capacity reservation group. When updating a capacity reservation group, - * only tags and sharing profile may be modified. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param parameters Parameters supplied to the Update capacity reservation Group operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - capacityReservationGroupName: string, - parameters: CapacityReservationGroupUpdate, - options?: CapacityReservationGroupsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete a capacity reservation group. This operation is allowed only if all the - * associated resources are disassociated from the reservation group and all capacity reservations - * under the reservation group have also been deleted. Please refer to - * https://aka.ms/CapacityReservation for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationGroupsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/capacityReservations.ts b/sdk/compute/arm-compute/src/operationsInterfaces/capacityReservations.ts deleted file mode 100644 index 4fcb2a00f2a6..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/capacityReservations.ts +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - CapacityReservation, - CapacityReservationsListByCapacityReservationGroupOptionalParams, - CapacityReservationsGetOptionalParams, - CapacityReservationsGetResponse, - CapacityReservationsCreateOrUpdateOptionalParams, - CapacityReservationsCreateOrUpdateResponse, - CapacityReservationUpdate, - CapacityReservationsUpdateOptionalParams, - CapacityReservationsUpdateResponse, - CapacityReservationsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a CapacityReservations. */ -export interface CapacityReservations { - /** - * Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink - * property in the response to get the next page of capacity reservations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param options The options parameters. - */ - listByCapacityReservationGroup( - resourceGroupName: string, - capacityReservationGroupName: string, - options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * The operation that retrieves information about the capacity reservation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - options?: CapacityReservationsGetOptionalParams, - ): Promise; - /** - * The operation to create or update a capacity reservation. Please note some properties can be set - * only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for - * more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Create capacity reservation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservation, - options?: CapacityReservationsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CapacityReservationsCreateOrUpdateResponse - > - >; - /** - * The operation to create or update a capacity reservation. Please note some properties can be set - * only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for - * more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Create capacity reservation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservation, - options?: CapacityReservationsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update a capacity reservation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Update capacity reservation operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservationUpdate, - options?: CapacityReservationsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CapacityReservationsUpdateResponse - > - >; - /** - * The operation to update a capacity reservation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param parameters Parameters supplied to the Update capacity reservation operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - parameters: CapacityReservationUpdate, - options?: CapacityReservationsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete a capacity reservation. This operation is allowed only when all the - * associated resources are disassociated from the capacity reservation. Please refer to - * https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be - * deleted after it has been successfully allocated until the schedule end time. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - options?: CapacityReservationsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete a capacity reservation. This operation is allowed only when all the - * associated resources are disassociated from the capacity reservation. Please refer to - * https://aka.ms/CapacityReservation for more details. Note: Block capacity reservations cannot be - * deleted after it has been successfully allocated until the schedule end time. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param capacityReservationGroupName The name of the capacity reservation group. - * @param capacityReservationName The name of the capacity reservation. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - capacityReservationGroupName: string, - capacityReservationName: string, - options?: CapacityReservationsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceOperatingSystems.ts b/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceOperatingSystems.ts deleted file mode 100644 index 14d3b7b78402..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceOperatingSystems.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - OSVersion, - CloudServiceOperatingSystemsListOSVersionsOptionalParams, - OSFamily, - CloudServiceOperatingSystemsListOSFamiliesOptionalParams, - CloudServiceOperatingSystemsGetOSVersionOptionalParams, - CloudServiceOperatingSystemsGetOSVersionResponse, - CloudServiceOperatingSystemsGetOSFamilyOptionalParams, - CloudServiceOperatingSystemsGetOSFamilyResponse, -} from "../models/index.js"; - -/// -/** Interface representing a CloudServiceOperatingSystems. */ -export interface CloudServiceOperatingSystems { - /** - * Gets a list of all guest operating system versions available to be specified in the XML service - * configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next - * page of OS versions. Do this till nextLink is null to fetch all the OS versions. - * @param location Name of the location that the OS versions pertain to. - * @param options The options parameters. - */ - listOSVersions( - location: string, - options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a list of all guest operating system families available to be specified in the XML service - * configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next - * page of OS Families. Do this till nextLink is null to fetch all the OS Families. - * @param location Name of the location that the OS families pertain to. - * @param options The options parameters. - */ - listOSFamilies( - location: string, - options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets properties of a guest operating system version that can be specified in the XML service - * configuration (.cscfg) for a cloud service. - * @param location Name of the location that the OS version pertains to. - * @param osVersionName Name of the OS version. - * @param options The options parameters. - */ - getOSVersion( - location: string, - osVersionName: string, - options?: CloudServiceOperatingSystemsGetOSVersionOptionalParams, - ): Promise; - /** - * Gets properties of a guest operating system family that can be specified in the XML service - * configuration (.cscfg) for a cloud service. - * @param location Name of the location that the OS family pertains to. - * @param osFamilyName Name of the OS family. - * @param options The options parameters. - */ - getOSFamily( - location: string, - osFamilyName: string, - options?: CloudServiceOperatingSystemsGetOSFamilyOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoleInstances.ts b/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoleInstances.ts deleted file mode 100644 index e69cf47c16e7..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoleInstances.ts +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - RoleInstance, - CloudServiceRoleInstancesListOptionalParams, - CloudServiceRoleInstancesDeleteOptionalParams, - CloudServiceRoleInstancesGetOptionalParams, - CloudServiceRoleInstancesGetResponse, - CloudServiceRoleInstancesGetInstanceViewOptionalParams, - CloudServiceRoleInstancesGetInstanceViewResponse, - CloudServiceRoleInstancesRestartOptionalParams, - CloudServiceRoleInstancesReimageOptionalParams, - CloudServiceRoleInstancesRebuildOptionalParams, - CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams, - CloudServiceRoleInstancesGetRemoteDesktopFileResponse, -} from "../models/index.js"; - -/// -/** Interface representing a CloudServiceRoleInstances. */ -export interface CloudServiceRoleInstances { - /** - * Gets the list of all role instances in a cloud service. Use nextLink property in the response to get - * the next page of role instances. Do this till nextLink is null to fetch all the role instances. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Deletes a role instance from a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginDelete( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a role instance from a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginDeleteAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesDeleteOptionalParams, - ): Promise; - /** - * Gets a role instance from a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - get( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesGetOptionalParams, - ): Promise; - /** - * Retrieves information about the run-time state of a role instance in a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - getInstanceView( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesGetInstanceViewOptionalParams, - ): Promise; - /** - * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud - * service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRestart( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRestartOptionalParams, - ): Promise, void>>; - /** - * The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud - * service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRestartAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRestartOptionalParams, - ): Promise; - /** - * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginReimage( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesReimageOptionalParams, - ): Promise, void>>; - /** - * The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginReimageAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesReimageOptionalParams, - ): Promise; - /** - * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles and initializes the storage resources that are used by them. If you do not - * want to initialize storage resources, you can use Reimage Role Instance. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRebuild( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRebuildOptionalParams, - ): Promise, void>>; - /** - * The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web - * roles or worker roles and initializes the storage resources that are used by them. If you do not - * want to initialize storage resources, you can use Reimage Role Instance. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRebuildAndWait( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesRebuildOptionalParams, - ): Promise; - /** - * Gets a remote desktop file for a role instance in a cloud service. - * @param roleInstanceName Name of the role instance. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - getRemoteDesktopFile( - roleInstanceName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRoleInstancesGetRemoteDesktopFileOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoles.ts b/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoles.ts deleted file mode 100644 index 1d5ab6d8b6cf..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServiceRoles.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - CloudServiceRole, - CloudServiceRolesListOptionalParams, - CloudServiceRolesGetOptionalParams, - CloudServiceRolesGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a CloudServiceRoles. */ -export interface CloudServiceRoles { - /** - * Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next - * page of roles. Do this till nextLink is null to fetch all the roles. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRolesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a role from a cloud service. - * @param roleName Name of the role. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - get( - roleName: string, - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServiceRolesGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServices.ts b/sdk/compute/arm-compute/src/operationsInterfaces/cloudServices.ts deleted file mode 100644 index aeb9db2a46b3..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServices.ts +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - CloudService, - CloudServicesListAllOptionalParams, - CloudServicesListOptionalParams, - CloudServicesCreateOrUpdateOptionalParams, - CloudServicesCreateOrUpdateResponse, - CloudServicesUpdateOptionalParams, - CloudServicesUpdateResponse, - CloudServicesDeleteOptionalParams, - CloudServicesGetOptionalParams, - CloudServicesGetResponse, - CloudServicesGetInstanceViewOptionalParams, - CloudServicesGetInstanceViewResponse, - CloudServicesStartOptionalParams, - CloudServicesPowerOffOptionalParams, - CloudServicesRestartOptionalParams, - CloudServicesReimageOptionalParams, - CloudServicesRebuildOptionalParams, - CloudServicesDeleteInstancesOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a CloudServices. */ -export interface CloudServices { - /** - * Gets a list of all cloud services in the subscription, regardless of the associated resource group. - * Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink - * is null to fetch all the Cloud Services. - * @param options The options parameters. - */ - listAll(options?: CloudServicesListAllOptionalParams): PagedAsyncIterableIterator; - /** - * Gets a list of all cloud services under a resource group. Use nextLink property in the response to - * get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. - * @param resourceGroupName Name of the resource group. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - options?: CloudServicesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create or update a cloud service. Please note some properties can be set only during cloud service - * creation. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - CloudServicesCreateOrUpdateResponse - > - >; - /** - * Create or update a cloud service. Please note some properties can be set only during cloud service - * creation. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateOptionalParams, - ): Promise< - SimplePollerLike, CloudServicesUpdateResponse> - >; - /** - * Update a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateOptionalParams, - ): Promise; - /** - * Deletes a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteOptionalParams, - ): Promise; - /** - * Display information about a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesGetOptionalParams, - ): Promise; - /** - * Gets the status of a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - getInstanceView( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesGetInstanceViewOptionalParams, - ): Promise; - /** - * Starts the cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginStart( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesStartOptionalParams, - ): Promise, void>>; - /** - * Starts the cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginStartAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesStartOptionalParams, - ): Promise; - /** - * Power off the cloud service. Note that resources are still attached and you are getting charged for - * the resources. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginPowerOff( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesPowerOffOptionalParams, - ): Promise, void>>; - /** - * Power off the cloud service. Note that resources are still attached and you are getting charged for - * the resources. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginPowerOffAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesPowerOffOptionalParams, - ): Promise; - /** - * Restarts one or more role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRestart( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRestartOptionalParams, - ): Promise, void>>; - /** - * Restarts one or more role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRestartAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRestartOptionalParams, - ): Promise; - /** - * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker - * roles. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginReimage( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesReimageOptionalParams, - ): Promise, void>>; - /** - * Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker - * roles. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginReimageAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesReimageOptionalParams, - ): Promise; - /** - * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and - * initializes the storage resources that are used by them. If you do not want to initialize storage - * resources, you can use Reimage Role Instances. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRebuild( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRebuildOptionalParams, - ): Promise, void>>; - /** - * Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and - * initializes the storage resources that are used by them. If you do not want to initialize storage - * resources, you can use Reimage Role Instances. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginRebuildAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesRebuildOptionalParams, - ): Promise; - /** - * Deletes role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginDeleteInstances( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteInstancesOptionalParams, - ): Promise, void>>; - /** - * Deletes role instances in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - beginDeleteInstancesAndWait( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesDeleteInstancesOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServicesUpdateDomain.ts b/sdk/compute/arm-compute/src/operationsInterfaces/cloudServicesUpdateDomain.ts deleted file mode 100644 index 9da2853e6cec..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/cloudServicesUpdateDomain.ts +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - UpdateDomain, - CloudServicesUpdateDomainListUpdateDomainsOptionalParams, - CloudServicesUpdateDomainWalkUpdateDomainOptionalParams, - CloudServicesUpdateDomainGetUpdateDomainOptionalParams, - CloudServicesUpdateDomainGetUpdateDomainResponse, -} from "../models/index.js"; - -/// -/** Interface representing a CloudServicesUpdateDomain. */ -export interface CloudServicesUpdateDomain { - /** - * Gets a list of all update domains in a cloud service. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param options The options parameters. - */ - listUpdateDomains( - resourceGroupName: string, - cloudServiceName: string, - options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Updates the role instances in the specified update domain. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are - * identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of - * 1, and so on. - * @param options The options parameters. - */ - beginWalkUpdateDomain( - resourceGroupName: string, - cloudServiceName: string, - updateDomain: number, - options?: CloudServicesUpdateDomainWalkUpdateDomainOptionalParams, - ): Promise, void>>; - /** - * Updates the role instances in the specified update domain. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are - * identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of - * 1, and so on. - * @param options The options parameters. - */ - beginWalkUpdateDomainAndWait( - resourceGroupName: string, - cloudServiceName: string, - updateDomain: number, - options?: CloudServicesUpdateDomainWalkUpdateDomainOptionalParams, - ): Promise; - /** - * Gets the specified update domain of a cloud service. Use nextLink property in the response to get - * the next page of update domains. Do this till nextLink is null to fetch all the update domains. - * @param resourceGroupName Name of the resource group. - * @param cloudServiceName Name of the cloud service. - * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are - * identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of - * 1, and so on. - * @param options The options parameters. - */ - getUpdateDomain( - resourceGroupName: string, - cloudServiceName: string, - updateDomain: number, - options?: CloudServicesUpdateDomainGetUpdateDomainOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleries.ts b/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleries.ts deleted file mode 100644 index 8b3c9445b0cd..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleries.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { - CommunityGalleriesGetOptionalParams, - CommunityGalleriesGetResponse, -} from "../models/index.js"; - -/** Interface representing a CommunityGalleries. */ -export interface CommunityGalleries { - /** - * Get a community gallery by gallery public name. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param options The options parameters. - */ - get( - location: string, - publicGalleryName: string, - options?: CommunityGalleriesGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts deleted file mode 100644 index 6514842bd0a0..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - CommunityGalleryImageVersion, - CommunityGalleryImageVersionsListOptionalParams, - CommunityGalleryImageVersionsGetOptionalParams, - CommunityGalleryImageVersionsGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a CommunityGalleryImageVersions. */ -export interface CommunityGalleryImageVersions { - /** - * List community gallery image versions inside an image. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param options The options parameters. - */ - list( - location: string, - publicGalleryName: string, - galleryImageName: string, - options?: CommunityGalleryImageVersionsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a community gallery image version. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param galleryImageVersionName The name of the community gallery image version. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within - * the range of a 32-bit integer. Format: .. - * @param options The options parameters. - */ - get( - location: string, - publicGalleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: CommunityGalleryImageVersionsGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts b/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts deleted file mode 100644 index 7ac62219a79e..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - CommunityGalleryImage, - CommunityGalleryImagesListOptionalParams, - CommunityGalleryImagesGetOptionalParams, - CommunityGalleryImagesGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a CommunityGalleryImages. */ -export interface CommunityGalleryImages { - /** - * List community gallery images inside a gallery. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param options The options parameters. - */ - list( - location: string, - publicGalleryName: string, - options?: CommunityGalleryImagesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a community gallery image. - * @param location The name of Azure region. - * @param publicGalleryName The public name of the community gallery. - * @param galleryImageName The name of the community gallery image definition. - * @param options The options parameters. - */ - get( - location: string, - publicGalleryName: string, - galleryImageName: string, - options?: CommunityGalleryImagesGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHostGroups.ts b/sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHostGroups.ts deleted file mode 100644 index ce25206e4d84..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHostGroups.ts +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - DedicatedHostGroup, - DedicatedHostGroupsListBySubscriptionOptionalParams, - DedicatedHostGroupsListByResourceGroupOptionalParams, - DedicatedHostGroupsGetOptionalParams, - DedicatedHostGroupsGetResponse, - DedicatedHostGroupsCreateOrUpdateOptionalParams, - DedicatedHostGroupsCreateOrUpdateResponse, - DedicatedHostGroupUpdate, - DedicatedHostGroupsUpdateOptionalParams, - DedicatedHostGroupsUpdateResponse, - DedicatedHostGroupsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a DedicatedHostGroups. */ -export interface DedicatedHostGroups { - /** - * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the - * response to get the next page of dedicated host groups. - * @param options The options parameters. - */ - listBySubscription( - options?: DedicatedHostGroupsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in - * the response to get the next page of dedicated host groups. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: DedicatedHostGroupsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a dedicated host group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostGroupsGetOptionalParams, - ): Promise; - /** - * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups - * please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Create Dedicated Host Group. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - hostGroupName: string, - parameters: DedicatedHostGroup, - options?: DedicatedHostGroupsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update an dedicated host group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param parameters Parameters supplied to the Update Dedicated Host Group operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - hostGroupName: string, - parameters: DedicatedHostGroupUpdate, - options?: DedicatedHostGroupsUpdateOptionalParams, - ): Promise; - /** - * Delete a dedicated host group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostGroupsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHosts.ts b/sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHosts.ts deleted file mode 100644 index 1c2834b5ac2d..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/dedicatedHosts.ts +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - DedicatedHost, - DedicatedHostsListByHostGroupOptionalParams, - DedicatedHostsListAvailableSizesOptionalParams, - DedicatedHostsGetOptionalParams, - DedicatedHostsGetResponse, - DedicatedHostsCreateOrUpdateOptionalParams, - DedicatedHostsCreateOrUpdateResponse, - DedicatedHostUpdate, - DedicatedHostsUpdateOptionalParams, - DedicatedHostsUpdateResponse, - DedicatedHostsDeleteOptionalParams, - DedicatedHostsRedeployOptionalParams, - DedicatedHostsRedeployResponse, - DedicatedHostsRestartOptionalParams, - DedicatedHostsRestartResponse, -} from "../models/index.js"; - -/// -/** Interface representing a DedicatedHosts. */ -export interface DedicatedHosts { - /** - * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in - * the response to get the next page of dedicated hosts. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param options The options parameters. - */ - listByHostGroup( - resourceGroupName: string, - hostGroupName: string, - options?: DedicatedHostsListByHostGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: - * The dedicated host sizes provided can be used to only scale up the existing dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - listAvailableSizes( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsListAvailableSizesOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsGetOptionalParams, - ): Promise; - /** - * Create or update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHost, - options?: DedicatedHostsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DedicatedHostsCreateOrUpdateResponse - > - >; - /** - * Create or update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Create Dedicated Host. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHost, - options?: DedicatedHostsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHostUpdate, - options?: DedicatedHostsUpdateOptionalParams, - ): Promise< - SimplePollerLike, DedicatedHostsUpdateResponse> - >; - /** - * Update a dedicated host . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param parameters Parameters supplied to the Update Dedicated Host operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - parameters: DedicatedHostUpdate, - options?: DedicatedHostsUpdateOptionalParams, - ): Promise; - /** - * Delete a dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a dedicated host. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsDeleteOptionalParams, - ): Promise; - /** - * Redeploy the dedicated host. The operation will complete successfully once the dedicated host has - * migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host - * after the redeploy check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - beginRedeploy( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRedeployOptionalParams, - ): Promise< - SimplePollerLike, DedicatedHostsRedeployResponse> - >; - /** - * Redeploy the dedicated host. The operation will complete successfully once the dedicated host has - * migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host - * after the redeploy check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - beginRedeployAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRedeployOptionalParams, - ): Promise; - /** - * Restart the dedicated host. The operation will complete successfully once the dedicated host has - * restarted and is running. To determine the health of VMs deployed on the dedicated host after the - * restart check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - beginRestart( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRestartOptionalParams, - ): Promise< - SimplePollerLike, DedicatedHostsRestartResponse> - >; - /** - * Restart the dedicated host. The operation will complete successfully once the dedicated host has - * restarted and is running. To determine the health of VMs deployed on the dedicated host after the - * restart check the Resource Health Center in the Azure Portal. Please refer to - * https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param hostGroupName The name of the dedicated host group. - * @param hostName The name of the dedicated host. - * @param options The options parameters. - */ - beginRestartAndWait( - resourceGroupName: string, - hostGroupName: string, - hostName: string, - options?: DedicatedHostsRestartOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/diskAccesses.ts b/sdk/compute/arm-compute/src/operationsInterfaces/diskAccesses.ts deleted file mode 100644 index c9130d0f49b7..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/diskAccesses.ts +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - DiskAccess, - DiskAccessesListOptionalParams, - DiskAccessesListByResourceGroupOptionalParams, - PrivateEndpointConnection, - DiskAccessesListPrivateEndpointConnectionsOptionalParams, - DiskAccessesGetOptionalParams, - DiskAccessesGetResponse, - DiskAccessesCreateOrUpdateOptionalParams, - DiskAccessesCreateOrUpdateResponse, - DiskAccessUpdate, - DiskAccessesUpdateOptionalParams, - DiskAccessesUpdateResponse, - DiskAccessesDeleteOptionalParams, - DiskAccessesGetAPrivateEndpointConnectionOptionalParams, - DiskAccessesGetAPrivateEndpointConnectionResponse, - DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, - DiskAccessesUpdateAPrivateEndpointConnectionResponse, - DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, - DiskAccessesGetPrivateLinkResourcesOptionalParams, - DiskAccessesGetPrivateLinkResourcesResponse, -} from "../models/index.js"; - -/// -/** Interface representing a DiskAccesses. */ -export interface DiskAccesses { - /** - * Lists all the disk access resources under a subscription. - * @param options The options parameters. - */ - list(options?: DiskAccessesListOptionalParams): PagedAsyncIterableIterator; - /** - * Lists all the disk access resources under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: DiskAccessesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * List information about private endpoint connections under a disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - listPrivateEndpointConnections( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesGetOptionalParams, - ): Promise; - /** - * Creates or updates a disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Put disk access operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccess, - options?: DiskAccessesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskAccessesCreateOrUpdateResponse - > - >; - /** - * Creates or updates a disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Put disk access operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccess, - options?: DiskAccessesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates (patches) a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Patch disk access operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccessUpdate, - options?: DiskAccessesUpdateOptionalParams, - ): Promise< - SimplePollerLike, DiskAccessesUpdateResponse> - >; - /** - * Updates (patches) a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param diskAccess disk access object supplied in the body of the Patch disk access operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - diskAccessName: string, - diskAccess: DiskAccessUpdate, - options?: DiskAccessesUpdateOptionalParams, - ): Promise; - /** - * Deletes a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesDeleteOptionalParams, - ): Promise; - /** - * Gets information about a private endpoint connection under a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - getAPrivateEndpointConnection( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams, - ): Promise; - /** - * Approve or reject a private endpoint connection under disk access resource, this can't be used to - * create a new private endpoint connection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put - * private endpoint connection operation. - * @param options The options parameters. - */ - beginUpdateAPrivateEndpointConnection( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - privateEndpointConnection: PrivateEndpointConnection, - options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskAccessesUpdateAPrivateEndpointConnectionResponse - > - >; - /** - * Approve or reject a private endpoint connection under disk access resource, this can't be used to - * create a new private endpoint connection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put - * private endpoint connection operation. - * @param options The options parameters. - */ - beginUpdateAPrivateEndpointConnectionAndWait( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - privateEndpointConnection: PrivateEndpointConnection, - options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, - ): Promise; - /** - * Deletes a private endpoint connection under a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - beginDeleteAPrivateEndpointConnection( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, - ): Promise, void>>; - /** - * Deletes a private endpoint connection under a disk access resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param options The options parameters. - */ - beginDeleteAPrivateEndpointConnectionAndWait( - resourceGroupName: string, - diskAccessName: string, - privateEndpointConnectionName: string, - options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, - ): Promise; - /** - * Gets the private link resources possible under disk access resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskAccessName The name of the disk access resource that is being created. The name can't be - * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, - * 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - getPrivateLinkResources( - resourceGroupName: string, - diskAccessName: string, - options?: DiskAccessesGetPrivateLinkResourcesOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/diskEncryptionSets.ts b/sdk/compute/arm-compute/src/operationsInterfaces/diskEncryptionSets.ts deleted file mode 100644 index 084d175390ac..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/diskEncryptionSets.ts +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - DiskEncryptionSet, - DiskEncryptionSetsListOptionalParams, - DiskEncryptionSetsListByResourceGroupOptionalParams, - DiskEncryptionSetsListAssociatedResourcesOptionalParams, - DiskEncryptionSetsGetOptionalParams, - DiskEncryptionSetsGetResponse, - DiskEncryptionSetsCreateOrUpdateOptionalParams, - DiskEncryptionSetsCreateOrUpdateResponse, - DiskEncryptionSetUpdate, - DiskEncryptionSetsUpdateOptionalParams, - DiskEncryptionSetsUpdateResponse, - DiskEncryptionSetsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a DiskEncryptionSets. */ -export interface DiskEncryptionSets { - /** - * Lists all the disk encryption sets under a subscription. - * @param options The options parameters. - */ - list( - options?: DiskEncryptionSetsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all the disk encryption sets under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: DiskEncryptionSetsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all resources that are encrypted with this disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - listAssociatedResources( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsGetOptionalParams, - ): Promise; - /** - * Creates or updates a disk encryption set - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption - * set operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSet, - options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskEncryptionSetsCreateOrUpdateResponse - > - >; - /** - * Creates or updates a disk encryption set - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption - * set operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSet, - options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates (patches) a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk - * encryption set operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSetUpdate, - options?: DiskEncryptionSetsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskEncryptionSetsUpdateResponse - > - >; - /** - * Updates (patches) a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk - * encryption set operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - diskEncryptionSetName: string, - diskEncryptionSet: DiskEncryptionSetUpdate, - options?: DiskEncryptionSetsUpdateOptionalParams, - ): Promise; - /** - * Deletes a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a disk encryption set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name - * can't be changed after the disk encryption set is created. Supported characters for the name are - * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - diskEncryptionSetName: string, - options?: DiskEncryptionSetsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/diskRestorePointOperations.ts b/sdk/compute/arm-compute/src/operationsInterfaces/diskRestorePointOperations.ts deleted file mode 100644 index b5cbbba03908..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/diskRestorePointOperations.ts +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - DiskRestorePoint, - DiskRestorePointListByRestorePointOptionalParams, - DiskRestorePointGetOptionalParams, - DiskRestorePointGetResponse, - GrantAccessData, - DiskRestorePointGrantAccessOptionalParams, - DiskRestorePointGrantAccessResponse, - DiskRestorePointRevokeAccessOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a DiskRestorePointOperations. */ -export interface DiskRestorePointOperations { - /** - * Lists diskRestorePoints under a vmRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param options The options parameters. - */ - listByRestorePoint( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - options?: DiskRestorePointListByRestorePointOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get disk restorePoint resource - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param options The options parameters. - */ - get( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - options?: DiskRestorePointGetOptionalParams, - ): Promise; - /** - * Grants access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - beginGrantAccess( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - grantAccessData: GrantAccessData, - options?: DiskRestorePointGrantAccessOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - DiskRestorePointGrantAccessResponse - > - >; - /** - * Grants access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - beginGrantAccessAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - grantAccessData: GrantAccessData, - options?: DiskRestorePointGrantAccessOptionalParams, - ): Promise; - /** - * Revokes access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param options The options parameters. - */ - beginRevokeAccess( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - options?: DiskRestorePointRevokeAccessOptionalParams, - ): Promise, void>>; - /** - * Revokes access to a diskRestorePoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection that the disk restore - * point belongs. - * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. - * @param diskRestorePointName The name of the DiskRestorePoint - * @param options The options parameters. - */ - beginRevokeAccessAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - vmRestorePointName: string, - diskRestorePointName: string, - options?: DiskRestorePointRevokeAccessOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/disks.ts b/sdk/compute/arm-compute/src/operationsInterfaces/disks.ts deleted file mode 100644 index 5a5206020835..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/disks.ts +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - Disk, - DisksListOptionalParams, - DisksListByResourceGroupOptionalParams, - DisksGetOptionalParams, - DisksGetResponse, - DisksCreateOrUpdateOptionalParams, - DisksCreateOrUpdateResponse, - DiskUpdate, - DisksUpdateOptionalParams, - DisksUpdateResponse, - DisksDeleteOptionalParams, - GrantAccessData, - DisksGrantAccessOptionalParams, - DisksGrantAccessResponse, - DisksRevokeAccessOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a Disks. */ -export interface Disks { - /** - * Lists all the disks under a subscription. - * @param options The options parameters. - */ - list(options?: DisksListOptionalParams): PagedAsyncIterableIterator; - /** - * Lists all the disks under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: DisksListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - diskName: string, - options?: DisksGetOptionalParams, - ): Promise; - /** - * Creates or updates a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - diskName: string, - disk: Disk, - options?: DisksCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike, DisksCreateOrUpdateResponse> - >; - /** - * Creates or updates a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - diskName: string, - disk: Disk, - options?: DisksCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates (patches) a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - diskName: string, - disk: DiskUpdate, - options?: DisksUpdateOptionalParams, - ): Promise, DisksUpdateResponse>>; - /** - * Updates (patches) a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param disk Disk object supplied in the body of the Patch disk operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - diskName: string, - disk: DiskUpdate, - options?: DisksUpdateOptionalParams, - ): Promise; - /** - * Deletes a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - diskName: string, - options?: DisksDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - diskName: string, - options?: DisksDeleteOptionalParams, - ): Promise; - /** - * Grants access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - beginGrantAccess( - resourceGroupName: string, - diskName: string, - grantAccessData: GrantAccessData, - options?: DisksGrantAccessOptionalParams, - ): Promise, DisksGrantAccessResponse>>; - /** - * Grants access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get disk access operation. - * @param options The options parameters. - */ - beginGrantAccessAndWait( - resourceGroupName: string, - diskName: string, - grantAccessData: GrantAccessData, - options?: DisksGrantAccessOptionalParams, - ): Promise; - /** - * Revokes access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - beginRevokeAccess( - resourceGroupName: string, - diskName: string, - options?: DisksRevokeAccessOptionalParams, - ): Promise, void>>; - /** - * Revokes access to a disk. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param diskName The name of the managed disk that is being created. The name can't be changed after - * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name - * length is 80 characters. - * @param options The options parameters. - */ - beginRevokeAccessAndWait( - resourceGroupName: string, - diskName: string, - options?: DisksRevokeAccessOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleries.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleries.ts deleted file mode 100644 index 717d25d579a0..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleries.ts +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - Gallery, - GalleriesListOptionalParams, - GalleriesListByResourceGroupOptionalParams, - GalleriesGetOptionalParams, - GalleriesGetResponse, - GalleriesCreateOrUpdateOptionalParams, - GalleriesCreateOrUpdateResponse, - GalleryUpdate, - GalleriesUpdateOptionalParams, - GalleriesUpdateResponse, - GalleriesDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a Galleries. */ -export interface Galleries { - /** - * List galleries under a subscription. - * @param options The options parameters. - */ - list(options?: GalleriesListOptionalParams): PagedAsyncIterableIterator; - /** - * List galleries under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: GalleriesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - options?: GalleriesGetOptionalParams, - ): Promise; - /** - * Create or update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - gallery: Gallery, - options?: GalleriesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleriesCreateOrUpdateResponse - > - >; - /** - * Create or update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the create or update Shared Image Gallery operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - gallery: Gallery, - options?: GalleriesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - gallery: GalleryUpdate, - options?: GalleriesUpdateOptionalParams, - ): Promise, GalleriesUpdateResponse>>; - /** - * Update a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param gallery Parameters supplied to the update Shared Image Gallery operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - gallery: GalleryUpdate, - options?: GalleriesUpdateOptionalParams, - ): Promise; - /** - * Delete a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - options?: GalleriesDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a Shared Image Gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - options?: GalleriesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryApplicationVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryApplicationVersions.ts deleted file mode 100644 index 6967d1dc035b..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryApplicationVersions.ts +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryApplicationVersion, - GalleryApplicationVersionsListByGalleryApplicationOptionalParams, - GalleryApplicationVersionsGetOptionalParams, - GalleryApplicationVersionsGetResponse, - GalleryApplicationVersionsCreateOrUpdateOptionalParams, - GalleryApplicationVersionsCreateOrUpdateResponse, - GalleryApplicationVersionUpdate, - GalleryApplicationVersionsUpdateOptionalParams, - GalleryApplicationVersionsUpdateResponse, - GalleryApplicationVersionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryApplicationVersions. */ -export interface GalleryApplicationVersions { - /** - * List gallery Application Versions in a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - listByGalleryApplication( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - options?: GalleryApplicationVersionsGetOptionalParams, - ): Promise; - /** - * Create or update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application - * Version operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersion, - options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationVersionsCreateOrUpdateResponse - > - >; - /** - * Create or update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application - * Version operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersion, - options?: GalleryApplicationVersionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version - * operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersionUpdate, - options?: GalleryApplicationVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationVersionsUpdateResponse - > - >; - /** - * Update a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version - * operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - galleryApplicationVersion: GalleryApplicationVersionUpdate, - options?: GalleryApplicationVersionsUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - options?: GalleryApplicationVersionsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a gallery Application Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplicationVersionName: string, - options?: GalleryApplicationVersionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryApplications.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryApplications.ts deleted file mode 100644 index 6663b93ae335..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryApplications.ts +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryApplication, - GalleryApplicationsListByGalleryOptionalParams, - GalleryApplicationsGetOptionalParams, - GalleryApplicationsGetResponse, - GalleryApplicationsCreateOrUpdateOptionalParams, - GalleryApplicationsCreateOrUpdateResponse, - GalleryApplicationUpdate, - GalleryApplicationsUpdateOptionalParams, - GalleryApplicationsUpdateResponse, - GalleryApplicationsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryApplications. */ -export interface GalleryApplications { - /** - * List gallery Application Definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryApplicationsListByGalleryOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationsGetOptionalParams, - ): Promise; - /** - * Create or update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplication, - options?: GalleryApplicationsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationsCreateOrUpdateResponse - > - >; - /** - * Create or update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the create or update gallery Application operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplication, - options?: GalleryApplicationsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplicationUpdate, - options?: GalleryApplicationsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryApplicationsUpdateResponse - > - >; - /** - * Update a gallery Application Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param galleryApplication Parameters supplied to the update gallery Application operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - galleryApplication: GalleryApplicationUpdate, - options?: GalleryApplicationsUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery Application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a gallery Application. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryApplicationName: string, - options?: GalleryApplicationsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts deleted file mode 100644 index fef0b4d81a07..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryImageVersion, - GalleryImageVersionsListByGalleryImageOptionalParams, - GalleryImageVersionsGetOptionalParams, - GalleryImageVersionsGetResponse, - GalleryImageVersionsCreateOrUpdateOptionalParams, - GalleryImageVersionsCreateOrUpdateResponse, - GalleryImageVersionUpdate, - GalleryImageVersionsUpdateOptionalParams, - GalleryImageVersionsUpdateResponse, - GalleryImageVersionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryImageVersions. */ -export interface GalleryImageVersions { - /** - * List gallery image versions in a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - listByGalleryImage( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImageVersionsListByGalleryImageOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: GalleryImageVersionsGetOptionalParams, - ): Promise; - /** - * Create or update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the create or update gallery image version - * operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersion, - options?: GalleryImageVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryImageVersionsCreateOrUpdateResponse - > - >; - /** - * Create or update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the create or update gallery image version - * operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersion, - options?: GalleryImageVersionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the update gallery image version operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersionUpdate, - options?: GalleryImageVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryImageVersionsUpdateResponse - > - >; - /** - * Update a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param galleryImageVersion Parameters supplied to the update gallery image version operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - galleryImageVersion: GalleryImageVersionUpdate, - options?: GalleryImageVersionsUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: GalleryImageVersionsDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a gallery image version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImageVersionName The name of the gallery image version to be retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: GalleryImageVersionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryImages.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryImages.ts deleted file mode 100644 index 00f8952af3b2..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryImages.ts +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryImage, - GalleryImagesListByGalleryOptionalParams, - GalleryImagesGetOptionalParams, - GalleryImagesGetResponse, - GalleryImagesCreateOrUpdateOptionalParams, - GalleryImagesCreateOrUpdateResponse, - GalleryImageUpdate, - GalleryImagesUpdateOptionalParams, - GalleryImagesUpdateResponse, - GalleryImagesDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryImages. */ -export interface GalleryImages { - /** - * List gallery image definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryImagesListByGalleryOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImagesGetOptionalParams, - ): Promise; - /** - * Create or update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImage, - options?: GalleryImagesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryImagesCreateOrUpdateResponse - > - >; - /** - * Create or update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the create or update gallery image operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImage, - options?: GalleryImagesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImageUpdate, - options?: GalleryImagesUpdateOptionalParams, - ): Promise< - SimplePollerLike, GalleryImagesUpdateResponse> - >; - /** - * Update a gallery image definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param galleryImage Parameters supplied to the update gallery image operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - galleryImage: GalleryImageUpdate, - options?: GalleryImagesUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImagesDeleteOptionalParams, - ): Promise, void>>; - /** - * Delete a gallery image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryImageName The name of the gallery image definition to be retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryImageName: string, - options?: GalleryImagesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts deleted file mode 100644 index d87e1ca13d9c..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryInVMAccessControlProfileVersion, - GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, - GalleryInVMAccessControlProfileVersionsGetOptionalParams, - GalleryInVMAccessControlProfileVersionsGetResponse, - GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, - GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse, - GalleryInVMAccessControlProfileVersionUpdate, - GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, - GalleryInVMAccessControlProfileVersionsUpdateResponse, - GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, - GalleryInVMAccessControlProfileVersionsDeleteResponse, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryInVMAccessControlProfileVersions. */ -export interface GalleryInVMAccessControlProfileVersions { - /** - * List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - listByGalleryInVMAccessControlProfile( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams, - ): Promise; - /** - * Create or update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, - options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse - > - >; - /** - * Create or update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, - options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, - options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfileVersionsUpdateResponse - > - >; - /** - * Update a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery - * inVMAccessControlProfile version operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, - options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfileVersionsDeleteResponse - > - >; - /** - * Delete a gallery inVMAccessControlProfile version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version - * to be retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - inVMAccessControlProfileVersionName: string, - options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts deleted file mode 100644 index 20771f96a1ef..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryInVMAccessControlProfile, - GalleryInVMAccessControlProfilesListByGalleryOptionalParams, - GalleryInVMAccessControlProfilesGetOptionalParams, - GalleryInVMAccessControlProfilesGetResponse, - GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, - GalleryInVMAccessControlProfilesCreateOrUpdateResponse, - GalleryInVMAccessControlProfileUpdate, - GalleryInVMAccessControlProfilesUpdateOptionalParams, - GalleryInVMAccessControlProfilesUpdateResponse, - GalleryInVMAccessControlProfilesDeleteOptionalParams, - GalleryInVMAccessControlProfilesDeleteResponse, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryInVMAccessControlProfiles. */ -export interface GalleryInVMAccessControlProfiles { - /** - * List gallery inVMAccessControlProfiles in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfilesGetOptionalParams, - ): Promise; - /** - * Create or update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, - options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfilesCreateOrUpdateResponse - > - >; - /** - * Create or update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, - options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, - options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfilesUpdateResponse - > - >; - /** - * Update a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery - * inVMAccessControlProfile operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, - options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryInVMAccessControlProfilesDeleteResponse - > - >; - /** - * Delete a gallery inVMAccessControlProfile. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be - * retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - inVMAccessControlProfileName: string, - options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryScriptVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryScriptVersions.ts deleted file mode 100644 index 074083d2ff20..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryScriptVersions.ts +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryScriptVersion, - GalleryScriptVersionsListByGalleryScriptOptionalParams, - GalleryScriptVersionsGetOptionalParams, - GalleryScriptVersionsGetResponse, - GalleryScriptVersionsCreateOrUpdateOptionalParams, - GalleryScriptVersionsCreateOrUpdateResponse, - GalleryScriptVersionUpdate, - GalleryScriptVersionsUpdateOptionalParams, - GalleryScriptVersionsUpdateResponse, - GalleryScriptVersionsDeleteOptionalParams, - GalleryScriptVersionsDeleteResponse, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryScriptVersions. */ -export interface GalleryScriptVersions { - /** - * List gallery Script Versions in a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - listByGalleryScript( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptVersionsListByGalleryScriptOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Custom ArmResourceRead operation template with CloudError as Error - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - options?: GalleryScriptVersionsGetOptionalParams, - ): Promise; - /** - * Create or update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version - * operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersion, - options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptVersionsCreateOrUpdateResponse - > - >; - /** - * Create or update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version - * operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersion, - options?: GalleryScriptVersionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersionUpdate, - options?: GalleryScriptVersionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptVersionsUpdateResponse - > - >; - /** - * Update a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - galleryScriptVersion: GalleryScriptVersionUpdate, - options?: GalleryScriptVersionsUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - options?: GalleryScriptVersionsDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptVersionsDeleteResponse - > - >; - /** - * Delete a gallery Script Version. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScriptVersionName: string, - options?: GalleryScriptVersionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryScripts.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryScripts.ts deleted file mode 100644 index 97bb58790134..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryScripts.ts +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - GalleryScript, - GalleryScriptsListByGalleryOptionalParams, - GalleryScriptsGetOptionalParams, - GalleryScriptsGetResponse, - GalleryScriptsCreateOrUpdateOptionalParams, - GalleryScriptsCreateOrUpdateResponse, - GalleryScriptUpdate, - GalleryScriptsUpdateOptionalParams, - GalleryScriptsUpdateResponse, - GalleryScriptsDeleteOptionalParams, - GalleryScriptsDeleteResponse, -} from "../models/index.js"; - -/// -/** Interface representing a GalleryScripts. */ -export interface GalleryScripts { - /** - * List gallery Script Definitions in a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param options The options parameters. - */ - listByGallery( - resourceGroupName: string, - galleryName: string, - options?: GalleryScriptsListByGalleryOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a gallery script definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptsGetOptionalParams, - ): Promise; - /** - * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse - * of common scripts - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the create or update gallery Script operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScript, - options?: GalleryScriptsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GalleryScriptsCreateOrUpdateResponse - > - >; - /** - * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse - * of common scripts - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the create or update gallery Script operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScript, - options?: GalleryScriptsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the update gallery Script operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScriptUpdate, - options?: GalleryScriptsUpdateOptionalParams, - ): Promise< - SimplePollerLike, GalleryScriptsUpdateResponse> - >; - /** - * Update a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param galleryScript Parameters supplied to the update gallery Script operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - galleryScript: GalleryScriptUpdate, - options?: GalleryScriptsUpdateOptionalParams, - ): Promise; - /** - * Delete a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptsDeleteOptionalParams, - ): Promise< - SimplePollerLike, GalleryScriptsDeleteResponse> - >; - /** - * Delete a gallery Script Definition. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param galleryScriptName The name of the gallery Script Definition to be retrieved. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - galleryName: string, - galleryScriptName: string, - options?: GalleryScriptsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/gallerySharingProfile.ts b/sdk/compute/arm-compute/src/operationsInterfaces/gallerySharingProfile.ts deleted file mode 100644 index abae1b8fda4c..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/gallerySharingProfile.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - SharingUpdate, - GallerySharingProfileUpdateOptionalParams, - GallerySharingProfileUpdateResponse, -} from "../models/index.js"; - -/** Interface representing a GallerySharingProfile. */ -export interface GallerySharingProfile { - /** - * Update sharing profile of a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param sharingUpdate Parameters supplied to the update gallery sharing profile. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - galleryName: string, - sharingUpdate: SharingUpdate, - options?: GallerySharingProfileUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GallerySharingProfileUpdateResponse - > - >; - /** - * Update sharing profile of a gallery. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param sharingUpdate Parameters supplied to the update gallery sharing profile. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - galleryName: string, - sharingUpdate: SharingUpdate, - options?: GallerySharingProfileUpdateOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/images.ts b/sdk/compute/arm-compute/src/operationsInterfaces/images.ts deleted file mode 100644 index 480a4d8ab326..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/images.ts +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - Image, - ImagesListOptionalParams, - ImagesListByResourceGroupOptionalParams, - ImagesGetOptionalParams, - ImagesGetResponse, - ImagesCreateOrUpdateOptionalParams, - ImagesCreateOrUpdateResponse, - ImageUpdate, - ImagesUpdateOptionalParams, - ImagesUpdateResponse, - ImagesDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a Images. */ -export interface Images { - /** - * Gets the list of Images in the subscription. Use nextLink property in the response to get the next - * page of Images. Do this till nextLink is null to fetch all the Images. - * @param options The options parameters. - */ - list(options?: ImagesListOptionalParams): PagedAsyncIterableIterator; - /** - * Gets the list of images under a resource group. Use nextLink property in the response to get the - * next page of Images. Do this till nextLink is null to fetch all the Images. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: ImagesListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - imageName: string, - options?: ImagesGetOptionalParams, - ): Promise; - /** - * Create or update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - imageName: string, - parameters: Image, - options?: ImagesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike, ImagesCreateOrUpdateResponse> - >; - /** - * Create or update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Create Image operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - imageName: string, - parameters: Image, - options?: ImagesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - imageName: string, - parameters: ImageUpdate, - options?: ImagesUpdateOptionalParams, - ): Promise, ImagesUpdateResponse>>; - /** - * Update an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param parameters Parameters supplied to the Update Image operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - imageName: string, - parameters: ImageUpdate, - options?: ImagesUpdateOptionalParams, - ): Promise; - /** - * Deletes an Image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - imageName: string, - options?: ImagesDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes an Image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param imageName The name of the image. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - imageName: string, - options?: ImagesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/index.ts b/sdk/compute/arm-compute/src/operationsInterfaces/index.ts deleted file mode 100644 index f91f8bc2c7cf..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -export * from "./operations.js"; -export * from "./availabilitySets.js"; -export * from "./capacityReservationGroups.js"; -export * from "./dedicatedHostGroups.js"; -export * from "./images.js"; -export * from "./virtualMachineImagesEdgeZone.js"; -export * from "./virtualMachineImages.js"; -export * from "./logAnalytics.js"; -export * from "./virtualMachineExtensionImages.js"; -export * from "./virtualMachineRunCommands.js"; -export * from "./usageOperations.js"; -export * from "./virtualMachineScaleSets.js"; -export * from "./virtualMachines.js"; -export * from "./virtualMachineSizes.js"; -export * from "./proximityPlacementGroups.js"; -export * from "./restorePointCollections.js"; -export * from "./sshPublicKeys.js"; -export * from "./capacityReservations.js"; -export * from "./dedicatedHosts.js"; -export * from "./restorePoints.js"; -export * from "./virtualMachineScaleSetRollingUpgrades.js"; -export * from "./virtualMachineScaleSetExtensions.js"; -export * from "./virtualMachineScaleSetVMs.js"; -export * from "./virtualMachineScaleSetVMExtensions.js"; -export * from "./virtualMachineScaleSetVMRunCommands.js"; -export * from "./virtualMachineExtensions.js"; -export * from "./diskAccesses.js"; -export * from "./diskEncryptionSets.js"; -export * from "./disks.js"; -export * from "./snapshots.js"; -export * from "./diskRestorePointOperations.js"; -export * from "./resourceSkus.js"; -export * from "./galleries.js"; -export * from "./communityGalleries.js"; -export * from "./communityGalleryImages.js"; -export * from "./communityGalleryImageVersions.js"; -export * from "./sharedGalleries.js"; -export * from "./sharedGalleryImages.js"; -export * from "./sharedGalleryImageVersions.js"; -export * from "./galleryApplications.js"; -export * from "./galleryApplicationVersions.js"; -export * from "./galleryImages.js"; -export * from "./galleryImageVersions.js"; -export * from "./galleryInVMAccessControlProfiles.js"; -export * from "./galleryInVMAccessControlProfileVersions.js"; -export * from "./galleryScripts.js"; -export * from "./galleryScriptVersions.js"; -export * from "./gallerySharingProfile.js"; -export * from "./softDeletedResource.js"; -export * from "./cloudServiceRoleInstances.js"; -export * from "./cloudServiceRoles.js"; -export * from "./cloudServices.js"; -export * from "./cloudServicesUpdateDomain.js"; -export * from "./cloudServiceOperatingSystems.js"; diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/logAnalytics.ts b/sdk/compute/arm-compute/src/operationsInterfaces/logAnalytics.ts deleted file mode 100644 index 7d81b510166b..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/logAnalytics.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - RequestRateByIntervalInput, - LogAnalyticsExportRequestRateByIntervalOptionalParams, - LogAnalyticsExportRequestRateByIntervalResponse, - ThrottledRequestsInput, - LogAnalyticsExportThrottledRequestsOptionalParams, - LogAnalyticsExportThrottledRequestsResponse, -} from "../models/index.js"; - -/** Interface representing a LogAnalytics. */ -export interface LogAnalytics { - /** - * Export logs that show Api requests made by this subscription in the given time window to show - * throttling activities. - * @param location The name of Azure region. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param options The options parameters. - */ - beginExportRequestRateByInterval( - location: string, - parameters: RequestRateByIntervalInput, - options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - LogAnalyticsExportRequestRateByIntervalResponse - > - >; - /** - * Export logs that show Api requests made by this subscription in the given time window to show - * throttling activities. - * @param location The name of Azure region. - * @param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api. - * @param options The options parameters. - */ - beginExportRequestRateByIntervalAndWait( - location: string, - parameters: RequestRateByIntervalInput, - options?: LogAnalyticsExportRequestRateByIntervalOptionalParams, - ): Promise; - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * @param location The name of Azure region. - * @param parameters The request body - * @param options The options parameters. - */ - beginExportThrottledRequests( - location: string, - parameters: ThrottledRequestsInput, - options?: LogAnalyticsExportThrottledRequestsOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - LogAnalyticsExportThrottledRequestsResponse - > - >; - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * @param location The name of Azure region. - * @param parameters The request body - * @param options The options parameters. - */ - beginExportThrottledRequestsAndWait( - location: string, - parameters: ThrottledRequestsInput, - options?: LogAnalyticsExportThrottledRequestsOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/operations.ts b/sdk/compute/arm-compute/src/operationsInterfaces/operations.ts deleted file mode 100644 index 58533294df40..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { Operation, OperationsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * List the operations for the provider - * @param options The options parameters. - */ - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/proximityPlacementGroups.ts b/sdk/compute/arm-compute/src/operationsInterfaces/proximityPlacementGroups.ts deleted file mode 100644 index ce2c2d3130e9..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/proximityPlacementGroups.ts +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - ProximityPlacementGroup, - ProximityPlacementGroupsListBySubscriptionOptionalParams, - ProximityPlacementGroupsListByResourceGroupOptionalParams, - ProximityPlacementGroupsGetOptionalParams, - ProximityPlacementGroupsGetResponse, - ProximityPlacementGroupsCreateOrUpdateOptionalParams, - ProximityPlacementGroupsCreateOrUpdateResponse, - ProximityPlacementGroupUpdate, - ProximityPlacementGroupsUpdateOptionalParams, - ProximityPlacementGroupsUpdateResponse, - ProximityPlacementGroupsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a ProximityPlacementGroups. */ -export interface ProximityPlacementGroups { - /** - * Lists all proximity placement groups in a subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: ProximityPlacementGroupsListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all proximity placement groups in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about a proximity placement group . - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - proximityPlacementGroupName: string, - options?: ProximityPlacementGroupsGetOptionalParams, - ): Promise; - /** - * Create or update a proximity placement group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Create Proximity Placement Group operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - proximityPlacementGroupName: string, - parameters: ProximityPlacementGroup, - options?: ProximityPlacementGroupsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a proximity placement group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param parameters Parameters supplied to the Update Proximity Placement Group operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - proximityPlacementGroupName: string, - parameters: ProximityPlacementGroupUpdate, - options?: ProximityPlacementGroupsUpdateOptionalParams, - ): Promise; - /** - * Delete a proximity placement group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param proximityPlacementGroupName The name of the proximity placement group. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - proximityPlacementGroupName: string, - options?: ProximityPlacementGroupsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/resourceSkus.ts b/sdk/compute/arm-compute/src/operationsInterfaces/resourceSkus.ts deleted file mode 100644 index a2e93abeced8..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/resourceSkus.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { ResourceSku, ResourceSkusListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a ResourceSkus. */ -export interface ResourceSkus { - /** - * Gets the list of Microsoft.Compute SKUs available for your Subscription. - * @param options The options parameters. - */ - list(options?: ResourceSkusListOptionalParams): PagedAsyncIterableIterator; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/restorePointCollections.ts b/sdk/compute/arm-compute/src/operationsInterfaces/restorePointCollections.ts deleted file mode 100644 index dda9291fc48d..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/restorePointCollections.ts +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - RestorePointCollection, - RestorePointCollectionsListAllOptionalParams, - RestorePointCollectionsListOptionalParams, - RestorePointCollectionsGetOptionalParams, - RestorePointCollectionsGetResponse, - RestorePointCollectionsCreateOrUpdateOptionalParams, - RestorePointCollectionsCreateOrUpdateResponse, - RestorePointCollectionUpdate, - RestorePointCollectionsUpdateOptionalParams, - RestorePointCollectionsUpdateResponse, - RestorePointCollectionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a RestorePointCollections. */ -export interface RestorePointCollections { - /** - * Gets the list of restore point collections in the subscription. Use nextLink property in the - * response to get the next page of restore point collections. Do this till nextLink is not null to - * fetch all the restore point collections. - * @param options The options parameters. - */ - listAll( - options?: RestorePointCollectionsListAllOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets the list of restore point collections in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - options?: RestorePointCollectionsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * The operation to get the restore point collection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - restorePointCollectionName: string, - options?: RestorePointCollectionsGetOptionalParams, - ): Promise; - /** - * The operation to create or update the restore point collection. Please refer to - * https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags - * may be modified. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param parameters Parameters supplied to the Create or Update restore point collection operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - restorePointCollectionName: string, - parameters: RestorePointCollection, - options?: RestorePointCollectionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update the restore point collection. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param parameters Parameters supplied to the Update restore point collection operation. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - restorePointCollectionName: string, - parameters: RestorePointCollectionUpdate, - options?: RestorePointCollectionsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete the restore point collection. This operation will also delete all the - * contained restore points. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - restorePointCollectionName: string, - options?: RestorePointCollectionsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete the restore point collection. This operation will also delete all the - * contained restore points. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - options?: RestorePointCollectionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/restorePoints.ts b/sdk/compute/arm-compute/src/operationsInterfaces/restorePoints.ts deleted file mode 100644 index d7955b87c26b..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/restorePoints.ts +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - RestorePointsGetOptionalParams, - RestorePointsGetResponse, - RestorePoint, - RestorePointsCreateOptionalParams, - RestorePointsCreateResponse, - RestorePointsDeleteOptionalParams, -} from "../models/index.js"; - -/** Interface representing a RestorePoints. */ -export interface RestorePoints { - /** - * The operation to get the restore point. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - options?: RestorePointsGetOptionalParams, - ): Promise; - /** - * The operation to create the restore point. Updating properties of an existing restore point is not - * allowed - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param parameters Parameters supplied to the Create restore point operation. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - parameters: RestorePoint, - options?: RestorePointsCreateOptionalParams, - ): Promise< - SimplePollerLike, RestorePointsCreateResponse> - >; - /** - * The operation to create the restore point. Updating properties of an existing restore point is not - * allowed - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param parameters Parameters supplied to the Create restore point operation. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - parameters: RestorePoint, - options?: RestorePointsCreateOptionalParams, - ): Promise; - /** - * The operation to delete the restore point. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - options?: RestorePointsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete the restore point. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param restorePointCollectionName The name of the restore point collection. - * @param restorePointName The name of the restore point. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - restorePointCollectionName: string, - restorePointName: string, - options?: RestorePointsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleries.ts b/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleries.ts deleted file mode 100644 index afb3d09b0a89..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleries.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - SharedGallery, - SharedGalleriesListOptionalParams, - SharedGalleriesGetOptionalParams, - SharedGalleriesGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a SharedGalleries. */ -export interface SharedGalleries { - /** - * List shared galleries by subscription id or tenant id. - * @param location The name of Azure region. - * @param options The options parameters. - */ - list( - location: string, - options?: SharedGalleriesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a shared gallery by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param options The options parameters. - */ - get( - location: string, - galleryUniqueName: string, - options?: SharedGalleriesGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImageVersions.ts deleted file mode 100644 index 701c976f6ec3..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImageVersions.ts +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - SharedGalleryImageVersion, - SharedGalleryImageVersionsListOptionalParams, - SharedGalleryImageVersionsGetOptionalParams, - SharedGalleryImageVersionsGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a SharedGalleryImageVersions. */ -export interface SharedGalleryImageVersions { - /** - * List shared gallery image versions by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param options The options parameters. - */ - list( - location: string, - galleryUniqueName: string, - galleryImageName: string, - options?: SharedGalleryImageVersionsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a shared gallery image version by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param galleryImageVersionName The name of the gallery image version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within - * the range of a 32-bit integer. Format: .. - * @param options The options parameters. - */ - get( - location: string, - galleryUniqueName: string, - galleryImageName: string, - galleryImageVersionName: string, - options?: SharedGalleryImageVersionsGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImages.ts b/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImages.ts deleted file mode 100644 index ab16743a6fc7..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/sharedGalleryImages.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - SharedGalleryImage, - SharedGalleryImagesListOptionalParams, - SharedGalleryImagesGetOptionalParams, - SharedGalleryImagesGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a SharedGalleryImages. */ -export interface SharedGalleryImages { - /** - * List shared gallery images by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param options The options parameters. - */ - list( - location: string, - galleryUniqueName: string, - options?: SharedGalleryImagesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Get a shared gallery image by subscription id or tenant id. - * @param location The name of Azure region. - * @param galleryUniqueName The unique name of the Shared Gallery. - * @param galleryImageName The name of the Shared Gallery Image Definition from which the Image - * Versions are to be listed. - * @param options The options parameters. - */ - get( - location: string, - galleryUniqueName: string, - galleryImageName: string, - options?: SharedGalleryImagesGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/snapshots.ts b/sdk/compute/arm-compute/src/operationsInterfaces/snapshots.ts deleted file mode 100644 index 04deef045465..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/snapshots.ts +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - Snapshot, - SnapshotsListOptionalParams, - SnapshotsListByResourceGroupOptionalParams, - SnapshotsGetOptionalParams, - SnapshotsGetResponse, - SnapshotsCreateOrUpdateOptionalParams, - SnapshotsCreateOrUpdateResponse, - SnapshotUpdate, - SnapshotsUpdateOptionalParams, - SnapshotsUpdateResponse, - SnapshotsDeleteOptionalParams, - GrantAccessData, - SnapshotsGrantAccessOptionalParams, - SnapshotsGrantAccessResponse, - SnapshotsRevokeAccessOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a Snapshots. */ -export interface Snapshots { - /** - * Lists snapshots under a subscription. - * @param options The options parameters. - */ - list(options?: SnapshotsListOptionalParams): PagedAsyncIterableIterator; - /** - * Lists snapshots under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: SnapshotsListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsGetOptionalParams, - ): Promise; - /** - * Creates or updates a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - snapshotName: string, - snapshot: Snapshot, - options?: SnapshotsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - SnapshotsCreateOrUpdateResponse - > - >; - /** - * Creates or updates a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Put disk operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - snapshotName: string, - snapshot: Snapshot, - options?: SnapshotsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Updates (patches) a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - snapshotName: string, - snapshot: SnapshotUpdate, - options?: SnapshotsUpdateOptionalParams, - ): Promise, SnapshotsUpdateResponse>>; - /** - * Updates (patches) a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - snapshotName: string, - snapshot: SnapshotUpdate, - options?: SnapshotsUpdateOptionalParams, - ): Promise; - /** - * Deletes a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsDeleteOptionalParams, - ): Promise; - /** - * Grants access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param options The options parameters. - */ - beginGrantAccess( - resourceGroupName: string, - snapshotName: string, - grantAccessData: GrantAccessData, - options?: SnapshotsGrantAccessOptionalParams, - ): Promise< - SimplePollerLike, SnapshotsGrantAccessResponse> - >; - /** - * Grants access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. - * @param options The options parameters. - */ - beginGrantAccessAndWait( - resourceGroupName: string, - snapshotName: string, - grantAccessData: GrantAccessData, - options?: SnapshotsGrantAccessOptionalParams, - ): Promise; - /** - * Revokes access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - beginRevokeAccess( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsRevokeAccessOptionalParams, - ): Promise, void>>; - /** - * Revokes access to a snapshot. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after - * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name - * length is 80 characters. - * @param options The options parameters. - */ - beginRevokeAccessAndWait( - resourceGroupName: string, - snapshotName: string, - options?: SnapshotsRevokeAccessOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/softDeletedResource.ts b/sdk/compute/arm-compute/src/operationsInterfaces/softDeletedResource.ts deleted file mode 100644 index dcb0dcd3b6c0..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/softDeletedResource.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - GallerySoftDeletedResource, - SoftDeletedResourceListByArtifactNameOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a SoftDeletedResource. */ -export interface SoftDeletedResource { - /** - * List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image - * version of an image. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param galleryName The name of the Shared Image Gallery. - * @param artifactType The type of the artifact to be listed, such as gallery image version. - * @param artifactName The artifact name to be listed. If artifact type is Images, then the artifact - * name should be the gallery image name. - * @param options The options parameters. - */ - listByArtifactName( - resourceGroupName: string, - galleryName: string, - artifactType: string, - artifactName: string, - options?: SoftDeletedResourceListByArtifactNameOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/sshPublicKeys.ts b/sdk/compute/arm-compute/src/operationsInterfaces/sshPublicKeys.ts deleted file mode 100644 index d5cb02b79de9..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/sshPublicKeys.ts +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { - SshPublicKeyResource, - SshPublicKeysListBySubscriptionOptionalParams, - SshPublicKeysListByResourceGroupOptionalParams, - SshPublicKeysGetOptionalParams, - SshPublicKeysGetResponse, - SshPublicKeysCreateOptionalParams, - SshPublicKeysCreateResponse, - SshPublicKeyUpdateResource, - SshPublicKeysUpdateOptionalParams, - SshPublicKeysUpdateResponse, - SshPublicKeysDeleteOptionalParams, - SshPublicKeysGenerateKeyPairOptionalParams, - SshPublicKeysGenerateKeyPairResponse, -} from "../models/index.js"; - -/// -/** Interface representing a SshPublicKeys. */ -export interface SshPublicKeys { - /** - * Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to - * get the next page of SSH public keys. - * @param options The options parameters. - */ - listBySubscription( - options?: SshPublicKeysListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the - * response to get the next page of SSH public keys. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: SshPublicKeysListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about an SSH public key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - sshPublicKeyName: string, - options?: SshPublicKeysGetOptionalParams, - ): Promise; - /** - * Creates a new SSH public key resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to create the SSH public key. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - sshPublicKeyName: string, - parameters: SshPublicKeyResource, - options?: SshPublicKeysCreateOptionalParams, - ): Promise; - /** - * Updates a new SSH public key resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param parameters Parameters supplied to update the SSH public key. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - sshPublicKeyName: string, - parameters: SshPublicKeyUpdateResource, - options?: SshPublicKeysUpdateOptionalParams, - ): Promise; - /** - * Delete an SSH public key. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - sshPublicKeyName: string, - options?: SshPublicKeysDeleteOptionalParams, - ): Promise; - /** - * Generates and returns a public/private key pair and populates the SSH public key resource with the - * public key. The length of the key will be 3072 bits. This operation can only be performed once per - * SSH public key resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param sshPublicKeyName The name of the SSH public key. - * @param options The options parameters. - */ - generateKeyPair( - resourceGroupName: string, - sshPublicKeyName: string, - options?: SshPublicKeysGenerateKeyPairOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/usageOperations.ts b/sdk/compute/arm-compute/src/operationsInterfaces/usageOperations.ts deleted file mode 100644 index 13222cb06d2b..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/usageOperations.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { Usage, UsageListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a UsageOperations. */ -export interface UsageOperations { - /** - * Gets, for the specified location, the current compute resource usage information as well as the - * limits for compute resources under the subscription. - * @param location The name of Azure region. - * @param options The options parameters. - */ - list(location: string, options?: UsageListOptionalParams): PagedAsyncIterableIterator; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts deleted file mode 100644 index c467cead3fd9..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { - VirtualMachineExtensionImagesListTypesOptionalParams, - VirtualMachineExtensionImagesListTypesResponse, - VirtualMachineExtensionImagesListVersionsOptionalParams, - VirtualMachineExtensionImagesListVersionsResponse, - VirtualMachineExtensionImagesGetOptionalParams, - VirtualMachineExtensionImagesGetResponse, -} from "../models/index.js"; - -/** Interface representing a VirtualMachineExtensionImages. */ -export interface VirtualMachineExtensionImages { - /** - * Gets a list of virtual machine extension image types. - * @param location The name of Azure region. - * @param publisherName - * @param options The options parameters. - */ - listTypes( - location: string, - publisherName: string, - options?: VirtualMachineExtensionImagesListTypesOptionalParams, - ): Promise; - /** - * Gets a list of virtual machine extension image versions. - * @param location The name of Azure region. - * @param publisherName - * @param typeParam - * @param options The options parameters. - */ - listVersions( - location: string, - publisherName: string, - typeParam: string, - options?: VirtualMachineExtensionImagesListVersionsOptionalParams, - ): Promise; - /** - * Gets a virtual machine extension image. - * @param location The name of Azure region. - * @param publisherName - * @param typeParam - * @param version - * @param options The options parameters. - */ - get( - location: string, - publisherName: string, - typeParam: string, - version: string, - options?: VirtualMachineExtensionImagesGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensions.ts deleted file mode 100644 index 7be367d4188e..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensions.ts +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachineExtensionsListOptionalParams, - VirtualMachineExtensionsListResponse, - VirtualMachineExtensionsGetOptionalParams, - VirtualMachineExtensionsGetResponse, - VirtualMachineExtension, - VirtualMachineExtensionsCreateOrUpdateOptionalParams, - VirtualMachineExtensionsCreateOrUpdateResponse, - VirtualMachineExtensionUpdate, - VirtualMachineExtensionsUpdateOptionalParams, - VirtualMachineExtensionsUpdateResponse, - VirtualMachineExtensionsDeleteOptionalParams, -} from "../models/index.js"; - -/** Interface representing a VirtualMachineExtensions. */ -export interface VirtualMachineExtensions { - /** - * The operation to get all extensions of a Virtual Machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - vmName: string, - options?: VirtualMachineExtensionsListOptionalParams, - ): Promise; - /** - * The operation to get the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - options?: VirtualMachineExtensionsGetOptionalParams, - ): Promise; - /** - * The operation to create or update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtension, - options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineExtensionsCreateOrUpdateResponse - > - >; - /** - * The operation to create or update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtension, - options?: VirtualMachineExtensionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtensionUpdate, - options?: VirtualMachineExtensionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineExtensionsUpdateResponse - > - >; - /** - * The operation to update the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - extensionParameters: VirtualMachineExtensionUpdate, - options?: VirtualMachineExtensionsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - options?: VirtualMachineExtensionsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmName: string, - vmExtensionName: string, - options?: VirtualMachineExtensionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImages.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImages.ts deleted file mode 100644 index fcdc9bf47a77..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImages.ts +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { - VirtualMachineImagesListByEdgeZoneOptionalParams, - VirtualMachineImagesListByEdgeZoneResponse, - VirtualMachineImagesListPublishersOptionalParams, - VirtualMachineImagesListPublishersResponse, - VirtualMachineImagesListOffersOptionalParams, - VirtualMachineImagesListOffersResponse, - VirtualMachineImagesListSkusOptionalParams, - VirtualMachineImagesListSkusResponse, - VirtualMachineImagesListOptionalParams, - VirtualMachineImagesListResponse, - VirtualMachineImagesGetOptionalParams, - VirtualMachineImagesGetResponse, - VirtualMachineImagesListWithPropertiesOptionalParams, - VirtualMachineImagesListWithPropertiesResponse, -} from "../models/index.js"; - -/** Interface representing a VirtualMachineImages. */ -export interface VirtualMachineImages { - /** - * Gets a list of all virtual machine image versions for the specified edge zone - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param options The options parameters. - */ - listByEdgeZone( - location: string, - edgeZone: string, - options?: VirtualMachineImagesListByEdgeZoneOptionalParams, - ): Promise; - /** - * Gets a list of virtual machine image publishers for the specified Azure location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - listPublishers( - location: string, - options?: VirtualMachineImagesListPublishersOptionalParams, - ): Promise; - /** - * Gets a list of virtual machine image offers for the specified location and publisher. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param options The options parameters. - */ - listOffers( - location: string, - publisherName: string, - options?: VirtualMachineImagesListOffersOptionalParams, - ): Promise; - /** - * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param options The options parameters. - */ - listSkus( - location: string, - publisherName: string, - offer: string, - options?: VirtualMachineImagesListSkusOptionalParams, - ): Promise; - /** - * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and - * SKU. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param options The options parameters. - */ - list( - location: string, - publisherName: string, - offer: string, - skus: string, - options?: VirtualMachineImagesListOptionalParams, - ): Promise; - /** - * Gets a virtual machine image. - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @param options The options parameters. - */ - get( - location: string, - publisherName: string, - offer: string, - skus: string, - version: string, - options?: VirtualMachineImagesGetOptionalParams, - ): Promise; - /** - * @param location The name of Azure region. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param expand The expand expression to apply on the operation. - * @param options The options parameters. - */ - listWithProperties( - location: string, - publisherName: string, - offer: string, - skus: string, - expand: string, - options?: VirtualMachineImagesListWithPropertiesOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImagesEdgeZone.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImagesEdgeZone.ts deleted file mode 100644 index 26877a915bad..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineImagesEdgeZone.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { - VirtualMachineImagesEdgeZoneListPublishersOptionalParams, - VirtualMachineImagesEdgeZoneListPublishersResponse, - VirtualMachineImagesEdgeZoneListOffersOptionalParams, - VirtualMachineImagesEdgeZoneListOffersResponse, - VirtualMachineImagesEdgeZoneListSkusOptionalParams, - VirtualMachineImagesEdgeZoneListSkusResponse, - VirtualMachineImagesEdgeZoneListOptionalParams, - VirtualMachineImagesEdgeZoneListResponse, - VirtualMachineImagesEdgeZoneGetOptionalParams, - VirtualMachineImagesEdgeZoneGetResponse, -} from "../models/index.js"; - -/** Interface representing a VirtualMachineImagesEdgeZone. */ -export interface VirtualMachineImagesEdgeZone { - /** - * Gets a list of virtual machine image publishers for the specified Azure location and edge zone. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param options The options parameters. - */ - listPublishers( - location: string, - edgeZone: string, - options?: VirtualMachineImagesEdgeZoneListPublishersOptionalParams, - ): Promise; - /** - * Gets a list of virtual machine image offers for the specified location, edge zone and publisher. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param options The options parameters. - */ - listOffers( - location: string, - edgeZone: string, - publisherName: string, - options?: VirtualMachineImagesEdgeZoneListOffersOptionalParams, - ): Promise; - /** - * Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and - * offer. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param options The options parameters. - */ - listSkus( - location: string, - edgeZone: string, - publisherName: string, - offer: string, - options?: VirtualMachineImagesEdgeZoneListSkusOptionalParams, - ): Promise; - /** - * Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, - * offer, and SKU. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param options The options parameters. - */ - list( - location: string, - edgeZone: string, - publisherName: string, - offer: string, - skus: string, - options?: VirtualMachineImagesEdgeZoneListOptionalParams, - ): Promise; - /** - * Gets a virtual machine image in an edge zone. - * @param location The name of Azure region. - * @param edgeZone The name of the edge zone. - * @param publisherName A valid image publisher. - * @param offer A valid image publisher offer. - * @param skus A valid image SKU. - * @param version A valid image SKU version. - * @param options The options parameters. - */ - get( - location: string, - edgeZone: string, - publisherName: string, - offer: string, - skus: string, - version: string, - options?: VirtualMachineImagesEdgeZoneGetOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineRunCommands.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineRunCommands.ts deleted file mode 100644 index 15d398b1a4f0..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineRunCommands.ts +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - RunCommandDocumentBase, - VirtualMachineRunCommandsListOptionalParams, - VirtualMachineRunCommand, - VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - VirtualMachineRunCommandsGetOptionalParams, - VirtualMachineRunCommandsGetResponse, - VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, - VirtualMachineRunCommandsGetByVirtualMachineResponse, - VirtualMachineRunCommandsCreateOrUpdateOptionalParams, - VirtualMachineRunCommandsCreateOrUpdateResponse, - VirtualMachineRunCommandUpdate, - VirtualMachineRunCommandsUpdateOptionalParams, - VirtualMachineRunCommandsUpdateResponse, - VirtualMachineRunCommandsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VirtualMachineRunCommands. */ -export interface VirtualMachineRunCommands { - /** - * Lists all available run commands for a subscription in a location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - list( - location: string, - options?: VirtualMachineRunCommandsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * The operation to get all run commands of a Virtual Machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param options The options parameters. - */ - listByVirtualMachine( - resourceGroupName: string, - vmName: string, - options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets specific run command for a subscription in a location. - * @param location The name of Azure region. - * @param commandId Specifies a commandId of predefined built-in script. Command IDs available for - * Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at - * https://aka.ms/RunCommandManagedWindows#available-commands. - * @param options The options parameters. - */ - get( - location: string, - commandId: string, - options?: VirtualMachineRunCommandsGetOptionalParams, - ): Promise; - /** - * The operation to get the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - getByVirtualMachine( - resourceGroupName: string, - vmName: string, - runCommandName: string, - options?: VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, - ): Promise; - /** - * The operation to create or update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineRunCommandsCreateOrUpdateResponse - > - >; - /** - * The operation to create or update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineRunCommandsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineRunCommandsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineRunCommandsUpdateResponse - > - >; - /** - * The operation to update the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Update Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmName: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineRunCommandsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmName: string, - runCommandName: string, - options?: VirtualMachineRunCommandsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete the run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the VirtualMachine - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmName: string, - runCommandName: string, - options?: VirtualMachineRunCommandsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetExtensions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetExtensions.ts deleted file mode 100644 index a8089b33fef6..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetExtensions.ts +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachineScaleSetExtension, - VirtualMachineScaleSetExtensionsListOptionalParams, - VirtualMachineScaleSetExtensionsGetOptionalParams, - VirtualMachineScaleSetExtensionsGetResponse, - VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetExtensionsCreateOrUpdateResponse, - VirtualMachineScaleSetExtensionUpdate, - VirtualMachineScaleSetExtensionsUpdateOptionalParams, - VirtualMachineScaleSetExtensionsUpdateResponse, - VirtualMachineScaleSetExtensionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VirtualMachineScaleSetExtensions. */ -export interface VirtualMachineScaleSetExtensions { - /** - * Gets a list of all extensions in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetExtensionsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * The operation to get the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - options?: VirtualMachineScaleSetExtensionsGetOptionalParams, - ): Promise; - /** - * The operation to create or update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtension, - options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetExtensionsCreateOrUpdateResponse - > - >; - /** - * The operation to create or update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Create VM scale set Extension operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtension, - options?: VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtensionUpdate, - options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetExtensionsUpdateResponse - > - >; - /** - * The operation to update an extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Parameters supplied to the Update VM scale set Extension operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - extensionParameters: VirtualMachineScaleSetExtensionUpdate, - options?: VirtualMachineScaleSetExtensionsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete the extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmssExtensionName The name of the VM scale set extension. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmssExtensionName: string, - options?: VirtualMachineScaleSetExtensionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetRollingUpgrades.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetRollingUpgrades.ts deleted file mode 100644 index 5c46c492a83d..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetRollingUpgrades.ts +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, - VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, - VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, - VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, - VirtualMachineScaleSetRollingUpgradesGetLatestResponse, -} from "../models/index.js"; - -/** Interface representing a VirtualMachineScaleSetRollingUpgrades. */ -export interface VirtualMachineScaleSetRollingUpgrades { - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the - * latest available extension version. Instances which are already running the latest extension - * versions are not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginStartExtensionUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, - ): Promise, void>>; - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the - * latest available extension version. Instances which are already running the latest extension - * versions are not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginStartExtensionUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOptionalParams, - ): Promise; - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available - * Platform Image OS version. Instances which are already running the latest available OS version are - * not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginStartOSUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, - ): Promise, void>>; - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available - * Platform Image OS version. Instances which are already running the latest available OS version are - * not affected. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginStartOSUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOptionalParams, - ): Promise; - /** - * Cancels the current virtual machine scale set rolling upgrade. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginCancel( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, - ): Promise, void>>; - /** - * Cancels the current virtual machine scale set rolling upgrade. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginCancelAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesCancelOptionalParams, - ): Promise; - /** - * Gets the status of the latest virtual machine scale set rolling upgrade. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - getLatest( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetRollingUpgradesGetLatestOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMExtensions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMExtensions.ts deleted file mode 100644 index 59c62ccc2fc8..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMExtensions.ts +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachineScaleSetVMExtensionsListOptionalParams, - VirtualMachineScaleSetVMExtensionsListResponse, - VirtualMachineScaleSetVMExtensionsGetOptionalParams, - VirtualMachineScaleSetVMExtensionsGetResponse, - VirtualMachineScaleSetVMExtension, - VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse, - VirtualMachineScaleSetVMExtensionUpdate, - VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, - VirtualMachineScaleSetVMExtensionsUpdateResponse, - VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, -} from "../models/index.js"; - -/** Interface representing a VirtualMachineScaleSetVMExtensions. */ -export interface VirtualMachineScaleSetVMExtensions { - /** - * The operation to get all extensions of an instance in Virtual Machine Scaleset. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMExtensionsListOptionalParams, - ): Promise; - /** - * The operation to get the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - options?: VirtualMachineScaleSetVMExtensionsGetOptionalParams, - ): Promise; - /** - * The operation to create or update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtension, - options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMExtensionsCreateOrUpdateResponse - > - >; - /** - * The operation to create or update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtension, - options?: VirtualMachineScaleSetVMExtensionsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, - options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMExtensionsUpdateResponse - > - >; - /** - * The operation to update the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Parameters supplied to the Update Virtual Machine Extension operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - extensionParameters: VirtualMachineScaleSetVMExtensionUpdate, - options?: VirtualMachineScaleSetVMExtensionsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete the VMSS VM extension. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - vmExtensionName: string, - options?: VirtualMachineScaleSetVMExtensionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMRunCommands.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMRunCommands.ts deleted file mode 100644 index 6c494ed16b69..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMRunCommands.ts +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachineRunCommand, - VirtualMachineScaleSetVMRunCommandsListOptionalParams, - VirtualMachineScaleSetVMRunCommandsGetOptionalParams, - VirtualMachineScaleSetVMRunCommandsGetResponse, - VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse, - VirtualMachineRunCommandUpdate, - VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, - VirtualMachineScaleSetVMRunCommandsUpdateResponse, - VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VirtualMachineScaleSetVMRunCommands. */ -export interface VirtualMachineScaleSetVMRunCommands { - /** - * The operation to get all run commands of an instance in Virtual Machine Scaleset. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param options The options parameters. - */ - list( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * The operation to get the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - options?: VirtualMachineScaleSetVMRunCommandsGetOptionalParams, - ): Promise; - /** - * The operation to create or update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse - > - >; - /** - * The operation to create or update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Parameters supplied to the Create Virtual Machine RunCommand operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommand, - options?: VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Resource create parameters. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMRunCommandsUpdateResponse - > - >; - /** - * The operation to update the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param runCommand Resource create parameters. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - runCommand: VirtualMachineRunCommandUpdate, - options?: VirtualMachineScaleSetVMRunCommandsUpdateOptionalParams, - ): Promise; - /** - * The operation to delete the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete the VMSS VM run command. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VirtualMachineScaleSet - * @param instanceId The name of the VirtualMachineScaleSetVM - * @param runCommandName The name of the VirtualMachineRunCommand - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - runCommandName: string, - options?: VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMs.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMs.ts deleted file mode 100644 index 46be8328474d..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSetVMs.ts +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachineScaleSetVM, - VirtualMachineScaleSetVMsListOptionalParams, - VirtualMachineScaleSetVMsGetOptionalParams, - VirtualMachineScaleSetVMsGetResponse, - VirtualMachineScaleSetVMsUpdateOptionalParams, - VirtualMachineScaleSetVMsUpdateResponse, - VirtualMachineScaleSetVMsDeleteOptionalParams, - VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, - VirtualMachineScaleSetVMsApproveRollingUpgradeResponse, - AttachDetachDataDisksRequest, - VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, - VirtualMachineScaleSetVMsAttachDetachDataDisksResponse, - VirtualMachineScaleSetVMsDeallocateOptionalParams, - VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, - VirtualMachineScaleSetVMsGetInstanceViewResponse, - VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, - VirtualMachineScaleSetVMsPowerOffOptionalParams, - VirtualMachineScaleSetVMsRedeployOptionalParams, - VirtualMachineScaleSetVMsReimageOptionalParams, - VirtualMachineScaleSetVMsReimageAllOptionalParams, - VirtualMachineScaleSetVMsRestartOptionalParams, - VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, - VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataResponse, - RunCommandInput, - VirtualMachineScaleSetVMsRunCommandOptionalParams, - VirtualMachineScaleSetVMsRunCommandResponse, - VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, - VirtualMachineScaleSetVMsStartOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VirtualMachineScaleSetVMs. */ -export interface VirtualMachineScaleSetVMs { - /** - * Gets a list of all virtual machines in a VM scale sets. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param virtualMachineScaleSetName The name of the VirtualMachineScaleSet - * @param options The options parameters. - */ - list( - resourceGroupName: string, - virtualMachineScaleSetName: string, - options?: VirtualMachineScaleSetVMsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsGetOptionalParams, - ): Promise; - /** - * Updates a virtual machine of a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: VirtualMachineScaleSetVM, - options?: VirtualMachineScaleSetVMsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsUpdateResponse - > - >; - /** - * Updates a virtual machine of a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine Scale Sets VM operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: VirtualMachineScaleSetVM, - options?: VirtualMachineScaleSetVMsUpdateOptionalParams, - ): Promise; - /** - * Deletes a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeleteOptionalParams, - ): Promise; - /** - * Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginApproveRollingUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsApproveRollingUpgradeResponse - > - >; - /** - * Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginApproveRollingUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsApproveRollingUpgradeOptionalParams, - ): Promise; - /** - * Attach and detach data disks to/from a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on a Virtual - * Machine Scale Sets VM. - * @param options The options parameters. - */ - beginAttachDetachDataDisks( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsAttachDetachDataDisksResponse - > - >; - /** - * Attach and detach data disks to/from a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on a Virtual - * Machine Scale Sets VM. - * @param options The options parameters. - */ - beginAttachDetachDataDisksAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachineScaleSetVMsAttachDetachDataDisksOptionalParams, - ): Promise; - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - * releases the compute resources it uses. You are not billed for the compute resources of this virtual - * machine once it is deallocated. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginDeallocate( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, - ): Promise, void>>; - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and - * releases the compute resources it uses. You are not billed for the compute resources of this virtual - * machine once it is deallocated. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginDeallocateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsDeallocateOptionalParams, - ): Promise; - /** - * Gets the status of a virtual machine from a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - getInstanceView( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, - ): Promise; - /** - * Performs maintenance on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginPerformMaintenance( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, - ): Promise, void>>; - /** - * Performs maintenance on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginPerformMaintenanceAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPerformMaintenanceOptionalParams, - ): Promise; - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid - * charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginPowerOff( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, - ): Promise, void>>; - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid - * charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginPowerOffAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsPowerOffOptionalParams, - ): Promise; - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers - * it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginRedeploy( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRedeployOptionalParams, - ): Promise, void>>; - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers - * it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginRedeployAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRedeployOptionalParams, - ): Promise; - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginReimage( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageOptionalParams, - ): Promise, void>>; - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginReimageAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageOptionalParams, - ): Promise; - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginReimageAll( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, - ): Promise, void>>; - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginReimageAllAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsReimageAllOptionalParams, - ): Promise; - /** - * Restarts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginRestart( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRestartOptionalParams, - ): Promise, void>>; - /** - * Restarts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginRestartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRestartOptionalParams, - ): Promise; - /** - * The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - retrieveBootDiagnosticsData( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, - ): Promise; - /** - * Run command on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - beginRunCommand( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: RunCommandInput, - options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetVMsRunCommandResponse - > - >; - /** - * Run command on a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - beginRunCommandAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - parameters: RunCommandInput, - options?: VirtualMachineScaleSetVMsRunCommandOptionalParams, - ): Promise; - /** - * The operation to simulate the eviction of spot virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - simulateEviction( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsSimulateEvictionOptionalParams, - ): Promise; - /** - * Starts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginStart( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsStartOptionalParams, - ): Promise, void>>; - /** - * Starts a virtual machine in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param options The options parameters. - */ - beginStartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - instanceId: string, - options?: VirtualMachineScaleSetVMsStartOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSets.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSets.ts deleted file mode 100644 index c90b04f80d1f..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineScaleSets.ts +++ /dev/null @@ -1,589 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachineScaleSet, - VirtualMachineScaleSetsListByLocationOptionalParams, - VirtualMachineScaleSetsListAllOptionalParams, - VirtualMachineScaleSetsListOptionalParams, - UpgradeOperationHistoricalStatusInfo, - VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - VirtualMachineScaleSetSku, - VirtualMachineScaleSetsListSkusOptionalParams, - VirtualMachineScaleSetsGetOptionalParams, - VirtualMachineScaleSetsGetResponse, - VirtualMachineScaleSetsCreateOrUpdateOptionalParams, - VirtualMachineScaleSetsCreateOrUpdateResponse, - VirtualMachineScaleSetUpdate, - VirtualMachineScaleSetsUpdateOptionalParams, - VirtualMachineScaleSetsUpdateResponse, - VirtualMachineScaleSetsDeleteOptionalParams, - VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, - VirtualMachineScaleSetsApproveRollingUpgradeResponse, - VMScaleSetConvertToSinglePlacementGroupInput, - VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, - VirtualMachineScaleSetsDeallocateOptionalParams, - VirtualMachineScaleSetVMInstanceRequiredIDs, - VirtualMachineScaleSetsDeleteInstancesOptionalParams, - VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, - VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, - VirtualMachineScaleSetsGetInstanceViewOptionalParams, - VirtualMachineScaleSetsGetInstanceViewResponse, - VirtualMachineScaleSetsUpdateInstancesOptionalParams, - VirtualMachineScaleSetsPerformMaintenanceOptionalParams, - VirtualMachineScaleSetsPowerOffOptionalParams, - VirtualMachineScaleSetsReapplyOptionalParams, - VirtualMachineScaleSetsRedeployOptionalParams, - VirtualMachineScaleSetsReimageOptionalParams, - VirtualMachineScaleSetsReimageAllOptionalParams, - VirtualMachineScaleSetsRestartOptionalParams, - VMScaleSetScaleOutInput, - VirtualMachineScaleSetsScaleOutOptionalParams, - OrchestrationServiceStateInput, - VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, - VirtualMachineScaleSetsStartOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VirtualMachineScaleSets. */ -export interface VirtualMachineScaleSets { - /** - * Gets all the VM scale sets under the specified subscription for the specified location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - listByLocation( - location: string, - options?: VirtualMachineScaleSetsListByLocationOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. - * Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink - * is null to fetch all the VM Scale Sets. - * @param options The options parameters. - */ - listAll( - options?: VirtualMachineScaleSetsListAllOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a list of all VM scale sets under a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - options?: VirtualMachineScaleSetsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets list of OS upgrades on a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - listOSUpgradeHistory( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances - * allowed for each SKU. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - listSkus( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsListSkusOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Display information about a virtual machine scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOptionalParams, - ): Promise; - /** - * Create or update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSet, - options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetsCreateOrUpdateResponse - > - >; - /** - * Create or update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSet, - options?: VirtualMachineScaleSetsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSetUpdate, - options?: VirtualMachineScaleSetsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetsUpdateResponse - > - >; - /** - * Update a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The scale set object. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VirtualMachineScaleSetUpdate, - options?: VirtualMachineScaleSetsUpdateOptionalParams, - ): Promise; - /** - * Deletes a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeleteOptionalParams, - ): Promise; - /** - * Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginApproveRollingUpgrade( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachineScaleSetsApproveRollingUpgradeResponse - > - >; - /** - * Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginApproveRollingUpgradeAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsApproveRollingUpgradeOptionalParams, - ): Promise; - /** - * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for ConvertToSinglePlacementGroup API. - * @param options The options parameters. - */ - convertToSinglePlacementGroup( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VMScaleSetConvertToSinglePlacementGroupInput, - options?: VirtualMachineScaleSetsConvertToSinglePlacementGroupOptionalParams, - ): Promise; - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - * releases the compute resources. You are not billed for the compute resources that this virtual - * machine scale set deallocates. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginDeallocate( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeallocateOptionalParams, - ): Promise, void>>; - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and - * releases the compute resources. You are not billed for the compute resources that this virtual - * machine scale set deallocates. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginDeallocateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsDeallocateOptionalParams, - ): Promise; - /** - * Deletes virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - beginDeleteInstances( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, - ): Promise, void>>; - /** - * Deletes virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - beginDeleteInstancesAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsDeleteInstancesOptionalParams, - ): Promise; - /** - * Manual platform update domain walk to update virtual machines in a service fabric virtual machine - * scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested - * @param options The options parameters. - */ - forceRecoveryServiceFabricPlatformUpdateDomainWalk( - resourceGroupName: string, - vmScaleSetName: string, - platformUpdateDomain: number, - options?: VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkOptionalParams, - ): Promise; - /** - * Gets the status of a VM scale set instance. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - getInstanceView( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetInstanceViewOptionalParams, - ): Promise; - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - beginUpdateInstances( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, - ): Promise, void>>; - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param vmInstanceIDs A list of virtual machine instance IDs from the VM scale set. - * @param options The options parameters. - */ - beginUpdateInstancesAndWait( - resourceGroupName: string, - vmScaleSetName: string, - vmInstanceIDs: VirtualMachineScaleSetVMInstanceRequiredIDs, - options?: VirtualMachineScaleSetsUpdateInstancesOptionalParams, - ): Promise; - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which - * are not eligible for perform maintenance will be failed. Please refer to best practices for more - * details: - * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginPerformMaintenance( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, - ): Promise, void>>; - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which - * are not eligible for perform maintenance will be failed. Please refer to best practices for more - * details: - * https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginPerformMaintenanceAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPerformMaintenanceOptionalParams, - ): Promise; - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - * attached and you are getting charged for the resources. Instead, use deallocate to release resources - * and avoid charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginPowerOff( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPowerOffOptionalParams, - ): Promise, void>>; - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still - * attached and you are getting charged for the resources. Instead, use deallocate to release resources - * and avoid charges. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginPowerOffAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsPowerOffOptionalParams, - ): Promise; - /** - * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginReapply( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReapplyOptionalParams, - ): Promise, void>>; - /** - * Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginReapplyAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReapplyOptionalParams, - ): Promise; - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and - * powers them back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginRedeploy( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRedeployOptionalParams, - ): Promise, void>>; - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and - * powers them back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginRedeployAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRedeployOptionalParams, - ): Promise; - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't - * have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is - * reset to initial state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginReimage( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageOptionalParams, - ): Promise, void>>; - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't - * have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is - * reset to initial state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginReimageAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageOptionalParams, - ): Promise; - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginReimageAll( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageAllOptionalParams, - ): Promise, void>>; - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This - * operation is only supported for managed disks. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginReimageAllAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsReimageAllOptionalParams, - ): Promise; - /** - * Restarts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginRestart( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRestartOptionalParams, - ): Promise, void>>; - /** - * Restarts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginRestartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsRestartOptionalParams, - ): Promise; - /** - * Scales out one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for ScaleOut API. - * @param options The options parameters. - */ - beginScaleOut( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VMScaleSetScaleOutInput, - options?: VirtualMachineScaleSetsScaleOutOptionalParams, - ): Promise, void>>; - /** - * Scales out one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for ScaleOut API. - * @param options The options parameters. - */ - beginScaleOutAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: VMScaleSetScaleOutInput, - options?: VirtualMachineScaleSetsScaleOutOptionalParams, - ): Promise; - /** - * Changes ServiceState property for a given service - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param options The options parameters. - */ - beginSetOrchestrationServiceState( - resourceGroupName: string, - vmScaleSetName: string, - parameters: OrchestrationServiceStateInput, - options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, - ): Promise, void>>; - /** - * Changes ServiceState property for a given service - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param parameters The input object for SetOrchestrationServiceState API. - * @param options The options parameters. - */ - beginSetOrchestrationServiceStateAndWait( - resourceGroupName: string, - vmScaleSetName: string, - parameters: OrchestrationServiceStateInput, - options?: VirtualMachineScaleSetsSetOrchestrationServiceStateOptionalParams, - ): Promise; - /** - * Starts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginStart( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsStartOptionalParams, - ): Promise, void>>; - /** - * Starts one or more virtual machines in a VM scale set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmScaleSetName The name of the VM scale set. - * @param options The options parameters. - */ - beginStartAndWait( - resourceGroupName: string, - vmScaleSetName: string, - options?: VirtualMachineScaleSetsStartOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineSizes.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineSizes.ts deleted file mode 100644 index caaffcc41a4c..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineSizes.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { VirtualMachineSize, VirtualMachineSizesListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a VirtualMachineSizes. */ -export interface VirtualMachineSizes { - /** - * This API is deprecated. Use [Resources - * Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) - * @param location The name of Azure region. - * @param options The options parameters. - */ - list( - location: string, - options?: VirtualMachineSizesListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachines.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachines.ts deleted file mode 100644 index 48f6c6a7e28d..000000000000 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachines.ts +++ /dev/null @@ -1,634 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import type { PagedAsyncIterableIterator } from "@azure/core-paging"; -import type { SimplePollerLike, OperationState } from "@azure/core-lro"; -import type { - VirtualMachine, - VirtualMachinesListByLocationOptionalParams, - VirtualMachinesListAllOptionalParams, - VirtualMachinesListOptionalParams, - VirtualMachineSize, - VirtualMachinesListAvailableSizesOptionalParams, - VirtualMachinesGetOptionalParams, - VirtualMachinesGetResponse, - VirtualMachinesCreateOrUpdateOptionalParams, - VirtualMachinesCreateOrUpdateResponse, - VirtualMachineUpdate, - VirtualMachinesUpdateOptionalParams, - VirtualMachinesUpdateResponse, - VirtualMachinesDeleteOptionalParams, - VirtualMachinesAssessPatchesOptionalParams, - VirtualMachinesAssessPatchesResponse, - AttachDetachDataDisksRequest, - VirtualMachinesAttachDetachDataDisksOptionalParams, - VirtualMachinesAttachDetachDataDisksResponse, - VirtualMachineCaptureParameters, - VirtualMachinesCaptureOptionalParams, - VirtualMachinesCaptureResponse, - VirtualMachinesConvertToManagedDisksOptionalParams, - VirtualMachinesDeallocateOptionalParams, - VirtualMachinesGeneralizeOptionalParams, - VirtualMachineInstallPatchesParameters, - VirtualMachinesInstallPatchesOptionalParams, - VirtualMachinesInstallPatchesResponse, - VirtualMachinesInstanceViewOptionalParams, - VirtualMachinesInstanceViewResponse, - VirtualMachinesMigrateToVMScaleSetOptionalParams, - VirtualMachinesMigrateToVMScaleSetResponse, - VirtualMachinesPerformMaintenanceOptionalParams, - VirtualMachinesPowerOffOptionalParams, - VirtualMachinesReapplyOptionalParams, - VirtualMachinesRedeployOptionalParams, - VirtualMachinesReimageOptionalParams, - VirtualMachinesRestartOptionalParams, - VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, - VirtualMachinesRetrieveBootDiagnosticsDataResponse, - RunCommandInput, - VirtualMachinesRunCommandOptionalParams, - VirtualMachinesRunCommandResponse, - VirtualMachinesSimulateEvictionOptionalParams, - VirtualMachinesStartOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a VirtualMachines. */ -export interface VirtualMachines { - /** - * Gets all the virtual machines under the specified subscription for the specified location. - * @param location The name of Azure region. - * @param options The options parameters. - */ - listByLocation( - location: string, - options?: VirtualMachinesListByLocationOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the - * response to get the next page of virtual machines. - * @param options The options parameters. - */ - listAll( - options?: VirtualMachinesListAllOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the - * response to get the next page of virtual machines. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - options?: VirtualMachinesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - listAvailableSizes( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesListAvailableSizesOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Retrieves information about the model view or the instance view of a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesGetOptionalParams, - ): Promise; - /** - * The operation to create or update a virtual machine. Please note some properties can be set only - * during virtual machine creation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachine, - options?: VirtualMachinesCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesCreateOrUpdateResponse - > - >; - /** - * The operation to create or update a virtual machine. Please note some properties can be set only - * during virtual machine creation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Create Virtual Machine operation. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachine, - options?: VirtualMachinesCreateOrUpdateOptionalParams, - ): Promise; - /** - * The operation to update a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineUpdate, - options?: VirtualMachinesUpdateOptionalParams, - ): Promise< - SimplePollerLike, VirtualMachinesUpdateResponse> - >; - /** - * The operation to update a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineUpdate, - options?: VirtualMachinesUpdateOptionalParams, - ): Promise; - /** - * The operation to delete a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeleteOptionalParams, - ): Promise, void>>; - /** - * The operation to delete a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeleteOptionalParams, - ): Promise; - /** - * Assess patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginAssessPatches( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesAssessPatchesOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesAssessPatchesResponse - > - >; - /** - * Assess patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginAssessPatchesAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesAssessPatchesOptionalParams, - ): Promise; - /** - * Attach and detach data disks to/from the virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on the virtual - * machine. - * @param options The options parameters. - */ - beginAttachDetachDataDisks( - resourceGroupName: string, - vmName: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachinesAttachDetachDataDisksOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesAttachDetachDataDisksResponse - > - >; - /** - * Attach and detach data disks to/from the virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the attach and detach data disks operation on the virtual - * machine. - * @param options The options parameters. - */ - beginAttachDetachDataDisksAndWait( - resourceGroupName: string, - vmName: string, - parameters: AttachDetachDataDisksRequest, - options?: VirtualMachinesAttachDetachDataDisksOptionalParams, - ): Promise; - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to - * create similar VMs. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param options The options parameters. - */ - beginCapture( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineCaptureParameters, - options?: VirtualMachinesCaptureOptionalParams, - ): Promise< - SimplePollerLike, VirtualMachinesCaptureResponse> - >; - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to - * create similar VMs. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Capture Virtual Machine operation. - * @param options The options parameters. - */ - beginCaptureAndWait( - resourceGroupName: string, - vmName: string, - parameters: VirtualMachineCaptureParameters, - options?: VirtualMachinesCaptureOptionalParams, - ): Promise; - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be - * stop-deallocated before invoking this operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginConvertToManagedDisks( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesConvertToManagedDisksOptionalParams, - ): Promise, void>>; - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be - * stop-deallocated before invoking this operation. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginConvertToManagedDisksAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesConvertToManagedDisksOptionalParams, - ): Promise; - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the - * compute resources that this virtual machine uses. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginDeallocate( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeallocateOptionalParams, - ): Promise, void>>; - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the - * compute resources that this virtual machine uses. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginDeallocateAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesDeallocateOptionalParams, - ): Promise; - /** - * Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual - * machine before performing this operation. For Windows, please refer to [Create a managed image of a - * generalized VM in - * Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource). For Linux, - * please refer to [How to create an image of a virtual machine or - * VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - generalize( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesGeneralizeOptionalParams, - ): Promise; - /** - * Installs patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API - * @param options The options parameters. - */ - beginInstallPatches( - resourceGroupName: string, - vmName: string, - installPatchesInput: VirtualMachineInstallPatchesParameters, - options?: VirtualMachinesInstallPatchesOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesInstallPatchesResponse - > - >; - /** - * Installs patches on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param installPatchesInput Input for InstallPatches as directly received by the API - * @param options The options parameters. - */ - beginInstallPatchesAndWait( - resourceGroupName: string, - vmName: string, - installPatchesInput: VirtualMachineInstallPatchesParameters, - options?: VirtualMachinesInstallPatchesOptionalParams, - ): Promise; - /** - * Retrieves information about the run-time state of a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - instanceView( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesInstanceViewOptionalParams, - ): Promise; - /** - * Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginMigrateToVMScaleSet( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesMigrateToVMScaleSetResponse - > - >; - /** - * Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginMigrateToVMScaleSetAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesMigrateToVMScaleSetOptionalParams, - ): Promise; - /** - * The operation to perform maintenance on a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginPerformMaintenance( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPerformMaintenanceOptionalParams, - ): Promise, void>>; - /** - * The operation to perform maintenance on a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginPerformMaintenanceAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPerformMaintenanceOptionalParams, - ): Promise; - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the - * same provisioned resources. You are still charged for this virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginPowerOff( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPowerOffOptionalParams, - ): Promise, void>>; - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the - * same provisioned resources. You are still charged for this virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginPowerOffAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesPowerOffOptionalParams, - ): Promise; - /** - * The operation to reapply a virtual machine's state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginReapply( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReapplyOptionalParams, - ): Promise, void>>; - /** - * The operation to reapply a virtual machine's state. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginReapplyAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReapplyOptionalParams, - ): Promise; - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginRedeploy( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRedeployOptionalParams, - ): Promise, void>>; - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginRedeployAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRedeployOptionalParams, - ): Promise; - /** - * Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for - * virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: - * The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is - * detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk - * will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before - * performing the reimage. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginReimage( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReimageOptionalParams, - ): Promise, void>>; - /** - * Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for - * virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: - * The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is - * detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk - * will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before - * performing the reimage. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginReimageAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesReimageOptionalParams, - ): Promise; - /** - * The operation to restart a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginRestart( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRestartOptionalParams, - ): Promise, void>>; - /** - * The operation to restart a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginRestartAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRestartOptionalParams, - ): Promise; - /** - * The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - retrieveBootDiagnosticsData( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesRetrieveBootDiagnosticsDataOptionalParams, - ): Promise; - /** - * Run command on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - beginRunCommand( - resourceGroupName: string, - vmName: string, - parameters: RunCommandInput, - options?: VirtualMachinesRunCommandOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - VirtualMachinesRunCommandResponse - > - >; - /** - * Run command on the VM. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param parameters Parameters supplied to the Run command operation. - * @param options The options parameters. - */ - beginRunCommandAndWait( - resourceGroupName: string, - vmName: string, - parameters: RunCommandInput, - options?: VirtualMachinesRunCommandOptionalParams, - ): Promise; - /** - * The operation to simulate the eviction of spot virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - simulateEviction( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesSimulateEvictionOptionalParams, - ): Promise; - /** - * The operation to start a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginStart( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesStartOptionalParams, - ): Promise, void>>; - /** - * The operation to start a virtual machine. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vmName The name of the virtual machine. - * @param options The options parameters. - */ - beginStartAndWait( - resourceGroupName: string, - vmName: string, - options?: VirtualMachinesStartOptionalParams, - ): Promise; -} diff --git a/sdk/compute/arm-compute/src/pagingHelper.ts b/sdk/compute/arm-compute/src/pagingHelper.ts deleted file mode 100644 index f64c4c8390ed..000000000000 --- a/sdk/compute/arm-compute/src/pagingHelper.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/compute/arm-compute/src/restorePollerHelpers.ts b/sdk/compute/arm-compute/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..0f7da83a8cee --- /dev/null +++ b/sdk/compute/arm-compute/src/restorePollerHelpers.ts @@ -0,0 +1,798 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ComputeManagementClient } from "./computeManagementClient.js"; +import { _updateDeserialize } from "./api/gallerySharingProfile/operations.js"; +import { + _revokeAccessDeserialize, + _grantAccessDeserialize, +} from "./api/diskRestorePoint/operations.js"; +import { + _exportThrottledRequestsDeserialize, + _exportRequestRateByIntervalDeserialize, +} from "./api/logAnalytics/operations.js"; +import { + _runCommandDeserialize, + _startDeserialize, + _restartDeserialize, + _redeployDeserialize, + _powerOffDeserialize, + _performMaintenanceDeserialize, + _attachDetachDataDisksDeserialize, + _reimageAllDeserialize, + _reimageDeserialize, + _deallocateDeserialize, + _approveRollingUpgradeDeserialize, + _$deleteDeserialize, + _updateDeserialize as _updateDeserializeVirtualMachineScaleSetVMs, +} from "./api/virtualMachineScaleSetVMs/operations.js"; +import { + _cancelDeserialize, + _startOSUpgradeDeserialize, + _startExtensionUpgradeDeserialize, +} from "./api/virtualMachineScaleSetRollingUpgrades/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryInVMAccessControlProfileVersions, + _updateDeserialize as _updateDeserializeGalleryInVMAccessControlProfileVersions, + _createOrUpdateDeserialize, +} from "./api/galleryInVMAccessControlProfileVersions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryInVMAccessControlProfiles, + _updateDeserialize as _updateDeserializeGalleryInVMAccessControlProfiles, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryInVMAccessControlProfiles, +} from "./api/galleryInVMAccessControlProfiles/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryScriptVersions, + _updateDeserialize as _updateDeserializeGalleryScriptVersions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryScriptVersions, +} from "./api/galleryScriptVersions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryScripts, + _updateDeserialize as _updateDeserializeGalleryScripts, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryScripts, +} from "./api/galleryScripts/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryApplicationVersions, + _updateDeserialize as _updateDeserializeGalleryApplicationVersions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryApplicationVersions, +} from "./api/galleryApplicationVersions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryApplications, + _updateDeserialize as _updateDeserializeGalleryApplications, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryApplications, +} from "./api/galleryApplications/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryImageVersions, + _updateDeserialize as _updateDeserializeGalleryImageVersions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryImageVersions, +} from "./api/galleryImageVersions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleryImages, + _updateDeserialize as _updateDeserializeGalleryImages, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleryImages, +} from "./api/galleryImages/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeGalleries, + _updateDeserialize as _updateDeserializeGalleries, + _createOrUpdateDeserialize as _createOrUpdateDeserializeGalleries, +} from "./api/galleries/operations.js"; +import { + _revokeAccessDeserialize as _revokeAccessDeserializeSnapshots, + _grantAccessDeserialize as _grantAccessDeserializeSnapshots, + _$deleteDeserialize as _$deleteDeserializeSnapshots, + _updateDeserialize as _updateDeserializeSnapshots, + _createOrUpdateDeserialize as _createOrUpdateDeserializeSnapshots, +} from "./api/snapshots/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeDiskEncryptionSets, + _updateDeserialize as _updateDeserializeDiskEncryptionSets, + _createOrUpdateDeserialize as _createOrUpdateDeserializeDiskEncryptionSets, +} from "./api/diskEncryptionSets/operations.js"; +import { + _deleteAPrivateEndpointConnectionDeserialize, + _updateAPrivateEndpointConnectionDeserialize, + _$deleteDeserialize as _$deleteDeserializeDiskAccesses, + _updateDeserialize as _updateDeserializeDiskAccesses, + _createOrUpdateDeserialize as _createOrUpdateDeserializeDiskAccesses, +} from "./api/diskAccesses/operations.js"; +import { + _revokeAccessDeserialize as _revokeAccessDeserializeDisks, + _grantAccessDeserialize as _grantAccessDeserializeDisks, + _$deleteDeserialize as _$deleteDeserializeDisks, + _updateDeserialize as _updateDeserializeDisks, + _createOrUpdateDeserialize as _createOrUpdateDeserializeDisks, +} from "./api/disks/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeVirtualMachineScaleSetVMRunCommands, + _updateDeserialize as _updateDeserializeVirtualMachineScaleSetVMRunCommands, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualMachineScaleSetVMRunCommands, +} from "./api/virtualMachineScaleSetVMRunCommands/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeVirtualMachineRunCommands, + _updateDeserialize as _updateDeserializeVirtualMachineRunCommands, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualMachineRunCommands, +} from "./api/virtualMachineRunCommands/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeCapacityReservations, + _updateDeserialize as _updateDeserializeCapacityReservations, + _createOrUpdateDeserialize as _createOrUpdateDeserializeCapacityReservations, +} from "./api/capacityReservations/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeRestorePoints, + _createDeserialize, +} from "./api/restorePoints/operations.js"; +import { _$deleteDeserialize as _$deleteDeserializeRestorePointCollections } from "./api/restorePointCollections/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeImages, + _updateDeserialize as _updateDeserializeImages, + _createOrUpdateDeserialize as _createOrUpdateDeserializeImages, +} from "./api/images/operations.js"; +import { + _restartDeserialize as _restartDeserializeDedicatedHosts, + _redeployDeserialize as _redeployDeserializeDedicatedHosts, + _$deleteDeserialize as _$deleteDeserializeDedicatedHosts, + _updateDeserialize as _updateDeserializeDedicatedHosts, + _createOrUpdateDeserialize as _createOrUpdateDeserializeDedicatedHosts, +} from "./api/dedicatedHosts/operations.js"; +import { _convertToVirtualMachineScaleSetDeserialize } from "./api/availabilitySets/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeVirtualMachineExtensions, + _updateDeserialize as _updateDeserializeVirtualMachineExtensions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualMachineExtensions, +} from "./api/virtualMachineExtensions/operations.js"; +import { + _migrateToVMScaleSetDeserialize, + _runCommandDeserialize as _runCommandDeserializeVirtualMachines, + _startDeserialize as _startDeserializeVirtualMachines, + _restartDeserialize as _restartDeserializeVirtualMachines, + _reimageDeserialize as _reimageDeserializeVirtualMachines, + _redeployDeserialize as _redeployDeserializeVirtualMachines, + _reapplyDeserialize, + _powerOffDeserialize as _powerOffDeserializeVirtualMachines, + _performMaintenanceDeserialize as _performMaintenanceDeserializeVirtualMachines, + _installPatchesDeserialize, + _deallocateDeserialize as _deallocateDeserializeVirtualMachines, + _convertToManagedDisksDeserialize, + _captureDeserialize, + _attachDetachDataDisksDeserialize as _attachDetachDataDisksDeserializeVirtualMachines, + _assessPatchesDeserialize, + _$deleteDeserialize as _$deleteDeserializeVirtualMachines, + _updateDeserialize as _updateDeserializeVirtualMachines, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualMachines, +} from "./api/virtualMachines/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeVirtualMachineScaleSetVMExtensions, + _updateDeserialize as _updateDeserializeVirtualMachineScaleSetVMExtensions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualMachineScaleSetVMExtensions, +} from "./api/virtualMachineScaleSetVMExtensions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeVirtualMachineScaleSetExtensions, + _updateDeserialize as _updateDeserializeVirtualMachineScaleSetExtensions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualMachineScaleSetExtensions, +} from "./api/virtualMachineScaleSetExtensions/operations.js"; +import { + _scaleOutDeserialize, + _startDeserialize as _startDeserializeVirtualMachineScaleSets, + _setOrchestrationServiceStateDeserialize, + _restartDeserialize as _restartDeserializeVirtualMachineScaleSets, + _reimageAllDeserialize as _reimageAllDeserializeVirtualMachineScaleSets, + _reimageDeserialize as _reimageDeserializeVirtualMachineScaleSets, + _redeployDeserialize as _redeployDeserializeVirtualMachineScaleSets, + _reapplyDeserialize as _reapplyDeserializeVirtualMachineScaleSets, + _powerOffDeserialize as _powerOffDeserializeVirtualMachineScaleSets, + _performMaintenanceDeserialize as _performMaintenanceDeserializeVirtualMachineScaleSets, + _updateInstancesDeserialize, + _deleteInstancesDeserialize, + _deallocateDeserialize as _deallocateDeserializeVirtualMachineScaleSets, + _approveRollingUpgradeDeserialize as _approveRollingUpgradeDeserializeVirtualMachineScaleSets, + _$deleteDeserialize as _$deleteDeserializeVirtualMachineScaleSets, + _updateDeserialize as _updateDeserializeVirtualMachineScaleSets, + _createOrUpdateDeserialize as _createOrUpdateDeserializeVirtualMachineScaleSets, +} from "./api/virtualMachineScaleSets/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: ComputeManagementClient, + 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.Compute/galleries/{galleryName}/share": + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess": + { deserializer: _revokeAccessDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess": + { deserializer: _grantAccessDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests": + { deserializer: _exportThrottledRequestsDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval": + { + deserializer: _exportRequestRateByIntervalDeserialize, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommand": + { deserializer: _runCommandDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/start": + { deserializer: _startDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/restart": + { deserializer: _restartDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/redeploy": + { deserializer: _redeployDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/powerOff": + { deserializer: _powerOffDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/performMaintenance": + { deserializer: _performMaintenanceDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/attachDetachDataDisks": + { deserializer: _attachDetachDataDisksDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall": + { deserializer: _reimageAllDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage": + { deserializer: _reimageDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate": + { deserializer: _deallocateDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/approveRollingUpgrade": + { deserializer: _approveRollingUpgradeDeserialize, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}": + { deserializer: _$deleteDeserialize, expectedStatuses: ["200", "202", "204"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}": + { + deserializer: _updateDeserializeVirtualMachineScaleSetVMs, + expectedStatuses: ["200", "202", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel": + { deserializer: _cancelDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade": + { deserializer: _startOSUpgradeDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade": + { deserializer: _startExtensionUpgradeDeserialize, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}": + { + deserializer: _$deleteDeserializeGalleryInVMAccessControlProfileVersions, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}": + { + deserializer: _updateDeserializeGalleryInVMAccessControlProfileVersions, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}": + { deserializer: _createOrUpdateDeserialize, expectedStatuses: ["200", "201", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}": + { + deserializer: _$deleteDeserializeGalleryInVMAccessControlProfiles, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}": + { + deserializer: _updateDeserializeGalleryInVMAccessControlProfiles, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}": + { + deserializer: _createOrUpdateDeserializeGalleryInVMAccessControlProfiles, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}": + { + deserializer: _$deleteDeserializeGalleryScriptVersions, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}": + { + deserializer: _updateDeserializeGalleryScriptVersions, + expectedStatuses: ["200", "202", "201"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}": + { + deserializer: _createOrUpdateDeserializeGalleryScriptVersions, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}": + { deserializer: _$deleteDeserializeGalleryScripts, expectedStatuses: ["202", "204", "200"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}": + { deserializer: _updateDeserializeGalleryScripts, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}": + { + deserializer: _createOrUpdateDeserializeGalleryScripts, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}": + { + deserializer: _$deleteDeserializeGalleryApplicationVersions, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}": + { + deserializer: _updateDeserializeGalleryApplicationVersions, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}": + { + deserializer: _createOrUpdateDeserializeGalleryApplicationVersions, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}": + { + deserializer: _$deleteDeserializeGalleryApplications, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}": + { + deserializer: _updateDeserializeGalleryApplications, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}": + { + deserializer: _createOrUpdateDeserializeGalleryApplications, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}": + { + deserializer: _$deleteDeserializeGalleryImageVersions, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}": + { + deserializer: _updateDeserializeGalleryImageVersions, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}": + { + deserializer: _createOrUpdateDeserializeGalleryImageVersions, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}": + { deserializer: _$deleteDeserializeGalleryImages, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}": + { deserializer: _updateDeserializeGalleryImages, expectedStatuses: ["200", "201", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}": + { + deserializer: _createOrUpdateDeserializeGalleryImages, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}": + { deserializer: _$deleteDeserializeGalleries, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}": + { deserializer: _updateDeserializeGalleries, expectedStatuses: ["200", "201", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}": + { deserializer: _createOrUpdateDeserializeGalleries, expectedStatuses: ["200", "201", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess": + { deserializer: _revokeAccessDeserializeSnapshots, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess": + { deserializer: _grantAccessDeserializeSnapshots, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}": + { deserializer: _$deleteDeserializeSnapshots, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}": + { deserializer: _updateDeserializeSnapshots, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}": + { deserializer: _createOrUpdateDeserializeSnapshots, expectedStatuses: ["200", "202", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}": + { + deserializer: _$deleteDeserializeDiskEncryptionSets, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}": + { deserializer: _updateDeserializeDiskEncryptionSets, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}": + { + deserializer: _createOrUpdateDeserializeDiskEncryptionSets, + expectedStatuses: ["200", "202", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}": + { + deserializer: _deleteAPrivateEndpointConnectionDeserialize, + expectedStatuses: ["200", "202", "204"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}": + { + deserializer: _updateAPrivateEndpointConnectionDeserialize, + expectedStatuses: ["200", "202", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}": + { deserializer: _$deleteDeserializeDiskAccesses, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}": + { deserializer: _updateDeserializeDiskAccesses, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}": + { + deserializer: _createOrUpdateDeserializeDiskAccesses, + expectedStatuses: ["200", "202", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess": + { deserializer: _revokeAccessDeserializeDisks, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess": + { deserializer: _grantAccessDeserializeDisks, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}": + { deserializer: _$deleteDeserializeDisks, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}": + { deserializer: _updateDeserializeDisks, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}": + { deserializer: _createOrUpdateDeserializeDisks, expectedStatuses: ["200", "202", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}": + { + deserializer: _$deleteDeserializeVirtualMachineScaleSetVMRunCommands, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}": + { + deserializer: _updateDeserializeVirtualMachineScaleSetVMRunCommands, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}": + { + deserializer: _createOrUpdateDeserializeVirtualMachineScaleSetVMRunCommands, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}": + { + deserializer: _$deleteDeserializeVirtualMachineRunCommands, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}": + { + deserializer: _updateDeserializeVirtualMachineRunCommands, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}": + { + deserializer: _createOrUpdateDeserializeVirtualMachineRunCommands, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}": + { + deserializer: _$deleteDeserializeCapacityReservations, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}": + { + deserializer: _updateDeserializeCapacityReservations, + expectedStatuses: ["200", "202", "201"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}": + { + deserializer: _createOrUpdateDeserializeCapacityReservations, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}": + { deserializer: _$deleteDeserializeRestorePoints, expectedStatuses: ["200", "202", "204"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}": + { deserializer: _createDeserialize, expectedStatuses: ["201", "200", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}": + { + deserializer: _$deleteDeserializeRestorePointCollections, + expectedStatuses: ["200", "202", "204"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}": + { deserializer: _$deleteDeserializeImages, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}": + { deserializer: _updateDeserializeImages, expectedStatuses: ["200", "201", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}": + { deserializer: _createOrUpdateDeserializeImages, expectedStatuses: ["200", "201", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart": + { deserializer: _restartDeserializeDedicatedHosts, expectedStatuses: ["200", "201", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/redeploy": + { deserializer: _redeployDeserializeDedicatedHosts, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}": + { deserializer: _$deleteDeserializeDedicatedHosts, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}": + { deserializer: _updateDeserializeDedicatedHosts, expectedStatuses: ["200", "201", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}": + { + deserializer: _createOrUpdateDeserializeDedicatedHosts, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/convertToVirtualMachineScaleSet": + { + deserializer: _convertToVirtualMachineScaleSetDeserialize, + expectedStatuses: ["202", "200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}": + { + deserializer: _$deleteDeserializeVirtualMachineExtensions, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}": + { + deserializer: _updateDeserializeVirtualMachineExtensions, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}": + { + deserializer: _createOrUpdateDeserializeVirtualMachineExtensions, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/migrateToVirtualMachineScaleSet": + { deserializer: _migrateToVMScaleSetDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand": + { + deserializer: _runCommandDeserializeVirtualMachines, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start": + { deserializer: _startDeserializeVirtualMachines, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart": + { deserializer: _restartDeserializeVirtualMachines, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage": + { deserializer: _reimageDeserializeVirtualMachines, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy": + { deserializer: _redeployDeserializeVirtualMachines, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply": + { deserializer: _reapplyDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff": + { deserializer: _powerOffDeserializeVirtualMachines, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance": + { + deserializer: _performMaintenanceDeserializeVirtualMachines, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches": + { deserializer: _installPatchesDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate": + { + deserializer: _deallocateDeserializeVirtualMachines, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks": + { deserializer: _convertToManagedDisksDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture": + { deserializer: _captureDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/attachDetachDataDisks": + { + deserializer: _attachDetachDataDisksDeserializeVirtualMachines, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches": + { deserializer: _assessPatchesDeserialize, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}": + { deserializer: _$deleteDeserializeVirtualMachines, expectedStatuses: ["200", "202", "204"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}": + { deserializer: _updateDeserializeVirtualMachines, expectedStatuses: ["200", "201", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}": + { + deserializer: _createOrUpdateDeserializeVirtualMachines, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}": + { + deserializer: _$deleteDeserializeVirtualMachineScaleSetVMExtensions, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}": + { + deserializer: _updateDeserializeVirtualMachineScaleSetVMExtensions, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}": + { + deserializer: _createOrUpdateDeserializeVirtualMachineScaleSetVMExtensions, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}": + { + deserializer: _$deleteDeserializeVirtualMachineScaleSetExtensions, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}": + { + deserializer: _updateDeserializeVirtualMachineScaleSetExtensions, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}": + { + deserializer: _createOrUpdateDeserializeVirtualMachineScaleSetExtensions, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/scaleOut": + { deserializer: _scaleOutDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start": + { + deserializer: _startDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState": + { + deserializer: _setOrchestrationServiceStateDeserialize, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart": + { + deserializer: _restartDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall": + { + deserializer: _reimageAllDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage": + { + deserializer: _reimageDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy": + { + deserializer: _redeployDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply": + { + deserializer: _reapplyDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff": + { + deserializer: _powerOffDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance": + { + deserializer: _performMaintenanceDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade": + { deserializer: _updateInstancesDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete": + { deserializer: _deleteInstancesDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate": + { + deserializer: _deallocateDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/approveRollingUpgrade": + { + deserializer: _approveRollingUpgradeDeserializeVirtualMachineScaleSets, + expectedStatuses: ["202", "200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}": + { + deserializer: _$deleteDeserializeVirtualMachineScaleSets, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}": + { + deserializer: _updateDeserializeVirtualMachineScaleSets, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}": + { + deserializer: _createOrUpdateDeserializeVirtualMachineScaleSets, + 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/compute/arm-compute/src/static-helpers/cloudSettingHelpers.ts b/sdk/compute/arm-compute/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/compute/arm-compute/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/compute/arm-compute/src/static-helpers/pagingHelpers.ts b/sdk/compute/arm-compute/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..9258ba95eda8 --- /dev/null +++ b/sdk/compute/arm-compute/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/compute/arm-compute/src/static-helpers/pollingHelpers.ts b/sdk/compute/arm-compute/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..8e36a866edcc --- /dev/null +++ b/sdk/compute/arm-compute/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/compute/arm-compute/src/static-helpers/serialization/check-prop-undefined.ts b/sdk/compute/arm-compute/src/static-helpers/serialization/check-prop-undefined.ts new file mode 100644 index 000000000000..50f78829e491 --- /dev/null +++ b/sdk/compute/arm-compute/src/static-helpers/serialization/check-prop-undefined.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Returns true if all specified properties of the item are undefined. + * @param item The object to check. + * @param properties The list of property names to check on the item. + * @returns True if all specified properties are undefined, otherwise false. + */ +export function areAllPropsUndefined(item: Record, properties: string[]): boolean { + for (const property of properties) { + if (item[property] !== undefined) { + return false; + } + } + return true; +} diff --git a/sdk/compute/arm-compute/src/static-helpers/simplePollerHelpers.ts b/sdk/compute/arm-compute/src/static-helpers/simplePollerHelpers.ts new file mode 100644 index 000000000000..f6996f3cee67 --- /dev/null +++ b/sdk/compute/arm-compute/src/static-helpers/simplePollerHelpers.ts @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PollerLike, OperationState, CancelOnProgress } from "@azure/core-lro"; +import type { AbortSignalLike } from "@azure/abort-controller"; + +/** + * A simple poller that can be used to poll a long running operation. + */ +export interface SimplePollerLike, TResult> { + /** + * Returns true if the poller has finished polling. + */ + isDone(): boolean; + /** + * Returns the state of the operation. + */ + getOperationState(): TState; + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult(): TResult | undefined; + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + */ + poll(options?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback: (state: TState) => void): CancelOnProgress; + + /** + * Returns a promise that could be used for serialized version of the poller's operation + * by invoking the operation's serialize method. + */ + serialize(): Promise; + + /** + * Wait the poller to be submitted. + */ + submitted(): Promise; + + /** + * Returns a string representation of the poller's operation. Similar to serialize but returns a string. + * @deprecated Use serialize() instead. + */ + toString(): string; + + /** + * Stops the poller from continuing to poll. Please note this will only stop the client-side polling + * @deprecated Use abortSignal to stop polling instead. + */ + stopPolling(): void; + + /** + * Returns true if the poller is stopped. + * @deprecated Use abortSignal status to track this instead. + */ + isStopped(): boolean; +} + +/** + * Create the deprecated SimplePollerLike from PollerLike + * @param poller PollerLike to convert + * @returns SimplePollerLike + */ +export function getSimplePoller( + poller: PollerLike, TResult>, +): SimplePollerLike, TResult> { + const simplePoller: SimplePollerLike, TResult> = { + isDone() { + return poller.isDone; + }, + isStopped() { + throw new Error("isStopped is deprecated. Use abortSignal status to track this instead."); + }, + getOperationState() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return poller.operationState; + }, + getResult() { + return poller.result; + }, + toString() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return JSON.stringify({ + state: poller.operationState, + }); + }, + stopPolling() { + throw new Error("stopPolling is deprecated. Use abortSignal to stop polling instead."); + }, + onProgress: poller.onProgress, + poll: poller.poll, + pollUntilDone: poller.pollUntilDone, + serialize: poller.serialize, + submitted: poller.submitted, + }; + return simplePoller; +} diff --git a/sdk/compute/arm-compute/src/static-helpers/urlTemplate.ts b/sdk/compute/arm-compute/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..e8af8cd3ab73 --- /dev/null +++ b/sdk/compute/arm-compute/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/compute/arm-compute/test/snippets.spec.ts b/sdk/compute/arm-compute/test/snippets.spec.ts index bc692fbbdc17..b76859da51d4 100644 --- a/sdk/compute/arm-compute/test/snippets.spec.ts +++ b/sdk/compute/arm-compute/test/snippets.spec.ts @@ -13,11 +13,11 @@ describe("snippets", () => { }); it("ReadmeSampleCreateClient_Browser", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ComputeManagementClient(credential, subscriptionId); }); diff --git a/sdk/compute/arm-compute/tsp-location.yaml b/sdk/compute/arm-compute/tsp-location.yaml new file mode 100644 index 000000000000..3c43bb13c103 --- /dev/null +++ b/sdk/compute/arm-compute/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/compute/resource-manager/Microsoft.Compute/Compute +commit: 1e6111d12c709c3395fb8546e311b6c67fd87efc +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/compute/arm-compute/warp.config.yml b/sdk/compute/arm-compute/warp.config.yml index 544a1a46ce20..c78d8fe24385 100644 --- a/sdk/compute/arm-compute/warp.config.yml +++ b/sdk/compute/arm-compute/warp.config.yml @@ -1 +1,29 @@ -extends: ../../../warp.base.config.yml +# warp.config.yml — build configuration + +exports: + "./package.json": "./package.json" + ".": "./src/index.ts" + "./api": "./src/api/index.ts" + "./models": "./src/models/index.ts" + "./models/common": "./src/models/common/index.ts" + "./models/compute": "./src/models/compute/index.ts" + "./models/computeDisk": "./src/models/computeDisk/index.ts" + "./models/computeGallery": "./src/models/computeGallery/index.ts" + "./models/computeSku": "./src/models/computeSku/index.ts" + +targets: + - name: browser + tsconfig: "../../../tsconfig.src.browser.json" + polyfillSuffix: "-browser" + + - name: react-native + tsconfig: "../../../tsconfig.src.react-native.json" + polyfillSuffix: "-react-native" + + - name: esm + condition: import + tsconfig: "../../../tsconfig.src.esm.json" + + - name: commonjs + condition: require + tsconfig: "../../../tsconfig.src.cjs.json" From 50f64b98c3c80f6d3f4e720874e3ceeb7d888910 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 23 Apr 2026 14:45:56 +0800 Subject: [PATCH 2/4] Update compute_examples.spec.ts --- sdk/compute/arm-compute/test/compute_examples.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/compute/arm-compute/test/compute_examples.spec.ts b/sdk/compute/arm-compute/test/compute_examples.spec.ts index 4fbba7f0a347..3379f809411b 100644 --- a/sdk/compute/arm-compute/test/compute_examples.spec.ts +++ b/sdk/compute/arm-compute/test/compute_examples.spec.ts @@ -28,7 +28,7 @@ export const testPollingOptions = { updateIntervalInMs: isPlaybackMode() ? 0 : undefined, }; -describe.skip("Compute test", () => { +describe("Compute test", () => { let recorder: Recorder; let subscriptionId: string; let client: ComputeManagementClient; From 1327c007b1857bfcd789922a10eadb399c7f71a4 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 24 Apr 2026 10:06:06 +0800 Subject: [PATCH 3/4] Update assets.json --- sdk/compute/arm-compute/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/compute/arm-compute/assets.json b/sdk/compute/arm-compute/assets.json index 0052b9aeba61..c7e7d585836d 100644 --- a/sdk/compute/arm-compute/assets.json +++ b/sdk/compute/arm-compute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/compute/arm-compute", - "Tag": "js/compute/arm-compute_fabf4d2fee" + "Tag": "js/compute/arm-compute_09f6e935ba" } From c932a6a480ec039b549ba8a178da65949cb75964 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 24 Apr 2026 02:54:33 +0000 Subject: [PATCH 4/4] Configurations: 'specification/compute/resource-manager/Microsoft.Compute/Compute/tspconfig.yaml', API Version: 2025-11-01, SDK Release Type: stable, and CommitSHA: 'c47834758ee318a2dacc4e268d8403ace60196f8' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6202998 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/compute/arm-compute/CHANGELOG.md | 8 +------- .../review/arm-compute-models-compute-node.api.md | 4 ++-- .../review/arm-compute-models-computeDisk-node.api.md | 2 +- sdk/compute/arm-compute/review/arm-compute-node.api.md | 6 +++--- sdk/compute/arm-compute/src/models/compute/models.ts | 4 ++-- sdk/compute/arm-compute/src/models/computeDisk/models.ts | 2 +- sdk/compute/arm-compute/tsp-location.yaml | 2 +- 7 files changed, 11 insertions(+), 17 deletions(-) diff --git a/sdk/compute/arm-compute/CHANGELOG.md b/sdk/compute/arm-compute/CHANGELOG.md index 4d3301b941eb..a6955c28548b 100644 --- a/sdk/compute/arm-compute/CHANGELOG.md +++ b/sdk/compute/arm-compute/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 24.0.0 (2026-04-21) +## 24.0.0 (2026-04-24) ### Features Added - Added operation group VirtualMachineScaleSetLifeCycleHookEventsOperations @@ -244,9 +244,6 @@ - Added Enum KnownStorageFaultDomainAlignmentType - Added Enum KnownVMScaleSetLifecycleHookEventState - Added Enum KnownVMScaleSetLifecycleHookEventType - - Enum KnownDiskSecurityTypes has a new value ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey - - Enum KnownNetworkApiVersion has a new value NetworkApiVersion20201101 - - Enum KnownNetworkApiVersion has a new value NetworkApiVersion20221101 - Enum KnownSecurityTypes has a new value Standard - Enum KnownZonalPlatformFaultDomainAlignMode has a new value BestEffortAligned @@ -362,9 +359,6 @@ - Removed Enum KnownAvailabilitySetSkuTypes - Removed Enum KnownCloudServiceSlotType - Removed Enum KnownCloudServiceUpgradeMode - - Enum KnownDiskSecurityTypes no longer has value ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey - - Enum KnownNetworkApiVersion no longer has value TwoThousandTwenty1101 - - Enum KnownNetworkApiVersion no longer has value TwoThousandTwentyTwo1101 ## 23.3.0 (2026-01-07) diff --git a/sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md index 84f95fee4f2d..70a340c8c73c 100644 --- a/sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md +++ b/sdk/compute/arm-compute/review/arm-compute-models-compute-node.api.md @@ -862,8 +862,8 @@ export enum KnownModes { // @public export enum KnownNetworkApiVersion { - NetworkApiVersion20201101 = "2020-11-01", - NetworkApiVersion20221101 = "2022-11-01" + TwoThousandTwenty1101 = "2020-11-01", + TwoThousandTwentyTwo1101 = "2022-11-01" } // @public diff --git a/sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md b/sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md index 2ed5e237fea8..5c6baf7ea7be 100644 --- a/sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md +++ b/sdk/compute/arm-compute/review/arm-compute-models-computeDisk-node.api.md @@ -455,7 +455,7 @@ export enum KnownDiskSecurityTypes { ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", - ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", TrustedLaunch = "TrustedLaunch" } diff --git a/sdk/compute/arm-compute/review/arm-compute-node.api.md b/sdk/compute/arm-compute/review/arm-compute-node.api.md index 36ca94ea3516..063d5b967561 100644 --- a/sdk/compute/arm-compute/review/arm-compute-node.api.md +++ b/sdk/compute/arm-compute/review/arm-compute-node.api.md @@ -3100,7 +3100,7 @@ export enum KnownDiskSecurityTypes { ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", - ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", TrustedLaunch = "TrustedLaunch" } @@ -3345,8 +3345,8 @@ export enum KnownNetworkAccessPolicy { // @public export enum KnownNetworkApiVersion { - NetworkApiVersion20201101 = "2020-11-01", - NetworkApiVersion20221101 = "2022-11-01" + TwoThousandTwenty1101 = "2020-11-01", + TwoThousandTwentyTwo1101 = "2022-11-01" } // @public diff --git a/sdk/compute/arm-compute/src/models/compute/models.ts b/sdk/compute/arm-compute/src/models/compute/models.ts index 1053107b3e14..db952f0074ae 100644 --- a/sdk/compute/arm-compute/src/models/compute/models.ts +++ b/sdk/compute/arm-compute/src/models/compute/models.ts @@ -2760,9 +2760,9 @@ export type NetworkInterfaceAuxiliarySku = string; /** specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations */ export enum KnownNetworkApiVersion { /** 2020-11-01 */ - NetworkApiVersion20201101 = "2020-11-01", + TwoThousandTwenty1101 = "2020-11-01", /** 2022-11-01 */ - NetworkApiVersion20221101 = "2022-11-01", + TwoThousandTwentyTwo1101 = "2022-11-01", } /** diff --git a/sdk/compute/arm-compute/src/models/computeDisk/models.ts b/sdk/compute/arm-compute/src/models/computeDisk/models.ts index ae4b2c8a1114..bc312ab339cf 100644 --- a/sdk/compute/arm-compute/src/models/computeDisk/models.ts +++ b/sdk/compute/arm-compute/src/models/computeDisk/models.ts @@ -885,7 +885,7 @@ export enum KnownDiskSecurityTypes { /** Trusted Launch provides security features such as secure boot and virtual Trusted Platform Module (vTPM) */ TrustedLaunch = "TrustedLaunch", /** Indicates Confidential VM disk with only VM guest state encrypted */ - ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform managed key */ ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer managed key */ diff --git a/sdk/compute/arm-compute/tsp-location.yaml b/sdk/compute/arm-compute/tsp-location.yaml index 3c43bb13c103..ad1bc50f7639 100644 --- a/sdk/compute/arm-compute/tsp-location.yaml +++ b/sdk/compute/arm-compute/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/compute/resource-manager/Microsoft.Compute/Compute -commit: 1e6111d12c709c3395fb8546e311b6c67fd87efc +commit: c47834758ee318a2dacc4e268d8403ace60196f8 repo: Azure/azure-rest-api-specs additionalDirectories: